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

add support for Python 3.11 #25

Merged
merged 4 commits into from
Oct 2, 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
91 changes: 46 additions & 45 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
# this file is *not* meant to cover or endorse the use of GitHub Actions, but rather to
# help make automated releases for this project

Expand All @@ -15,48 +16,48 @@ jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.9'
- name: Install build and deploy dependencies
run: |
python -m pip install -U setuptools wheel build
if [ -f requirements-deploy.txt ]; then pip install -r requirements-deploy.txt; fi
pip install .
- name: Parse changelog
id: parse_changelog
run: |
changelog2version --changelog_file changelog.md --print | python -c "import sys, json; print(json.load(sys.stdin)['info']['description'])" > latest_description.txt
echo 'LATEST_DESCRIPTION<<"EOT"' >> $GITHUB_OUTPUT
cat latest_description.txt >> $GITHUB_OUTPUT
echo '"EOT"' >> $GITHUB_OUTPUT
latest_version=$(changelog2version --changelog_file changelog.md --print | python -c "import sys, json; print(json.load(sys.stdin)['info']['version'])")
echo "latest_version=$latest_version" >> $GITHUB_ENV
- name: Build package
run: |
changelog2version \
--changelog_file changelog.md \
--version_file src/changelog2version/version.py \
--version_file_type py \
--debug
python -m build .
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1.5
with:
password: ${{ secrets.PYPI_API_TOKEN }}
skip_existing: true
verbose: true
print_hash: true
- name: Create Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.latest_version }}
release_name: ${{ env.latest_version }}
body: ${{ steps.parse_changelog.outputs.LATEST_DESCRIPTION }}
draft: false
prerelease: false
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.9'
- name: Install build and deploy dependencies
run: |
python -m pip install -U setuptools wheel build
if [ -f requirements-deploy.txt ]; then pip install -r requirements-deploy.txt; fi
pip install .
- name: Parse changelog
id: parse_changelog
run: |
changelog2version --changelog_file changelog.md --print | python -c "import sys, json; print(json.load(sys.stdin)['info']['description'])" > latest_description.txt
echo 'LATEST_DESCRIPTION<<"EOT"' >> $GITHUB_OUTPUT
cat latest_description.txt >> $GITHUB_OUTPUT
echo '"EOT"' >> $GITHUB_OUTPUT
latest_version=$(changelog2version --changelog_file changelog.md --print | python -c "import sys, json; print(json.load(sys.stdin)['info']['version'])")
echo "latest_version=$latest_version" >> $GITHUB_ENV
- name: Build package
run: |
changelog2version \
--changelog_file changelog.md \
--version_file src/changelog2version/version.py \
--version_file_type py \
--debug
python -m build .
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1.5
with:
password: ${{ secrets.PYPI_API_TOKEN }}
skip_existing: true
verbose: true
print_hash: true
- name: Create Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.latest_version }}
release_name: ${{ env.latest_version }}
body: ${{ steps.parse_changelog.outputs.LATEST_DESCRIPTION }}
draft: false
prerelease: false
117 changes: 59 additions & 58 deletions .github/workflows/test-release.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
# this file is *not* meant to cover or endorse the use of GitHub Actions, but rather to
# help make automated releases for this project

