Drop use of setup.py and setup.cfg (#81443)

pull/83773/head
Matt Clay 3 months ago committed by GitHub
parent 2b91c57c85
commit 68515abf97
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

2
.gitignore vendored

@ -92,6 +92,8 @@ Vagrantfile
/lib/ansible_base.egg-info/
# First used in the `devel` branch during Ansible 2.11 development.
/lib/ansible_core.egg-info/
# First used in the `devel` branch during Ansible 2.18 development.
/ansible_core.egg-info/
# vendored lib dir
lib/ansible/_vendor/*
!lib/ansible/_vendor/__init__.py

@ -1,5 +1,4 @@
include COPYING
include bin/*
include changelogs/CHANGELOG*.rst
include changelogs/changelog.yaml
include licenses/*.txt

@ -1,3 +1,112 @@
[build-system]
requires = ["setuptools >= 66.1.0, <= 72.1.0"] # lower bound to support controller Python versions, upper bound for latest version tested at release
build-backend = "setuptools.build_meta"
[project]
requires-python = ">=3.11"
name = "ansible-core"
authors = [
{name = "Ansible Project"},
]
description = "Radically simple IT automation"
readme = "README.md"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: Developers",
"Intended Audience :: Information Technology",
"Intended Audience :: System Administrators",
"License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
"Natural Language :: English",
"Operating System :: POSIX",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3 :: Only",
"Topic :: System :: Installation/Setup",
"Topic :: System :: Systems Administration",
"Topic :: Utilities",
]
dynamic = ["version", "dependencies"]
[project.urls]
"Homepage" = "https://ansible.com/"
"Source Code" = "https://github.com/ansible/ansible/"
"Bug Tracker" = "https://github.com/ansible/ansible/issues/"
"CI: Azure Pipelines" = "https://dev.azure.com/ansible/ansible/"
"Documentation" = "https://docs.ansible.com/ansible-core/"
"Code of Conduct" = "https://docs.ansible.com/ansible/latest/community/code_of_conduct.html"
[tool.setuptools.dynamic]
version = {attr = "ansible.release.__version__"}
dependencies = {file = "requirements.txt"}
[tool.setuptools]
include-package-data = false
license-files = [
"COPYING",
"licenses/*.txt",
]
[tool.setuptools.packages.find]
where = ["lib", "test/lib"]
[tool.setuptools.package-data]
ansible = [
"config/*.yml",
"executor/powershell/*.ps1",
"galaxy/data/COPYING",
"galaxy/data/*.yml",
"galaxy/data/*/*.j2",
"galaxy/data/*/*.md",
"galaxy/data/*/*/*.cfg",
"galaxy/data/*/*/*.j2",
"galaxy/data/*/*/*.md",
"galaxy/data/*/*/*/*.j2",
"galaxy/data/*/*/*/*.yml",
"galaxy/data/*/*/*/.git_keep",
"galaxy/data/*/*/*/inventory",
"galaxy/data/*/*/.git_keep",
"galaxy/data/*/*/inventory",
"keyword_desc.yml",
"module_utils/csharp/*.cs",
"module_utils/powershell/*.psm1",
"plugins/*/*.yml",
]
ansible_test = [
"_data/*/*.in",
"_data/*/*.ps1",
"_data/*/*.txt",
"_data/*/*.yml",
"_data/*/*/*.ini",
"_data/ansible.cfg",
"_data/coveragerc",
"_util/*/*/*.ps1",
"_util/*/*/*.py",
"_util/*/*/*.sh",
"_util/*/*/*/*.ini",
"_util/*/*/*/*.json",
"_util/*/*/*/*.ps1",
"_util/*/*/*/*.psd1",
"_util/*/*/*/*.py",
"_util/*/*/*/*.txt",
"_util/*/*/*/*/*.cfg",
"_util/*/*/*/*/*.ps1",
"_util/*/*/*/*/*.py",
"_util/*/*/*/*/*.yml",
"config/*.template",
"config/*.yml",
]
[project.scripts]
ansible = "ansible.cli.adhoc:main"
ansible-config = "ansible.cli.config:main"
ansible-console = "ansible.cli.console:main"
ansible-doc = "ansible.cli.doc:main"
ansible-galaxy = "ansible.cli.galaxy:main"
ansible-inventory = "ansible.cli.inventory:main"
ansible-playbook = "ansible.cli.playbook:main"
ansible-pull = "ansible.cli.pull:main"
ansible-vault = "ansible.cli.vault:main"
ansible-test = "ansible_test._util.target.cli.ansible_test_cli_stub:main"

