Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
119 changes: 0 additions & 119 deletions .ci/scripts/calc_constraints.py

This file was deleted.

7 changes: 3 additions & 4 deletions .ci/scripts/collect_changes.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/env python3
# /// script
# requires-python = ">=3.11"
# requires-python = ">=3.13"
# dependencies = [
# "gitpython>=3.1.46,<3.2.0",
# "packaging>=25.0,<25.1",
Expand Down Expand Up @@ -80,7 +80,7 @@ def main():
branches.sort(key=lambda ref: parse_version(ref.remote_head), reverse=True)
branches = [ref.name for ref in branches]

with open(CHANGELOG_FILE, "r") as f:
with open(CHANGELOG_FILE) as f:
main_changelog = f.read()
preamble, main_changes = split_changelog(main_changelog)
old_length = len(main_changes)
Expand All @@ -105,8 +105,7 @@ def main():
print(f"{new_length - old_length} new versions have been added.")
with open(CHANGELOG_FILE, "w") as fp:
fp.write(preamble)
for change in main_changes:
fp.write(change[1])
fp.writelines(change[1] for change in main_changes)

repo.git.commit("-m", "Update Changelog", CHANGELOG_FILE)

Expand Down
10 changes: 5 additions & 5 deletions .ci/scripts/validate_commit_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,22 @@
if NOISSUE_MARKER in message:
sys.exit("Do not add '[noissue]' in the commit message.")

if any((re.match(pattern, message) for pattern in BLOCKING_REGEX)):
if any(re.match(pattern, message) for pattern in BLOCKING_REGEX):
sys.exit("This PR is not ready for consumption.")

g = Github(os.environ.get("GITHUB_TOKEN"))
repo = g.get_repo("pulp/pulp-cli-maven")


def check_status(issue):
def check_status(issue: str) -> None:
gi = repo.get_issue(int(issue))
if gi.pull_request:
sys.exit(f"Error: issue #{issue} is a pull request.")
if gi.closed_at:
sys.exit(f"Error: issue #{issue} is closed.")


def check_changelog(issue):
def check_changelog(issue: str) -> None:
matches = list(Path("CHANGES").rglob(f"{issue}.*"))

if len(matches) < 1:
Expand All @@ -58,7 +58,7 @@ def check_changelog(issue):
sys.exit(f"Invalid extension for changelog entry '{match}'.")


print("Checking commit message for {sha}.".format(sha=sha[0:7]))
print(f"Checking commit message for {sha[0:7]}.")

# validate the issue attached to the commit
issue_regex = r"(?:{keywords})[\s:]+#(\d+)".format(keywords=("|").join(KEYWORDS))
Expand All @@ -72,4 +72,4 @@ def check_changelog(issue):
check_status(issue)
check_changelog(issue)

print("Commit message for {sha} passed.".format(sha=sha[0:7]))
print(f"Commit message for {sha[0:7]} passed.")
21 changes: 9 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,27 @@ jobs:
build:
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v6"
- uses: "actions/cache@v5"
with:
path: "~/.cache/pip"
key: "${{ runner.os }}-pip-${{ hashFiles('**/*requirements.txt', '**/*constraints.lock', '**/setup.py', '**/pyproject.toml') }}"
restore-keys: |
${{ runner.os }}-pip-

- name: "Checkout"
uses: "actions/checkout@v6"
- name: "Set up Python"
uses: "actions/setup-python@v6"
with:
python-version: "3.14"
- name: "Install python dependencies"
run: |
pip install build setuptools wheel
allow-prereleases: true
- name: "Install uv"
uses: "astral-sh/setup-uv@v7"
with:
enable-cache: true
- name: "Build wheels"
run: |
make build
touch .root
- name: "Upload wheels"
uses: "actions/upload-artifact@v6"
with:
name: "pulp_cli_packages"
path: |
pulp-glue-maven/dist/
.root
dist/
if-no-files-found: "error"
retention-days: 5
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
security-events: "write"

steps:
- name: "Checkout repository"
- name: "Checkout"
uses: "actions/checkout@v6"
- name: "Initialize CodeQL"
uses: "github/codeql-action/init@v4"
Expand Down
17 changes: 11 additions & 6 deletions .github/workflows/collect_changes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,26 @@ jobs:
collect-changes:
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v6"
- name: "Checkout"
uses: "actions/checkout@v6"
with:
ref: "main"
fetch-depth: 0
- uses: "actions/setup-python@v6"
- name: "Set up Python"
uses: "actions/setup-python@v6"
with:
python-version: "3.x"
python-version: "3.14"
allow-prereleases: true
- name: "Install uv"
uses: "astral-sh/setup-uv@v7"
with:
enable-cache: true
- name: "Setup git"
run: |
git config user.name pulpbot
git config user.email pulp-infra@redhat.com
- name: "Collect changes"
run: |
pip install GitPython packaging
python3 .ci/scripts/collect_changes.py
uv run --script .ci/scripts/collect_changes.py
- name: "Create Pull Request"
uses: "peter-evans/create-pull-request@v8"
id: "create_pr"
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/cookiecutter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ jobs:
with:
token: "${{ secrets.RELEASE_TOKEN }}"
path: "pulp-cli-maven"
- name: "Setup git"
run: |
git config user.name pulpbot
git config user.email pulp-infra@redhat.com
- name: "Set up Python"
uses: "actions/setup-python@v6"
with:
Expand All @@ -34,6 +30,10 @@ jobs:
uses: "astral-sh/setup-uv@v7"
with:
enable-cache: true
- name: "Setup git"
run: |
git config user.name pulpbot
git config user.email pulp-infra@redhat.com
- name: "Apply cookiecutter templates"
run: |
uv run ../pulp-cli/cookiecutter/apply_templates.py
Expand Down Expand Up @@ -70,10 +70,6 @@ jobs:
with:
token: "${{ secrets.RELEASE_TOKEN }}"
path: "pulp-cli-maven"
- name: "Setup git"
run: |
git config user.name pulpbot
git config user.email pulp-infra@redhat.com
- name: "Set up Python"
uses: "actions/setup-python@v6"
with:
Expand All @@ -83,6 +79,10 @@ jobs:
uses: "astral-sh/setup-uv@v7"
with:
enable-cache: true
- name: "Setup git"
run: |
git config user.name pulpbot
git config user.email pulp-infra@redhat.com
- name: "Apply cookiecutter templates"
run: |
uv run ../pulp-cli/cookiecutter/update_pulp_cli.py
Expand Down
22 changes: 7 additions & 15 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,17 @@ jobs:
- "3.11"
- "3.14"
steps:
- uses: "actions/checkout@v6"
- uses: "actions/cache@v5"
with:
path: "~/.cache/pip"
key: "${{ runner.os }}-pip-${{ hashFiles('**/*requirements.txt', '**/*constraints.lock', '**/setup.py', '**/pyproject.toml') }}"
restore-keys: |
${{ runner.os }}-pip-

- name: "Download wheels"
uses: "actions/download-artifact@v8"
with:
name: "pulp_cli_packages"
- name: "Checkout"
uses: "actions/checkout@v6"
- name: "Set up Python"
uses: "actions/setup-python@v6"
with:
python-version: "${{ matrix.python }}"
- name: "Install python dependencies"
run: |
pip install dist/pulp_cli_maven-*.whl pulp-glue-maven/dist/pulp_glue_maven-*.whl -r lint_requirements.txt
allow-prereleases: true
- name: "Install uv"
uses: "astral-sh/setup-uv@v7"
with:
enable-cache: true
- name: "Lint code"
run: |
make lint
Expand Down
Loading
Loading