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

Update to use pyproject.toml for packaging metadata #137

Merged

Conversation

davidwilby
Copy link
Collaborator

📝 Description

At the moment, dependencies are specified in both setup.cfg and in requirements files under requirements/ which is a little odd and opens up potential errors such as in #131 where I bumped the version of neuralprocesses in the requirements file but not in the setup.cfg - the tests pass because they use the requirements file, but the built package would not have the same dependency version specification.

In this PR, I suggest moving to using pyproject.toml for specifying package metadata. This does solve the above problem, though that could also be solved using setup.cfg, but the python community seems to be converging on pyproject.toml. If we need to keep setup.py for any reason, that is also possible.

This PR also updates the workflows and docs accordingly.

I've tested that builds succeed and all seems to work as expected.

Feel free to close this @tom-andersson if it isn't to your taste.

✅ Checklist before requesting a review

(See the contributing guide for more details on these steps.)

  • I have installed developer dependencies with pip install -r requirements/requirements.dev.txt and running pre-commit install (or alternatively, manually running ruff format before commiting)

If changing or adding source code:

  • tests are included and are passing (run pytest).
  • documentation is included or updated as relevant, including docstrings.

If changing or adding documentation:

  • docs build successfully (jupyter-book build docs --all) and the changes look good from a manual inspection of the HTML in docs/_build/html/.

Copy link
Collaborator

@tom-andersson tom-andersson left a comment

Choose a reason for hiding this comment

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

This is great!! LGTM after my one comment is resolved.

I think there was a reason I went with setup.cfg rather than pyproject.toml when I set the deepsensor repo up 1.5 years ago, but I can't remember. I did read that pyproject.toml was starting to gain precedence, but it's probably even more encouraged now. If everything is working I'm happy because this is cleaner.

P.S. the pip install deepsensor[<deep learning library>] is great.

pyproject.toml Outdated Show resolved Hide resolved
@davidwilby davidwilby force-pushed the update-pkg-metadata branch from bfb42b0 to e99f68a Compare January 2, 2025 15:38
@davidwilby davidwilby self-assigned this Jan 2, 2025
@tom-andersson
Copy link
Collaborator

Thanks @davidwilby!

@tom-andersson tom-andersson merged commit 8699fca into alan-turing-institute:main Jan 15, 2025
4 of 5 checks passed
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