Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail to parse a private repo URI w/ credentials containing . #5475

Closed
ci-builder-onixs opened this issue Nov 16, 2022 · 2 comments · Fixed by #6139
Closed

Fail to parse a private repo URI w/ credentials containing . #5475

ci-builder-onixs opened this issue Nov 16, 2022 · 2 comments · Fixed by #6139
Labels
Category: Private PyPIs 😎 Problem relates to private PyPI usage. triage Type: Possible Bug This issue describes a possible bug in pipenv. Type: Vendored Dependencies This issue affects vendored dependencies within pipenv.

Comments

@ci-builder-onixs
Copy link

Issue description

I have the source defined in my Pipfile:

[[source]]
url = "https://${ARTIFACTORY_USER}:${ARTIFACTORY_API_KEY}@private.jfrog.io/artifactory/api/pypi/pypi-ci/simple"
verify_ssl = true
name = "my"

My username (in the ARTIFACTORY_USER envvar) contains a dot character (e.g. my.user).

Expected result

pipenv install dependencies.

Actual result

Pipfile.lock not found, creating...
Locking [packages] dependencies...
Building requirements...
Resolving dependencies...
✘ Locking Failed!

Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/pipenv/patched/pip/_vendor/packaging/requirements.py", line 102, in __init__
    req = REQUIREMENT.parseString(requirement_string)
  File "/usr/lib/python3.10/site-packages/pipenv/patched/pip/_vendor/pyparsing/core.py", line 1141, in parse_string
    raise exc.with_traceback(None)
pipenv.patched.pip._vendor.pyparsing.exceptions.ParseException: Expected string_end, found ':'  (at char 16), (line:1, col:17)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/pipenv/patched/pip/_vendor/pkg_resources/__init__.py", line 3101, in __init__
    super(Requirement, self).__init__(requirement_string)
  File "/usr/lib/python3.10/site-packages/pipenv/patched/pip/_vendor/packaging/requirements.py", line 104, in __init__
    raise InvalidRequirement(
pipenv.patched.pip._vendor.packaging.requirements.InvalidRequirement: Parse error at "':myPass'": Expected string_end
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/pipenv/vendor/requirementslib/models/requirements.py", line 964, in _parse_name_from_line
    self._requirement = init_requirement(self.line)
  File "/usr/lib/python3.10/site-packages/pipenv/vendor/requirementslib/models/utils.py", line 192, in init_requirement
    req = Requirement.parse(name)
  File "/usr/lib/python3.10/site-packages/pipenv/patched/pip/_vendor/pkg_resources/__init__.py", line 3148, in parse
    req, = parse_requirements(s)
  File "/usr/lib/python3.10/site-packages/pipenv/patched/pip/_vendor/pkg_resources/__init__.py", line 3094, in parse_requirements
    yield Requirement(line)
  File "/usr/lib/python3.10/site-packages/pipenv/patched/pip/_vendor/pkg_resources/__init__.py", line 3103, in __init__
    raise RequirementParseError(str(e))
pipenv.patched.pip._vendor.pkg_resources.RequirementParseError: Parse error at "':myPass'": Expected string_end
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/pipenv/resolver.py", line 845, in <module>
    main()
  File "/usr/lib/python3.10/site-packages/pipenv/resolver.py", line 831, in main
    _main(
  File "/usr/lib/python3.10/site-packages/pipenv/resolver.py", line 811, in _main
    resolve_packages(
  File "/usr/lib/python3.10/site-packages/pipenv/resolver.py", line 759, in resolve_packages
    results, resolver = resolve(
  File "/usr/lib/python3.10/site-packages/pipenv/resolver.py", line 738, in resolve
    return resolve_deps(
  File "/usr/lib/python3.10/site-packages/pipenv/utils/resolver.py", line 1104, in resolve_deps
    results, hashes, markers_lookup, resolver, skipped = actually_resolve_deps(
  File "/usr/lib/python3.10/site-packages/pipenv/utils/resolver.py", line 888, in actually_resolve_deps
    resolver = Resolver.create(
  File "/usr/lib/python3.10/site-packages/pipenv/utils/resolver.py", line 457, in create
    constraints, skipped, index_lookup, markers_lookup = resolver.get_metadata(
  File "/usr/lib/python3.10/site-packages/pipenv/utils/resolver.py", line 215, in get_metadata
    req, req_idx, markers_idx = self.parse_line(
  File "/usr/lib/python3.10/site-packages/pipenv/utils/resolver.py", line 272, in parse_line
    req = Requirement.from_line(line)
  File "/usr/lib/python3.10/site-packages/pipenv/vendor/requirementslib/models/requirements.py", line 2675, in from_line
    parsed_line = Line(line)
  File "/usr/lib/python3.10/site-packages/pipenv/vendor/requirementslib/models/requirements.py", line 171, in __init__
    self.parse()
  File "/usr/lib/python3.10/site-packages/pipenv/vendor/requirementslib/models/requirements.py", line 1300, in parse
    self.parse_name()
  File "/usr/lib/python3.10/site-packages/pipenv/vendor/requirementslib/models/requirements.py", line 1025, in parse_name
    name = self._parse_name_from_line()
  File "/usr/lib/python3.10/site-packages/pipenv/vendor/requirementslib/models/requirements.py", line 966, in _parse_name_from_line
    raise RequirementError(
pipenv.vendor.requirementslib.exceptions.RequirementError: Failed parsing requirement from 'my.user:[email protected]/artifactory/api/pypi/pypi-ci/simple'

Steps to replicate

  1. Add a private repo w/ a username containing . symbol in it
  2. Try pipenv install any deps from the added source
@matteius matteius added triage Type: Possible Bug This issue describes a possible bug in pipenv. Category: Private PyPIs 😎 Problem relates to private PyPI usage. labels Nov 19, 2022
@matteius
Copy link
Member

matteius commented Dec 3, 2022

@ci-builder-onixs can you open a report in requirementslib linked to this issue?

@matteius matteius added the Type: Vendored Dependencies This issue affects vendored dependencies within pipenv. label Dec 3, 2022
@matteius
Copy link
Member

@ci-builder-onixs I think this issue may be addressed on my future oriented requirementslib branch: #5679

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Private PyPIs 😎 Problem relates to private PyPI usage. triage Type: Possible Bug This issue describes a possible bug in pipenv. Type: Vendored Dependencies This issue affects vendored dependencies within pipenv.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants