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

Rename antsibull project to antsibull-build #632

Merged
merged 9 commits into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions .github/workflows/antsibull-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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".
COVERAGE_RELEASE_FORCE_TMPDIR: /tmp
Copy link
Contributor

Choose a reason for hiding this comment

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

Google returns no results for COVERAGE_RELEASE_FORCE_TMPDIR. How does it change pycoverage's behavior?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It doesn't. This is interpreted by noxfile.py.

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 }}
8 changes: 4 additions & 4 deletions .github/workflows/nox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
runs-on: ubuntu-latest
defaults:
run:
working-directory: antsibull
working-directory: antsibull-build
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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 }}
30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,24 @@ 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

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

Expand All @@ -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

Expand All @@ -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.
Expand Down Expand Up @@ -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
Expand All @@ -107,7 +107,7 @@ nox
* Bumps the package version in `src/antsibull/__init__.py`.
* Creates `changelogs/fragments/<version>.yml` with a `release_summary` section.
* Runs `antsibull-changelog release` and adds the changed files to git.
* Commits with message `Release <version>.` and runs `git tag -a -m 'antsibull <version>' <version>`.
* Commits with message `Release <version>.` and runs `git tag -a -m 'antsibull-build <version>' <version>`.
* 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.
Expand Down
1 change: 1 addition & 0 deletions antsibull-stub/LICENSE
1 change: 1 addition & 0 deletions antsibull-stub/LICENSES
11 changes: 11 additions & 0 deletions antsibull-stub/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!--
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
-->

# 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 <https://pypi.org/project/antsibull-build>.
60 changes: 60 additions & 0 deletions antsibull-stub/pyproject.toml
Original file line number Diff line number Diff line change
@@ -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.66.0"
felixfontein marked this conversation as resolved.
Show resolved Hide resolved
]

[[project.authors]]
name = "Toshio Kuratomi"
email = "[email protected]"

[[project.authors]]
name = "Felix Fontein"
email = "[email protected]"

[[project.maintainers]]
name = "Felix Fontein"
email = "[email protected]"

[[project.maintainers]]
name = "Maxwell G"
email = "[email protected]"

[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
12 changes: 12 additions & 0 deletions changelogs/fragments/629-antsibull-stub.yaml
Original file line number Diff line number Diff line change
@@ -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)."
2 changes: 1 addition & 1 deletion codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ github_checks:
annotations: false

fixes:
- "antsibull/::"
- "antsibull_build/::"
33 changes: 20 additions & 13 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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}
Expand Down Expand Up @@ -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 os.environ.get("COVERAGE_RELEASE_FORCE_TMPDIR"):
tmp_env["TMPDIR"] = os.environ["COVERAGE_RELEASE_FORCE_TMPDIR"]
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems redundant if COVERAGE_RELEASE_FORCE_TMPDIR=/tmp that's set in CI is already the default. Also, probably better not to use the COVERAGE_ namespace if the coverage program is not actually reading this envvar.

with coverage_run(session) as (build_command, cov_env):
session.run(
"ansible-playbook",
Expand All @@ -154,9 +155,11 @@ def coverage_release(session: nox.Session):
"-e",
f"antsibull_build_command={build_command!r}",
env={
"TMPDIR": "/tmp",
felixfontein marked this conversation as resolved.
Show resolved Hide resolved
"ANSIBLE_COLLECTIONS_PATH": str(collections),
"ANSIBLE_CALLBACK_RESULT_FORMAT": "yaml",
**cov_env,
**tmp_env,
},
)

Expand Down Expand Up @@ -193,8 +196,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")

Expand All @@ -203,7 +206,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
Expand Down Expand Up @@ -252,7 +255,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}",
Expand Down Expand Up @@ -332,7 +335,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")
Expand All @@ -345,7 +352,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
Expand All @@ -355,7 +362,7 @@ def bump(session: nox.Session):
"tag",
"-a",
"-m",
f"antsibull {version}",
f"antsibull-build {version}",
"--edit",
version,
external=True,
Expand All @@ -371,14 +378,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(
Expand Down
Loading