Skip to content

Try to simplify some of the CI and add support for Python 3.13 #1339

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

Merged
merged 5 commits into from
Oct 23, 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
7 changes: 4 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
name: CI

on: [push, pull_request]
on: [ push, pull_request ]

jobs:
ci:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
os: [ ubuntu-latest, macos-latest, windows-latest ]
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12", "3.13" ]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
Expand All @@ -22,6 +22,7 @@ jobs:
uses: actions/setup-python@v5 # https://github.com/actions/setup-python
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- name: Install python prerequisites
run: pip install -U --user pip setuptools setuptools-scm nox
- name: Run tests and post coverage results
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
name: Doc

on: [push, pull_request]
on: [ push, pull_request, workflow_dispatch ]

permissions:
contents: read
Expand All @@ -11,8 +11,8 @@ jobs:
doc:
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.12"]
os: [ ubuntu-latest ]
python-version: [ "3.12" ]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
Expand Down
19 changes: 4 additions & 15 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,13 @@ permissions:
contents: read

jobs:
lint:
strategy:
matrix:
os: [ ubuntu-latest ]
python-version: [ "3.12" ]
fail-fast: false
runs-on: ${{ matrix.os }}
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4 # https://github.com/actions/checkout
with:
# Only a single commit is fetched by default, for the ref/SHA that triggered the workflow.
# Set fetch-depth: 0 to fetch all history for all branches and tags.
fetch-depth: 0 # Needed for setuptools_scm to work correctly
- name: Set up Python
uses: actions/setup-python@v5 # https://github.com/actions/setup-python
with:
python-version: ${{ matrix.python-version }}
- name: Install python prerequisites
run: pip install -U --user ruff
- name: Ruff format
run: ruff format --check
- run: pip install --user ruff
- run: ruff format --check
17 changes: 3 additions & 14 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,12 @@ permissions:

jobs:
lint:
strategy:
matrix:
os: [ ubuntu-latest ]
python-version: [ "3.12" ]
fail-fast: false
runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4 # https://github.com/actions/checkout
with:
# Only a single commit is fetched by default, for the ref/SHA that triggered the workflow.
# Set fetch-depth: 0 to fetch all history for all branches and tags.
fetch-depth: 0 # Needed for setuptools_scm to work correctly
- name: Set up Python
uses: actions/setup-python@v5 # https://github.com/actions/setup-python
with:
python-version: ${{ matrix.python-version }}
- name: Install python prerequisites
run: pip install -U --user ruff
- name: Ruff lint
run: ruff check
- run: pip install --user ruff
- run: ruff check --output-format=github .
22 changes: 7 additions & 15 deletions .github/workflows/mypy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,22 @@
# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
name: MyPy

on: [push, pull_request]
on: [ push, pull_request ]

permissions:
contents: read

jobs:
mypy:
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.12"]
fail-fast: false
runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4 # https://github.com/actions/checkout
- uses: actions/setup-python@v5 # https://github.com/actions/setup-python
with:
python-version: 3.13
allow-prereleases: true
# Only a single commit is fetched by default, for the ref/SHA that triggered the workflow.
# Set fetch-depth: 0 to fetch all history for all branches and tags.
fetch-depth: 0 # Needed for setuptools_scm to work correctly
- name: Set up Python
uses: actions/setup-python@v5 # https://github.com/actions/setup-python
with:
python-version: ${{ matrix.python-version }}
- name: Install python prerequisites
run: pip install -U --user pip setuptools setuptools-scm nox
- name: MyPy
run: python -m nox --non-interactive --session validate-${{ matrix.python-version }} -k mypy # Run nox for mypy
- run: pip install -U --user pip setuptools setuptools-scm nox
- run: python -m nox --non-interactive --session validate-${{ python-version }} -k mypy # Run nox for mypy
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## 2.5.0 (TBD)
## 2.5.0 (October 22, 2024)
* Breaking Change
* `cmd2` 2.5 supports Python 3.8+ (removed support for Python 3.6 and 3.7)
* Bug Fixes
Expand All @@ -12,7 +12,7 @@
* Removed dependency on `attrs` and replaced with [dataclasses](https://docs.python.org/3/library/dataclasses.html)
* add `allow_clipboard` initialization parameter and attribute to disable ability to
add output to the operating system clipboard
* Updated unit tests to be Python 3.12 compliant.
* Updated unit tests to be Python 3.13 compliant.
* Fall back to bz2 compression of history file when lzma is not installed.
* Added settable called `scripts_add_to_history` which determines whether scripts and pyscripts
add commands to history.
Expand Down
11 changes: 8 additions & 3 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
Sphinx>=8.1.0
sphinx-autobuild>=2024.10.3
sphinx-rtd-theme>=3.0.1

pyperclip
setuptools
setuptools-scm
Sphinx
sphinx-autobuild
sphinx-rtd-theme
wcwidth
4 changes: 2 additions & 2 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def docs(session):
)


@nox.session(python=['3.8', '3.9', '3.10', '3.11', '3.12'])
@nox.session(python=['3.8', '3.9', '3.10', '3.11', '3.12', '3.13'])
@nox.parametrize('plugin', [None, 'ext_test', 'template', 'coverage'])
def tests(session, plugin):
if plugin is None:
Expand All @@ -41,7 +41,7 @@ def tests(session, plugin):
)


@nox.session(python=['3.8', '3.9', '3.10', '3.11', '3.12'])
@nox.session(python=['3.8', '3.9', '3.10', '3.11', '3.12', '3.13'])
@nox.parametrize('step', ['mypy', 'flake8'])
def validate(session, step):
session.install('invoke', './[validate]')
Expand Down
Loading