-
Notifications
You must be signed in to change notification settings - Fork 3
Use hatchling instead of setuptools, add pixi task: pypi-publish #760
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
Conversation
I just set this up for xugrid, and it seems to be working. Keep in mind that you will need to update the conda-recipe for the host requirements. See for example: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apart from the one comment looks good to me
pixi.toml
Outdated
@@ -38,6 +38,7 @@ examples = { cmd = [ | |||
"--verbose", | |||
"--junitxml=examples_report.xml", | |||
], depends_on = ["install"], cwd = "imod/tests" } | |||
pypi-publish = { cmd = "rm --recursive --force dist && python -m build && twine check dist/*" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add hatchling
to the dependencies?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. I've added it to the pyproject dev dependencies.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By the way, we could arguably remove the dev dependencies since we recommend pixi anyway, right?
And hatchling then wouldn't be need for a regular user.
I'll open an issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that should be fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still annoying that there is no good way to find out if you require too much or especially too little in your normal dependencies.
Link doesn't work, but here are some useful links: FYI: The developer also promotes |
Agreed. |
I removed the MANIFEST.in, which is no longer needed, and I re-added the upload command to the new pixi task. |
There was a problem hiding this 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, just a question: Does this require developers to do a new editable install on their machines?
I don't think so, and otherwise you just run pixi run install... |
Good that you mention that. |
Ah good to know, this means the advice has to be added to the changelog: "Users who did a development install are adviced to run |
We shouldn't forget to update the imod-feedstock for the next release, I made an issue to remind myself here: conda-forge/imod-feedstock#31 |
Fixes #774 # Description Build in #760 fails for test_rasterio_ascii ``test_rasterio_ascii`` doesn't work for GDAL 3.8.3 compared to 3.7.3. Previously it was tested if files are exactly identical. This defeats the purpose, more important is that GDAL can read the file and interprets the file equal as if it were written with GDAL. Replacing ``assert_equal_content`` with the changes fixes things. # Checklist <!--- Before requesting review, please go through this checklist: --> - [x] Links to correct issue - [ ] Update changelog, if changes affect users - [x] PR title starts with ``Issue #nr``, e.g. ``Issue #737`` - [x] Unit tests were added - [ ] **If feature added**: Added/extended example
This setups the pyproject to use hatching instead of setuptools.
It also adds a pypi-publish task to pixi to make the release process a little smoother.
Finally, the pyproject version is derived from the imod.init. Ideally, there's a single source of truth, but pixi still contains its own version number (note: that one is not used anywhere, you could set it to a dummy value as well).