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
25 changes: 15 additions & 10 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,22 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v5

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

- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Create virtual environment
run: uv venv

- name: Install requirements
run: pip install -r requirements-dev.txt
- name: isort
run: isort .
- name: black
run: black .
- name: flake8
run: flake8 .
- name: mypy
run: mypy .
run: |
uv pip install typer-invoke
uv run inv pip install dev

- name: Linting
run: uv run inv lint all
24 changes: 14 additions & 10 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,32 @@ jobs:
strategy:
matrix:
include:
- python-version: '3.12'
- python-version: '3.14'
pytest-version: 9
- python-version: '3.10'
- python-version: '3.11'
pytest-version: 7
runs-on: ubuntu-latest
name: pytest ${{ matrix.pytest-version }}
steps:
- name: Checkout code
uses: actions/checkout@v5

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '${{ matrix.python-version }}'

- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Create virtual environment
run: uv venv

- name: Install requirements
run: |
python -m pip install -U pip
python -m pip install "pytest>=${{ matrix.pytest-version }},<$(( ${{ matrix.pytest-version }} + 1 ))"
python -m pip install flit
- name: Install package
run: |
flit install
uv pip install "pytest>=${{ matrix.pytest-version }},<$(( ${{ matrix.pytest-version }} + 1 ))"
uv pip install --editable .

- name: Run tests
# Test folder(s) and other pytest options configured in `pyproject.toml`
run: |
python -m pytest .
run: uv run python -m pytest .
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,19 @@ Under [docs](https://github.com/joaonc/pytest-params/tree/main/docs):
$ pip install pytest-params
```

## Development and testing

[`uv`](https://docs.astral.sh/uv/) is required for development. Install it first, then set up
the environment:

```bash
uv venv
uv pip install -r admin/requirements/requirements-dev.txt
```

See [docs/develop.md](https://github.com/joaonc/pytest-params/blob/main/docs/develop.md) for
detailed development instructions.

## Examples
Some examples are provided here. For more examples with advanced usage, please see the test cases
under `tests`.
Expand Down
5 changes: 5 additions & 0 deletions admin/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from pathlib import Path

PROJECT_ROOT = Path(__file__).parents[1]
PROJECT_NAME = PROJECT_ROOT.name.replace('-', '_') # 'pytest_params'
SOURCE_DIR = PROJECT_ROOT / 'src' / PROJECT_NAME
Loading
Loading