Expand All @@ -12,61 +13,61 @@ jobs:
test-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.9'
- name: Install deploy dependencies
run: |
python -m pip install -U setuptools wheel build
if [ -f requirements-deploy.txt ]; then pip install -r requirements-deploy.txt; fi
pip install .
- name: Parse changelog
id: parse_changelog
run: |
changelog2version --changelog_file changelog.md --print | python -c "import sys, json; print(json.load(sys.stdin)['info']['description'])" > latest_description.txt
echo 'LATEST_DESCRIPTION<<"EOT"' >> $GITHUB_OUTPUT
cat latest_description.txt >> $GITHUB_OUTPUT
echo '"EOT"' >> $GITHUB_OUTPUT
latest_version=$(changelog2version --changelog_file changelog.md --print | python -c "import sys, json; print(json.load(sys.stdin)['info']['version'])")
echo "latest_version=$latest_version" >> $GITHUB_ENV
- name: Build package
run: |
changelog2version \
--changelog_file changelog.md \
--version_file src/changelog2version/version.py \
--version_file_type py \
--additional_version_info="-rc${{ github.run_number }}.dev${{ github.event.number }}" \
--debug
python -m build .
- name: Test built package
run: |
twine check dist/*.tar.gz
- name: Archive build package artifact
uses: actions/upload-artifact@v3
with:
# https://docs.github.com/en/actions/learn-github-actions/contexts#github-context
# ${{ github.repository }} and ${{ github.ref_name }} can't be used for artifact name due to unallowed '/'
name: dist_py.${{ github.event.repository.name }}_sha.${{ github.sha }}_build.${{ github.run_number }}
path: dist/*.tar.gz
retention-days: 14
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1.5
with:
repository_url: https://test.pypi.org/legacy/
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
skip_existing: true
verbose: true
print_hash: true
- name: Create Prerelease
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.latest_version }}-rc${{ github.run_number }}.dev${{ github.event.number }}
release_name: ${{ env.latest_version }}-rc${{ github.run_number }}.dev${{ github.event.number }}
body: ${{ steps.parse_changelog.outputs.LATEST_DESCRIPTION }}
draft: false
prerelease: true
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.9'
- name: Install deploy dependencies
run: |
python -m pip install -U setuptools wheel build
if [ -f requirements-deploy.txt ]; then pip install -r requirements-deploy.txt; fi
pip install .
- name: Parse changelog
id: parse_changelog
run: |
changelog2version --changelog_file changelog.md --print | python -c "import sys, json; print(json.load(sys.stdin)['info']['description'])" > latest_description.txt
echo 'LATEST_DESCRIPTION<<"EOT"' >> $GITHUB_OUTPUT
cat latest_description.txt >> $GITHUB_OUTPUT
echo '"EOT"' >> $GITHUB_OUTPUT
latest_version=$(changelog2version --changelog_file changelog.md --print | python -c "import sys, json; print(json.load(sys.stdin)['info']['version'])")
echo "latest_version=$latest_version" >> $GITHUB_ENV
- name: Build package
run: |
changelog2version \
--changelog_file changelog.md \
--version_file src/changelog2version/version.py \
--version_file_type py \
--additional_version_info="-rc${{ github.run_number }}.dev${{ github.event.number }}" \
--debug
python -m build .
- name: Test built package
run: |
twine check dist/*.tar.gz
- name: Archive build package artifact
uses: actions/upload-artifact@v3
with:
# https://docs.github.com/en/actions/learn-github-actions/contexts#github-context
# ${{ github.repository }} and ${{ github.ref_name }} can't be used for artifact name due to unallowed '/'
name: dist_py.${{ github.event.repository.name }}_sha.${{ github.sha }}_build.${{ github.run_number }}
path: dist/*.tar.gz
retention-days: 14
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1.5
with:
repository_url: https://test.pypi.org/legacy/
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
skip_existing: true
verbose: true
print_hash: true
- name: Create Prerelease
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.latest_version }}-rc${{ github.run_number }}.dev${{ github.event.number }}
release_name: ${{ env.latest_version }}-rc${{ github.run_number }}.dev${{ github.event.number }}
body: ${{ steps.parse_changelog.outputs.LATEST_DESCRIPTION }}
draft: false
prerelease: true
65 changes: 33 additions & 32 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

Expand All @@ -19,37 +20,37 @@ jobs:
# runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10']
python-version: ['3.8', '3.9', '3.10', '3.11']
# os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
# python-version: '3.9'
- name: Install dependencies
run: |
python -m pip install .[dev]
python -m pip install .[test]
- name: Test with tox
run: |
python -m tox -e py
# echo "Passing :P"
- name: Install deploy dependencies
run: |
python -m pip install -U setuptools wheel build
if [ -f requirements-deploy.txt ]; then pip install -r requirements-deploy.txt; fi
pip install .
- name: Build package
run: |
changelog2version \
--changelog_file changelog.md \
--version_file src/changelog2version/version.py \
--version_file_type py \
--debug
python -m build .
- name: Test built package
run: |
twine check dist/*.tar.gz
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
# python-version: '3.9'
- name: Install dependencies
run: |
python -m pip install .[dev]
python -m pip install .[test]
- name: Test with tox
run: |
python -m tox -e py
# echo "Passing :P"
- name: Install deploy dependencies
run: |
python -m pip install -U setuptools wheel build
if [ -f requirements-deploy.txt ]; then pip install -r requirements-deploy.txt; fi
pip install .
- name: Build package
run: |
changelog2version \
--changelog_file changelog.md \
--version_file src/changelog2version/version.py \
--version_file_type py \
--debug
python -m build .
- name: Test built package
run: |
twine check dist/*.tar.gz
43 changes: 22 additions & 21 deletions .github/workflows/unittest.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
# this file is *not* meant to cover or endorse the use of GitHub Actions, but rather to
# help make automated releases for this project

Expand All @@ -12,24 +13,24 @@ jobs:
test-and-coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v3
with:
python-version: '3.9'
- name: Execute tests
run: |
pip install .[test]
python create_report_dirs.py
nose2 --config tests/unittest.cfg
- name: Create coverage report
run: |
coverage xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./reports/coverage/coverage.xml
flags: unittests
fail_ci_if_error: true
# path_to_write_report: ./reports/coverage/codecov_report.txt
verbose: true
- uses: actions/checkout@v2
- uses: actions/setup-python@v3
with:
python-version: '3.9'
- name: Execute tests
run: |
pip install .[test]
python create_report_dirs.py
nose2 --config tests/unittest.cfg
- name: Create coverage report
run: |
coverage xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./reports/coverage/coverage.xml
flags: unittests
fail_ci_if_error: true
# path_to_write_report: ./reports/coverage/codecov_report.txt
verbose: true
13 changes: 13 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---

extends: default

ignore:
- .tox
- .venv

rules:
line-length:
level: warning
ignore:
- .github/workflows/*
10 changes: 9 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ r"^\#\# \[\d{1,}[.]\d{1,}[.]\d{1,}\] \- \d{4}\-\d{2}-\d{2}$"
-->

## Released
## [0.10.1] - 2024-10-02
### Fixed
- add support for `Python 3.11`
- update `twine` version to `5.1.1` or newer to fix KeyError issue
- drop release testing with `Python 3.7`
- yaml syntax is correct for all workflow files

## [0.10.0] - 2023-07-08
### Added
- `--validate` argument can be used to validate an existing version file against the latest changelog entry
Expand Down Expand Up @@ -166,8 +173,9 @@ r"^\#\# \[\d{1,}[.]\d{1,}[.]\d{1,}\] \- \d{4}\-\d{2}-\d{2}$"
- Data folder after fork

<!-- Links -->
[Unreleased]: https://github.com/brainelectronics/changelog2version/compare/0.10.0...main
[Unreleased]: https://github.com/brainelectronics/changelog2version/compare/0.10.1...main

[0.10.1]: https://github.com/brainelectronics/changelog2version/tree/0.10.1
[0.10.0]: https://github.com/brainelectronics/changelog2version/tree/0.10.0
[0.9.0]: https://github.com/brainelectronics/changelog2version/tree/0.9.0
[0.8.0]: https://github.com/brainelectronics/changelog2version/tree/0.8.0
Expand Down
2 changes: 1 addition & 1 deletion requirements-deploy.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# List external packages here
# Avoid fixed versions
# # to upload package to PyPi or other package hosts
twine>=4.0.1,<5
twine>=5.1.1,<6
Loading
Loading