@ -1,106 +0,0 @@
# Minimum target setuptools 66.1.0
[metadata]
name = ansible-core
version = attr: ansible.release.__version__
description = Radically simple IT automation
long_description = file: README.md
long_description_content_type = text/markdown
author = Ansible, Inc.
author_email = info@ansible.com
url = https://ansible.com/
project_urls =
Bug Tracker=https://github.com/ansible/ansible/issues
CI: Azure Pipelines=https://dev.azure.com/ansible/ansible/
Code of Conduct=https://docs.ansible.com/ansible/latest/community/code_of_conduct.html
Documentation=https://docs.ansible.com/ansible-core/
Mailing lists=https://docs.ansible.com/ansible/latest/community/communication.html#mailing-list-information
Source Code=https://github.com/ansible/ansible
license = GPLv3+
classifiers =
Development Status :: 5 - Production/Stable
Environment :: Console
Intended Audience :: Developers
Intended Audience :: Information Technology
Intended Audience :: System Administrators
License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
Natural Language :: English
Operating System :: POSIX
Programming Language :: Python :: 3
Programming Language :: Python :: 3.11
Programming Language :: Python :: 3.12
Programming Language :: Python :: 3 :: Only
Topic :: System :: Installation/Setup
Topic :: System :: Systems Administration
Topic :: Utilities
[options]
zip_safe = False
python_requires = >=3.11
# keep ansible-test as a verbatim script to work with editable installs, since it needs to do its
# own package redirection magic that's beyond the scope of the normal `ansible` path redirection
# done by setuptools `develop`
scripts =
bin/ansible-test
[options.package_data]
ansible =
config/*.yml
executor/powershell/*.ps1
galaxy/data/COPYING
galaxy/data/*.yml
galaxy/data/*/*.j2
galaxy/data/*/*.md
galaxy/data/*/*/*.cfg
galaxy/data/*/*/*.j2
galaxy/data/*/*/*.md
galaxy/data/*/*/*/*.j2
galaxy/data/*/*/*/*.yml
galaxy/data/*/*/*/.git_keep
galaxy/data/*/*/*/inventory
galaxy/data/*/*/.git_keep
galaxy/data/*/*/inventory
keyword_desc.yml
module_utils/csharp/*.cs
module_utils/powershell/*.psm1
plugins/*/*.yml
ansible_test =
_data/*/*.in
_data/*/*.ps1
_data/*/*.txt
_data/*/*.yml
_data/*/*/*.ini
_data/ansible.cfg
_data/coveragerc
_util/*/*/*.ps1
_util/*/*/*.py
_util/*/*/*.sh
_util/*/*/*/*.ini
_util/*/*/*/*.json
_util/*/*/*/*.ps1
_util/*/*/*/*.psd1
_util/*/*/*/*.py
_util/*/*/*/*.txt
_util/*/*/*/*/*.cfg
_util/*/*/*/*/*.ps1
_util/*/*/*/*/*.py
_util/*/*/*/*/*.yml
config/*.template
config/*.yml
# setuptools 51.0.0
# [options.entry_points]
# console_scripts =
# ansible = ansible.cli.adhoc:main
# ansible-config = ansible.cli.config:main
# ansible-console = ansible.cli.console:main
# ansible-doc = ansible.cli.doc:main
# ansible-galaxy = ansible.cli.galaxy:main
# ansible-inventory = ansible.cli.inventory:main
# ansible-playbook = ansible.cli.playbook:main
# ansible-pull = ansible.cli.pull:main
# ansible-vault = ansible.cli.vault:main
# ansible-test = ansible_test._util.target.cli.ansible_test_cli_stub:main
[flake8]
max-line-length = 160

@ -1,29 +0,0 @@
from __future__ import annotations
import pathlib
from setuptools import find_packages, setup
here = pathlib.Path(__file__).parent.resolve()
install_requires = (here / 'requirements.txt').read_text(encoding='utf-8').splitlines()
setup(
install_requires=install_requires,
package_dir={'': 'lib',
'ansible_test': 'test/lib/ansible_test'},
packages=find_packages('lib') + find_packages('test/lib'),
entry_points={
'console_scripts': [
'ansible=ansible.cli.adhoc:main',
'ansible-config=ansible.cli.config:main',
'ansible-console=ansible.cli.console:main',
'ansible-doc=ansible.cli.doc:main',
'ansible-galaxy=ansible.cli.galaxy:main',
'ansible-inventory=ansible.cli.inventory:main',
'ansible-playbook=ansible.cli.playbook:main',
'ansible-pull=ansible.cli.pull:main',
'ansible-vault=ansible.cli.vault:main',
],
},
)

@ -834,8 +834,6 @@ class PathMapper:
'MANIFEST.in',
'pyproject.toml',
'requirements.txt',
'setup.cfg',
'setup.py',
):
return packaging

@ -24,6 +24,7 @@ def collect_sdist_files(complete_file_list: list[str]) -> list[str]:
'.cherry_picker.toml',
'.git*',
'.mailmap',
'bin/*',
'changelogs/README.md',
'changelogs/config.yaml',
'changelogs/fragments/*',
@ -37,13 +38,13 @@ def collect_sdist_files(complete_file_list: list[str]) -> list[str]:
'SOURCES.txt',
'dependency_links.txt',
'entry_points.txt',
'not-zip-safe',
'requires.txt',
'top_level.txt',
)
sdist_files.append('PKG-INFO')
sdist_files.extend(f'lib/ansible_core.egg-info/{name}' for name in egg_info)
sdist_files.append('setup.cfg')
sdist_files.extend(f'ansible_core.egg-info/{name}' for name in egg_info)
return sdist_files
@ -51,8 +52,12 @@ def collect_sdist_files(complete_file_list: list[str]) -> list[str]:
def collect_wheel_files(complete_file_list: list[str]) -> list[str]:
"""Return a list of files which should be present in the wheel."""
wheel_files = []
license_files = []
for path in complete_file_list:
if path.startswith('licenses/'):
license_files.append(os.path.relpath(path, 'licenses'))
if path.startswith('lib/ansible/'):
prefix = 'lib'
elif path.startswith('test/lib/ansible_test/'):
@ -62,16 +67,15 @@ def collect_wheel_files(complete_file_list: list[str]) -> list[str]:
wheel_files.append(os.path.relpath(path, prefix))
dist_info = (
dist_info = [
'COPYING',
'METADATA',
'RECORD',
'WHEEL',
'entry_points.txt',
'top_level.txt',
)
] + license_files
wheel_files.append(f'ansible_core-{__version__}.data/scripts/ansible-test')
wheel_files.extend(f'ansible_core-{__version__}.dist-info/{name}' for name in dist_info)
return wheel_files

Loading…
Cancel
Save