Uploaded image for project: 'Artifactory Binary Repository'
  1. Artifactory Binary Repository
  2. RTFACT-20390

PyPi uploads using twine cause duplicate entries

    Details

    • Type: Bug
    • Status: Open
    • Priority: Normal
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: PyPI
    • Labels:
      None

      Description

      Symptoms: Duplicate entries appear in the "simple.html" PyPi index file after uploading a twine package

      Steps to reproduce:

      1. Create the project folder:

      mkdir twine-test

      mkdir twine-test/example_pkg

      cd twine-test/

      2. Add a basic setup.py - Include underscores in the package name

      import setuptools

      setuptools.setup(

          name="infra_pypipkg_test",

          version="0.0.1",

          author="jfrog",

          author_email="",

          description="A small example package",

          url="",

          packages=setuptools.find_packages(),

          classifiers=[

              "Programming Language :: Python :: 3",

              "Operating System :: OS Independent",

          ],

          python_requires='>=3.6',

      )

       

      3. Add a dummy "hello world" script

      echo 'print "hello-world!"' > example_pkg/hello.py

       

      3. Bundle it up using python - Do not upload

      python3 setup.py sdist bdist_wheel

       

      4. Twine upload the file:

      twine upload --repository local dist/*

      Uploading distributions to http://artifactory.com:8081/artifactory/api/pypi/pypi

      Uploading infra_pypipkg_test-0.0.1-py3-none-any.whl

      100%|███████████████████████████████████████████████████████████████| 4.70k/4.70k [00:00<00:00, 64.1kB/s]

      Uploading infra_pypipkg_test-0.0.1.tar.gz

      100%|███████████████████████████████████████████████████████████████| 3.51k/3.51k [00:00<00:00, 61.7kB/s]

       

      After indexing, the package appears twice in the simple.html metadata:

      <a data-requires-python=">=3.6" href="infra-pypipkg-test" rel="internal" >infra-pypipkg-test</a><br/>

      <a data-requires-python=">=3.6" href="infra_pypipkg_test" rel="internal" >infra_pypipkg_test</a><br/>

       

      Both link to the Underscore packages. From what I can tell, it might be caused by the folder name:

      pypi-local/infra-pypipkg-test/0.0.1/infra_pypipkg_test-0.0.1-py3-none-any.whl

       

      Only one POST was recorded for me:

      20191018204116|298|REQUEST|127.0.0.1|admin|POST|/api/pypi/pypi|HTTP/1.1|200|3389

       

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              patrickr Patrick Russell
            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: