You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the README for hynek/build-and-inspect-python-package@hynek describes a GitHub Actions use case for running tests against a built wheel installation of the package. The idea is that the tests are more "realistic" because they run against the built dist instead of the source tree.
instead of checking out the source tree – retrieve the built packages and run your tests against that. For example, by unpacking the tests and config from the SDist and using tox run --installpkg dist/*.whl ... to run the tests against the built wheel without access to the package source code.
I'm wondering if it's possible for hatch to do something similar, i.e. run hatch test against a built wheel of the package in CI (but for local development, I would want to keep the current behavior of running hatch test against the editable install of my source tree).
I'm imagining the GHA workflow steps like this:
Download built package dists (via actions/download-artifact@v4 from a previous build job)
Delete the src dir to ensure tests run against the wheel (rm -rf src)
Set up Python (actions/setup-python@v5)
Install hatch (pip install --upgrade hatch)
Run something like hatch test --installpkg dist/*.whl ... to install the built wheel and run the tests against it from the sdist (this would imply dev-mode = false)
I realize that I could just do this with tox, but then it seems like I'd have to maintain a separate configuration and keep it in sync with the hatch config. It would be nice to have this as a command line flag out of the box without changing any of the hatch config or messing with environments in pyproject.toml.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
In the README for hynek/build-and-inspect-python-package @hynek describes a GitHub Actions use case for running tests against a built wheel installation of the package. The idea is that the tests are more "realistic" because they run against the built dist instead of the source tree.
I'm wondering if it's possible for hatch to do something similar, i.e. run
hatch test
against a built wheel of the package in CI (but for local development, I would want to keep the current behavior of runninghatch test
against the editable install of my source tree).I'm imagining the GHA workflow steps like this:
actions/download-artifact@v4
from a previous build job)tar xf dist/*.tar.gz --strip-components=1
)rm -rf src
)actions/setup-python@v5
)pip install --upgrade hatch
)hatch test --installpkg dist/*.whl ...
to install the built wheel and run the tests against it from the sdist (this would implydev-mode = false
)I realize that I could just do this with tox, but then it seems like I'd have to maintain a separate configuration and keep it in sync with the hatch config. It would be nice to have this as a command line flag out of the box without changing any of the hatch config or messing with environments in
pyproject.toml
.Beta Was this translation helpful? Give feedback.
All reactions