Skip to content
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
34 changes: 11 additions & 23 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,44 +26,32 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Setup Graphviz
uses: ts-graphviz/setup-graphviz@v1
- name: Install Poetry
uses: snok/install-poetry@v1
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
version: 1.5.1
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root --all-extras
enable-cache: true
cache-suffix: "python${{ matrix.python-version }}"
- name: Install the project
run: uv sync --all-extras --dev
- name: Install old pydot for 3.7 only
if: matrix.python-version == 3.7
run: |
source .venv/bin/activate
pip install pydot==2.0.0
uv pip install pydot==2.0.0
#----------------------------------------------
# run ruff
#----------------------------------------------
- name: Linter with ruff
if: matrix.python-version == 3.12
run: |
source .venv/bin/activate
ruff check .
ruff format --check .
uv run ruff check .
uv run ruff format --check .
#----------------------------------------------
# run pytest
#----------------------------------------------
- name: Test with pytest
run: |
source .venv/bin/activate
pytest --cov-report=xml:coverage.xml
coverage xml
uv run pytest --cov-report=xml:coverage.xml
uv run coverage xml
#----------------------------------------------
# upload coverage
#----------------------------------------------
Expand Down
29 changes: 7 additions & 22 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,29 +26,14 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Setup Graphviz
uses: ts-graphviz/setup-graphviz@v1
- name: Install Poetry
uses: snok/install-poetry@v1
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
version: 1.5.1
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root --all-extras
- name: Test with pytest
run: |
source .venv/bin/activate
pytest
- name: Poetry build
enable-cache: true
- name: Install the project
run: uv sync --all-extras --dev
- name: Build
run: |
source .venv/bin/activate
poetry build
uv build
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
16 changes: 5 additions & 11 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,18 @@
# Required
version: 2

# Set the version of Python and other tools you might need
build:
os: ubuntu-22.04
os: "ubuntu-22.04"
tools:
python: "3.12"
apt_packages:
- graphviz
jobs:
post_create_environment:
# Install poetry
# https://python-poetry.org/docs/#installing-manually
- python -m pip install poetry
# Tell poetry to not use a virtual environment
- poetry config virtualenvs.create false
post_install:
# Install dependencies with 'docs' dependency group
# https://python-poetry.org/docs/managing-dependencies/#dependency-groups
- VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH poetry install --extras diagrams --with docs
- asdf plugin add uv
- asdf install uv latest
- asdf global uv latest
- UV_PROJECT_ENVIRONMENT=$READTHEDOCS_VIRTUALENV_PATH uv sync --all-extras --frozen

# Build documentation in the docs/ directory with Sphinx
sphinx:
Expand Down
Loading