Closed jorisroovers closed 1 year ago
I noticed the
gitlint-core
packages have the dash replaced with underscore, e.g.:gitlint_core-0.19.0.dev2.tar.gz
. AFAIK, setuptools keeps the dash. Is this just a build-tool implementation detail or is there some PEP or other rationale I’m not aware of?
https://peps.python.org/pep-0625/ though you can disable strict-naming
e.g. https://hatch.pypa.io/latest/plugins/builder/wheel/#options
Why is the
.gitignore
included in the build?
https://hatch.pypa.io/latest/plugins/builder/sdist/#default-file-selection
so building from sdist is reproducible
Is there a way to have a script that can run across different environments?
not yet
Maybe I missed it, but from the docs, it’s not entirely clear what Hatchling is [...] Perhaps a short Q/A can be added to the FAQ?
https://github.com/pypa/hatch/commit/497408385f54e2f99a06a4cb61c3e604f0185deb
For my own future reference:
I noticed the gitlint-core packages have the dash replaced with underscore, e.g.: gitlint_core-0.19.0.dev2.tar.gz . AFAIK, setuptools keeps the dash. Is this just a build-tool implementation detail or is there some PEP or other rationale I’m not aware of?
https://peps.python.org/pep-0625/ though you can disable strict-naming e.g. https://hatch.pypa.io/latest/plugins/builder/wheel/#options
From PEP-625 I found https://packaging.python.org/en/latest/specifications/binary-distribution-format/ which specifies:
In distribution names, any run of -. characters (HYPHEN-MINUS, LOW LINE and FULL STOP) should be replaced with (LOW LINE), and uppercase characters should be replaced with corresponding lowercase ones. This is equivalent to PEP 503 normalisation followed by replacing - with _.
Why is the .gitignore included in the build?
https://hatch.pypa.io/latest/plugins/builder/sdist/#default-file-selection
so building from sdist is reproducible
Had to read carefully, but think I figured it out. The build docs mention:
By default, Hatch will respect the first .gitignore or .hgignore file found in your project's root directory or parent directories. Set ignore-vcs to true to disable this behavior:
So if the builds needs to be reproducible from sdist, hatch needs to know which files to ignore in the sdist tarball. When building the sdist tarball using hatch itself, I don't think any of the git ignored files would still be included in the tarball since hatch would've already respected the .gitignore
file, but I reckon that could've been overridden by specifying a specific include
clause in the sdist build config.
Initial implementation of project management using hatch.
@ofek: Appreciate if you can give this a quick review, but understand if you don't have time!
Required follow-up
./run_tests.sh
stats
script that replaces./run_tests.sh --stats
, consider whether still wantedclean
script that cleans up more directories that onlydist
(which is whathatch clean
does)gitlint --version
checks.yaml
, deduplicate between Linux and Windows. The CI script isn’t really the focus of this PR.Questions
CC: @ofek
I love hatch - thanks for maintaining it! These are all just minor things.
I noticed the
gitlint-core
packages have the dash replaced with underscore, e.g.:gitlint_core-0.19.0.dev2.tar.gz
. AFAIK, setuptools keeps the dash. Is this just a build-tool implementation detail or is there some PEP or other rationale I’m not aware of? Just trying to learn :)Why is the
.gitignore
included in the build? I’ve tried adding it to the excluded files and also tried settingignore-vcs = true
under[tool.hatch.build]
but that didn’t work.Is there a way to have a script that can run across different environments? AFAICT, there is not. Perhaps this will be supported by workspaces? Example:
Maybe I missed it, but from the docs, it’s not entirely clear what Hatchling is, other than a dependency of Hatch, although there’s a few references to it here and there. From my 30 sec of digging it seems the be PEP517-compliant build system that’s part of Hatch? Perhaps a short Q/A can be added to the FAQ?