Closed jorisroovers closed 1 year ago
@harens This should be fixed now - I just tried a hatch build -t wheel
on the sdist of the latest dev builds and it worked.
Can you confirm? Latest dev builds: https://pypi.org/project/gitlint/0.19.1.dev2/ https://pypi.org/project/gitlint-core/0.19.1.dev2/
I was just thinking about this: https://github.com/jorisroovers/gitlint/pull/418/files#r1131062741
@jorisroovers TL;DR to have a proper smoke-test, switch to invoking python -m build
(without CLI args! it's important). It'll still use hatch's PEP 517 backend. This would build an sdist from Git checkout, followed by building a wheel from said sdist rather than from Git.
Additionally, you can make use of https://github.com/re-actors/checkout-python-sdist to run testing from sdist and not Git. This takes smoke-testing availability for the downstream packaging since they often use sdist as the source of truth.
@webknjaz would you be up for sending a PR to use that?
Which part? using pypa/build? or testing from sdist? The latter would probably require some agreement and restructuring, while the former is straightforward.
There is also this which I've heard good things about (and of course it's Hynek) https://github.com/hynek/build-and-inspect-python-package
@ofek yes, I know about that action, but don't use it myself — it's too coupled for my taste.
FWIW I've made the small version of the PR: https://github.com/jorisroovers/gitlint/pull/463. https://github.com/re-actors/checkout-python-sdist can always be added later.
@harens This should be fixed now - I just tried a
hatch build -t wheel
on the sdist of the latest dev builds and it worked.Can you confirm? Latest dev builds: https://pypi.org/project/gitlint/0.19.1.dev2/ https://pypi.org/project/gitlint-core/0.19.1.dev2/
Seems to work fine, so I'll update the MacPorts portfile in the next stable release. Thanks for fixing @jorisroovers 👍
Seems to work fine, so I'll update the MacPorts portfile in the next stable release. Thanks for fixing @jorisroovers 👍
Great. I'll try to release 0.19.1 with this fix later today so we can get the homebrew package out for 0.19.x and then look at the other suggestions afterwards.
@jorisroovers I recommend releasing after merging #463 so that the fix is validated in the CI, not just locally.
@jorisroovers I recommend releasing after merging #463 so that the fix is validated in the CI, not just locally.
Ack. I'll do it tomorrow morning then (CET), rather than trying to rush it out tonight and inevitably make a mistake.
@harens just published 0.19.1! Can you retry?
Thanks!
Awesome, thanks!
I created separate issues for everything else that was suggested here - thanks everyone. Closing this one!
This issue was first discovered and discussed in #367.
To reproduce for
gitlint-core
:This issue is caused by a bug in hatch-vcs metadata hook. I’ll be opening a bug with hatch-vcs for this soon.
For gitlint-core, it’s this line that’s problematic (thanks for pointing this out @ofek):
https://github.com/jorisroovers/gitlint/blob/014bfaeac8c75bf0a06b55e533a39a79b3c69cd3/gitlint-core/pyproject.toml#L70
The same issue exists for the gitlint package, caused by these 2 lines:
https://github.com/jorisroovers/gitlint/blob/014bfaeac8c75bf0a06b55e533a39a79b3c69cd3/pyproject.toml#L48-L49
The fix in both cases is to remove these lines from the respective
pyproject.toml
files.However, after doing so, I ran into another issue with gitlint-core:
This is caused by the fact that in the source code,
gitlint-core/README.md
is a symlink to gitlint’s mainREADME.md
file (same for thegitlint-core/LICENSE
file).When creating the gitlint-core sdist, hatch includes the
gitlint-core/README.md
as a symlink file and not as the actual README.md the symlink is pointing to. When then runninghatch build -t wheel
on the sdist, hatch errors out trying to read the contents of thegitlint-core/README.md
symlink file (now pointing nowhere).This is easily resolved by replacing the symlink by the actual README.md file in gitlint-core in the source code.
I’ll be submitting a fix for this shortly.
CC: @ofek, @harens