python-poetry / poetry

Python packaging and dependency management made easy
https://python-poetry.org
MIT License
31.17k stars 2.25k forks source link

Missing version names of a package cause poetry to crash #817

Closed dvf closed 4 years ago

dvf commented 5 years ago

Issue

Poetry crashes when trying to install some-private-dep pinned at a parsable version (1.1.5).

There are missing versions of this private package, causing Poetry to be calling Version.parse with text = None

Here's the Traceback:

~/P/brxp ❯❯❯ poetry add some-private-dep==1.1.5 -vvv
Using virtualenv: /Users/dvf/Library/Caches/pypoetry/virtualenvs/someproject-py3.6

[TypeError]              
expected string or bytes-like object  

Exception trace:
 /Users/dvf/.poetry/lib/poetry/_vendor/py3.6/cleo/application.py in run() at line 94
   status_code = self.do_run(input_, output_)
 /Users/dvf/.poetry/lib/poetry/console/application.py in do_run() at line 88
   return super(Application, self).do_run(i, o)
 /Users/dvf/.poetry/lib/poetry/_vendor/py3.6/cleo/application.py in do_run() at line 197
   status_code = command.run(input_, output_)
 /Users/dvf/.poetry/lib/poetry/console/commands/command.py in run() at line 77
   return super(BaseCommand, self).run(i, o)
 /Users/dvf/.poetry/lib/poetry/_vendor/py3.6/cleo/commands/base_command.py in run() at line 146
   status_code = self.execute(input_, output_)
 /Users/dvf/.poetry/lib/poetry/_vendor/py3.6/cleo/commands/command.py in execute() at line 107
   return self.handle()
 /Users/dvf/.poetry/lib/poetry/console/commands/add.py in handle() at line 69
   packages, allow_prereleases=self.option("allow-prereleases")
 /Users/dvf/.poetry/lib/poetry/console/commands/init.py in _determine_requirements() at line 244
   allow_prereleases=allow_prereleases,
 /Users/dvf/.poetry/lib/poetry/console/commands/init.py in _find_best_version_for_package() at line 260
   name, required_version, allow_prereleases=allow_prereleases
 /Users/dvf/.poetry/lib/poetry/version/version_selector.py in find_best_candidate() at line 29
   package_name, constraint, allow_prereleases=allow_prereleases
 /Users/dvf/.poetry/lib/poetry/repositories/pool.py in find_packages() at line 65
   name, constraint, extras=extras, allow_prereleases=allow_prereleases
 /Users/dvf/.poetry/lib/poetry/repositories/legacy_repository.py in find_packages() at line 219
   for version in page.versions:
 /Users/dvf/.poetry/lib/poetry/repositories/legacy_repository.py in versions() at line 88
   version = self.link_version(link)
 /Users/dvf/.poetry/lib/poetry/repositories/legacy_repository.py in link_version() at line 134
   version = Version.parse(version)
 /Users/dvf/.poetry/lib/poetry/semver/version.py in parse() at line 199
   match = COMPLETE_VERSION.match(text)

add [-D|--dev] [--git GIT] [--path PATH] [-E|--extras EXTRAS] [--optional] [--python PYTHON] [--platform PLATFORM] [--allow-prereleases] [--dry-run] [--] <name> (<name>)...

I'll create a PR to fix.

dvf commented 5 years ago

Bump

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 4 years ago

Closing this issue automatically because it has not had any activity since it has been marked as stale. If you think it is still relevant and should be addressed, feel free to open a new one.

github-actions[bot] commented 6 months ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.