question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Poetry is not able to handle URLs correctly: ParseVersionError: Unable to parse None

See original GitHub issue
  • I am on the latest Poetry version.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).
  • OS version and name: Linux, Arch Linux
  • Poetry version: 1.0.10
  • contents of your pyproject.toml file:
[tool.poetry]
name = "avency-blockctl"
version = "0.1.0"
description = "blocklist management tool for Forcepoint NGFW"
authors = ["Christian Rebischke <chris@shibumi.dev>"]

[tool.poetry.dependencies]
python = "^3.8"
pyyaml = "^5.3.1"
requests = "^2.24.0"
ipaddress = "^1.0.23"

[tool.poetry.dev-dependencies]

[build-system]
requires = ["poetry>=0.12"]
build-backend = "poetry.masonry.api"

Issue

Hi, I just switched from virtualenvwrapper or plain pyenv to poetry. So maybe I am just doing something wrong. I try to add a dependency for my project, that consists out of an URL:

https://github.com/Forcepoint/fp-NGFW-SMC-python/archive/4c004e86b2bc2bd2870e57687e3ac8af9d42abbf.tar.gz#egg=fp-ngfw-smc-python

Looks like poetry cannot handle this?

Command + output:

❯ poetry add -vvv 'https://github.com/Forcepoint/fp-NGFW-SMC-python/archive/4c004e86b2bc2bd2870e57687e3ac8af9d42abbf.tar.gz#egg=fp-ngfw-smc-python'
Using virtualenv: /home/chris/.cache/pypoetry/virtualenvs/avency-blockctl-OZBv3Rqq-py3.8

[ParseVersionError]
Unable to parse "None".

Traceback:

Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/clikit/console_application.py", line 131, in run
    status_code = command.handle(parsed_args, io)
  File "/usr/lib/python3.8/site-packages/clikit/api/command/command.py", line 120, in handle
    status_code = self._do_handle(args, io)
  File "/usr/lib/python3.8/site-packages/clikit/api/command/command.py", line 171, in _do_handle
    return getattr(handler, handler_method)(args, io, self)
  File "/usr/lib/python3.8/site-packages/cleo/commands/command.py", line 92, in wrap_handle
    return self.handle()
  File "/usr/lib/python3.8/site-packages/poetry/console/commands/add.py", line 95, in handle
    requirements = self._determine_requirements(
  File "/usr/lib/python3.8/site-packages/poetry/console/commands/init.py", line 293, in _determine_requirements
    requires = self._parse_requirements(requires)
  File "/usr/lib/python3.8/site-packages/poetry/console/commands/init.py", line 388, in _parse_requirements
    package = Provider.get_package_from_url(requirement)
  File "/usr/lib/python3.8/site-packages/poetry/puzzle/provider.py", line 503, in get_package_from_url
    package = cls.get_package_from_file(temp_dir / file_name)
  File "/usr/lib/python3.8/site-packages/poetry/puzzle/provider.py", line 271, in get_package_from_file
    package = Package(info["name"], info["version"])
  File "/usr/lib/python3.8/site-packages/poetry/packages/package.py", line 46, in __init__
    self._version = Version.parse(version)
  File "/usr/lib/python3.8/site-packages/poetry/semver/version.py", line 206, in parse
    raise ParseVersionError('Unable to parse "{}".'.format(text))

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
abncommented, Aug 25, 2020

Closing this as this is a known limitation of poetry<=1.0.10. As mentioned above version 1.1.0 improves the situation, but we cannot truly get away from bad package metadata.

1reaction
shibumicommented, Aug 25, 2020

@abn this is exactly I was looking for and it’s fine by now. This way I can use poetry + wait for the release.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using poetry on different machines - Stack Overflow
Possible help: ensure that poetry installed and path to poetry executable in PATH environment variable;; check that python 3.8+ is installed ( ...
Read more >
History | Poetry - Python dependency management and ...
Fix an issue where Poetry fails with an AssertionError due to distribution.files being None (#6788). Fix an issue where poetry env info did...
Read more >
poetry - PyPI
Poetry helps you declare, manage and install dependencies of Python projects, ensuring you have the right stack everywhere. Poetry Install.
Read more >
Dependency Management With Python Poetry
After an update, a package might not work as it did before the update. A dependency manager like Python Poetry helps you specify,...
Read more >
Configure a Poetry environment | PyCharm Documentation
Project dependencies are recorded in the pyproject.toml file that specifies required packages, scripts, plugins, and URLs. See the pyproject reference for more ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found