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
pip-compile Does Not Work for vsphere-automation-sdk-python setup.py on GitHub #1054
Comments
Hello @nguyenlieunhatvy, Thanks for the detailed information and reproducible steps. The issue is caused when we combine install requirements where we lose some info on dropped requirements, see the pip-tools/piptools/resolver.py Lines 61 to 68 in d405bf9
I've tried to trace /usr/local/bin/pip-compile(8)<module>()
-> sys.exit(cli())
/usr/local/lib/python3.7/site-packages/click/core.py(764)__call__()
-> return self.main(*args, **kwargs)
/usr/local/lib/python3.7/site-packages/click/core.py(717)main()
-> rv = self.invoke(ctx)
/usr/local/lib/python3.7/site-packages/click/core.py(956)invoke()
-> return ctx.invoke(self.callback, **ctx.params)
/usr/local/lib/python3.7/site-packages/click/core.py(555)invoke()
-> return callback(*args, **kwargs)
/usr/local/lib/python3.7/site-packages/click/decorators.py(17)new_func()
-> return f(get_current_context(), *args, **kwargs)
/usr/local/lib/python3.7/site-packages/piptools/scripts/compile.py(385)cli()
-> results = resolver.resolve(max_rounds=max_rounds)
/usr/local/lib/python3.7/site-packages/piptools/resolver.py(171)resolve()
-> has_changed, best_matches = self._resolve_one_round()
/usr/local/lib/python3.7/site-packages/piptools/resolver.py(269)_resolve_one_round()
-> theirs = set(self._group_constraints(sorted(their_constraints, key=str)))
/usr/local/lib/python3.7/site-packages/piptools/resolver.py(236)_group_constraints()
-> yield combine_install_requirements(ireqs)
> /usr/local/lib/python3.7/site-packages/piptools/resolver.py(60)combine_install_requirements()
-> combined_ireq = copy.deepcopy(source_ireqs[0]) Where
Note, we deep copy the Changing pip-tools/piptools/resolver.py Line 60 in d405bf9
to combined_ireq = copy.deepcopy(source_ireqs[-1])` fixes the issue, but it is not the right way to go, we need to figure out how to properly merge the data. |
Hey @atugushev, Would you mind if I took this issue? I figured out that the information being lost here is the sub libraries come from repos lib folder. Once it loses that information it tries to search pypi for these libraries but can't find them because they're not on there. I feel that I have a good solution for this. |
@microcat49 sure 👍🏻 |
Pull request #1385 |
I tried out your logic fix from #1385, and it does seem to fix the issue. But the output is full of paths to local temporary checkout of git dependencies. I guess that is a separate issue, but am wondering if anyone can shine some light on this result vs expectations, whatever they may be: Output#
# This file is autogenerated by pip-compile with python 3.9
# To update, run:
#
# pip-compile reqsin/base.in
#
-e git+https://github.com/vmware/vsphere-automation-sdk-python.git@v6.9.1#egg=vSphere-Automation-SDK
# via -r reqsin/base.in
certifi==2021.10.8
# via requests
cffi==1.14.6
# via cryptography
charset-normalizer==2.0.7
# via requests
cryptography==35.0.0
# via pyopenssl
idna==3.3
# via requests
lxml==4.6.3
# via vsphere-automation-sdk
nsx-policy-python-sdk @ file://localhost//home/andy/.local/share/venvs/1b2b5c9cc79c4656dd687f3b665b224c/venv/src/vsphere-automation-sdk/lib/nsx-policy-python-sdk/nsx_policy_python_sdk-2.3.0.0.3.13851140-py2.py3-none-any.whl
# via vsphere-automation-sdk
nsx-python-sdk @ file://localhost//home/andy/.local/share/venvs/1b2b5c9cc79c4656dd687f3b665b224c/venv/src/vsphere-automation-sdk/lib/nsx-python-sdk/nsx_python_sdk-2.3.0.0.3.13851140-py2.py3-none-any.whl
# via vsphere-automation-sdk
nsx-vmc-aws-integration-python-sdk @ file://localhost//home/andy/.local/share/venvs/1b2b5c9cc79c4656dd687f3b665b224c/venv/src/vsphere-automation-sdk/lib/nsx-vmc-aws-integration-python-sdk/nsx_vmc_aws_integration_python_sdk-2.3.0.0.3.13851140-py2.py3-none-any.whl
# via vsphere-automation-sdk
nsx-vmc-policy-python-sdk @ file://localhost//home/andy/.local/share/venvs/1b2b5c9cc79c4656dd687f3b665b224c/venv/src/vsphere-automation-sdk/lib/nsx-vmc-policy-python-sdk/nsx_vmc_policy_python_sdk-2.3.0.0.3.13851140-py2.py3-none-any.whl
# via vsphere-automation-sdk
pycparser==2.20
# via cffi
pyopenssl==21.0.0
# via vapi-runtime
pyvmomi==7.0.2
# via vsphere-automation-sdk
requests==2.26.0
# via
# pyvmomi
# vapi-runtime
six==1.16.0
# via
# pyopenssl
# pyvmomi
# vapi-runtime
suds-jurko==0.6
# via vsphere-automation-sdk
urllib3==1.26.7
# via requests
vapi-client-bindings @ file://localhost//home/andy/.local/share/venvs/1b2b5c9cc79c4656dd687f3b665b224c/venv/src/vsphere-automation-sdk/lib/vapi-client-bindings/vapi_client_bindings-3.1.0-py2.py3-none-any.whl
# via vsphere-automation-sdk
vapi-common-client @ file://localhost//home/andy/.local/share/venvs/1b2b5c9cc79c4656dd687f3b665b224c/venv/src/vsphere-automation-sdk/lib/vapi-common-client/vapi_common_client-2.12.0-py2.py3-none-any.whl
# via
# nsx-policy-python-sdk
# nsx-python-sdk
# nsx-vmc-aws-integration-python-sdk
# nsx-vmc-policy-python-sdk
# vmc-client-bindings
# vmc-draas-client-bindings
# vsphere-automation-sdk
vapi-runtime @ file://localhost//home/andy/.local/share/venvs/1b2b5c9cc79c4656dd687f3b665b224c/venv/src/vsphere-automation-sdk/lib/vapi-runtime/vapi_runtime-2.12.0-py2.py3-none-any.whl
# via
# nsx-policy-python-sdk
# nsx-python-sdk
# nsx-vmc-aws-integration-python-sdk
# nsx-vmc-policy-python-sdk
# vapi-client-bindings
# vapi-common-client
# vmc-client-bindings
# vmc-draas-client-bindings
# vsphere-automation-sdk
vmc-client-bindings @ file://localhost//home/andy/.local/share/venvs/1b2b5c9cc79c4656dd687f3b665b224c/venv/src/vsphere-automation-sdk/lib/vmc-client-bindings/vmc_client_bindings-1.11.0-py2.py3-none-any.whl
# via vsphere-automation-sdk
vmc-draas-client-bindings @ file://localhost//home/andy/.local/share/venvs/1b2b5c9cc79c4656dd687f3b665b224c/venv/src/vsphere-automation-sdk/lib/vmc-draas-client-bindings/vmc_draas_client_bindings-1.0.0-py2.py3-none-any.whl
# via vsphere-automation-sdk
# The following packages are considered to be unsafe in a requirements file:
# setuptools |
Fixes jazzband#1054 Co-authored-by: Andrew <harta5039@gmail.com>
Fixes jazzband#1054 Co-authored-by: Andrew <harta5039@gmail.com>
pip-compile does not work if I have this in my requirements.in/base.txt
Link to vsphere-automation-sdk-python GitHub
Environment Versions
Steps to replicate
python3 -m venv venv
.pip install -U pip
.pip-compile requirements.in/base.txt
Expected result
Should successfully compile the requirements.in/base.txt
Actual result
Error:
The text was updated successfully, but these errors were encountered: