Repository navigation
Closed
Labels
area/installerRelated to the dependency installerRelated to the dependency installerkind/enhancementNot a bug or feature, but improves usability or performanceNot a bug or feature, but improves usability or performance
Description
- 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 (
-vvvoption).
- OS version and name: Windows 10, Version 1909
- Poetry version: 1.1.3
- Link of a Gist with the contents of your pyproject.toml file: https://gist.github.com/ajacquah/4b6cab23073fb21c03eaa436b911f89d
Issue
Pip as invoked by poetry installs build depdencies from pypi.org instead of custom repository. And since I am running this behind a firewall with no proxy settings this fails. My understanding was that poetry would use default repository for all package actions. Can you please take a look?
To reproduce:
- Create new project.
$poetry new --src test-pkg - Add a private default source. This source is a mirror of pypi.org + internal packages.
- From limited connectivity environment, try to add
blackdev dependency:poetry add black -D
Result stack trace:
Command C:\Source\test-pkg\.venv\Scripts\pip.exe install --no-deps file:///C:/Users/ajacquah/AppData/Local/pypoetry/Cache/artifacts/8b/b9/b7/d4ec53ca89b288b6be53361d96da13d397c1dfaf70aa7b48b127e6c727/black-20.8b1.tar.gz errored with the following return code 1, and output:
Processing c:\users\ajacquah\appdata\local\pypoetry\cache\artifacts\8b\b9\b7\d4ec53ca89b288b6be53361d96da13d397c1dfaf70aa7b48b127e6c727\black-20.8b1.tar.gz
Installing build dependencies: started
Installing build dependencies: still running...
Installing build dependencies: still running...
Installing build dependencies: still running...
Installing build dependencies: still running...
Installing build dependencies: still running...
Installing build dependencies: still running...
Installing build dependencies: finished with status 'error'
ERROR: Command errored out with exit status 1:
command: 'C:\Source\rails-test\.venv\Scripts\python.exe' 'C:\Source\rails-test\.venv\lib\site-packages\pip' install --ignore-installed --no-user --prefix 'C:\Users\ajacquah\AppData\Local\Temp\pip-build-env-x0saifh5\overlay' --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools>=41.0' setuptools-scm wheel
cwd: None
Complete output (7 lines):
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.HTTPSConnection object at 0x00000278EC4CB670>, 'Connection to pypi.org timed out. (connect timeout=15)')': /simple/setuptools/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.HTTPSConnection object at 0x00000278EC4CBAF0>, 'Connection to pypi.org timed out. (connect timeout=15)')': /simple/setuptools/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.HTTPSConnection object at 0x00000278EC4CBC40>, 'Connection to pypi.org timed out. (connect timeout=15)')': /simple/setuptools/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.HTTPSConnection object at 0x00000278EC4CBEE0>, 'Connection to pypi.org timed out. (connect timeout=15)')': /simple/setuptools/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.HTTPSConnection object at 0x00000278EC4A3BB0>, 'Connection to pypi.org timed out. (connect timeout=15)')': /simple/setuptools/
ERROR: Could not find a version that satisfies the requirement setuptools>=41.0 (from versions: none)
ERROR: No matching distribution found for setuptools>=41.0
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Source\test-pkg\.venv\Scripts\python.exe' 'C:\Source\test-pkg\.venv\lib\site-packages\pip' install --ignore-installed --no-user --prefix 'C:\Users\ajacquah\AppData\Local\Temp\pip-build-env-x0saifh5\overlay' --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools>=41.0' setuptools-scm wheel Check the logs for full command output.
at c:\python38\lib\site-packages\poetry\utils\env.py:948 in _run
944│ output = subprocess.check_output(
945│ cmd, stderr=subprocess.STDOUT, **kwargs
946│ )
947│ except CalledProcessError as e:
→ 948│ raise EnvCommandError(e, input=input_)
949│
950│ return decode(output)
951│
952│ def execute(self, bin, *args, **kwargs):
Thanks for your help!
Reacted by Andrew Riachi, Jamie Chang, André Sassi, Marti Raudsepp, Alexandre L., 代码之美, Myles Prather, qkponton, Gregor and Dylan Scheidle
Metadata
Metadata
Assignees
Labels
area/installerRelated to the dependency installerRelated to the dependency installerkind/enhancementNot a bug or feature, but improves usability or performanceNot a bug or feature, but improves usability or performance
Activity
abn commentedon Oct 19, 2020
@ajacquah can you provide the output of the following please?
poetry add black -D -vvv # if black is already in the pyproject.toml you can do this too poetry lock -vvvabn commentedon Oct 20, 2020
@ajacquah the issue here is that the isolated build environment required to build balck from
sdistis not able to be setup as it cannot download setuptools.Poetry when building wheels from sdist for dependencies (not the project itself) will handover build to
pipviapip install /path/to/sdist. This will in turn trigger a PEP 517 isolated build withinpip. During this process, it needs to get the dependencies required for the build. This step is handled bypipand not bypoetryin this case.As for why the
sdistis being used, you will have to check if proxy has the wheels available. If not, that could explain why an sdist is downloaded and used.Eventually we would want to consume this part of the pipe too, and eventually setup the build environment ourselves. Once that happens this should, and a lot of other annoyances, go away.
abn commentedon Oct 20, 2020
At initial glance, I reckon your proposal is reasonable and should not impact other aspects as only assist and path cases require the isolated build environment.
Can you maybe verify that doing so manually works in your environment?
qiuwei commentedon Oct 27, 2020
It seems this is already fixed in 1.1.4 release.
Woklex commentedon Dec 31, 2020
Faced a similar problem, but this problem is not present on version 1.0.10.
aja-intel commentedon Mar 29, 2021
hello @abn and maintainers. Any further thoughts on this? I've seen a few suggestion for work-arounds on related issues but it would be great to see this working for the configured default package index.
Liz4v commentedon Aug 10, 2021
I haven't found an effective workaround; plus I'm having the opposite problem: it's failing to find pypi.org dependencies in my custom secondary repository. I'm not sure if I should open a separate bug for it.
23 remaining items
radoering commentedon Feb 22, 2023
IIRC, we will use the sources from pyproject.toml of the root project. Relevant lines of code:
poetry/src/poetry/installation/chef.py
Line 116 in c8945eb
poetry/src/poetry/installation/chef.py
Line 75 in c8945eb
qkponton commentedon Feb 23, 2023
Hi guys
Can you communicate on an expected release date for 1.4
I have the same issue in my new company where I can't update the global pip config (/etc/pip.conf yeah don't laugh)
Need to consider my options quickly about this please
qkponton commentedon Feb 24, 2023
just for information even setting PIP_INDEX_URL as root doesn't fix the issue for non-root user on 1.3.2
idhyt commentedon Feb 27, 2023
same issue in
1.3.2, run install command from EnvCommandError logbut, i run command again with
-i, successYAGregor commentedon Feb 27, 2023
I have the same issue but solved by change global pip config
/etc/pip.confas neersighted saidqkponton commentedon Mar 1, 2023
As root or with non root user?
dimbleby commentedon Mar 1, 2023
poetry 1.4 is out, I guess this should be closed
YAGregor commentedon Mar 2, 2023
root.this will change default pip index for every user no matter whether is it root. @qkponton
qkponton commentedon Mar 2, 2023
1.4 release solved the issue for me
qkponton commentedon Mar 2, 2023
@YAGregor yeah the issue was with a non root user :)
michaelishri commentedon Mar 2, 2023
I can confirm that this issue appears to be resolved for our case. Poetry appears to now be respecting the Artifactory instance we've defined in our
pyproject.tomlfile.For anyone that needs it, this is how we configured Artifactory in our
pyproject.tomlfile.Interestingly, it appears that our internal certificates are not an issue, even without defining our PEM file in the config. I'm running on Windows so not sure if Poetry is using the certs in the Windows cert store or just ignoring SSL validation all together?
Secrus commentedon Apr 18, 2023
Closing, as the issue seems to be fixed. If you encounter this in new versions of Poetry, please open new issue.
github-actions commentedon Feb 29, 2024
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.