giotto-ai / pyflagser

Python bindings and API for the flagser C++ library (https://github.com/luetge/flagser).
Other
13 stars 15 forks source link

No PKG_INFO error when uploading tar file to PyPI #14

Closed ulupo closed 4 years ago

ulupo commented 4 years ago

Description

While the wheels for v0.1.0 have been successfully uploaded to PyPI, we encountered the error in the title when attempting to upload the tarball to PyPI.

gtauzin commented 4 years ago

@ulupo Did it happen again when you uploaded the wheels?

ulupo commented 4 years ago

It didn't, but uploading the wheels was never a problem. We didn't attempt to upload the tar this time round either, so I don't know if it would have happened again.

gtauzin commented 4 years ago

I think initially it might have been because the link to the tarball in setup.py was not the right one. It was still pointing to v0.1.0 on May 6, when I changed it (commit d59d35ecfc281be806535f647166775a0dcc215e).

ulupo commented 4 years ago

@gtauzin thanks for the info. For 0.3.1, we can try uploading the tarball again then.

ulupo commented 4 years ago

Update: we just tested on 0.3.0 and the problem persists there: the traceback shows:

ValueError: No PKG-INFO in archive: /Users/matteocaorsi/Desktop/UPLOAD_TO_PYPI/dist/pyflagser-0.3.0.tar.gz
gtauzin commented 4 years ago

How do you generate the archive?

ulupo commented 4 years ago

I think (please @matteocao correct me if wrong) that we take it from the release, i.e. from https://github.com/giotto-ai/pyflagser/archive/v0.3.0.tar.gz.

gtauzin commented 4 years ago

And this problem never arises with giotto-tda while it is uploaded the same way?

ulupo commented 4 years ago

As far as I recall, this problem did not arise when we were uploading it. But we no longer upload tars for giotto-tda as they are guaranteed to fail due to the git submodule steps.

gtauzin commented 4 years ago

Ok, the one you pointed to is generated by GitHub. Indeed, we don't upload tarballs directly. I don't see any difference with giotto-tda then. As I recall, the git submodules steps are the same in giotto-tda and in pyflagser, no?

It seems to me the one PyPI expects are the one generated by the azure pipelines. It does have the egg-file folder and the PKG-INFO file. which are absent from the GitHub generated tarballs which just contain the release branch.

ulupo commented 4 years ago

@gtauzin using the Azure files did the trick, thanks for the diagnosis! Closing the issue as it is solved.

However, installing from tarballs will fail. In my case, I obtained the following traceback:

ERROR: Command errored out with exit status 1:
     command: /Users/umbertolupo/anaconda3/envs/pyflagser-tar/bin/python3.8 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/8d/05mg3tln65v3x2qxs9pxfgkm0000gn/T/pip-req-build-0_yn8bgm/setup.py'"'"'; __file__='"'"'/private/var/folders/8d/05mg3tln65v3x2qxs9pxfgkm0000gn/T/pip-req-build-0_yn8bgm/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/8d/05mg3tln65v3x2qxs9pxfgkm0000gn/T/pip-pip-egg-info-1ny2253v
         cwd: /private/var/folders/8d/05mg3tln65v3x2qxs9pxfgkm0000gn/T/pip-req-build-0_yn8bgm/
    Complete output (5 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/8d/05mg3tln65v3x2qxs9pxfgkm0000gn/T/pip-req-build-0_yn8bgm/setup.py", line 19, in <module>
        with open('requirements.txt') as f:
    FileNotFoundError: [Errno 2] No such file or directory: 'requirements.txt'
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

This is of course a different problem and should be the subject of a separate issue.