Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move project metadata to pyproject.toml; add build-backend #1165

Merged
merged 4 commits into from
Dec 8, 2022

Conversation

mwtoews
Copy link
Member

@mwtoews mwtoews commented Nov 22, 2022

This PR moves the project metadata to pyproject.toml (PEP 621), as supported by setuptools>61, and specifies "setuptools.build_meta" as the build-backend (PEP 517).

A few other things to note:

  • The --no-use-pep517 option raises "ERROR: Disabling PEP 517 processing is invalid: project specifies a build backend of setuptools.build_meta in pyproject.toml", so is removed from CI workflow. More CI reworkings might be expected later, this is the minimal change needed for now.
  • Add -v flag for pip install to show Cython compilation details
  • VERSION.txt is removed from the base package. Was it needed?
  • A pytest option --import-mode=importlib seems to be needed; see pytest docs for what it is.
  • Updates to requirements-dev.txt were also required, for instance the previous pytest==6.2.5 was problematic

Changes to the metadata:

  • Add Python 3.11 classifier
  • Upgrade versions in the optional dependencies closer to the requirements*txt files (which I may consider removing sometime later)
  • Add project URLs table with multiple links
  • Removed @sgillies email, and added "Fiona contributors" as generic maintainer
  • Change license from "BSD" to more specific "BSD 3-Clause"

Note that package_data was kept in setup.py, as it is dynamically evaluated based on environment variables.

@mwtoews mwtoews force-pushed the pyproject-metadata branch 2 times, most recently from 3b23383 to 3f57254 Compare November 24, 2022 11:29
@mwtoews
Copy link
Member Author

mwtoews commented Nov 24, 2022

The "name" metadata is kept in setup.py (for now) to maintain GitHub's dependency graph, currently showing 9818 repositories / 308 packages.

@mwtoews
Copy link
Member Author

mwtoews commented Nov 30, 2022

One last change is to include gdal.pxi and *.pxd files with the wheels, so that someone writing their Cython modules could use (e.g.) from fiona.crs cimport CRS

@rbuffat
Copy link
Contributor

rbuffat commented Dec 4, 2022

@mwtoews What are the implications regarding backward compatibility when changing to pyproject.toml? Setuptools 61.0.0 seems to have been released less than a year ago.

@mwtoews
Copy link
Member Author

mwtoews commented Dec 4, 2022

Good question @rbuffat, this could potentially impact a few folks that use old setuptools versions. I'm not sure who they are, but generally this is overcome by using venv with the latest components from PyPI. Another implication was with inclusion for Debian/Ubuntu, which has been recently resolved with Debian testing, so this shouldn't be a blocker for downstream packaging.

From what I read from Python devs, pyproject.toml is the final destination for project metadata (among a swarm of other tool configurations), so this PR is for the long-term gain.

pyproject.toml Outdated Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
Copy link
Member

@sgillies sgillies left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mwtoews thank you!

calc = ["shapely"]
s3 = ["boto3>=1.3.1"]
test = [
"Cython~=0.29.29",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason that test needs cython?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, this is a leftover from old versions, I think.

Copy link
Member

@sgillies sgillies Dec 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed it in 10ce6b7.

@sgillies sgillies merged commit d4894d9 into Toblerity:maint-1.9 Dec 8, 2022
@mwtoews mwtoews deleted the pyproject-metadata branch January 24, 2023 03:04
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.

4 participants