gh-action-pypi-publish icon indicating copy to clipboard operation
gh-action-pypi-publish copied to clipboard

action fails when non-dist files are present

Open daknuett opened this issue 2 years ago • 8 comments

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.

daknuett avatar Oct 12 '21 12:10 daknuett

It just runs twine {whatever's in the dir arg}. I bet you could just pass a wildcard if you wish.

webknjaz avatar Nov 01 '21 10:11 webknjaz

@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?

bhrutledge avatar Jan 10 '22 13:01 bhrutledge

To @webknjaz's point, you could also try the equivalent of:

twine upload dist/*.{gz,whl}

cc @meowmeowmeowcat

bhrutledge avatar Jan 10 '22 13:01 bhrutledge

@bhrutledge I have not checked the code. But including it can break some other processes which is a bit unfortunate.

daknuett avatar Jan 10 '22 14:01 daknuett

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.

webknjaz avatar Jul 25 '22 20:07 webknjaz

But including it can break some other processes which is a bit unfortunate.

What do you mean by this?

webknjaz avatar Jul 25 '22 20:07 webknjaz

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.

daknuett avatar Jul 25 '22 21:07 daknuett

Yeah, it's usually useful to include a copy of a traceback or larger logs for bug reports to survive data cleanup.

webknjaz avatar Jul 25 '22 21:07 webknjaz

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.

daknuett avatar Nov 08 '22 11:11 daknuett