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
6 changes: 3 additions & 3 deletions .github/workflows/main_coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ jobs:
fetch-depth: 2

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.10'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox tox-gh-actions pytest-cov
pip install --upgrade pip
pip install tox tox-uv

- name: Run tests
run: tox run -e py310 -- --cov matplot2tikz --cov-branch --cov-report=xml
Expand Down
38 changes: 17 additions & 21 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,26 @@ on:

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
include:
- python-version: '3.9'
os: ubuntu-latest
tox-env: lint
# Run on a single, standard runner
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python 3.11
# We just need one modern Python version to run the 'tox' command itself.
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
python-version: "3.11"

- name: Install Tox and tox-uv
# Install the required tools into the workflow runner environment
run: |
python -m pip install --upgrade pip
pip install tox tox-gh-actions
- name: Test with tox
pip install --upgrade pip
pip install tox tox-uv

- name: Run All Tox Environments
# The 'tox' command executes the full matrix (py310, py311, etc.)
# defined in tox.ini. tox-uv handles the fast installation.
run: tox
env:
# Pass the current matrix Python version to tox-gh-actions
# so it can filter the tox environments
TOX_GH_ACTIONS_MATRIX_PYTHON_VERSION: ${{ matrix.python-version }}
TOX_GH_ACTIONS_TOX_ENV: ${{ matrix.tox-env || '' }}
36 changes: 16 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,35 +219,31 @@ For contributing, follow these steps:
1. Download the git repository, e.g., using
`git clone git@github.com:ErwindeGelder/matplot2tikz.git`.
2. Create a virtual environment, e.g., using `python -m venv venv`.
3. Activate the virtual environment (e.g., on Windows, `venv\Scripts\activate.bat`).
4. Install the necessary libraries using `pip install -e .[dev]`.
3. Activate the virtual environment (e.g., on Windows, `venv\Scripts\activate`).
4. Install `uv` using `pip install uv` and then `tox-uv` using `uv pip install tox-uv`.
5. The main branch is protected, meaning that you cannot directly push changes to this branch.
Therefore, if you want to make changes, do so in a seperate branch. For example, you can create
a new branch using `git checkout -b feature/my_awesome_new_feature`.
6. Before pushing changes, ensure that the code adheres to the linting rules and that the tests are
successful. To run the linting and testing, tox first needs to know where it can find the
different Python versions that are supported. One way to do so is by making use of pyenv or
pyenv-win. Note that you only need to do this once for a single machine.
7. Run `tox`. This does a linting check and runs all test scripts. To manually perform these steps,
use the following commands (note that to ensure the same output is generated, Python 3.9 is used
in step 2 above):
1. Run `tox -e lint`. If issues arise, fix them. You can do the linting commands manually
using:
1. `ruff format . --check` (remove the `--check` flag to let `ruff` do the formatting)
2. `ruff check .`
3. `mypy .`
2. Run `tox -e py39`.
3. Run `tox -e py310`.
4. Run `tox -e py311`.
5. Run `tox -e py312`.
6. Run `tox -e py313`.
successful. Run `tox`. This does a linting check and runs all test scripts. To manually perform
these steps, use the following commands:
1. Run `tox -e lint`. You can do the linting commands manually using:
1. (One time) `uv pip install -r requirements-lint.txt`
2. `ruff format . --check` (remove the `--check` flag to let `ruff` do the formatting)
3. `ruff check .`
4. `mypy .`
2. Run `tox -e py310`.
3. Run `tox -e py311`.
4. Run `tox -e py312`.
5. Run `tox -e py313`.
6. Run `tox -e py314`.
7. Run `tox -e combine-test-reports`
8. Check if the tests covered everything using the coverage report in
7. Check if the tests covered everything using the coverage report in
`/reports/coverage_html/index.html`.

NOTE: Currently, now all code is covered. Ideally, all code is covered, but for now, ensure that
all *new* code is covered by the testing.
9. Push changes to GitHub. If everything is OK and you want to merge your changes to the `main`
8. Push changes to GitHub. If everything is OK and you want to merge your changes to the `main`
branch, create a pull request.
Ideally, there is at least one reviewer who reviews the pull request before the merge.

