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

eachdist.py script cannot install the test/utils package #1846

Open
iblancasa opened this issue May 12, 2021 · 12 comments
Open

eachdist.py script cannot install the test/utils package #1846

iblancasa opened this issue May 12, 2021 · 12 comments
Labels
backlog bug Something isn't working

Comments

@iblancasa
Copy link

Using the last commit from the main branch (dad4b2b) I get the following error when running scripts/eachdist.py develop (as CONTRIBUTING.md file describes):

ERROR: Could not find a version that satisfies the requirement opentelemetry-test==0.21b0 (from opentelemetry-opentracing-shim[test]) (from versions: none)
ERROR: No matching distribution found for opentelemetry-test==0.21b0

I'm using RHEL 8.3.

Steps to reproduce
Clone the repository and run:

python -m venv environment
source environment/bin/activate
scripts/eachdist.py develop

What is the expected behavior?
The eachdist.py should install everything to start the development.

Workaround

pip install test/utils
scripts/eachdist.py develop
@iblancasa iblancasa added the bug Something isn't working label May 12, 2021
@iblancasa
Copy link
Author

After the latest changes in the repository, the issue is different now:

(environ) ➜ iblancas@iblancas  ~/projects/opentelemetry-python git:(main) scripts/eachdist.py develop
>>> python -m pip install --upgrade pip setuptools wheel --upgrade-strategy=eager
Requirement already satisfied: pip in /home/iblancas/projects/environ/lib/python3.6/site-packages (21.1.1)
Requirement already satisfied: setuptools in /home/iblancas/projects/environ/lib/python3.6/site-packages (56.2.0)
Requirement already satisfied: wheel in /home/iblancas/projects/environ/lib/python3.6/site-packages (0.36.2)
>>> python -m pip install -e 'file:///home/iblancas/projects/opentelemetry-python/opentelemetry-api[test]' -e 'file:///home/iblancas/projects/opentelemetry-python/opentelemetry-sdk[test]' -e 'file:///home/iblancas/projects/opentelemetry-python/opentelemetry-proto[test]' -e 'file:///home/iblancas/projects/opentelemetry-python/opentelemetry-distro[test]' -e 'file:///home/iblancas/projects/opentelemetry-python/tests/util[test]' -e 'file:///home/iblancas/projects/opentelemetry-python/exporter/opentelemetry-exporter-jaeger-proto-grpc[test]' -e 'file:///home/iblancas/projects/opentelemetry-python/exporter/opentelemetry-exporter-jaeger-thrift[test]' -e 'file:///home/iblancas/projects/opentelemetry-python/exporter/opentelemetry-exporter-jaeger[test]' -e 'file:///home/iblancas/projects/opentelemetry-python/exporter/opentelemetry-exporter-opencensus[test]' -e 'file:///home/iblancas/projects/opentelemetry-python/exporter/opentelemetry-exporter-otlp-proto-grpc[test]' -e 'file:///home/iblancas/projects/opentelemetry-python/exporter/opentelemetry-exporter-otlp[test]' -e 'file:///home/iblancas/projects/opentelemetry-python/exporter/opentelemetry-exporter-zipkin-json[test]' -e 'file:///home/iblancas/projects/opentelemetry-python/exporter/opentelemetry-exporter-zipkin-proto-http[test]' -e 'file:///home/iblancas/projects/opentelemetry-python/exporter/opentelemetry-exporter-zipkin[test]' -e 'file:///home/iblancas/projects/opentelemetry-python/docs/examples/error_handler/error_handler_0[test]' -e 'file:///home/iblancas/projects/opentelemetry-python/docs/examples/error_handler/error_handler_1[test]' -e 'file:///home/iblancas/projects/opentelemetry-python/opentelemetry-semantic-conventions[test]' -e 'file:///home/iblancas/projects/opentelemetry-python/propagator/opentelemetry-propagator-b3[test]' -e 'file:///home/iblancas/projects/opentelemetry-python/propagator/opentelemetry-propagator-jaeger[test]' -e 'file:///home/iblancas/projects/opentelemetry-python/shim/opentelemetry-opentracing-shim[test]' --upgrade-strategy=eager
Obtaining file:///home/iblancas/projects/opentelemetry-python/opentelemetry-api
Obtaining file:///home/iblancas/projects/opentelemetry-python/opentelemetry-sdk
Obtaining file:///home/iblancas/projects/opentelemetry-python/opentelemetry-proto
Obtaining file:///home/iblancas/projects/opentelemetry-python/opentelemetry-distro
Obtaining file:///home/iblancas/projects/opentelemetry-python/tests/util
Obtaining file:///home/iblancas/projects/opentelemetry-python/exporter/opentelemetry-exporter-jaeger-proto-grpc
Obtaining file:///home/iblancas/projects/opentelemetry-python/exporter/opentelemetry-exporter-jaeger-thrift
Obtaining file:///home/iblancas/projects/opentelemetry-python/exporter/opentelemetry-exporter-jaeger
Obtaining file:///home/iblancas/projects/opentelemetry-python/exporter/opentelemetry-exporter-opencensus
Obtaining file:///home/iblancas/projects/opentelemetry-python/exporter/opentelemetry-exporter-otlp-proto-grpc
Obtaining file:///home/iblancas/projects/opentelemetry-python/exporter/opentelemetry-exporter-otlp
Obtaining file:///home/iblancas/projects/opentelemetry-python/exporter/opentelemetry-exporter-zipkin-json
Obtaining file:///home/iblancas/projects/opentelemetry-python/exporter/opentelemetry-exporter-zipkin-proto-http
Obtaining file:///home/iblancas/projects/opentelemetry-python/exporter/opentelemetry-exporter-zipkin
Obtaining file:///home/iblancas/projects/opentelemetry-python/docs/examples/error_handler/error_handler_0
Obtaining file:///home/iblancas/projects/opentelemetry-python/docs/examples/error_handler/error_handler_1
Obtaining file:///home/iblancas/projects/opentelemetry-python/opentelemetry-semantic-conventions
Obtaining file:///home/iblancas/projects/opentelemetry-python/propagator/opentelemetry-propagator-b3
Obtaining file:///home/iblancas/projects/opentelemetry-python/propagator/opentelemetry-propagator-jaeger
Obtaining file:///home/iblancas/projects/opentelemetry-python/shim/opentelemetry-opentracing-shim
WARNING: error-handler-0 0.21.dev0 does not provide the extra 'test'
ERROR: Could not find a version that satisfies the requirement opentelemetry-sdk==1.3.0.dev0 (from error-handler-0[test]) (from versions: 0.1a0, 0.2a0, 0.3a0, 0.4a0, 0.4a1, 0.5b0, 0.6b0, 0.7b1, 0.8b0, 0.9b0, 0.10b0, 0.11b0, 0.12b0, 0.13b0, 0.14b0, 0.15b0, 0.16b0, 0.16b1, 0.17b0, 1.0.0rc1, 1.0.0, 1.1.0, 1.2.0, 1.10a0)
ERROR: No matching distribution found for opentelemetry-sdk==1.3.0.dev0

