Skip to content

Commit 524df07

Browse files
committed
Merge branch 'release/2.2.0'
2 parents dbfc4e9 + 45427e5 commit 524df07

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+1894
-1313
lines changed

.github/workflows/codesee-arch-diagram.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.

.github/workflows/python-package.yml

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
strategy:
1616
fail-fast: false
1717
matrix:
18-
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
18+
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
1919

2020
steps:
2121
- uses: actions/checkout@v3
@@ -46,18 +46,11 @@ jobs:
4646
# run ruff
4747
#----------------------------------------------
4848
- name: Linter with ruff
49-
if: matrix.python-version == 3.11
49+
if: matrix.python-version == 3.12
5050
run: |
5151
source .venv/bin/activate
52-
ruff .
53-
#----------------------------------------------
54-
# run black
55-
#----------------------------------------------
56-
- name: Linter with black
57-
if: matrix.python-version == 3.11
58-
run: |
59-
source .venv/bin/activate
60-
black . --check --diff
52+
ruff check .
53+
ruff format --check .
6154
#----------------------------------------------
6255
# run pytest
6356
#----------------------------------------------
@@ -70,8 +63,8 @@ jobs:
7063
# upload coverage
7164
#----------------------------------------------
7265
- name: Upload coverage to Codecov
73-
uses: codecov/codecov-action@v3
74-
if: matrix.python-version == 3.11
66+
uses: codecov/codecov-action@v4
67+
if: matrix.python-version == 3.12
7568
with:
7669
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
7770
directory: .

.github/workflows/release.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
on:
2+
push:
3+
tags: [ 'v?*.*.*' ]
4+
name: release
5+
6+
jobs:
7+
pypi-publish:
8+
name: upload release to PyPI
9+
runs-on: ubuntu-latest
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
python-version: ["3.12"]
14+
15+
# Specifying a GitHub environment is optional, but strongly encouraged
16+
environment: release
17+
permissions:
18+
# IMPORTANT: this permission is mandatory for trusted publishing
19+
id-token: write
20+
steps:
21+
- uses: actions/checkout@v3
22+
- run: git fetch origin develop
23+
- name: Set up Python ${{ matrix.python-version }}
24+
uses: actions/setup-python@v4
25+
with:
26+
python-version: ${{ matrix.python-version }}
27+
- name: Install Poetry
28+
uses: snok/install-poetry@v1
29+
with:
30+
version: 1.5.1
31+
virtualenvs-create: true
32+
virtualenvs-in-project: true
33+
installer-parallel: true
34+
- name: Load cached venv
35+
id: cached-poetry-dependencies
36+
uses: actions/cache@v3
37+
with:
38+
path: .venv
39+
key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}
40+
- name: Install dependencies
41+
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
42+
run: poetry install --no-interaction --no-root
43+
- name: Test with pytest
44+
run: |
45+
source .venv/bin/activate
46+
pytest
47+
- name: Poetry build
48+
run: |
49+
source .venv/bin/activate
50+
poetry build
51+
- name: Publish package distributions to PyPI
52+
uses: pypa/gh-action-pypi-publish@release/v1

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,3 +78,4 @@ target/
7878
# Sphinx-galery
7979
docs/auto_examples/sg_execution_times.*
8080
docs/auto_examples/*.pickle
81+
docs/sg_execution_times.rst

.pre-commit-config.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ repos:
99
exclude: docs/auto_examples
1010
- repo: https://github.com/charliermarsh/ruff-pre-commit
1111
# Ruff version.
12-
rev: 'v0.0.257'
12+
rev: v0.3.7
1313
hooks:
14+
# Run the linter.
1415
- id: ruff
15-
- repo: https://github.com/psf/black
16-
rev: 22.10.0
17-
hooks:
18-
- id: black
16+
args: [ --fix ]
17+
# Run the formatter.
18+
- id: ruff-format
1919

2020
- repo: local
2121
hooks:

.readthedocs.yaml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,23 @@ version: 2
77

88
# Set the version of Python and other tools you might need
99
build:
10-
os: ubuntu-20.04
10+
os: ubuntu-22.04
1111
tools:
12-
python: "3.11"
12+
python: "3.12"
1313
apt_packages:
1414
- graphviz
1515
jobs:
1616
post_create_environment:
1717
# Install poetry
1818
# https://python-poetry.org/docs/#installing-manually
19-
- pip install poetry
19+
- python -m pip install poetry
2020
# Tell poetry to not use a virtual environment
2121
- poetry config virtualenvs.create false
22+
post_install:
2223
# Install dependencies with 'docs' dependency group
2324
# https://python-poetry.org/docs/managing-dependencies/#dependency-groups
24-
- poetry install --extras diagrams --with docs
25+
- VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH poetry install --extras diagrams --with docs
2526

2627
# Build documentation in the docs/ directory with Sphinx
2728
sphinx:
2829
configuration: docs/conf.py
29-
30-
python:
31-
install:
32-
- requirements: docs/requirements.txt

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666

6767
# General information about the project.
6868
project = "Python State Machine"
69-
copyright = "2023, Fernando Macedo"
69+
copyright = "2024, Fernando Macedo"
7070

7171
# The version info for the project you're documenting, acts as replacement
7272
# for |version| and |release|, also used in various other places throughout

docs/diagram.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ A handy shortcut to have the graph representation:
8787
8888
```py
8989
>>> machine._graph()
90-
<pydot.Dot ...
90+
<pydot.core.Dot ...
9191
9292
```
9393

7.61 KB
Loading
2.73 KB
Loading

0 commit comments

Comments
 (0)