-
Notifications
You must be signed in to change notification settings - Fork 100
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
gitlint and gitlint-core v0.19.0 fail to build from sdist #460
Comments
Temporarily comment out dynamic URLs using the `commit_hash` variable in the tool.hatch.metadata.hooks.vcs.urls section in pyproject.toml. Required to fix builds from sdist. Relates to #460
Temporarily comment out dynamic URLs using the `commit_hash` variable in the tool.hatch.metadata.hooks.vcs.urls section in pyproject.toml. Required to fix builds from sdist. Relates to #460
@harens This should be fixed now - I just tried a Can you confirm? Latest dev builds: |
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 |
@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 |
This patch switches the CI/CD workflows to use the PyPA-endorsed PEP 517 build front-end called `build`. It is called without `--sdist` and `--wheel` CLI options, in which case `build` creates an sdist from the Git checkout but the following wheel build is made from that sdist tarball as opposed to using the Git checkout. This has a side effect of smoke-testing that it's possible to build wheels from the published sdists. And this is the flow that `pip install` follows when it's requested to install from an sdist. Ref: jorisroovers#460 (comment)
@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: #463. https://github.com/re-actors/checkout-python-sdist can always be added later. |
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. |
Ack. I'll do it tomorrow morning then (CET), rather than trying to rush it out tonight and inevitably make a mistake. |
This patch switches the CI/CD workflows to use the PyPA-endorsed PEP 517 build front-end called `build`. It is called without `--sdist` and `--wheel` CLI options, in which case `build` creates an sdist from the Git checkout but the following wheel build is made from that sdist tarball as opposed to using the Git checkout. This has a side effect of smoke-testing that it's possible to build wheels from the published sdists. And this is the flow that `pip install` follows when it's requested to install from an sdist. Ref: #460 (comment)
@harens just published 0.19.1! Can you retry? Thanks! |
Already done :) |
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):
gitlint/gitlint-core/pyproject.toml
Line 70 in 014bfae
The same issue exists for the gitlint package, caused by these 2 lines:
gitlint/pyproject.toml
Lines 48 to 49 in 014bfae
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
The text was updated successfully, but these errors were encountered: