Skip to content

Commit

Permalink
Fix python_requires in setup.cfg. (#559)
Browse files Browse the repository at this point in the history
  • Loading branch information
felixfontein committed Nov 21, 2023
1 parent 9cb2927 commit d974876
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions changelogs/fragments/559-python_requires.yml
@@ -0,0 +1,2 @@
bugfixes:
- "Use the correct directive in ``setup.cfg`` for Ansible 9+ for requiring a Python version, i.e. use ``python_requires`` instead of ``requires_python`` (https://github.com/ansible-community/antsibull/pull/559)."
4 changes: 2 additions & 2 deletions src/antsibull/python_metadata.py
Expand Up @@ -293,7 +293,7 @@ def generate(self) -> None:
f"ansible-core ~= {self.ansible_core_version}"
)

self["options"]["requires_python"] = (
self["options"]["python_requires"] = (
self.python_requires or self.core_python_requires
)

Expand Down Expand Up @@ -363,7 +363,7 @@ def write(self, file: Path | None = None) -> None:
# pylint: disable-next=protected-access
collection_directories=self.maker._collection_directories,
#
python_requires=self.maker["options"]["requires_python"],
python_requires=self.maker["options"]["python_requires"],
PypiVer=PypiVer,
)
file.write_text(setup_contents, encoding="utf-8")
Expand Up @@ -34,7 +34,7 @@ project_urls =
zip_safe = False
install_requires =
ansible-core ~= 2.15.1
requires_python = >=3.9
python_requires = >=3.9
package_dir =
=.
packages = find_namespace:
Expand Down

0 comments on commit d974876

Please sign in to comment.