-
-
Notifications
You must be signed in to change notification settings - Fork 148
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
Migrate to hatch #889
Migrate to hatch #889
Conversation
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) |
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.
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.
@@ -1,2 +1,2 @@ | |||
.* |
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.
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.
Upgrading project to a modern build system.
hatch
for buildinghatch new --init
to migratesetup.py
,setup.cfg
andrequirements.txt
topyproject.toml
versioneer
withhatch-vcs
hatch build
in CI release process