Expand Down
7 changes: 4 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ readme = "README.md"
license = "MIT"
keywords = ["latex", "tikz", "matplotlib", "graphics"]
dynamic = ["version"]
requires-python = ">=3.9"
requires-python = ">=3.10"
dependencies = [
"matplotlib >= 1.4.0",
"numpy",
Expand All @@ -23,11 +23,11 @@ authors = [
]
classifiers=[
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
]

# Enables the usage of setuptools_scm
Expand All @@ -43,6 +43,7 @@ test = [
"pytest-cov>=6.0.0",
"coverage[toml]>=7.0.0",
"typeguard>=4.4.0",
"pandas",
]
dev = [
"tox",
Expand All @@ -61,7 +62,7 @@ src = ["src"]
extend-exclude = [
"conf.py",
]
target-version = "py39"
target-version = "py310"
lint.select = ["ALL"]
lint.ignore = [
"COM812", # Conflicts with the formatter
Expand Down
75 changes: 75 additions & 0 deletions requirements-310.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# This file was autogenerated by uv via the following command:
# uv pip compile pyproject.toml --extra test --resolution highest --python 3.10 -o requirements-310.txt
colorama==0.4.6
# via pytest
contourpy==1.3.2
# via matplotlib
coverage==7.11.0
# via
# matplot2tikz (pyproject.toml)
# pytest-cov
cycler==0.12.1
# via matplotlib
exceptiongroup==1.3.0
# via pytest
fonttools==4.60.1
# via matplotlib
iniconfig==2.3.0
# via pytest
kiwisolver==1.4.9
# via matplotlib
matplotlib==3.10.7
# via matplot2tikz (pyproject.toml)
numpy==2.2.6
# via
# matplot2tikz (pyproject.toml)
# contourpy
# matplotlib
# pandas
packaging==25.0
# via
# matplotlib
# pytest
pandas==2.3.3
# via matplot2tikz (pyproject.toml)
pillow==12.0.0
# via
# matplot2tikz (pyproject.toml)
# matplotlib
pluggy==1.6.0
# via
# pytest
# pytest-cov
pygments==2.19.2
# via pytest
pyparsing==3.2.5
# via matplotlib
pytest==8.4.2
# via
# matplot2tikz (pyproject.toml)
# pytest-cov
pytest-cov==7.0.0
# via matplot2tikz (pyproject.toml)
python-dateutil==2.9.0.post0
# via
# matplotlib
# pandas
pytz==2025.2
# via pandas
six==1.17.0
# via python-dateutil
tomli==2.3.0
# via
# coverage
# pytest
typeguard==4.4.4
# via matplot2tikz (pyproject.toml)
typing-extensions==4.15.0
# via
# matplot2tikz (pyproject.toml)
# exceptiongroup
# typeguard
tzdata==2025.2
# via pandas
webcolors==24.11.1
# via matplot2tikz (pyproject.toml)
70 changes: 70 additions & 0 deletions requirements-311.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# This file was autogenerated by uv via the following command:
# uv pip compile pyproject.toml --extra test --resolution highest --python 3.11 -o requirements-311.txt
colorama==0.4.6
# via pytest
contourpy==1.3.3
# via matplotlib
coverage==7.11.0
# via
# matplot2tikz (pyproject.toml)
# pytest-cov
cycler==0.12.1
# via matplotlib
fonttools==4.60.1
# via matplotlib
iniconfig==2.3.0
# via pytest
kiwisolver==1.4.9
# via matplotlib
matplotlib==3.10.7
# via matplot2tikz (pyproject.toml)
numpy==2.3.4
# via
# matplot2tikz (pyproject.toml)
# contourpy
# matplotlib
# pandas
packaging==25.0
# via
# matplotlib
# pytest
pandas==2.3.3
# via matplot2tikz (pyproject.toml)
pillow==12.0.0
# via
# matplot2tikz (pyproject.toml)
# matplotlib
pluggy==1.6.0
# via
# pytest
# pytest-cov
pygments==2.19.2
# via pytest
pyparsing==3.2.5
# via matplotlib
pytest==8.4.2
# via
# matplot2tikz (pyproject.toml)
# pytest-cov
pytest-cov==7.0.0
# via matplot2tikz (pyproject.toml)
python-dateutil==2.9.0.post0
# via
# matplotlib
# pandas
pytz==2025.2
# via pandas
six==1.17.0
# via python-dateutil
tomli==2.3.0
# via coverage
typeguard==4.4.4
# via matplot2tikz (pyproject.toml)
typing-extensions==4.15.0
# via
# matplot2tikz (pyproject.toml)
# typeguard
tzdata==2025.2
# via pandas
webcolors==24.11.1
# via matplot2tikz (pyproject.toml)
68 changes: 68 additions & 0 deletions requirements-312.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# This file was autogenerated by uv via the following command:
# uv pip compile pyproject.toml --extra test --resolution highest --python 3.12 -o requirements-312.txt
colorama==0.4.6
# via pytest
contourpy==1.3.3
# via matplotlib
coverage==7.11.0
# via
# matplot2tikz (pyproject.toml)
# pytest-cov
cycler==0.12.1
# via matplotlib
fonttools==4.60.1
# via matplotlib
iniconfig==2.3.0
# via pytest
kiwisolver==1.4.9
# via matplotlib
matplotlib==3.10.7
# via matplot2tikz (pyproject.toml)
numpy==2.3.4
# via
# matplot2tikz (pyproject.toml)
# contourpy
# matplotlib
# pandas
packaging==25.0
# via
# matplotlib
# pytest
pandas==2.3.3
# via matplot2tikz (pyproject.toml)
pillow==12.0.0
# via
# matplot2tikz (pyproject.toml)
# matplotlib
pluggy==1.6.0
# via
# pytest
# pytest-cov
pygments==2.19.2
# via pytest
pyparsing==3.2.5
# via matplotlib
pytest==8.4.2
# via
# matplot2tikz (pyproject.toml)
# pytest-cov
pytest-cov==7.0.0
# via matplot2tikz (pyproject.toml)
python-dateutil==2.9.0.post0
# via
# matplotlib
# pandas
pytz==2025.2
# via pandas
six==1.17.0
# via python-dateutil
typeguard==4.4.4
# via matplot2tikz (pyproject.toml)
typing-extensions==4.15.0
# via
# matplot2tikz (pyproject.toml)
# typeguard
tzdata==2025.2
# via pandas
webcolors==24.11.1
# via matplot2tikz (pyproject.toml)
Loading