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
Packaging: Convert from setuptools to hatch #1082
Conversation
dc96d1d
to
3a7ffed
Compare
run: python -m pip install hatch | ||
- run: hatch build |
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.
Keep it simple by using build
?
- name: Run python tests | ||
run: tox | ||
run: hatch run +mistune +python=${{ matrix.python }} test:test-python |
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.
It seems tox.ini
isn't needed anymore.
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 reason I hesitate to get rid of tox is that hatch currently doesn't have any equivalent of tox -p
— that is, it doesn't yet have the ability to run the various test environments in parallel (though, reportedly, that feature is planned). For the CI tests, it doesn't matter, but it does matter for the dev running the tests on their workstation.
And if we're going to keep the tox tests for that, I figure we should use them in CI.
0da37c7
to
7a6cc55
Compare
Closing in favor of #1112, which includes just the hatchling PEP 512 builder bits from this PR. I don't think that using hatch to manage test and dev environments buys us much. Our test requirements are complex enough that I think it's better we stick with tox for that. For building distributions, however, hatchling is a flexible PEP-621build backend that is customizable enough that we can hook the esbuild-ing of our backend code into the PEP-512 build process, which is a big win. |
I started working on packaging Lektor using hatch a few weeks ago.
The use of
hatch
allows for:make build-js
step, this allows Lektor to be installed directly from a git repo.Issue(s) Resolved
Fixes #1081
Fixes #1057
Related Issues / Links
Description of Changes
(This work probably needs a bit of freshening. I'm creating this PR now since it relates to the newly created #1081.)
All or most of our
tox
tests could probably be converted tohatch
scripts. At present, however, hatch does not support running scripts in parallel (e.g. there is no equivalent oftox -p
) so running the full set of tests via hatch is painfully slow.