@eddyleelin
Copy link
Contributor

eddyleelin commented May 14, 2021

I had the same error as above yesterday when using scripts/eachdist.py:

ERROR: Could not find a version that satisfies the requirement opentelemetry-sdk==1.3.0.dev0 (from error-handler-0[test]) (from versions: 0.1a0, 0.2a0, 0.3a0, 0.4a0, 0.4a1, 0.5b0, 0.6b0, 0.7b1, 0.8b0, 0.9b0, 0.10b0, 0.11b0, 0.12b0, 0.13b0, 0.14b0, 0.15b0, 0.16b0, 0.16b1, 0.17b0, 1.0.0rc1, 1.0.0, 1.1.0, 1.2.0, 1.10a0)
ERROR: No matching distribution found for opentelemetry-sdk==1.3.0.dev0

I was able to get the test suite to work by using some of the tox commands. As @lonewolf3739 told me, maybe it is worth digging up the old issue #1462 about removing eachdist in favor of tox?

@iblancasa
Copy link
Author

@eddyleelin probably that is not a bad idea but I would add something: since tox creates a Python virtual environment, I would add documentation about how to source that virtual environment. It can be really useful for development purposes.

@github-actions
Copy link

This issue was marked stale due to lack of activity. It will be closed in 30 days.

@Oberon00
Copy link
Member

