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

Using dependencies from a URL fails on Windows #6011

Closed
thtrummer opened this issue Nov 9, 2023 · 2 comments · Fixed by #6012
Closed

Using dependencies from a URL fails on Windows #6011

thtrummer opened this issue Nov 9, 2023 · 2 comments · Fixed by #6012

Comments

@thtrummer
Copy link

Issue description

Using dependencies from a URL is broken on Windows since pipenv==2023.9.7. This is likely caused by treating the URL as filesystem path (which on Windows will change the slashes).

Might be caused by 91743a6.

Expected result

λ pipenv lock
Locking [packages] dependencies...
Building requirements...
Resolving dependencies...
Success!
Locking [dev-packages] dependencies...
Updated Pipfile.lock (ce05cad406b5493dd778394bb280d21c43453a535aa20df07333d0e22d99b03f)!

Actual result

pipenv.patched.pip._internal.exceptions.InstallationError: Invalid requirement: '\\files.pythonhosted.org\\packages\\70\\8e\\0e2d847013cb52cd35b38c009bb167a1a26b2ce6cd6965bf26b47bc0bf44\\requests==2.31.0'
Hint: It looks like a path. File '\files.pythonhosted.org\packages\70\8e\0e2d847013cb52cd35b38c009bb167a1a26b2ce6cd6965bf26b47bc0bf44\requests==2.31.0' does not exist.

Steps to replicate

[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true

[packages]
requests = { file = "https://files.pythonhosted.org/packages/70/8e/0e2d847013cb52cd35b38c009bb167a1a26b2ce6cd6965bf26b47bc0bf44/requests-2.31.0-py3-none-any.whl" }

[requires]
python_version = "3.10"
@matteius
Copy link
Member

@thtrummer I have a PR up that I believe addresses this issue -- would you be able to give it a try?

@thtrummer
Copy link
Author

Seems to work -- great job!

Log
λ git status
On branch issue-6011
Your branch is up to date with 'origin/issue-6011'.

λ python .\pipenv\pipenv\__main__.py lock -v
Locking [packages] dependencies...
Building requirements...
Resolving dependencies...
INFO:pipenv.patched.pip._internal.operations.prepare:Collecting requests@
https://files.pythonhosted.org/packages/70/8e/0e2d847013cb52cd35b38c009bb167a1a26b2ce6cd6965bf26b47bc0bf44/requests-2.31.0-py3-none-any.whl (from -r
C:\Users\trummer\AppData\Local\Temp\pipenv-8m7xkk7p-requirements\pipenv-rckln5cx-constraints.txt (line 2))
INFO:pipenv.patched.pip._internal.network.download:Using cached requests-2.31.0-py3-none-any.whl (62 kB)
INFO:pipenv.patched.pip._internal.resolution.resolvelib.reporter:Reporter.starting()
INFO:pipenv.patched.pip._internal.resolution.resolvelib.reporter:Reporter.adding_requirement(ExplicitRequirement(LinkCandidate('https://files.pythonhosted.org/packages/70/8e/0e2d847013cb52cd35b38c009bb167a1a26b2ce6cd6965bf26b47bc0bf44/requests-2.31.0-py3-none-any.whl')), None)
INFO:pipenv.patched.pip._internal.resolution.resolvelib.reporter:Reporter.starting_round(0)
INFO:pipenv.patched.pip._internal.resolution.resolvelib.reporter:Reporter.adding_requirement(SpecifierRequirement('charset-normalizer<4,>=2'),
LinkCandidate('https://files.pythonhosted.org/packages/70/8e/0e2d847013cb52cd35b38c009bb167a1a26b2ce6cd6965bf26b47bc0bf44/requests-2.31.0-py3-none-any.whl'))
INFO:pipenv.patched.pip._internal.operations.prepare:Collecting charset-normalizer<4,>=2 (from requests@
https://files.pythonhosted.org/packages/70/8e/0e2d847013cb52cd35b38c009bb167a1a26b2ce6cd6965bf26b47bc0bf44/requests-2.31.0-py3-none-any.whl->-r C:\Users\trummer\AppData\Local\Temp\pipenv-8m7xkk7p-requirements\pipenv-rckln5cx-constraints.txt(line 2))
INFO:pipenv.patched.pip._internal.network.download:Using cached
charset_normalizer-3.3.2-cp310-cp310-win_amd64.whl.metadata (34 kB)
INFO:pipenv.patched.pip._internal.resolution.resolvelib.reporter:Reporter.adding_requirement(SpecifierRequirement('idna<4,>=2.5'),
LinkCandidate('https://files.pythonhosted.org/packages/70/8e/0e2d847013cb52cd35b38c009bb167a1a26b2ce6cd6965bf26b47bc0bf44/requests-2.31.0-py3-none-any.whl'))
INFO:pipenv.patched.pip._internal.operations.prepare:Collecting idna<4,>=2.5 (from requests@
https://files.pythonhosted.org/packages/70/8e/0e2d847013cb52cd35b38c009bb167a1a26b2ce6cd6965bf26b47bc0bf44/requests-2.31.0-py3-none-any.whl->-r C:\Users\trummer\AppData\Local\Temp\pipenv-8m7xkk7p-requirements\pipenv-rckln5cx-constraints.txt(line 2))
INFO:pipenv.patched.pip._internal.network.download:Using cached idna-3.4-py3-none-any.whl (61 kB)
INFO:pipenv.patched.pip._internal.resolution.resolvelib.reporter:Reporter.adding_requirement(SpecifierRequirement('urllib3<3,>=1.21.1'),
LinkCandidate('https://files.pythonhosted.org/packages/70/8e/0e2d847013cb52cd35b38c009bb167a1a26b2ce6cd6965bf26b47bc0bf44/requests-2.31.0-py3-none-any.whl'))
INFO:pipenv.patched.pip._internal.operations.prepare:Collecting urllib3<3,>=1.21.1 (from requests@
https://files.pythonhosted.org/packages/70/8e/0e2d847013cb52cd35b38c009bb167a1a26b2ce6cd6965bf26b47bc0bf44/requests-2.31.0-py3-none-any.whl->-r C:\Users\trummer\AppData\Local\Temp\pipenv-8m7xkk7p-requirements\pipenv-rckln5cx-constraints.txt(line 2))
INFO:pipenv.patched.pip._internal.network.download:Using cached urllib3-2.0.7-py3-none-any.whl.metadata (6.6 kB)
INFO:pipenv.patched.pip._internal.resolution.resolvelib.reporter:Reporter.adding_requirement(SpecifierRequirement('certifi>=2017.4.17'),
LinkCandidate('https://files.pythonhosted.org/packages/70/8e/0e2d847013cb52cd35b38c009bb167a1a26b2ce6cd6965bf26b47bc0bf44/requests-2.31.0-py3-none-any.whl'))
INFO:pipenv.patched.pip._internal.operations.prepare:Collecting certifi>=2017.4.17 (from requests@
https://files.pythonhosted.org/packages/70/8e/0e2d847013cb52cd35b38c009bb167a1a26b2ce6cd6965bf26b47bc0bf44/requests-2.31.0-py3-none-any.whl->-r C:\Users\trummer\AppData\Local\Temp\pipenv-8m7xkk7p-requirements\pipenv-rckln5cx-constraints.txt(line 2))
INFO:pipenv.patched.pip._internal.network.download:Using cached certifi-2023.7.22-py3-none-any.whl.metadata (2.2 kB)
INFO:pipenv.patched.pip._internal.resolution.resolvelib.reporter:Reporter.pinning(LinkCandidate('https://files.pythonhosted.org/packages/70/8e/0e2d847013cb52cd35b38c009bb167a1a26b2ce6cd6965bf26b47bc0bf44/requests-2.31.0-py3-none-any.whl'))
INFO:pipenv.patched.pip._internal.resolution.resolvelib.reporter:Reporter.ending_round(0, state)
INFO:pipenv.patched.pip._internal.resolution.resolvelib.reporter:Reporter.starting_round(1)
INFO:pipenv.patched.pip._internal.resolution.resolvelib.reporter:Reporter.pinning(LinkCandidate('https://files.pythonhosted.org/packages/4c/dd/2234eab22353ffc7d94e8d13177aaa050113286e93e7b40eae01fbf7c3d9/certifi-2023.7.22-py3-none-any.whl
(from https://pypi.org/simple/certifi/) (requires-python:>=3.6)'))
INFO:pipenv.patched.pip._internal.resolution.resolvelib.reporter:Reporter.ending_round(1, state)
INFO:pipenv.patched.pip._internal.resolution.resolvelib.reporter:Reporter.starting_round(2)
INFO:pipenv.patched.pip._internal.resolution.resolvelib.reporter:Reporter.pinning(LinkCandidate('https://files.pythonhosted.org/packages/a2/a0/4af29e22cb5942488cf45630cbdd7cefd908768e69bdd90280842e4e8529/charset_normalizer-3.3.2-cp310-cp310-win_amd64.whl (from https://pypi.org/simple/charset-normalizer/) (requires-python:>=3.7.0)'))
INFO:pipenv.patched.pip._internal.resolution.resolvelib.reporter:Reporter.ending_round(2, state)
INFO:pipenv.patched.pip._internal.resolution.resolvelib.reporter:Reporter.starting_round(3)
INFO:pipenv.patched.pip._internal.resolution.resolvelib.reporter:Reporter.pinning(LinkCandidate('https://files.pythonhosted.org/packages/fc/34/3030de6f1370931b9dbb4dad48f6ab1015ab1d32447850b9fc94e60097be/idna-3.4-py3-none-any.whl (from
https://pypi.org/simple/idna/) (requires-python:>=3.5)'))
INFO:pipenv.patched.pip._internal.resolution.resolvelib.reporter:Reporter.ending_round(3, state)
INFO:pipenv.patched.pip._internal.resolution.resolvelib.reporter:Reporter.starting_round(4)
INFO:pipenv.patched.pip._internal.resolution.resolvelib.reporter:Reporter.pinning(LinkCandidate('https://files.pythonhosted.org/packages/d2/b2/b157855192a68541a91ba7b2bbcb91f1b4faa51f8bae38d8005c034be524/urllib3-2.0.7-py3-none-any.whl (fromhttps://pypi.org/simple/urllib3/) (requires-python:>=3.7)'))
INFO:pipenv.patched.pip._internal.resolution.resolvelib.reporter:Reporter.ending_round(4, state)
INFO:pipenv.patched.pip._internal.resolution.resolvelib.reporter:Reporter.starting_round(5)
INFO:pipenv.patched.pip._internal.resolution.resolvelib.reporter:Reporter.ending(State(mapping=OrderedDict([('requests',LinkCandidate('https://files.pythonhosted.org/packages/70/8e/0e2d847013cb52cd35b38c009bb167a1a26b2ce6cd6965bf26b47bc0bf44/requests-2.31.0-py3-none-any.whl')), ('certifi',
LinkCandidate('https://files.pythonhosted.org/packages/4c/dd/2234eab22353ffc7d94e8d13177aaa050113286e93e7b40eae01fbf7c3d9/certifi-2023.7.22-py3-none-any.whl (from https://pypi.org/simple/certifi/) (requires-python:>=3.6)')),
('charset-normalizer',
LinkCandidate('https://files.pythonhosted.org/packages/a2/a0/4af29e22cb5942488cf45630cbdd7cefd908768e69bdd90280842e4e8529/charset_normalizer-3.3.2-cp310-cp310-win_amd64.whl (from https://pypi.org/simple/charset-normalizer/)
(requires-python:>=3.7.0)')), ('idna',
LinkCandidate('https://files.pythonhosted.org/packages/fc/34/3030de6f1370931b9dbb4dad48f6ab1015ab1d32447850b9fc94e60097be/idna-3.4-py3-none-any.whl (from https://pypi.org/simple/idna/) (requires-python:>=3.5)')), ('urllib3',
LinkCandidate('https://files.pythonhosted.org/packages/d2/b2/b157855192a68541a91ba7b2bbcb91f1b4faa51f8bae38d8005c034be524/urllib3-2.0.7-py3-none-any.whl (from https://pypi.org/simple/urllib3/) (requires-python:>=3.7)'))]),
criteria={'requests':
Criterion((ExplicitRequirement(LinkCandidate('https://files.pythonhosted.org/packages/70/8e/0e2d847013cb52cd35b38c009bb167a1a26b2ce6cd6965bf26b47bc0bf44/requests-2.31.0-py3-none-any.whl')), via=None)), 'charset-normalizer':
Criterion((SpecifierRequirement('charset-normalizer<4,>=2'),
via=LinkCandidate('https://files.pythonhosted.org/packages/70/8e/0e2d847013cb52cd35b38c009bb167a1a26b2ce6cd6965bf26b47bc0bf44/requests-2.31.0-py3-none-any.whl'))), 'idna': Criterion((SpecifierRequirement('idna<4,>=2.5'),
via=LinkCandidate('https://files.pythonhosted.org/packages/70/8e/0e2d847013cb52cd35b38c009bb167a1a26b2ce6cd6965bf26b47bc0bf44/requests-2.31.0-py3-none-any.whl'))), 'urllib3': Criterion((SpecifierRequirement('urllib3<3,>=1.21.1'),
via=LinkCandidate('https://files.pythonhosted.org/packages/70/8e/0e2d847013cb52cd35b38c009bb167a1a26b2ce6cd6965bf26b47bc0bf44/requests-2.31.0-py3-none-any.whl'))), 'certifi': Criterion((SpecifierRequirement('certifi>=2017.4.17'),
via=LinkCandidate('https://files.pythonhosted.org/packages/70/8e/0e2d847013cb52cd35b38c009bb167a1a26b2ce6cd6965bf26b47bc0bf44/requests-2.31.0-py3-none-any.whl')))}, backtrack_causes=[]))
INFO:pipenv.patched.pip._internal.network.download:Using cached certifi-2023.7.22-py3-none-any.whl (158 kB)
INFO:pipenv.patched.pip._internal.network.download:Using cached charset_normalizer-3.3.2-cp310-cp310-win_amd64.whl (100
kB)
INFO:pipenv.patched.pip._internal.network.download:Using cached urllib3-2.0.7-py3-none-any.whl (124 kB)
[ ===] Locking...
Success!
Locking [dev-packages] dependencies...
Updated Pipfile.lock (ce05cad406b5493dd778394bb280d21c43453a535aa20df07333d0e22d99b03f)!

achim-k pushed a commit to foxglove/ws-protocol that referenced this issue Nov 20, 2023
Bumps [pipenv](https://github.com/pypa/pipenv) from 2023.10.24 to
2023.11.15.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/pypa/pipenv/releases">pipenv's
releases</a>.</em></p>
<blockquote>
<h2>Release v2023.11.15</h2>
<h2>What's Changed</h2>
<ul>
<li>Treat all return paths of this method as strings by <a
href="https://github.com/matteius"><code>@​matteius</code></a> in <a
href="https://redirect.github.com/pypa/pipenv/pull/6017">pypa/pipenv#6017</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/pypa/pipenv/compare/v2023.11.14...v2023.11.15">https://github.com/pypa/pipenv/compare/v2023.11.14...v2023.11.15</a></p>
<h2>Release v2023.11.14</h2>
<h2>What's Changed</h2>
<ul>
<li>Restore this code that should prevent the string has no attribute
update bug. by <a
href="https://github.com/matteius"><code>@​matteius</code></a> in <a
href="https://redirect.github.com/pypa/pipenv/pull/6007">pypa/pipenv#6007</a></li>
<li>Pass through pipfile index urls when creating https session so that
keyring fully works by <a
href="https://github.com/mungojam"><code>@​mungojam</code></a> in <a
href="https://redirect.github.com/pypa/pipenv/pull/5994">pypa/pipenv#5994</a></li>
<li>Fix issue-6011 direct file url path by <a
href="https://github.com/matteius"><code>@​matteius</code></a> in <a
href="https://redirect.github.com/pypa/pipenv/pull/6012">pypa/pipenv#6012</a></li>
<li>Ignore existing venv dir when PIPENV_VENV_IN_PROJECT is false by <a
href="https://github.com/arnaud-dezandee"><code>@​arnaud-dezandee</code></a>
in <a
href="https://redirect.github.com/pypa/pipenv/pull/6009">pypa/pipenv#6009</a></li>
<li>Assume that vcs and direct URL installs need to be reinstalled by <a
href="https://github.com/matteius"><code>@​matteius</code></a> in <a
href="https://redirect.github.com/pypa/pipenv/pull/5936">pypa/pipenv#5936</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a
href="https://github.com/arnaud-dezandee"><code>@​arnaud-dezandee</code></a>
made their first contribution in <a
href="https://redirect.github.com/pypa/pipenv/pull/6009">pypa/pipenv#6009</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/pypa/pipenv/compare/v2023.10.24...v2023.11.14">https://github.com/pypa/pipenv/compare/v2023.10.24...v2023.11.14</a></p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/pypa/pipenv/blob/main/CHANGELOG.md">pipenv's
changelog</a>.</em></p>
<blockquote>
<h1>2023.11.15 (2023-11-15)</h1>
<h1>Pipenv 2023.11.15 (2023-11-15)</h1>
<h2>Bug Fixes</h2>
<ul>
<li>Fix regression with path installs on most recent release
<code>2023.11.14</code>
<code>[#6017](pypa/pipenv#6017)
&lt;https://github.com/pypa/pipenv/issues/6017&gt;</code>_</li>
</ul>
<h1>2023.11.14 (2023-11-14)</h1>
<h1>Pipenv 2023.11.14 (2023-11-14)</h1>
<h2>Behavior Changes</h2>
<ul>
<li>pipenv now ignores existing venv dir when
<code>PIPENV_VENV_IN_PROJECT</code> is false.
<code>[#6009](pypa/pipenv#6009)
&lt;https://github.com/pypa/pipenv/issues/6009&gt;</code>_</li>
</ul>
<h2>Bug Fixes</h2>
<ul>
<li>Assume the vcs and direct URL installs need to be reinstalled.
<code>[#5936](pypa/pipenv#5936)
&lt;https://github.com/pypa/pipenv/issues/5936&gt;</code>_</li>
<li>Pass through pipfile index urls when creating https session so that
keyring fully works
<code>[#5994](pypa/pipenv#5994)
&lt;https://github.com/pypa/pipenv/issues/5994&gt;</code>_</li>
<li>Fix Using dependencies from a URL fails on Windows.
<code>[#6011](pypa/pipenv#6011)
&lt;https://github.com/pypa/pipenv/issues/6011&gt;</code>_</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/pypa/pipenv/commit/7ec8fee4f261bf27a655e926df34ea63c2c3ea0d"><code>7ec8fee</code></a>
Release v2023.11.15</li>
<li><a
href="https://github.com/pypa/pipenv/commit/85ba107e5b63a2543ed3a406dff2f31bdeb32e30"><code>85ba107</code></a>
Treat all return paths of this method as strings (<a
href="https://redirect.github.com/pypa/pipenv/issues/6017">#6017</a>)</li>
<li><a
href="https://github.com/pypa/pipenv/commit/acbcdcc14273ad55f31e0cd14309f0a8d3f5470b"><code>acbcdcc</code></a>
Bumped version.</li>
<li><a
href="https://github.com/pypa/pipenv/commit/ff5cbbb3484de90744be2bee0bc8fc4af836d95c"><code>ff5cbbb</code></a>
Release v2023.11.14</li>
<li><a
href="https://github.com/pypa/pipenv/commit/55258f71c78026a0bd02c0bf389f0b4d7d9728f1"><code>55258f7</code></a>
Assume that vcs and direct URL installs need to be reinstalled (<a
href="https://redirect.github.com/pypa/pipenv/issues/5936">#5936</a>)</li>
<li><a
href="https://github.com/pypa/pipenv/commit/9eb07b443944b64c83c3f0a1dbbdcfecadea4979"><code>9eb07b4</code></a>
add news fragment on behalf of contributor</li>
<li><a
href="https://github.com/pypa/pipenv/commit/bb0ca90fecf11e1189d6e20c3276f4526c4331e6"><code>bb0ca90</code></a>
Ignore existing venv dir when PIPENV_VENV_IN_PROJECT is false (<a
href="https://redirect.github.com/pypa/pipenv/issues/6009">#6009</a>)</li>
<li><a
href="https://github.com/pypa/pipenv/commit/cd961a41b87f00d1b0923bc8ee87861adb88b468"><code>cd961a4</code></a>
Fix issue-6011 direct file url path (<a
href="https://redirect.github.com/pypa/pipenv/issues/6012">#6012</a>)</li>
<li><a
href="https://github.com/pypa/pipenv/commit/bc668e64755079abd9e154cacace98bce88a59c3"><code>bc668e6</code></a>
Merge pull request <a
href="https://redirect.github.com/pypa/pipenv/issues/5994">#5994</a>
from mungojam/fix-keyring-warnings</li>
<li><a
href="https://github.com/pypa/pipenv/commit/023b6bccf7b71b13449ef9420255d1bf81bc710a"><code>023b6bc</code></a>
Add news entry</li>
<li>Additional commits viewable in <a
href="https://github.com/pypa/pipenv/compare/v2023.10.24...v2023.11.15">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=pipenv&package-manager=pip&previous-version=2023.10.24&new-version=2023.11.15)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants