gh-action-pypi-publish
gh-action-pypi-publish copied to clipboard
action fails when non-dist files are present
It seems like the action tries to upload all files and directories present in the dist/
directory. This is fine as long as the build system did not add other files or directories to the dist/
directory.
In some cases the build system might add other files or directories. Most common is a <package-name>-<version>.dist-info
directory. One example can be found here.
Currently one can work around this by cleaning up the pollution manually, but I think it would be better to make the package discovery a bit more robust. Most notably directories should be excluded.
It just runs twine {whatever's in the dir arg}
. I bet you could just pass a wildcard if you wish.
@daknuett I'm surprised to see that *.dist-info
is ending up in the dist/
directory. Do you know why that is? Is there a way to avoid that?
I'm curious what happens if you specify a different --outdir
, i.e., what ends up in the new directory, and are there still files in the dist/
directory?
To @webknjaz's point, you could also try the equivalent of:
twine upload dist/*.{gz,whl}
cc @meowmeowmeowcat
@bhrutledge I have not checked the code. But including it can break some other processes which is a bit unfortunate.
So I've cloned https://github.com/daknuett/PyQCS and verified that running python -m build
indeed creates that *.dist-info/
folder. I checked the build back-end and it turned out to be meson
.
A quick search suggests that these lines are to blame: https://gitlab.com/thiblahute/mesonpep517/-/blob/fe3b0086/mesonpep517/buildapi.py#L648-650.
FWIW, I've filed a bug with them at https://gitlab.com/thiblahute/mesonpep517/-/issues/22. If anybody wants to poke upstream, please, comment there.
But including it can break some other processes which is a bit unfortunate.
What do you mean by this?
But including it can break some other processes which is a bit unfortunate.
What do you mean by this?
The fact that the .dist-info
is included or attempts to remove it broke something. Related to this run.
Unfortunately, the log retention time has been exceeded so it will take me a while to find out what exactly was broken.
Yeah, it's usually useful to include a copy of a traceback or larger logs for bug reports to survive data cleanup.
mesonpep517 seems to be dead since Feb. 2021. I moved to meson-python which works fine and does not leave any pollution in the dist/
directory.
Closing this issue because it seems obsolete.