Skip to content

Conversation

@jessicamack
Copy link
Member

SUMMARY

This PR updates the Python version to 3.12.

ISSUE TYPE
  • Bug, Docs Fix or other nominal change
COMPONENT NAME
  • Other
ADDITIONAL INFORMATION

@jessicamack jessicamack requested a review from djyasin December 16, 2025 20:16
@github-actions github-actions bot added component:api component:awx_collection issues related to the collection for controlling AWX component:cli dependencies Pull requests that update a dependency file component:docs labels Dec 16, 2025
@AlanCoding
Copy link
Member

#24 [builder 13/13] RUN make sdist && /var/lib/awx/venv/awx/bin/pip install dist/awx.tar.gz
#24 0.105 python3.12 -m build -s
#24 0.181 * Creating isolated environment: venv+pip...
#24 0.184 * Installing packages in isolated environment:
#24 1.284   - setuptools>=45
#24 1.284   - setuptools_scm[toml]>=6.2
#24 1.284 * Getting build dependencies for sdist...
#24 1.543 /tmp/build-env-moi5kmnl/lib64/python3.12/site-packages/setuptools_scm/_integration/deprecation.py:7: UserWarning: setup.cfg: at [metadata]
#24 1.543 version = attr: ... is forcing setuptools to override the version setuptools-scm did already set
#24 1.543 When using setuptools-scm it's invalid to use setuptools dynamic version as well, please remove it.
#24 1.543 Setuptools-scm is responsible for setting the version, forcing setuptools to override creates errors.
#24 1.543   warnings.warn(
#24 1.544 toml section missing PosixPath('pyproject.toml') does not contain a tool.setuptools_scm section
#24 1.548 Traceback (most recent call last):
#24 1.548   File "/usr/local/lib/python3.12/site-packages/pyproject_hooks/_in_process/_in_process.py", line 389, in <module>
#24 1.548     main()
#24 1.549   File "/usr/local/lib/python3.12/site-packages/pyproject_hooks/_in_process/_in_process.py", line 373, in main
#24 1.549     json_out["return_val"] = hook(**hook_input["kwargs"])
#24 1.549                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#24 1.549   File "/usr/local/lib/python3.12/site-packages/pyproject_hooks/_in_process/_in_process.py", line 317, in get_requires_for_build_sdist
#24 1.549     return hook(config_settings)
#24 1.549            ^^^^^^^^^^^^^^^^^^^^^
#24 1.549   File "/tmp/build-env-moi5kmnl/lib64/python3.12/site-packages/setuptools/build_meta.py", line 334, in get_requires_for_build_sdist
#24 1.549     return self._get_build_requires(config_settings, requirements=[])
#24 1.549            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#24 1.549   File "/tmp/build-env-moi5kmnl/lib64/python3.12/site-packages/setuptools/build_meta.py", line 301, in _get_build_requires
#24 1.549     self.run_setup()
#24 1.549   File "/tmp/build-env-moi5kmnl/lib64/python3.12/site-packages/setuptools/build_meta.py", line 317, in run_setup
#24 1.549     exec(code, locals())
#24 1.549   File "<string>", line 1, in <module>
#24 1.549   File "/tmp/build-env-moi5kmnl/lib64/python3.12/site-packages/setuptools/__init__.py", line 115, in setup
#24 1.549     return distutils.core.setup(**attrs)
#24 1.549            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#24 1.549   File "/tmp/build-env-moi5kmnl/lib64/python3.12/site-packages/setuptools/_distutils/core.py", line 160, in setup
#24 1.549     dist.parse_config_files()
#24 1.549   File "/tmp/build-env-moi5kmnl/lib64/python3.12/site-packages/setuptools/dist.py", line 752, in parse_config_files
#24 1.550     setupcfg.parse_configuration(
#24 1.550   File "/tmp/build-env-moi5kmnl/lib64/python3.12/site-packages/setuptools/config/setupcfg.py", line 188, in parse_configuration
#24 1.550     meta.parse()
#24 1.550   File "/tmp/build-env-moi5kmnl/lib64/python3.12/site-packages/setuptools/config/setupcfg.py", line 502, in parse
#24 1.550     section_parser_method(section_options)
#24 1.550   File "/tmp/build-env-moi5kmnl/lib64/python3.12/site-packages/setuptools/config/setupcfg.py", line 477, in parse_section
#24 1.550     self[name] = value
#24 1.550     ~~~~^^^^^^
#24 1.550   File "/tmp/build-env-moi5kmnl/lib64/python3.12/site-packages/setuptools/config/setupcfg.py", line 294, in __setitem__
#24 1.550     parsed = self.parsers.get(option_name, lambda x: x)(value)
#24 1.550              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#24 1.550   File "/tmp/build-env-moi5kmnl/lib64/python3.12/site-packages/setuptools/config/setupcfg.py", line 600, in _parse_version
#24 1.550     return expand.version(self._parse_attr(value, self.package_dir, self.root_dir))
#24 1.550            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#24 1.550   File "/tmp/build-env-moi5kmnl/lib64/python3.12/site-packages/setuptools/config/expand.py", line 329, in version
#24 1.551     _value = value() if callable(value) else value
#24 1.551              ^^^^^^^
#24 1.551   File "/tmp/src/awx/__init__.py", line 18, in get_version
#24 1.551     version = get_version(root='..', relative_to=__file__)
#24 1.551               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#24 1.551   File "/tmp/build-env-moi5kmnl/lib64/python3.12/site-packages/setuptools_scm/_get_version_impl.py", line 238, in get_version
#24 1.551     _version_missing(config)
#24 1.551   File "/tmp/build-env-moi5kmnl/lib64/python3.12/site-packages/setuptools_scm/_get_version_impl.py", line 188, in _version_missing
#24 1.551     raise LookupError(error_msg)
#24 1.551 LookupError: setuptools-scm was unable to detect version for /tmp/src.
#24 1.551 
#24 1.551 Make sure you're either building from a fully intact git repository or PyPI tarballs. Most other sources (such as GitHub's tarballs, a git checkout without the .git folder) don't contain the necessary metadata and will not work.
#24 1.551 
#24 1.551 For example, if you're using pip, instead of https://github.com/user/proj/archive/master.zip use git+https://github.com/user/proj.git#egg=proj
#24 1.551 
#24 1.551 Alternatively, set the version with the environment variable SETUPTOOLS_SCM_PRETEND_VERSION_FOR_${NORMALIZED_DIST_NAME} as described in https://setuptools-scm.readthedocs.io/en/latest/config/
#24 1.587 
#24 1.587 ERROR Backend subprocess exited when trying to invoke get_requires_for_build_sdist
#24 1.603 make: *** [Makefile:464: dist/awx-.tar.gz] Error 1

