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

Rap 614 use setuptools scm #224

Merged
merged 8 commits into from
May 6, 2024
Merged

Rap 614 use setuptools scm #224

merged 8 commits into from
May 6, 2024

Conversation

gmloose
Copy link
Collaborator

@gmloose gmloose commented May 6, 2024

Use setuptools_scm to do automatic versioning.

Since setuptools_scm recommends to use pyproject.toml instead of setup.py, most setting were move from setup.py to pyproject.toml. However, scikit-build requires a few settings to be set in setup.py. So these were retained.

gmloose added 8 commits May 2, 2024 17:30
…e what we want. This is needed, because `setuptools` when used in combination with `setuptools_scm` adds all the files under revision control in the source distribution. We do not want that.
Only adding `setuptools_scm` already required changes to `MANIFEST.in` to avoid that all the files under version control are put into the source distribution.
TODO:
  * Actually start using automatic versioning
  * Move all project settings from `setup.py` to `pyproject.toml`
Make room for automatically generated `_version.py` file by renaming the existing file.
This still needs some significant cleanup, but at least this appears to work.
Automatic versioning only works if version is _not_ also set in `setup.py`.
Also added `bdsf/_version.py` to the `.gitignore` file, because is should *never* be put under version control anymore.
All project settings have been moved from `setup.py` to `pyproject.toml`, except for a few that need to be set in the call to `setup()` in `setup.py`, as required by `scikit-build`.
Added a comment in `setup.py`, explaining why we need to pass some configuration options as arguments to `setup()`, instead of providing them in `pyproject.toml`.
@gmloose gmloose self-assigned this May 6, 2024
@gmloose gmloose requested a review from tammojan May 6, 2024 08:11
Copy link
Collaborator

@tammojan tammojan left a comment

Choose a reason for hiding this comment

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

Looks good to me! The few remaining arguments that require setup.py can probably be removed at a later stage when either setuptools_scm has made this possible or we have found out how to pass them.

@gmloose
Copy link
Collaborator Author

gmloose commented May 6, 2024

The issue is not with setuptools_scm, but with scikit-build. Once scikit-build-core provides proper support for f2py, we can probably switch. The advantage of scikit-build-core is that is integrates setuptools_scm very nicely.

@gmloose gmloose merged commit 9246686 into master May 6, 2024
2 checks passed
@gmloose gmloose deleted the RAP-614_use-setuptools_scm branch August 27, 2024 13:19
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