Skip to content

Eachdist expects that that python interpreter is always named 'python'  #1426

@pilhuhn

Description

@pilhuhn

Describe your environment

UPDATE:
I guess my issues come from the fact that CONTRIBUTING.md only quickly says "First create a virtualenv and activate it. Then run python scripts/eachdist.py develop" , which is easily overlooked. Also it does not really say in which way to create the v-env (this is hidden in README). But even this combo does not work

❯ python3 -m venv my_test_env
❯ python3 scripts/eachdist.py develop
>>> python -m pip install --upgrade pip setuptools wheel --upgrade-strategy=eager
Traceback (most recent call last):
...  [ same as below ] ...

Both on macOS and RHEL

❯ python3.10 scripts/eachdist.py develop
>>> python -m pip install --upgrade pip setuptools wheel --upgrade-strategy=eager
Traceback (most recent call last):
  File "/Users/hrupp/src/opentelemetry-python-contrib/scripts/eachdist.py", line 389, in runsubprocess
    return subprocess_run(params, *args, check=check, **kwargs)
  File "/usr/local/Cellar/[email protected]/3.10.7/Frameworks/Python.framework/Versions/3.10/lib/python3.10/subprocess.py", line 501, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/usr/local/Cellar/[email protected]/3.10.7/Frameworks/Python.framework/Versions/3.10/lib/python3.10/subprocess.py", line 969, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/local/Cellar/[email protected]/3.10.7/Frameworks/Python.framework/Versions/3.10/lib/python3.10/subprocess.py", line 1845, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'python'

This is even despite the shebang goes #!/usr/bin/env python3:

❯ python3 scripts/eachdist.py develop
>>> python -m pip install --upgrade pip setuptools wheel --upgrade-strategy=eager
Traceback (most recent call last):
  File "/Users/hrupp/src/opentelemetry-python-contrib/scripts/eachdist.py", line 389, in runsubprocess
    return subprocess_run(params, *args, check=check, **kwargs)
  File "/usr/local/Cellar/[email protected]/3.10.7/Frameworks/Python.framework/Versions/3.10/lib/python3.10/subprocess.py", line 501, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/usr/local/Cellar/[email protected]/3.10.7/Frameworks/Python.framework/Versions/3.10/lib/python3.10/subprocess.py", line 969, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/local/Cellar/[email protected]/3.10.7/Frameworks/Python.framework/Versions/3.10/lib/python3.10/subprocess.py", line 1845, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'python'

Steps to reproduce

See above

What is the expected behavior?

The script should determine the used python version and then use that interpreter name to continue instead of only 'python'

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions