diff --git a/.github/workflows/antsibull-build.yml b/.github/workflows/antsibull-build.yml index a4a6da33..c8016f67 100644 --- a/.github/workflows/antsibull-build.yml +++ b/.github/workflows/antsibull-build.yml @@ -59,10 +59,10 @@ jobs: antsibull_fileutils_ref: main steps: - - name: Check out antsibull + - name: Check out antsibull-build uses: actions/checkout@v4 with: - path: antsibull + path: antsibull-build - name: Check out dependent project antsibull-changelog uses: actions/checkout@v4 @@ -111,16 +111,20 @@ jobs: - name: "Test building a release: ${{ matrix.name }}" run: | nox -e coverage_release -- ${{ matrix.options }} - working-directory: antsibull + env: + # Since antsibull was renamed to antsibull-build, paths during the bytecompile test + # are too long and bytecompile fails with "OSError: AF_UNIX path too long". + ANTSIBULL_COVERAGE_RELEASE_FORCE_TMPDIR: /tmp + working-directory: antsibull-build - name: Report coverage run: | nox -v -e coverage - working-directory: antsibull + working-directory: antsibull-build - name: Upload coverage uses: codecov/codecov-action@v4 with: - working-directory: antsibull + working-directory: antsibull-build env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/nox.yml b/.github/workflows/nox.yml index 932da15c..5ab11982 100644 --- a/.github/workflows/nox.yml +++ b/.github/workflows/nox.yml @@ -24,7 +24,7 @@ jobs: runs-on: ubuntu-latest defaults: run: - working-directory: antsibull + working-directory: antsibull-build strategy: fail-fast: false matrix: @@ -55,10 +55,10 @@ jobs: packages: "" name: "Run nox ${{ matrix.session }} session" steps: - - name: Check out antsibull + - name: Check out antsibull-build uses: actions/checkout@v4 with: - path: antsibull + path: antsibull-build - name: Check out dependent project antsibull-core uses: actions/checkout@v4 with: @@ -106,7 +106,7 @@ jobs: if: ${{ matrix.codecov }} uses: codecov/codecov-action@v4 with: - working-directory: antsibull + working-directory: antsibull-build name: "${{ matrix.session }}" env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/README.md b/README.md index 78b14528..177bd97d 100644 --- a/README.md +++ b/README.md @@ -4,12 +4,12 @@ GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://w SPDX-License-Identifier: GPL-3.0-or-later --> -# antsibull -- Ansible Build Scripts +# antsibull-build -- Ansible Build Scripts [![Discuss on Matrix at #antsibull:ansible.com](https://img.shields.io/matrix/antsibull:ansible.com.svg?server_fqdn=ansible-accounts.ems.host&label=Discuss%20on%20Matrix%20at%20%23antsibull:ansible.com&logo=matrix)](https://matrix.to/#/#antsibull:ansible.com) -[![Nox badge](https://github.com/ansible-community/antsibull/actions/workflows/nox.yml/badge.svg)](https://github.com/ansible-community/antsibull/actions/workflows/nox.yml) -[![dumb PyPI on GH pages badge](https://github.com/ansible-community/antsibull/workflows/👷%20dumb%20PyPI%20on%20GH%20pages/badge.svg?event=push&branch=main)](https://github.com/ansible-community/antsibull/actions?query=workflow%3A%22👷+dumb+PyPI+on+GH+pages%22+branch%3Amain) -[![Codecov badge](https://img.shields.io/codecov/c/github/ansible-community/antsibull)](https://codecov.io/gh/ansible-community/antsibull) -[![REUSE status](https://api.reuse.software/badge/github.com/ansible-community/antsibull)](https://api.reuse.software/info/github.com/ansible-community/antsibull) +[![Nox badge](https://github.com/ansible-community/antsibull-build/actions/workflows/nox.yml/badge.svg)](https://github.com/ansible-community/antsibull-build/actions/workflows/nox.yml) +[![dumb PyPI on GH pages badge](https://github.com/ansible-community/antsibull-build/workflows/👷%20dumb%20PyPI%20on%20GH%20pages/badge.svg?event=push&branch=main)](https://github.com/ansible-community/antsibull-build/actions?query=workflow%3A%22👷+dumb+PyPI+on+GH+pages%22+branch%3Amain) +[![Codecov badge](https://img.shields.io/codecov/c/github/ansible-community/antsibull-build)](https://codecov.io/gh/ansible-community/antsibull-build) +[![REUSE status](https://api.reuse.software/badge/github.com/ansible-community/antsibull-build)](https://api.reuse.software/info/github.com/ansible-community/antsibull-build) Tooling for building various things related to Ansible @@ -17,11 +17,11 @@ Scripts that are here: * antsibull-build - Builds Ansible 6+ from component collections ([docs](https://github.com/ansible-community/antsibull/blob/main/docs/build-ansible.rst)) -Related projects are [antsibull-changelog](https://pypi.org/project/antsibull-changelog/) and [antsibull-docs](https://pypi.org/project/antsibull-docs/), which are in their own repositories ([antsibull-changelog repository](https://github.com/ansible-community/antsibull-changelog/), [antsibull-docs repository](https://github.com/ansible-community/antsibull-docs/)). Currently antsibull-changelog is a dependency of antsibull. Therefore, the scripts contained in it will be available as well when installing antsibull. +Related projects are [antsibull-changelog](https://pypi.org/project/antsibull-changelog/) and [antsibull-docs](https://pypi.org/project/antsibull-docs/), which are in their own repositories ([antsibull-changelog repository](https://github.com/ansible-community/antsibull-changelog/), [antsibull-docs repository](https://github.com/ansible-community/antsibull-docs/)). Currently antsibull-changelog is a dependency of antsibull-build. Therefore, the scripts contained in it will be available as well when installing antsibull-build. -You can find a list of changes in [the Antsibull changelog](https://github.com/ansible-community/antsibull/blob/main/CHANGELOG.md). +You can find a list of changes in [the Antsibull Build changelog](https://github.com/ansible-community/antsibull-build/blob/main/CHANGELOG.md). -antsibull is covered by the [Ansible Code of Conduct](https://docs.ansible.com/ansible/latest/community/code_of_conduct.html). +antsibull-build is covered by the [Ansible Code of Conduct](https://docs.ansible.com/ansible/latest/community/code_of_conduct.html). ## Licensing @@ -36,9 +36,9 @@ Summarily: ## Versioning and compatibility -From version 0.1.0 on, antsibull sticks to semantic versioning and aims at providing no backwards compatibility breaking changes **to the command line API (antsibull)** during a major release cycle. We might make exceptions from this in case of security fixes for vulnerabilities that are severe enough. +From version 0.1.0 on, antsibull-build sticks to semantic versioning and aims at providing no backwards compatibility breaking changes **to the command line API (antsibull-build)** during a major release cycle. We might make exceptions from this in case of security fixes for vulnerabilities that are severe enough. -We explicitly exclude code compatibility. **antsibull is not supposed to be used as a library.** The only exception are potential dependencies with other antsibull projects (currently, none). If you want to use a certain part of antsibull as a library, please create an issue so we can discuss whether we add a stable interface for **parts** of the Python code. We do not promise that this will actually happen though. +We explicitly exclude code compatibility. **antsibull-build is not supposed to be used as a library.** The only exception are potential dependencies with other antsibull projects (currently, none). If you want to use a certain part of antsibull-build as a library, please create an issue so we can discuss whether we add a stable interface for **parts** of the Python code. We do not promise that this will actually happen though. ## Development @@ -48,12 +48,12 @@ and install the requirements needed to run the tests there. --- -antsibull depends on the sister antsibull-core, antsibull-changelog, +antsibull-build depends on the sister antsibull-core, antsibull-changelog, antsibull-docs-parser, antsibull-docutils, and antsibull-fileutils projects. By default, `nox` will install development versions of these projects from Github. If you're hacking on antsibull-core, antsibull-changelog, antsibull-docs-parser, -antsibull-docutils and/or antsibull-fileutils alongside antsibull, +antsibull-docutils and/or antsibull-fileutils alongside antsibull-build, nox will automatically install the projects from `../antsibull-core`, `../antsibull-changelog`, `../antsibull-docs-parser`, `../antsibull-docutils`, and `../antsibull-fileutils` when running tests if those paths exist. @@ -92,8 +92,8 @@ git clone https://github.com/ansible-community/antsibull-changelog.git git clone https://github.com/ansible-community/antsibull-core.git git clone https://github.com/ansible-community/antsibull-docs-parser.git git clone https://github.com/ansible-community/antsibull-docutils.git -git clone https://github.com/ansible-community/antsibull.git -cd antsibull +git clone https://github.com/ansible-community/antsibull-build.git +cd antsibull-build python3 -m venv venv . ./venv/bin/activate pip install -e '.[dev]' -e ../antsibull-changelog -e ../antsibull-core -e ../antsibull-docs-parser -e ../antsibull-docutils @@ -107,7 +107,7 @@ nox * Bumps the package version in `src/antsibull/__init__.py`. * Creates `changelogs/fragments/.yml` with a `release_summary` section. * Runs `antsibull-changelog release` and adds the changed files to git. - * Commits with message `Release .` and runs `git tag -a -m 'antsibull ' `. + * Commits with message `Release .` and runs `git tag -a -m 'antsibull-build ' `. * Runs `hatch build --clean` to build an sdist and wheel in `dist/` and clean up any old artifacts in that directory. 2. Run `git push` to the appropriate remotes. diff --git a/antsibull-stub/LICENSE b/antsibull-stub/LICENSE new file mode 120000 index 00000000..ea5b6064 --- /dev/null +++ b/antsibull-stub/LICENSE @@ -0,0 +1 @@ +../LICENSE \ No newline at end of file diff --git a/antsibull-stub/LICENSES b/antsibull-stub/LICENSES new file mode 120000 index 00000000..fafe4e47 --- /dev/null +++ b/antsibull-stub/LICENSES @@ -0,0 +1 @@ +../LICENSES \ No newline at end of file diff --git a/antsibull-stub/README.md b/antsibull-stub/README.md new file mode 100644 index 00000000..c048f6a0 --- /dev/null +++ b/antsibull-stub/README.md @@ -0,0 +1,11 @@ + + +# antsibull PyPI stub package + +The `antsibull` project has been renamed to `antsibull-build`. +This is an empty stub package for backwards compatibility. +The new PyPI project is located at . diff --git a/antsibull-stub/pyproject.toml b/antsibull-stub/pyproject.toml new file mode 100644 index 00000000..5f6ca0e3 --- /dev/null +++ b/antsibull-stub/pyproject.toml @@ -0,0 +1,60 @@ +# Copyright (c) Ansible Project +# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) +# SPDX-License-Identifier: GPL-3.0-or-later + +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project] +name = "antsibull" +version = "0.67.0" +description = "The antsibull project has been renamed to antsibull-build" +license = "GPL-3.0-or-later AND Python-2.0.1" +license-files = {globs=["LICENSES/*.txt"]} +readme = "README.md" +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Framework :: Ansible", + "Intended Audience :: Developers", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Typing :: Typed", +] +requires-python = ">=3.9" +dependencies = [ + "antsibull-build>=0.67.0" +] + +[[project.authors]] +name = "Toshio Kuratomi" +email = "a.badger@gmail.com" + +[[project.authors]] +name = "Felix Fontein" +email = "felix@fontein.de" + +[[project.maintainers]] +name = "Felix Fontein" +email = "felix@fontein.de" + +[[project.maintainers]] +name = "Maxwell G" +email = "maxwell@gtmx.me" + +[project.urls] +"New package" = "https://pypi.org/project/antsibull-build" + +[project.optional-dependencies] +# User-facing extras +clipboard = [ + "antsibull-build[clipboard]" +] +all = [ + "antsibull-build[all]", +] + +[tool.hatch.build.targets.wheel] +# This is an empty package +bypass-selection = true diff --git a/changelogs/fragments/629-antsibull-stub.yaml b/changelogs/fragments/629-antsibull-stub.yaml new file mode 100644 index 00000000..916847d7 --- /dev/null +++ b/changelogs/fragments/629-antsibull-stub.yaml @@ -0,0 +1,12 @@ +--- +breaking_changes: + - "The name of this project has been changed from ``antsibull`` to + ``antsibull-build`` to reflect that it provides the ``antsibull-build`` + command and disambiguate this project from the other antsibull projects. + For backwards compatibility purposes, the ``antsibull`` project on PyPI + has been converted to an empty stub package that requires + ``antsibull-build``, but users should immediately switch to the new name. + The Git repository has also been moved to + https://github.com/ansible-community/antsibull-build + (https://github.com/ansible-community/antsibull/issues/627, + https://github.com/ansible-community/antsibull/pull/629)." diff --git a/codecov.yml b/codecov.yml index 9d5db5b8..a01e1838 100644 --- a/codecov.yml +++ b/codecov.yml @@ -27,4 +27,4 @@ github_checks: annotations: false fixes: - - "antsibull/::" + - "antsibull_build/::" diff --git a/noxfile.py b/noxfile.py index 6f2dcd48..850471e7 100644 --- a/noxfile.py +++ b/noxfile.py @@ -91,7 +91,7 @@ def test(session: nox.Session): session.run( "pytest", "--cov-branch", - "--cov=antsibull", + "--cov=antsibull_build", "--cov-report", "term-missing", *more_args, @@ -102,9 +102,7 @@ def test(session: nox.Session): @contextlib.contextmanager def coverage_run(session: nox.Session) -> Iterator[tuple[str, dict[str, str]]]: - build_command = ( - "coverage run -p --branch --source antsibull -m antsibull.cli.antsibull_build" - ) + build_command = "coverage run -p --branch --source antsibull_build -m antsibull_build.cli.antsibull_build" tmp = Path(session.create_tmp()) covfile = tmp / ".coverage" cov_env = {"COVERAGE_FILE": f"{covfile}", **session.env} @@ -145,6 +143,9 @@ def coverage_release(session: nox.Session): "git+https://github.com/ansible-collections/community.general", env={"ANSIBLE_COLLECTIONS_PATH": str(collections), **session.env}, ) + tmp_env = {} + if tmpdir := os.environ.get("ANTSIBULL_COVERAGE_RELEASE_FORCE_TMPDIR"): + tmp_env["TMPDIR"] = tmpdir with coverage_run(session) as (build_command, cov_env): session.run( "ansible-playbook", @@ -157,6 +158,7 @@ def coverage_release(session: nox.Session): "ANSIBLE_COLLECTIONS_PATH": str(collections), "ANSIBLE_CALLBACK_RESULT_FORMAT": "yaml", **cov_env, + **tmp_env, }, ) @@ -193,8 +195,8 @@ def formatters(session: nox.Session): @nox.session def codeqa(session: nox.Session): install(session, ".[codeqa]", *other_antsibull(), editable=True) - session.run("flake8", "src/antsibull", *session.posargs) - session.run("pylint", "--rcfile", ".pylintrc.automated", "src/antsibull") + session.run("flake8", "src/antsibull_build", *session.posargs) + session.run("pylint", "--rcfile", ".pylintrc.automated", "src/antsibull_build") session.run("reuse", "lint") session.run("antsibull-changelog", "lint") @@ -203,7 +205,7 @@ def codeqa(session: nox.Session): def typing(session: nox.Session): others = other_antsibull() install(session, ".[typing]", *others) - session.run("mypy", "src/antsibull") + session.run("mypy", "src/antsibull_build") @nox.session @@ -252,7 +254,7 @@ def check_package_files( "run", "-p", "--branch", - "--source=antsibull", + "--source=antsibull_build", "tests/verify_package_files.py", "check", f"--data-dir={build_data / major}", @@ -332,7 +334,11 @@ def bump(session: nox.Session): with open(fragment_file, "w") as fp: fp.write(fragment) session.run( - "git", "add", "src/antsibull/__init__.py", str(fragment_file), external=True + "git", + "add", + "src/antsibull_build/__init__.py", + str(fragment_file), + external=True, ) session.run("git", "commit", "-m", f"Prepare {version}.", external=True) session.run("antsibull-changelog", "release") @@ -345,7 +351,7 @@ def bump(session: nox.Session): "changelogs/fragments/", # src/antsibull/__init__.py is not committed in the last step # when the release_summary fragment is created manually - "src/antsibull/__init__.py", + "src/antsibull_build/__init__.py", external=True, ) install(session, ".") # Smoke test @@ -355,7 +361,7 @@ def bump(session: nox.Session): "tag", "-a", "-m", - f"antsibull {version}", + f"antsibull-build {version}", "--edit", version, external=True, @@ -371,14 +377,14 @@ def publish(session: nox.Session): install(session, "hatch") session.run("hatch", "publish", *session.posargs) session.run("hatch", "version", "post") - session.run("git", "add", "src/antsibull/__init__.py", external=True) + session.run("git", "add", "src/antsibull_build/__init__.py", external=True) session.run("git", "commit", "-m", "Post-release version bump.", external=True) @nox.session def install_env(session: nox.Session): """ - Install antsibull and the other project in the the local environment. + Install antsibull-build and the other project in the the local environment. Invoke with `nox -e install_env --no-venv` """ session.run( diff --git a/pyproject.toml b/pyproject.toml index 3ea6e846..16a87b05 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ requires = ["hatchling"] build-backend = "hatchling.build" [project] -name = "antsibull" +name = "antsibull-build" dynamic = [ "version", ] @@ -61,13 +61,13 @@ name = "Maxwell G" email = "maxwell@gtmx.me" [project.urls] -"Source code" = "https://github.com/ansible-community/antsibull" +"Source code" = "https://github.com/ansible-community/antsibull-build" "Code of Conduct" = "https://docs.ansible.com/ansible/latest/community/code_of_conduct.html" -"Bug tracker" = "https://github.com/ansible-community/antsibull/issues" -"Changelog" = "https://github.com/ansible-community/antsibull/tree/main/CHANGELOG.md" +"Bug tracker" = "https://github.com/ansible-community/antsibull-build/issues" +"Changelog" = "https://github.com/ansible-community/antsibull-build/tree/main/CHANGELOG.md" [project.scripts] -antsibull-build = "antsibull.cli.antsibull_build:main" +antsibull-build = "antsibull_build.cli.antsibull_build:main" [project.optional-dependencies] # User-facing extras @@ -75,7 +75,7 @@ clipboard = [ "pyperclip", ] all = [ - "antsibull[clipboard]", + "antsibull-build[clipboard]", ] # Dev extras @@ -108,17 +108,20 @@ typing = [ ] dev = [ # Used by nox sessions - "antsibull[codeqa]", - "antsibull[coverage]", - "antsibull[test]", - "antsibull[typing]", + "antsibull-build[codeqa]", + "antsibull-build[coverage]", + "antsibull-build[test]", + "antsibull-build[typing]", # misc - "antsibull[all]", + "antsibull-build[all]", "nox", ] [tool.hatch.version] -path = "src/antsibull/__init__.py" +path = "src/antsibull_build/__init__.py" + +[tool.hatch.build.targets.wheel] +packages = ["src/antsibull_build"] [tool.isort] profile = "black" diff --git a/src/antsibull/__init__.py b/src/antsibull_build/__init__.py similarity index 100% rename from src/antsibull/__init__.py rename to src/antsibull_build/__init__.py diff --git a/src/antsibull/_vendor/__init__.py b/src/antsibull_build/_vendor/__init__.py similarity index 100% rename from src/antsibull/_vendor/__init__.py rename to src/antsibull_build/_vendor/__init__.py diff --git a/src/antsibull/_vendor/shutil.py b/src/antsibull_build/_vendor/shutil.py similarity index 100% rename from src/antsibull/_vendor/shutil.py rename to src/antsibull_build/_vendor/shutil.py diff --git a/src/antsibull/announcements.py b/src/antsibull_build/announcements.py similarity index 98% rename from src/antsibull/announcements.py rename to src/antsibull_build/announcements.py index 1af7c4ed..efd9365a 100644 --- a/src/antsibull/announcements.py +++ b/src/antsibull_build/announcements.py @@ -30,8 +30,8 @@ from packaging.version import Version as PypiVer from typing_extensions import TypedDict -from antsibull.constants import ANSIBLE_FORUM_URL, BUILD_DATA_URL -from antsibull.pypi import PyPIClient, SdistAndWheelPair, UrlInfo +from antsibull_build.constants import ANSIBLE_FORUM_URL, BUILD_DATA_URL +from antsibull_build.pypi import PyPIClient, SdistAndWheelPair, UrlInfo try: import pyperclip # type: ignore[import] diff --git a/src/antsibull/build_ansible_commands.py b/src/antsibull_build/build_ansible_commands.py similarity index 99% rename from src/antsibull/build_ansible_commands.py rename to src/antsibull_build/build_ansible_commands.py index 77e45cd8..2f53b4d1 100644 --- a/src/antsibull/build_ansible_commands.py +++ b/src/antsibull_build/build_ansible_commands.py @@ -31,8 +31,8 @@ from semantic_version import SimpleSpec as SemVerSpec from semantic_version import Version as SemVer -from antsibull.constants import MINIMUM_ANSIBLE_VERSIONS -from antsibull.python_metadata import BuildMetaMaker, LegacyBuildMetaMaker +from antsibull_build.constants import MINIMUM_ANSIBLE_VERSIONS +from antsibull_build.python_metadata import BuildMetaMaker, LegacyBuildMetaMaker from . import __version__ as antsibull_version from .build_changelog import ReleaseNotes diff --git a/src/antsibull/build_changelog.py b/src/antsibull_build/build_changelog.py similarity index 100% rename from src/antsibull/build_changelog.py rename to src/antsibull_build/build_changelog.py diff --git a/src/antsibull/build_data_lint.py b/src/antsibull_build/build_data_lint.py similarity index 100% rename from src/antsibull/build_data_lint.py rename to src/antsibull_build/build_data_lint.py diff --git a/src/antsibull/changelog.py b/src/antsibull_build/changelog.py similarity index 100% rename from src/antsibull/changelog.py rename to src/antsibull_build/changelog.py diff --git a/src/antsibull/cli/__init__.py b/src/antsibull_build/cli/__init__.py similarity index 100% rename from src/antsibull/cli/__init__.py rename to src/antsibull_build/cli/__init__.py diff --git a/src/antsibull/cli/antsibull_build.py b/src/antsibull_build/cli/antsibull_build.py similarity index 99% rename from src/antsibull/cli/antsibull_build.py rename to src/antsibull_build/cli/antsibull_build.py index 7633c34f..9947b85b 100644 --- a/src/antsibull/cli/antsibull_build.py +++ b/src/antsibull_build/cli/antsibull_build.py @@ -422,7 +422,8 @@ def parse_args(program_name: str, args: list[str]) -> argparse.Namespace: ) # Delay import to avoid potential import loops - from antsibull import __version__ as _ver # pylint: disable=import-outside-toplevel + # pylint: disable-next=import-outside-toplevel + from antsibull_build import __version__ as _ver parser = get_toplevel_parser( prog=program_name, diff --git a/src/antsibull/constants.py b/src/antsibull_build/constants.py similarity index 100% rename from src/antsibull/constants.py rename to src/antsibull_build/constants.py diff --git a/src/antsibull/data/README_md.txt b/src/antsibull_build/data/README_md.txt similarity index 100% rename from src/antsibull/data/README_md.txt rename to src/antsibull_build/data/README_md.txt diff --git a/src/antsibull/data/README_md.txt.license b/src/antsibull_build/data/README_md.txt.license similarity index 100% rename from src/antsibull/data/README_md.txt.license rename to src/antsibull_build/data/README_md.txt.license diff --git a/src/antsibull/data/__init__.py b/src/antsibull_build/data/__init__.py similarity index 100% rename from src/antsibull/data/__init__.py rename to src/antsibull_build/data/__init__.py diff --git a/src/antsibull/data/ansible-community.py.j2 b/src/antsibull_build/data/ansible-community.py.j2 similarity index 100% rename from src/antsibull/data/ansible-community.py.j2 rename to src/antsibull_build/data/ansible-community.py.j2 diff --git a/src/antsibull/data/ansible-forum-announcement.j2 b/src/antsibull_build/data/ansible-forum-announcement.j2 similarity index 100% rename from src/antsibull/data/ansible-forum-announcement.j2 rename to src/antsibull_build/data/ansible-forum-announcement.j2 diff --git a/src/antsibull/data/ansible-matrix-announcement.j2 b/src/antsibull_build/data/ansible-matrix-announcement.j2 similarity index 100% rename from src/antsibull/data/ansible-matrix-announcement.j2 rename to src/antsibull_build/data/ansible-matrix-announcement.j2 diff --git a/src/antsibull/data/ansible-readme.rst b/src/antsibull_build/data/ansible-readme.rst similarity index 100% rename from src/antsibull/data/ansible-readme.rst rename to src/antsibull_build/data/ansible-readme.rst diff --git a/src/antsibull/data/ansible-release_py.j2 b/src/antsibull_build/data/ansible-release_py.j2 similarity index 100% rename from src/antsibull/data/ansible-release_py.j2 rename to src/antsibull_build/data/ansible-release_py.j2 diff --git a/src/antsibull/data/ansible-setup_py.j2 b/src/antsibull_build/data/ansible-setup_py.j2 similarity index 100% rename from src/antsibull/data/ansible-setup_py.j2 rename to src/antsibull_build/data/ansible-setup_py.j2 diff --git a/src/antsibull/data/ansible-stub-setup.py b/src/antsibull_build/data/ansible-stub-setup.py similarity index 100% rename from src/antsibull/data/ansible-stub-setup.py rename to src/antsibull_build/data/ansible-stub-setup.py diff --git a/src/antsibull/data/build-ansible.sh.j2 b/src/antsibull_build/data/build-ansible.sh.j2 similarity index 100% rename from src/antsibull/data/build-ansible.sh.j2 rename to src/antsibull_build/data/build-ansible.sh.j2 diff --git a/src/antsibull/data/collection-readme.j2 b/src/antsibull_build/data/collection-readme.j2 similarity index 100% rename from src/antsibull/data/collection-readme.j2 rename to src/antsibull_build/data/collection-readme.j2 diff --git a/src/antsibull/data/collection-setup_py.j2 b/src/antsibull_build/data/collection-setup_py.j2 similarity index 100% rename from src/antsibull/data/collection-setup_py.j2 rename to src/antsibull_build/data/collection-setup_py.j2 diff --git a/src/antsibull/data/debian/changelog.j2 b/src/antsibull_build/data/debian/changelog.j2 similarity index 100% rename from src/antsibull/data/debian/changelog.j2 rename to src/antsibull_build/data/debian/changelog.j2 diff --git a/src/antsibull/data/debian/control.j2 b/src/antsibull_build/data/debian/control.j2 similarity index 100% rename from src/antsibull/data/debian/control.j2 rename to src/antsibull_build/data/debian/control.j2 diff --git a/src/antsibull/data/debian/copyright b/src/antsibull_build/data/debian/copyright similarity index 100% rename from src/antsibull/data/debian/copyright rename to src/antsibull_build/data/debian/copyright diff --git a/src/antsibull/data/debian/copyright.license b/src/antsibull_build/data/debian/copyright.license similarity index 100% rename from src/antsibull/data/debian/copyright.license rename to src/antsibull_build/data/debian/copyright.license diff --git a/src/antsibull/data/debian/rules b/src/antsibull_build/data/debian/rules similarity index 100% rename from src/antsibull/data/debian/rules rename to src/antsibull_build/data/debian/rules diff --git a/src/antsibull/data/debian/rules.license b/src/antsibull_build/data/debian/rules.license similarity index 100% rename from src/antsibull/data/debian/rules.license rename to src/antsibull_build/data/debian/rules.license diff --git a/src/antsibull/data/galaxy_yml.j2 b/src/antsibull_build/data/galaxy_yml.j2 similarity index 100% rename from src/antsibull/data/galaxy_yml.j2 rename to src/antsibull_build/data/galaxy_yml.j2 diff --git a/src/antsibull/data/gplv3.txt b/src/antsibull_build/data/gplv3.txt similarity index 100% rename from src/antsibull/data/gplv3.txt rename to src/antsibull_build/data/gplv3.txt diff --git a/src/antsibull/data/gplv3.txt.license b/src/antsibull_build/data/gplv3.txt.license similarity index 100% rename from src/antsibull/data/gplv3.txt.license rename to src/antsibull_build/data/gplv3.txt.license diff --git a/src/antsibull/data/pyproject.toml b/src/antsibull_build/data/pyproject.toml similarity index 100% rename from src/antsibull/data/pyproject.toml rename to src/antsibull_build/data/pyproject.toml diff --git a/src/antsibull/dep_closure.py b/src/antsibull_build/dep_closure.py similarity index 100% rename from src/antsibull/dep_closure.py rename to src/antsibull_build/dep_closure.py diff --git a/src/antsibull/from_source/__init__.py b/src/antsibull_build/from_source/__init__.py similarity index 100% rename from src/antsibull/from_source/__init__.py rename to src/antsibull_build/from_source/__init__.py diff --git a/src/antsibull/from_source/_utils.py b/src/antsibull_build/from_source/_utils.py similarity index 91% rename from src/antsibull/from_source/_utils.py rename to src/antsibull_build/from_source/_utils.py index f332d370..a48d1af6 100644 --- a/src/antsibull/from_source/_utils.py +++ b/src/antsibull_build/from_source/_utils.py @@ -15,8 +15,8 @@ from semantic_version import Version as SemVer -from antsibull.tagging import CollectionTagData -from antsibull.types import CollectionName +from antsibull_build.tagging import CollectionTagData +from antsibull_build.types import CollectionName def filter_tag_data( diff --git a/src/antsibull/from_source/clone.py b/src/antsibull_build/from_source/clone.py similarity index 95% rename from src/antsibull/from_source/clone.py rename to src/antsibull_build/from_source/clone.py index f399f03d..fbfb3dbc 100644 --- a/src/antsibull/from_source/clone.py +++ b/src/antsibull_build/from_source/clone.py @@ -20,9 +20,9 @@ from antsibull_core.subprocess_util import async_log_run from antsibull_fileutils.yaml import load_yaml_file, store_yaml_file -from antsibull.tagging import CollectionTagData -from antsibull.types import CollectionName -from antsibull.utils.paths import copytree_and_symlinks +from antsibull_build.tagging import CollectionTagData +from antsibull_build.types import CollectionName +from antsibull_build.utils.paths import copytree_and_symlinks from .exceptions import CloneError from .verify import FileError, FileErrorOutput @@ -45,7 +45,7 @@ async def clone_collection( Args: tag_data: - A tag dictionary. See `antsibull.tagging.get_collections_tags()`. + A tag dictionary. See `antsibull_build.tagging.get_collections_tags()`. Returns: The path to the collection checkout """ @@ -156,7 +156,7 @@ async def normalize_clone( expected_collection: Expected NAMESPACE.NAME of the collection tag_data: - A tag dictionary. See `antsibull.tagging.get_collections_tags()`. + A tag dictionary. See `antsibull_build.tagging.get_collections_tags()`. """ flog = mlog.fields(func="normalize_clone", collection=collection) errors: list[FileErrorOutput] = [] diff --git a/src/antsibull/from_source/commands.py b/src/antsibull_build/from_source/commands.py similarity index 95% rename from src/antsibull/from_source/commands.py rename to src/antsibull_build/from_source/commands.py index d826c2fe..b5e2b6b8 100644 --- a/src/antsibull/from_source/commands.py +++ b/src/antsibull_build/from_source/commands.py @@ -20,11 +20,11 @@ from antsibull_core.subprocess_util import async_log_run from antsibull_fileutils.yaml import load_yaml_file, store_yaml_file -from antsibull.build_ansible_commands import download_collections -from antsibull.tagging import CollectionTagData -from antsibull.types import CollectionName, make_collection_mapping -from antsibull.utils.galaxy import create_galaxy_context -from antsibull.utils.paths import atemp_or_dir +from antsibull_build.build_ansible_commands import download_collections +from antsibull_build.tagging import CollectionTagData +from antsibull_build.types import CollectionName, make_collection_mapping +from antsibull_build.utils.galaxy import create_galaxy_context +from antsibull_build.utils.paths import atemp_or_dir from ._utils import filter_tag_data, tag_data_as_version_mapping from .clone import NormalizedCheckout, clone_collection, normalize_clone diff --git a/src/antsibull/from_source/exceptions.py b/src/antsibull_build/from_source/exceptions.py similarity index 100% rename from src/antsibull/from_source/exceptions.py rename to src/antsibull_build/from_source/exceptions.py diff --git a/src/antsibull/from_source/verify.py b/src/antsibull_build/from_source/verify.py similarity index 98% rename from src/antsibull/from_source/verify.py rename to src/antsibull_build/from_source/verify.py index 3b735a01..00f6dca2 100644 --- a/src/antsibull/from_source/verify.py +++ b/src/antsibull_build/from_source/verify.py @@ -18,7 +18,7 @@ from antsibull_core import app_context from antsibull_fileutils.hashing import verify_hash -from antsibull.types import add_yaml_type +from antsibull_build.types import add_yaml_type if TYPE_CHECKING: from typing_extensions import NotRequired diff --git a/src/antsibull/new_ansible.py b/src/antsibull_build/new_ansible.py similarity index 100% rename from src/antsibull/new_ansible.py rename to src/antsibull_build/new_ansible.py diff --git a/src/antsibull/py.typed b/src/antsibull_build/py.typed similarity index 100% rename from src/antsibull/py.typed rename to src/antsibull_build/py.typed diff --git a/src/antsibull/pypi.py b/src/antsibull_build/pypi.py similarity index 100% rename from src/antsibull/pypi.py rename to src/antsibull_build/pypi.py diff --git a/src/antsibull/python_metadata.py b/src/antsibull_build/python_metadata.py similarity index 100% rename from src/antsibull/python_metadata.py rename to src/antsibull_build/python_metadata.py diff --git a/src/antsibull/sanity_tests.py b/src/antsibull_build/sanity_tests.py similarity index 98% rename from src/antsibull/sanity_tests.py rename to src/antsibull_build/sanity_tests.py index 020eda71..84121e1c 100644 --- a/src/antsibull/sanity_tests.py +++ b/src/antsibull_build/sanity_tests.py @@ -28,8 +28,8 @@ from antsibull_fileutils.yaml import store_yaml_file from packaging.version import Version -from antsibull.constants import SANITY_TESTS_BANNED_IGNORES, SANITY_TESTS_DEFAULT -from antsibull.types import CollectionName, add_dataclass_yaml_type +from antsibull_build.constants import SANITY_TESTS_BANNED_IGNORES, SANITY_TESTS_DEFAULT +from antsibull_build.types import CollectionName, add_dataclass_yaml_type if TYPE_CHECKING: from _typeshed import StrPath diff --git a/src/antsibull/tagging.py b/src/antsibull_build/tagging.py similarity index 100% rename from src/antsibull/tagging.py rename to src/antsibull_build/tagging.py diff --git a/src/antsibull/types.py b/src/antsibull_build/types.py similarity index 100% rename from src/antsibull/types.py rename to src/antsibull_build/types.py diff --git a/src/antsibull/utils/__init__.py b/src/antsibull_build/utils/__init__.py similarity index 100% rename from src/antsibull/utils/__init__.py rename to src/antsibull_build/utils/__init__.py diff --git a/src/antsibull/utils/galaxy.py b/src/antsibull_build/utils/galaxy.py similarity index 100% rename from src/antsibull/utils/galaxy.py rename to src/antsibull_build/utils/galaxy.py diff --git a/src/antsibull/utils/get_pkg_data.py b/src/antsibull_build/utils/get_pkg_data.py similarity index 74% rename from src/antsibull/utils/get_pkg_data.py rename to src/antsibull_build/utils/get_pkg_data.py index 422542a1..5bdb00dd 100644 --- a/src/antsibull/utils/get_pkg_data.py +++ b/src/antsibull_build/utils/get_pkg_data.py @@ -13,12 +13,14 @@ def get_antsibull_data(filename: str) -> bytes: """ - Retrieve data from the antsibull.data package as bytes. + Retrieve data from the antsibull_build.data package as bytes. The filename can be a relative path separated with '/' to access subdirectories. See https://docs.python.org/3/library/pkgutil.html#pkgutil.get_data for details. """ - data = pkgutil.get_data("antsibull.data", filename) + data = pkgutil.get_data("antsibull_build.data", filename) if data is None: - raise RuntimeError(f"Cannot find {filename} in the antsibull.data package") + raise RuntimeError( + f"Cannot find {filename} in the antsibull_build.data package" + ) return data diff --git a/src/antsibull/utils/paths.py b/src/antsibull_build/utils/paths.py similarity index 95% rename from src/antsibull/utils/paths.py rename to src/antsibull_build/utils/paths.py index 83ad9062..85b5c2aa 100644 --- a/src/antsibull/utils/paths.py +++ b/src/antsibull_build/utils/paths.py @@ -18,7 +18,7 @@ import aiofiles.ospath import aiofiles.tempfile -from antsibull._vendor.shutil import copytree_and_symlinks +from antsibull_build._vendor.shutil import copytree_and_symlinks if TYPE_CHECKING: from _typeshed import StrPath diff --git a/src/antsibull/versions.py b/src/antsibull_build/versions.py similarity index 100% rename from src/antsibull/versions.py rename to src/antsibull_build/versions.py diff --git a/tests/test_announcements.py b/tests/test_announcements.py index 291e1580..0cdf9290 100644 --- a/tests/test_announcements.py +++ b/tests/test_announcements.py @@ -12,7 +12,7 @@ import pytest -from antsibull.cli.antsibull_build import run +from antsibull_build.cli.antsibull_build import run ANNOUNCEMENT_TESTS = [ ("7.0.0b1", "announce-7.0.0b1"), diff --git a/tests/test_dummy.py b/tests/test_dummy.py index 6bc94b1a..9a95c769 100644 --- a/tests/test_dummy.py +++ b/tests/test_dummy.py @@ -5,7 +5,7 @@ # This file is here so that pytest won't complain that it cannot find tests. # Remove once we have actual tests. -import antsibull +import antsibull_build def test_dummy(): diff --git a/tests/test_paths.py b/tests/test_paths.py index edb65ca4..76c75dc0 100644 --- a/tests/test_paths.py +++ b/tests/test_paths.py @@ -12,8 +12,8 @@ import pytest -from antsibull._vendor.shutil import _should_symlink -from antsibull.utils.paths import atemp_or_dir, copytree_and_symlinks, temp_or_dir +from antsibull_build._vendor.shutil import _should_symlink +from antsibull_build.utils.paths import atemp_or_dir, copytree_and_symlinks, temp_or_dir @pytest.mark.asyncio diff --git a/tests/test_tagging.py b/tests/test_tagging.py index 7fdf9422..24ce6e42 100644 --- a/tests/test_tagging.py +++ b/tests/test_tagging.py @@ -9,7 +9,7 @@ import pytest from antsibull_core.yaml import load_yaml_file -from antsibull.cli.antsibull_build import run +from antsibull_build.cli.antsibull_build import run @pytest.mark.parametrize( @@ -213,7 +213,9 @@ def test_validate_tags(test_data_path: Path, tmp_path: Path): expected_data_path = test_data_path / name expected_data = load_yaml_file(expected_data_path) output_data_path = tmp_path / name - with patch("antsibull.tagging.get_collections_tags", return_value=expected_data): + with patch( + "antsibull_build.tagging.get_collections_tags", return_value=expected_data + ): ran = run( [ "antsibull-build", diff --git a/tests/test_types.py b/tests/test_types.py index 9bd471e2..048adfc6 100644 --- a/tests/test_types.py +++ b/tests/test_types.py @@ -8,7 +8,7 @@ import pytest -from antsibull.types import CollectionName, make_collection_mapping +from antsibull_build.types import CollectionName, make_collection_mapping def test_collection_name() -> None: diff --git a/tests/test_versions.py b/tests/test_versions.py index 539d10f2..df6a6b84 100644 --- a/tests/test_versions.py +++ b/tests/test_versions.py @@ -5,7 +5,7 @@ import pytest -from antsibull.build_ansible_commands import feature_freeze_version +from antsibull_build.build_ansible_commands import feature_freeze_version @pytest.mark.parametrize( diff --git a/tests/verify_package_files.py b/tests/verify_package_files.py index b4660b53..09bdad47 100644 --- a/tests/verify_package_files.py +++ b/tests/verify_package_files.py @@ -24,10 +24,10 @@ import aiohttp from packaging.version import Version as PypiVer -import antsibull.build_ansible_commands -from antsibull.cli import antsibull_build -from antsibull.constants import MINIMUM_ANSIBLE_VERSIONS -from antsibull.utils.paths import temp_or_dir +from antsibull_build import build_ansible_commands +from antsibull_build.cli import antsibull_build +from antsibull_build.constants import MINIMUM_ANSIBLE_VERSIONS +from antsibull_build.utils.paths import temp_or_dir HERE = Path(__file__).resolve().parent ROOT = HERE.parent @@ -161,7 +161,7 @@ def generate_package_files( cm, cm2, patch_object( - antsibull.build_ansible_commands, + build_ansible_commands, "antsibull_version", PLACEHOLDER_ANTSIBULL_VERSION, ),