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

make VERSION fails outside the virtual environment #15216

Open
AlexPykavy opened this issue May 22, 2024 · 0 comments
Open

make VERSION fails outside the virtual environment #15216

AlexPykavy opened this issue May 22, 2024 · 0 comments

Comments

@AlexPykavy
Copy link
Contributor

ISSUE TYPE
  • Bug, Docs Fix or other nominal change
COMPONENT NAME
  • Other (local development)
SUMMARY

I faced a problem that some Python packages used by the make VERSION are missing and can't be autoinstalled by the https://github.com/ansible/awx/blob/devel/tools/scripts/scm_version.py, look:

Unable to import setuptools-scm, attempting to install now...
Traceback (most recent call last):
  File "/mnt/c/Users/Alexander.Pykavy/GitHub/ansible/awx/tools/scripts/scm_version.py", line 6, in <module>
    from setuptools_scm import get_version
ModuleNotFoundError: No module named 'setuptools_scm'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/mnt/c/Users/Alexander.Pykavy/GitHub/ansible/awx/tools/scripts/scm_version.py", line 17, in <module>
    raise Exception(f'\nCommand `{" ".join(cmd)}` failed (rc={result.returncode}).\n\nstdout:\n{result.stdout}\n\nstderr:\n{result.stderr}')
Exception:
Command `/usr/bin/python3 -m ensurepip` failed (rc=1).

stdout:
b'ensurepip is disabled in Debian/Ubuntu for the system python.\n\nPython modules for the system python are usually handled by dpkg and apt-get.\n\n    apt install python3-<module name>\n\nInstall the python3-pip package to use pip itself.  Using pip together\nwith the system python might have unexpected results for any system installed\nmodule, so use it on your own risk, or make sure to only use it in virtual\nenvironments.\n\n'

stderr:
b''

Then I found that I can initialize a virtual environment using make virtualenv. But I didn't want /var/lib/awx/venv to be used to not clutter the machine and decided to override this variable to point to some directory under the repository:

VENV_BASE=./venv make virtualenv.
. ./venv/awx/bin/activate
make VERSION

Is it fine to override the VENV_BASE to be in the repo?

ENVIRONMENT
  • AWX version: X.Y.Z
  • AWX install method: developer environment
  • Operating System: Ubuntu 22.04 in Windows 11 WSL2
STEPS TO REPRODUCE
  • clone repository
  • don't activate the virtual environment
  • run make VERSION
EXPECTED RESULTS
  • the AWX version is outputted
ACTUAL RESULTS
  • the error s thrown
ADDITIONAL INFORMATION
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant