pipfile icon indicating copy to clipboard operation
pipfile copied to clipboard

how to specific version in extras of pipfile?

Open ChenhuaWANG22 opened this issue 2 years ago • 0 comments

how to specific version in extras of pipfile?

from:

celery = {extras = ["redis"],version = "*"}

to:

celery = {extras = ["redis = '==3.5.3'"],version = "==4.4.7"}

get error: File "/home/chenhua/.local/share/virtualenvs/healthServer-jnmSNbeH/lib/python3.7/site-packages/pkg_resources/_vendor/pyparsing/core.py", line 1141, in parse_string raise exc.with_traceback(None) pkg_resources._vendor.pyparsing.exceptions.ParseException: Expected string_end, found '[' (at char 6), (line:1, col:7)

or to:

celery = {extras = ["redis ==3.5.3"],version = "==4.4.7"}

get error: File "/home/chenhua/.local/share/virtualenvs/healthServer-jnmSNbeH/lib/python3.7/site-packages/pkg_resources/_vendor/packaging/requirements.py", line 105, in init f'Parse error at "{ requirement_string[e.loc : e.loc + 8]!r}": {e.msg}' pkg_resources.extern.packaging.requirements.InvalidRequirement: Parse error at "'[redis=='": Expected string_end

details:

I have an old project and recently I try to continue develop. However I get some dependency issues. try to pin the version to specific version according to pipfile.lock. While everything goes well, except the one in "extras".

Anyone knows how to do it?

Currently I write like below. However, I don't know whether it will cause potential bug or something weird or not. celery = "==4.4.7" redis = "==3.5.3"

ChenhuaWANG22 avatar Nov 17 '22 14:11 ChenhuaWANG22