Skip to content

Commit

Permalink
chore: switch to pdm for lockfile support
Browse files Browse the repository at this point in the history
  • Loading branch information
aravinda0 committed Oct 14, 2023
1 parent ef1d5d3 commit 17411d6
Show file tree
Hide file tree
Showing 5 changed files with 866 additions and 76 deletions.
62 changes: 32 additions & 30 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,35 +10,37 @@ jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11"]
fail-fast: false
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: |
3.10
- name: Set up pip cache
if: runner.os == 'Linux'
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }}
restore-keys: ${{ runner.os }}-pip-
- name: Install dependencies
run: |
sudo apt update
sudo apt install -y libpangocairo-1.0-0 libxkbcommon-dev libxcb-cursor0 xvfb libwayland-dev wayland-protocols xwayland qt6-base-dev
pip install hatch
hatch env create ci
- name: Check formatting
run: |
hatch run ci:format_check .
- name: Run tests
run: |
hatch run ci:pytest
- name: Generate coverage report
run: |
hatch run ci:cov
- name: Upload coverage reports to codecov
uses: codecov/codecov-action@v3
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Set up pip cache
if: runner.os == 'Linux'
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }}
restore-keys: ${{ runner.os }}-pip-
- name: Install dependencies
run: |
sudo apt update
sudo apt install -y libpangocairo-1.0-0 libxkbcommon-dev libxcb-cursor0 xvfb libwayland-dev wayland-protocols xwayland qt6-base-dev
pip install pdm
pdm venv create ${{ matrix.python-version }}
pdm sync
- name: Check formatting
run: |
pdm run format_check .
- name: Run tests
run: |
pdm run pytest
- name: Generate coverage report
run: |
pdm run cov
- name: Upload coverage reports to codecov
uses: codecov/codecov-action@v3
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,16 @@ ipython_config.py
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml
.pdm-python
.pdm-build/

# Celery stuff
celerybeat-schedule
celerybeat.pid
Expand Down
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ repos:
- id: check-merge-conflict
- repo: local
hooks:
- id: format
name: format
entry: hatch run default:format .
types: [python]
language: system
- id: format
name: format
entry: pdm run format .
types: [python]
language: system
Loading

0 comments on commit 17411d6

Please sign in to comment.