Skip to content

Commit f1ee3c1

Browse files
authored
Try to simplify some of the CI and add support for Python 3.13 (#1339)
Try to simplify some of the CI and add support for Python 3.13
1 parent a4d1941 commit f1ee3c1

File tree

8 files changed

+33
-57
lines changed

8 files changed

+33
-57
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
33
name: CI
44

5-
on: [push, pull_request]
5+
on: [ push, pull_request ]
66

77
jobs:
88
ci:
99
strategy:
1010
matrix:
11-
os: [ubuntu-latest, macos-latest, windows-latest]
12-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
11+
os: [ ubuntu-latest, macos-latest, windows-latest ]
12+
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12", "3.13" ]
1313
fail-fast: false
1414
runs-on: ${{ matrix.os }}
1515
steps:
@@ -22,6 +22,7 @@ jobs:
2222
uses: actions/setup-python@v5 # https://github.com/actions/setup-python
2323
with:
2424
python-version: ${{ matrix.python-version }}
25+
allow-prereleases: true
2526
- name: Install python prerequisites
2627
run: pip install -U --user pip setuptools setuptools-scm nox
2728
- name: Run tests and post coverage results

.github/workflows/doc.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
33
name: Doc
44

5-
on: [push, pull_request]
5+
on: [ push, pull_request, workflow_dispatch ]
66

77
permissions:
88
contents: read
@@ -11,8 +11,8 @@ jobs:
1111
doc:
1212
strategy:
1313
matrix:
14-
os: [ubuntu-latest]
15-
python-version: ["3.12"]
14+
os: [ ubuntu-latest ]
15+
python-version: [ "3.12" ]
1616
fail-fast: false
1717
runs-on: ${{ matrix.os }}
1818
steps:

.github/workflows/format.yml

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,13 @@ permissions:
88
contents: read
99

1010
jobs:
11-
lint:
12-
strategy:
13-
matrix:
14-
os: [ ubuntu-latest ]
15-
python-version: [ "3.12" ]
16-
fail-fast: false
17-
runs-on: ${{ matrix.os }}
11+
format:
12+
runs-on: ubuntu-latest
1813
steps:
1914
- uses: actions/checkout@v4 # https://github.com/actions/checkout
2015
with:
2116
# Only a single commit is fetched by default, for the ref/SHA that triggered the workflow.
2217
# Set fetch-depth: 0 to fetch all history for all branches and tags.
2318
fetch-depth: 0 # Needed for setuptools_scm to work correctly
24-
- name: Set up Python
25-
uses: actions/setup-python@v5 # https://github.com/actions/setup-python
26-
with:
27-
python-version: ${{ matrix.python-version }}
28-
- name: Install python prerequisites
29-
run: pip install -U --user ruff
30-
- name: Ruff format
31-
run: ruff format --check
19+
- run: pip install --user ruff
20+
- run: ruff format --check

.github/workflows/lint.yml

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,12 @@ permissions:
99

1010
jobs:
1111
lint:
12-
strategy:
13-
matrix:
14-
os: [ ubuntu-latest ]
15-
python-version: [ "3.12" ]
16-
fail-fast: false
17-
runs-on: ${{ matrix.os }}
12+
runs-on: ubuntu-latest
1813
steps:
1914
- uses: actions/checkout@v4 # https://github.com/actions/checkout
2015
with:
2116
# Only a single commit is fetched by default, for the ref/SHA that triggered the workflow.
2217
# Set fetch-depth: 0 to fetch all history for all branches and tags.
2318
fetch-depth: 0 # Needed for setuptools_scm to work correctly
24-
- name: Set up Python
25-
uses: actions/setup-python@v5 # https://github.com/actions/setup-python
26-
with:
27-
python-version: ${{ matrix.python-version }}
28-
- name: Install python prerequisites
29-
run: pip install -U --user ruff
30-
- name: Ruff lint
31-
run: ruff check
19+
- run: pip install --user ruff
20+
- run: ruff check --output-format=github .

.github/workflows/mypy.yml

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,22 @@
22
# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
33
name: MyPy
44

5-
on: [push, pull_request]
5+
on: [ push, pull_request ]
66

77
permissions:
88
contents: read
99

1010
jobs:
1111
mypy:
12-
strategy:
13-
matrix:
14-
os: [ubuntu-latest]
15-
python-version: ["3.12"]
16-
fail-fast: false
17-
runs-on: ${{ matrix.os }}
12+
runs-on: ubuntu-latest
1813
steps:
1914
- uses: actions/checkout@v4 # https://github.com/actions/checkout
15+
- uses: actions/setup-python@v5 # https://github.com/actions/setup-python
2016
with:
17+
python-version: 3.13
18+
allow-prereleases: true
2119
# Only a single commit is fetched by default, for the ref/SHA that triggered the workflow.
2220
# Set fetch-depth: 0 to fetch all history for all branches and tags.
2321
fetch-depth: 0 # Needed for setuptools_scm to work correctly
24-
- name: Set up Python
25-
uses: actions/setup-python@v5 # https://github.com/actions/setup-python
26-
with:
27-
python-version: ${{ matrix.python-version }}
28-
- name: Install python prerequisites
29-
run: pip install -U --user pip setuptools setuptools-scm nox
30-
- name: MyPy
31-
run: python -m nox --non-interactive --session validate-${{ matrix.python-version }} -k mypy # Run nox for mypy
22+
- run: pip install -U --user pip setuptools setuptools-scm nox
23+
- run: python -m nox --non-interactive --session validate-${{ python-version }} -k mypy # Run nox for mypy

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## 2.5.0 (TBD)
1+
## 2.5.0 (October 22, 2024)
22
* Breaking Change
33
* `cmd2` 2.5 supports Python 3.8+ (removed support for Python 3.6 and 3.7)
44
* Bug Fixes
@@ -12,7 +12,7 @@
1212
* Removed dependency on `attrs` and replaced with [dataclasses](https://docs.python.org/3/library/dataclasses.html)
1313
* add `allow_clipboard` initialization parameter and attribute to disable ability to
1414
add output to the operating system clipboard
15-
* Updated unit tests to be Python 3.12 compliant.
15+
* Updated unit tests to be Python 3.13 compliant.
1616
* Fall back to bz2 compression of history file when lzma is not installed.
1717
* Added settable called `scripts_add_to_history` which determines whether scripts and pyscripts
1818
add commands to history.

docs/requirements.txt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1-
Sphinx>=8.1.0
2-
sphinx-autobuild>=2024.10.3
3-
sphinx-rtd-theme>=3.0.1
1+
2+
pyperclip
3+
setuptools
4+
setuptools-scm
5+
Sphinx
6+
sphinx-autobuild
7+
sphinx-rtd-theme
8+
wcwidth

noxfile.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def docs(session):
1717
)
1818

1919

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

4343

44-
@nox.session(python=['3.8', '3.9', '3.10', '3.11', '3.12'])
44+
@nox.session(python=['3.8', '3.9', '3.10', '3.11', '3.12', '3.13'])
4545
@nox.parametrize('step', ['mypy', 'flake8'])
4646
def validate(session, step):
4747
session.install('invoke', './[validate]')

0 commit comments

Comments
 (0)