Install package, stored on test.pypi.org, with Poetry failed

Viewed 31

I've publish a package on test.pypi.org. So, fotr now, I want to test it on a new local project, and adding it with poetry.

Simply :

python setup.py sdist bdist_wheel
python twine upload --repository-url https://test.pypi.org/legacy/ dist/*

poetry config repositories.testpypi https://test.pypi.org/legacy/
poetry config pypi-token.testpypi pypi-{my_token}

The poetry config :

$ poetry config --list
...
repositories.testpypi.url = "https://test.pypi.org/legacy/"
...

Adding on pyproject.toml :

[[tool.poetry.source]]
name = "testpypi"
url = "https://test.pypi.org/legacy/"
secondary = true

But when I try to add to my new poetry project :

$ poetry add https://test.pypi.org/project/{my_project} -vvv

Loading configuration file /home/{me}/.config/pypoetry/config.toml
Loading configuration file /home/{me}/.config/pypoetry/auth.toml
Adding repository testpypi (https://test.pypi.org/legacy) and setting it as secondary
Using virtualenv: /mnt/c/var/www/tmp/testpipy/.venv
Project environment contains an empty path in sys_path, ignoring.
[urllib3.connectionpool] Starting new HTTPS connection (1): test.pypi.org:443
[urllib3.connectionpool] https://test.pypi.org:443 "GET /project/{my_project} HTTP/1.1" 301 221
[urllib3.connectionpool] https://test.pypi.org:443 "GET /project/{my_project}/ HTTP/1.1" 200 7235
...
...
    1  ~/.local/share/pypoetry/venv/lib/python3.9/site-packages/pkginfo/distribution.py:115 in extractMetadata
      113│ 
      114│     def extractMetadata(self):
    → 115│         data = self.read()
      116│         self.parse(data)
      117│

  ValueError

  Not a known archive format: /tmp/tmpcujxzr6t/{my_project}

  at ~/.local/share/pypoetry/venv/lib/python3.9/site-packages/pkginfo/bdist.py:25 in read
       21│             names = archive.namelist()
       22│             def read_file(name):
       23│                 return archive.read(name)
       24│         else:
    →  25│             raise ValueError('Not a known archive format: %s' % fqn)
       26│
       27│         try:
       28│             tuples = [x.split('/') for x in names if 'PKG-INFO' in x]
       29│             schwarz = sorted([(len(x), x) for x in tuples])

...
 1  ~/.local/share/pypoetry/venv/lib/python3.9/site-packages/poetry/inspection/info.py:559 in from_path
      557│         """
      558│         try:
    → 559│             return cls.from_bdist(path=path)
      560│         except PackageInfoError:
      561│             return cls.from_sdist(path=path)

  PackageInfoError

  Unable to determine package info for path: /tmp/tmpcujxzr6t/{my_project}

  Not a known archive format: /tmp/tmpcujxzr6t/{my_project}

  at ~/.local/share/pypoetry/venv/lib/python3.9/site-packages/poetry/inspection/info.py:549 in from_bdist
      545│ 
      546│         try:
      547│             return cls._from_distribution(pkginfo.BDist(str(path)))
      548│         except ValueError as e:
    → 549│             raise PackageInfoError(path, e)
      550│
      551│     @classmethod
      552│     def from_path(cls, path: Path) -> PackageInfo:
      553│         """
...
1  ~/.local/share/pypoetry/venv/lib/python3.9/site-packages/poetry/inspection/info.py:309 in _from_sdist_file
       307│         with temporary_directory() as tmp_str:
       308│             tmp = Path(tmp_str)
     → 309│             with context(path.as_posix()) as archive:
       310│                 archive.extractall(tmp.as_posix())
       311│

  ReadError

  file could not be opened successfully

  at /usr/lib/python3.9/tarfile.py:1616 in open
      1612│                 except (ReadError, CompressionError):
      1613│                     if fileobj is not None:
      1614│                         fileobj.seek(saved_pos)
      1615│                     continue
    → 1616│             raise ReadError("file could not be opened successfully")
      1617│
      1618│         elif ":" in mode:
      1619│             filemode, comptype = mode.split(":", 1)
      1620│             filemode = filemode or "r"

Have you an idea?

0 Answers
Related