Skip to content

Conversation

@musicinmybrain
Copy link
Contributor

Explicitly declare setuptools.build_meta as the build backend.

I can’t easily reproduce the following problem with just venv or build, but for me, working on the python-docx package in Fedora Linux, this PR fixes the following:

+ /usr/bin/python3 -Bs /usr/lib/rpm/redhat/pyproject_buildrequires.py --generate-extr
as --python3_pkgversion 3 --wheeldir /builddir/build/BUILD/python-docx-1.0.1/pyprojec
t-wheeldir --output /builddir/build/BUILD/python-docx-1.0.1-1.fc40.x86_64-pyproject-b
uildrequires -t
Handling setuptools>=61.0.0 from build-system.requires
Requirement not satisfied: setuptools>=61.0.0
Traceback (most recent call last):
  File "/usr/lib/rpm/redhat/pyproject_buildrequires.py", line 555, in main
    generate_requires(
  File "/usr/lib/rpm/redhat/pyproject_buildrequires.py", line 450, in generate_requir
es
    backend = get_backend(requirements)
              ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/rpm/redhat/pyproject_buildrequires.py", line 243, in get_backend
    raise FileNotFoundError('File "setup.py" not found for legacy project.')
FileNotFoundError: File "setup.py" not found for legacy project.

In any case, it matches the following reference: https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html

@musicinmybrain
Copy link
Contributor Author

In https://setuptools.pypa.io/en/latest/build_meta.html, I read:

Note that if there is no pyproject.toml file or the build-backend parameter is not defined, then the fall-back behaviour is to use setuptools.

That explains why this works under other circumstances. It may be Fedora’s tooling should be changed to imitate that fallback—I’m looking into this—but there is no harm in being explicit.

@scanny
Copy link
Contributor

scanny commented Oct 16, 2023

Hi @musicinmybrain I've merged both these changes into the develop branch so they'll go into the next release.

I didn't have a pressing reason otherwise to push a patch release but will likely be publishing a minor release in the next couple weeks.

How urgent are these changes for you?

@musicinmybrain
Copy link
Contributor Author

Hi @musicinmybrain I've merged both these changes into the develop branch so they'll go into the next release.

Thank you!

How urgent are these changes for you?

They are not urgent. I can easily carry them as downstream patches until the next release. Thank you for asking.

@musicinmybrain
Copy link
Contributor Author

Are you sure you actually merged them, though? Maybe you did so locally and didn’t push to GitHub yet?

https://github.com/python-openxml/python-docx/commits/develop

@scanny
Copy link
Contributor

scanny commented Oct 16, 2023

yes, I hadn't pushed them but they're up on the develop branch now if you want to take a look.

@scanny
Copy link
Contributor

scanny commented Nov 5, 2023

Included in Release 1.1.0 yesterday.

@scanny scanny closed this Nov 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants