Conversation
jacobtomlinson
commented
Apr 29, 2024
Comment on lines
+19
to
+24
| try: | ||
| from ._version import version as __version__ # noqa | ||
| from ._version import version_tuple as __version_tuple__ # noqa | ||
| except ImportError: | ||
| __version__ = "0.0.0" | ||
| __version_tuple__ = (0, 0, 0) |
Member
Author
There was a problem hiding this comment.
The _version.py file is no longer kept in version control and instead is generated when running pip install -e . or by hatch build when packaging the distribution for PyPI/Conda Forge. So it's possible to clone the repo and never install it, so we catch the ImportError and use a null version so imports at least work.
jacobtomlinson
commented
Apr 29, 2024
jacobtomlinson
commented
Apr 29, 2024
| @@ -1,2 +1,2 @@ | |||
| .* | |||
Member
Author
There was a problem hiding this comment.
This was stopping the .git directory from being copied in which is needed to correctly resolve the version number. To avoid this blowing up the container size I've switched the Dockerfile to do a multi-stage build where we build the distributions and then only copy those over to the final container image.
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Upgrading project to a modern build system.
hatchfor buildinghatch new --initto migratesetup.py,setup.cfgandrequirements.txttopyproject.tomlversioneerwithhatch-vcshatch buildin CI release process