from awx-operator check.

datetime.UTC is an alias of datetime.timezone.utc. if we're doing the double import for datetime it's more straightforward to just import timezone as well and get it directly
datetime.UTC is an alias of datetime.timezone.utc. if we're doing the double import for datetime it's more straightforward to just import timezone as well and get it directly
@AlanCoding
Copy link
Member

I checked a reference PR and saw in the operator check, for the build

DOCKER_BUILDKIT=1 docker build -f Dockerfile \
	--ssh default=/tmp/ssh-G0eXt2yHGTcp/agent.2129 \
	--build-arg VERSION=0.1.dev1 \
	--build-arg SETUPTOOLS_SCM_PRETEND_VERSION=0.1.dev1 \
	--build-arg HEADLESS=yes \
	--cache-from=local/awx:ci \
	-t local/awx:ci .

But your PR appears to see --build-arg VERSION=, which seems highly related to it failing

Copy link
Member

@tvo318 tvo318 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

Comment on lines 194 to 198
- name: Check Python version
working-directory: awx
run: |
make print-PYTHON && $(make print-PYTHON) tools/scripts/scm_version.py
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove debug code before merging


- name: Setup python, referencing action at awx relative path
uses: ./awx/.github/actions/setup-python
uses: actions/setup-python@v5
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pin to SHA when using external action

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't do that in other cases

@sonarqubecloud
Copy link

sonarqubecloud bot commented Jan 7, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
14 Security Hotspots
19.6% Coverage on New Code (required ≥ 80%)
D Maintainability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@jessicamack jessicamack merged commit de86b93 into ansible:devel Jan 7, 2026
17 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component:api component:awx_collection issues related to the collection for controlling AWX component:cli component:docs dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants