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

Stop using deprecated packages in CI #630

Merged
merged 6 commits into from
Jul 31, 2024
Merged
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
16 changes: 8 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ defaults:
run:
shell: bash

env:
PIP_DISABLE_PIP_VERSION_CHECK: "1"

jobs:
build:
name: ${{ matrix.task.name}} - ${{ matrix.os.name }} ${{ matrix.python.name }}
Expand Down Expand Up @@ -250,18 +253,15 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.11

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pep517
python-version: 3.12

- name: Display structure of files to be pushed
run: ls --recursive dist/

- name: Check matched tag version and branch version - on tag
run: python admin/check_tag_version_match.py "${{ github.ref }}"
- name: Ensure tag and package versions match.
run: |
python -Im pip install dist/*.whl
python -I admin/check_tag_version_match.py "${{ github.ref }}"

- name: Publish to PyPI - on tag
uses: pypa/gh-action-pypi-publish@a56da0b891b3dc519c7ee3284aff1fad93cc8598
Expand Down
16 changes: 9 additions & 7 deletions admin/check_tag_version_match.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
#
# Used during the release process to make sure that we release based on a
# tag that has the same version as the current twisted.__version.
# tag that has the same version as the current packaging metadata.
#
# Designed to be conditionally called inside GitHub Actions release job.
# Tags should use PEP440 version scheme.
#
# To be called as: admin/check_tag_version_match.py refs/tags/twisted-20.3.0
# To be called as: admin/check_tag_version_match.py refs/tags/20.3.0
#

import sys

import pep517.meta
from importlib import metadata


TAG_PREFIX = "refs/tags/"
Expand All @@ -18,7 +19,8 @@
print("No tag check requested.")
sys.exit(0)

branch_version = pep517.meta.load(".").version
pkg_version = metadata.version("towncrier")
print(f"Package version is {pkg_version}.")
run_version = sys.argv[1]

if not run_version.startswith(TAG_PREFIX):
Expand All @@ -27,9 +29,9 @@

run_version = run_version[len(TAG_PREFIX) :] # noqa: E203

if run_version != branch_version:
print(f"Branch is at '{branch_version}' while tag is '{run_version}'")
if run_version != pkg_version:
print(f"Package is at '{pkg_version}' while tag is '{run_version}'")
exit(1)

print(f"All good. Branch and tag versions match for '{branch_version}'.")
print(f"All good. Package and tag versions match for '{pkg_version}'.")
sys.exit(0)
4 changes: 1 addition & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
[build-system]
requires = [
"hatchling",
]
requires = ["hatchling"]
build-backend = "hatchling.build"


Expand Down
Empty file.
Loading