-
Notifications
You must be signed in to change notification settings - Fork 792
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
Update package metadata and dev experience #971
Merged
Merged
Conversation
This file contains 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
ofek
force-pushed
the
modernize-metadata
branch
from
October 21, 2022 13:05
d564441
to
dbf09dc
Compare
Thanks! Will look at this after the pending release. Need to understand a bit more about Hatch. |
Happy to help! I'm interested in hearing your thoughts. |
ofek
force-pushed
the
modernize-metadata
branch
from
October 22, 2022 14:31
dbf09dc
to
89a53bc
Compare
ofek
force-pushed
the
modernize-metadata
branch
3 times, most recently
from
October 22, 2022 21:42
215d134
to
9f272ba
Compare
ofek
commented
Oct 31, 2022
ofek
force-pushed
the
modernize-metadata
branch
from
October 31, 2022 14:42
5a425d8
to
b6b20fd
Compare
I rebased, would you mind triggering the CI with that button below? |
Passing 🙂 |
Thanks @ofek . We're just about to release a new version. But I reckon we should go all in with Hatch after that. |
ofek
force-pushed
the
modernize-metadata
branch
from
November 1, 2022 16:30
b6b20fd
to
16a7cfb
Compare
Cool, rebased again |
Thanks. Next release will be "hatched"! |
Merged
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.
Background
Hello there! As discussed in Discord, this is a PoC showing what a switch to Hatch would look like. Some new users include Black, Pydantic, MkDocs, and FastAPI.
The only thing lost is the lock file, since the format is not yet standardized. This can be thought of as an improvement though since Textual is a library for actual apps to use. (examples: ics-py/ics-py#354, P403n1x87/austin-python#9, delb-xml/delb-py@010f5f0)
Build backend
The Python packaging ecosystem has standardized on the format for metadata declaration (PEP 621/PEP 631). The build backend
hatchling
(of which I am a maintainer in the PyPA) is now used as that is the default in the official Python packaging tutorial.Hatchling is available on all the major distribution channels such as Debian, Fedora, Arch Linux, conda-forge, Nixpkgs, Alpine Linux, FreeBSD/OpenBSD, Gentoo Linux, MacPorts, OpenEmbedded, Spack, MSYS2, etc.
PyPI landing page
As you can see on https://pypi.org/project/textual/0.2.0b8/, the links to code samples and images are broken. This PR fixes that by using @hynek's awesome hatch-fancy-pypi-readme plugin.
Dev experience
The dependencies for testing, linting, and documentation are now separated into 3 different environments. This speeds up install/syncing operations and reduces the chance of conflicts or runtime side effects.
default
- the dependencies for testing are installed here along with the project and thedev
optional dependency group. thedefault
environment is special in that Hatch will use it always in lieu of a selection e.g.hatch run test
vshatch run docs:serve
docs
- the dependencies for documentation are installed here. the project and thedev
optional dependency group are also required formkdocstrings
auto-generation of docslint
- only the dependencies for linting are installed hereThis now works on Windows! (Makefiles do not without great effort)
Python version cap
I removed the Python upper bound constraint as upper bounds for libraries are heavily discouraged by the community and that was just a thing that Poetry recommended.
Future
mypy.ini
and intopyproject.toml