Skip to content
This repository has been archived by the owner on Jan 12, 2021. It is now read-only.

'InvalidSpecifier: ==not' when converting from Pipfile.lock #455

Open
intgr opened this issue Aug 11, 2020 · 0 comments
Open

'InvalidSpecifier: ==not' when converting from Pipfile.lock #455

intgr opened this issue Aug 11, 2020 · 0 comments
Labels
bug Something isn't working

Comments

@intgr
Copy link

intgr commented Aug 11, 2020

Short description

Conversion from Pipfile.lock almost always fails with error "ERROR InvalidSpecifier: ==not in3.0"

cd /empty/directory
pipenv install requests
dephell deps convert --from-format=pipfilelock --from-path=Pipfile.lock --to-format=pipfile --to-path=Pipfile.x --level=DEBUG

Output

WARNING cannot find config file
DEBUG load dependencies... (format=pipfilelock, path=Pipfile.lock)
DEBUG dump dependencies... (format=pipfile, path=Pipfile.x)
ERROR InvalidSpecifier: ==not in3.0

I suspect it's due to markers in Pipfile.lock:

        "urllib3": {
            "hashes": [...],
            "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' and python_version < '4'",
            "version": "==1.25.10"
        }

Steps to reproduce

cd /empty/directory
pipenv install requests
dephell deps convert --from-format=pipfilelock --from-path=Pipfile.lock --to-format=pipfile --to-path=Pipfile.x --level=DEBUG

Traceback

Traceback (most recent call last):
  File "/Users/marti.raudsepp/.local/share/git/virtualenvs/b-LbqoOGsB/lib/python3.8/site-packages/dephell/cli.py", line 66, in main
    result = handler()
  File "/Users/marti.raudsepp/.local/share/git/virtualenvs/b-LbqoOGsB/lib/python3.8/site-packages/dephell/commands/deps_convert.py", line 91, in __call__
    dumper.dump(path=self.config['to']['path'], **dumper_kwargs)
  File "/Users/marti.raudsepp/.local/share/git/virtualenvs/b-LbqoOGsB/lib/python3.8/site-packages/dephell/converters/base.py", line 74, in dump
    content = self.dumps(reqs=reqs, content=content, project=project)
  File "/Users/marti.raudsepp/.local/share/git/virtualenvs/b-LbqoOGsB/lib/python3.8/site-packages/dephell/converters/pipfile.py", line 160, in dumps
    doc[section][raw_name] = self._format_req(req=req)
  File "/Users/marti.raudsepp/.local/share/git/virtualenvs/b-LbqoOGsB/lib/python3.8/site-packages/dephell/converters/pipfile.py", line 202, in _format_req
    for name, value in req:
  File "/Users/marti.raudsepp/.local/share/git/virtualenvs/b-LbqoOGsB/lib/python3.8/site-packages/dephell/models/requirement.py", line 248, in __iter__
    value = getattr(self, name)
  File "/Users/marti.raudsepp/.local/share/git/virtualenvs/b-LbqoOGsB/lib/python3.8/site-packages/dephell/cached_property.py", line 18, in __get__
    value = obj.__dict__[self.func.__name__] = self.func(obj)
  File "/Users/marti.raudsepp/.local/share/git/virtualenvs/b-LbqoOGsB/lib/python3.8/site-packages/dephell/models/requirement.py", line 147, in python
    python = self.dep.marker.python_version
  File "/Users/marti.raudsepp/.local/share/git/virtualenvs/b-LbqoOGsB/lib/python3.8/site-packages/dephell/models/marker_tracker.py", line 43, in __getattr__
    return getattr(self.markers, name)
  File "/Users/marti.raudsepp/.local/share/git/virtualenvs/b-LbqoOGsB/lib/python3.8/site-packages/dephell_markers/_markers.py", line 57, in python_version
    return RangeSpecifier(value)
  File "/Users/marti.raudsepp/.local/share/git/virtualenvs/b-LbqoOGsB/lib/python3.8/site-packages/dephell_specifier/range_specifier.py", line 40, in __init__
    self._specs = self._parse(spec)
  File "/Users/marti.raudsepp/.local/share/git/virtualenvs/b-LbqoOGsB/lib/python3.8/site-packages/dephell_specifier/range_specifier.py", line 73, in _parse
    result.add(Specifier(constr))
  File "/Users/marti.raudsepp/.local/share/git/virtualenvs/b-LbqoOGsB/lib/python3.8/site-packages/dephell_specifier/specifier.py", line 62, in __init__
    raise specifiers.InvalidSpecifier(constr)
packaging.specifiers.InvalidSpecifier: ==not in3.0

Versions

{
  "cache": "1.90Mb",
  "path": "/Users/marti.raudsepp/.local/share/git/virtualenvs/b-LbqoOGsB/lib/python3.8/site-packages/dephell",
  "python": "/Users/marti.raudsepp/.local/share/git/virtualenvs/b-LbqoOGsB/bin/python",
  "version": "0.8.3",
  "versions": {
    "dephell-archive": "0.1.7",
    "dephell-argparse": "0.1.3",
    "dephell-changelogs": "0.0.1",
    "dephell-discover": "0.2.10",
    "dephell-licenses": "0.1.7",
    "dephell-links": "0.1.5",
    "dephell-markers": "1.0.3",
    "dephell-pythons": "0.1.15",
    "dephell-setuptools": "0.2.4",
    "dephell-shells": "0.1.5",
    "dephell-specifier": "0.2.2",
    "dephell-venvs": "0.1.17",
    "dephell-versioning": "0.1.2"
  }
}
@orsinium orsinium added the bug Something isn't working label Aug 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Development

No branches or pull requests

2 participants