Oberon00 commented Jul 26, 2021

The command line lists everything in correct order:
-e 'file:///home/iblancas/projects/opentelemetry-python/opentelemetry-sdk[test]' comes before -e file:///home/iblancas/projects/opentelemetry-python/docs/examples/error_handler/error_handler_0.

I guess pip is at fault here, and this may be fixed by the newest pip released yesterday: pypa/pip#9204

Otherwise, it should be a one-line fix to remove the --all from here:

This will cause a separate invocation of pip for each command which may be slower.

@Oberon00
Copy link
Member

@iblancasa:

tox creates a Python virtual environment, I would add documentation about how to source that virtual environment. It can be really useful for development purposes.

tox creates tons of virtual environments, so it would indeed be important to know which one to use (it needs to be one where everything is installed, including dev-dependencies, and the repository's packages need to be in --editable mode)

@ocelotl
Copy link
Contributor

ocelotl commented Jul 27, 2021

@iblancasa does using tox instead of eachdist.py solves your issue?

@Oberon00
Copy link
Member

Oberon00 commented Jul 28, 2021

I think tox would definititely not have that problem, but does it have an environment to install everything in editable mode?

That said, I think updating to the newest pip will also solve the problem when using eachdist.py, i.e., I don't think this problem is reproducible now because as of pip 21.2, released 5 days ago the bug is fixed and eachdist.py updates pip before doing anything else with it.

@Oberon00
Copy link
Member

Oberon00 commented Jul 28, 2021

Specifically, this was pypa/pip#9204 which is mentioned in https://github.com/pypa/pip/blob/21.2.1/NEWS.rst#bug-fixes as

  • New resolver: Detect an unnamed requirement is user-specified (by building its metadata for the project name) so it can be correctly ordered in the resolver. (#9204)

Since eachdist.py supplies everything on the same pip commandline (in hopes that being faster), it relies on pip to not break the ordering.

@github-actions
Copy link

This issue was marked stale due to lack of activity. It will be closed in 30 days.

@pmcollins
Copy link
Member

Looks like this is still a problem -- I just did a clean checkout and tried to run eachdist.py develop, but am getting the error pasted below.

(Unfortunately, the workaround as mentioned at the top is no longer valid because there is no test/utils directory. I tried pip install tests/opentelemetry-test-utils but that also failed with a No matching distribution error.)

$ ./scripts/eachdist.py develop
<snip>
INFO: pip is looking at multiple versions of opentelemetry-sdk[test] to determine which version is compatible with other requirements. This could take a while.
ERROR: Could not find a version that satisfies the requirement opentelemetry-semantic-conventions==0.42b0.dev (from opentelemetry-sdk[test]) (from versions: 0.20b0, 0.21b0, 0.22b0, 0.23b0, 0.23b2, 0.24b0, 0.25b0, 0.25b1, 0.25b2, 0.26b0, 0.26b1, 0.27b0, 0.28b0, 0.28b1, 0.29b0, 0.30b0, 0.30b1, 0.31b0, 0.32b0, 0.33b0, 0.34b0, 0.35b0, 0.36b0, 0.37b0, 0.38b0, 0.39b0, 0.40b0, 0.41b0)
ERROR: No matching distribution found for opentelemetry-semantic-conventions==0.42b0.dev

@lzchen
Copy link
Contributor

lzchen commented Sep 14, 2023

Discussed in 9/14 SIG, we might have to revisit this eachdist.py as it hasn't been changed in awhile. We might have to go through the documentation to see if this is mentioned anywhere and reevaluate whether we want to keep this or refactor it.

@sanketmehta28
Could you add some of the painpoints you've experienced using this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants