Skip to content
Open
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
24 changes: 14 additions & 10 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches: [master]
paths:
- 'src/**'
- 'tests/**'

jobs:
test:
Expand All @@ -17,28 +18,31 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

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

- name: Cache pip dependencies
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-

- name: Install package in editable mode
run: |
pip install --upgrade pip
pip install -e .

- name: Install testing and linting tools
run: pip install pytest flake8 mypy
run: pip install pytest flake8

- name: Cache pip dependencies
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Lint with flake8
run: flake8 src/ --max-line-length=120 --count --select=E9,F63,F7,F82 --show-source --statistics

- name: Run pytest
run: pytest tests/
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CBBpy.egg-info/
*.egg-info/
*.ipynb
*.pyc
.ipynb_checkpoints/
Expand All @@ -10,4 +10,5 @@ __pycache__/
build/
dist/
*.log
*.xlsx
*.xlsx
.vscode/
6 changes: 6 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ dependencies = [
]
requires-python = ">=3.9"

[project.optional-dependencies]
dev = [
"pytest>=7.0.0",
"flake8>=6.0.0",
]

[project.urls]
homepage = "https://github.com/dcstats/CBBpy/"
issues = "https://github.com/dcstats/CBBpy/issues"
Expand Down
Loading