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

Replace setup.py with pyproject.toml #1670

Open
wants to merge 5 commits into
base: develop-1.9
Choose a base branch
from

Conversation

omad
Copy link
Member

@omad omad commented Nov 29, 2024

Reason for this pull request

I've been using uv a lot because it's brilliantly fast to create/replace virtualenvs. However, it wants package metadata kept in (pyproject.toml)[https://packaging.python.org/en/latest/specifications/pyproject-toml/], as standardised back in 2020, and so I haven't been able to use it with datacube-core.

Datacube core is a pure Python project, and all the metadata (except version) being specified in setup.py is static anyway, so I think this is a nice modernisation and simplification.

This still allows packages to be built with python -m build (or uv build) and the build frontend, and uses setuptools as the build backend.

I've compared the sdists and wheels produced and the contain the same files, with the exception of now including 3 .sql that were previously excluded. Happy for that to be either way, it just happened by default since extra files in the package are now included by default, whereas in ye-olde times they weren't.


📚 Documentation preview 📚: https://datacube-core--1670.org.readthedocs.build/en/1670/

@pjonsson
Copy link
Contributor

pjonsson commented Dec 1, 2024

I think this is a great idea, is this PR something that could be merged to the 1.8 branch as well?

@SpacemanPaul
Copy link
Contributor

SpacemanPaul commented Dec 1, 2024

No problems with this, but I need to understand why so many checks are failing.

Edit: the lint jobs are failing because pycodestyle and mypy are apparently not being installed. Presumably at least partly because the old tests dependency group is MIA - which probably also explains the actual test failures as well, although I haven't dug into them.

@pjonsson - in theory yes we could, but focus is very much on 1.9 branch at the moment, which we hope to release by the end of the year. After that, 1.8 development will mostly concentrate on bugfixes and making the upgrade to 1.9 smoother and easier. So in practice, it's unlikely to be a priority from our end. Always happy to review external PRs though.

@omad
Copy link
Member Author

omad commented Dec 1, 2024

I think this is a great idea, is this PR something that could be merged to the 1.8 branch as well?
There's a couple of changed dependencies in 1.9... otherwise should be okay.

Edit: the lint jobs are failing because pycodestyle and mypy are apparently not being installed. Presumably at least partly because the old tests dependency group is MIA - which probably also explains the actual test failures as well, although I haven't dug into them.

I've moved the development/linting/test dependencies into dependency groups, defined in PEP 735 – Dependency Groups in pyproject.toml | peps.python.org.

I'll have a look at why CI is failing to install them. (Cursed CI)

@omad omad force-pushed the dra/update-packaging-setup branch 4 times, most recently from cda681c to 3ba222e Compare December 1, 2024 23:27
@omad omad force-pushed the dra/update-packaging-setup branch from 7b3571d to 7f3d4d9 Compare December 2, 2024 01:19
@omad omad mentioned this pull request Dec 2, 2024
3 tasks
Copy link
Contributor

@SpacemanPaul SpacemanPaul left a comment

Choose a reason for hiding this comment

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

Passing tests now, but still failing the build action.

We can't really afford to let that break right now - unless you've got a fix waiting in another PR?

@omad
Copy link
Member Author

omad commented Dec 3, 2024

I'm still working on it Paul.

Got scared seeing repeated segfaults in netcdf, so trying to work out how they started. I suspect there were tests not being run before, but I'm not sure.

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.

3 participants