lebrice / SimpleParsing

Simple, Elegant, Typed Argument Parsing with argparse
MIT License
399 stars 49 forks source link

All python 3.7 Builds on Travis fail and I have no clue why #118

Closed lebrice closed 2 years ago

lebrice commented 2 years ago

Describe the bug

Example job: https://app.travis-ci.com/github/lebrice/SimpleParsing/jobs/566488391

It's always this error:

$ pip install --no-cache --ignore-installed -e .

Obtaining file:///home/travis/build/lebrice/SimpleParsing

  Preparing metadata (setup.py): started

  Preparing metadata (setup.py): finished with status 'error'

  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.

  │ exit code: 1

  ╰─> [22 lines of output]

      Traceback (most recent call last):

        File "<string>", line 36, in <module>

        File "<pip-setuptools-caller>", line 14, in <module>

        File "/home/travis/virtualenv/python3.7.1/lib/python3.7/site-packages/setuptools/__init__.py", line 18, in <module>

          from setuptools.dist import Distribution

        File "/home/travis/virtualenv/python3.7.1/lib/python3.7/site-packages/setuptools/dist.py", line 34, in <module>

          from ._importlib import metadata

        File "/home/travis/virtualenv/python3.7.1/lib/python3.7/site-packages/setuptools/_importlib.py", line 28, in <module>

          disable_importlib_metadata_finder(metadata)

        File "/home/travis/virtualenv/python3.7.1/lib/python3.7/site-packages/setuptools/_importlib.py", line 12, in disable_importlib_metadata_finder

          import importlib_metadata

        File "/home/travis/virtualenv/python3.7.1/lib/python3.7/site-packages/importlib_metadata/__init__.py", line 471, in <module>

          __version__ = version(__name__)

        File "/home/travis/virtualenv/python3.7.1/lib/python3.7/site-packages/importlib_metadata/__init__.py", line 438, in version

          return distribution(package).version

        File "/home/travis/virtualenv/python3.7.1/lib/python3.7/site-packages/importlib_metadata/__init__.py", line 411, in distribution

          return Distribution.from_name(package)

        File "/home/travis/virtualenv/python3.7.1/lib/python3.7/site-packages/importlib_metadata/__init__.py", line 179, in from_name

          dists = resolver(name)

        File "/home/travis/virtualenv/python3.7.1/lib/python3.7/site-packages/setuptools/_vendor/importlib_metadata/__init__.py", line 886, in find_distributions

          found = self._search_paths(context.name, context.path)

      AttributeError: 'str' object has no attribute 'name'

      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.

error: metadata-generation-failed

× Encountered error while generating package metadata.

╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.

hint: See above for details.

The command "pip install --no-cache --ignore-installed -e ." failed and exited with 1 during .

Your build has been stopped.

Anyone have any idea what might be causing this? I'm totally unable to reproduce it on my end, python 3.7.1 installs just fine!

As a temporary solution, I'm just running the tests myself, and overrulling the CI on PRs.. but this is less than ideal.

Qu4tro commented 2 years ago

I know I'm late (I see your shiny new github actions CI) - but the solution would be to run pip install --upgrade importlib_metadata before pip install . .

I've found this issue on google, so I'm hoping it saves someone a headache.

I had written a whole rant on TravisCI, but I don't think it's worth it. This issue exists, as I write this, for at least 29 days.

Qu4tro commented 2 years ago

I've only seen this package contents, now :sweat_smile: . Looks great. A declarative way to express your arg options. Nice!