Skip to content

Commit

Permalink
Using rye for Python and package management
Browse files Browse the repository at this point in the history
  • Loading branch information
pchakraborty committed Aug 12, 2024
1 parent b55a27c commit 2a4f9f9
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 34 deletions.
25 changes: 14 additions & 11 deletions .github/workflows/run-formatter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,20 @@ jobs:
runs-on: ubuntu-latest
name: Format code
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.9
uses: actions/setup-python@v5

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

- name: Install rye
uses: eifinger/setup-rye@v4
with:
python-version: 3.9
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.lock
timeout-minutes: 5
enable-cache: true

- name: Sync dependencies
run: rye sync

- name: Run black
run: black --check .
run: |
source .venv/bin/activate
black --check .
timeout-minutes: 5
24 changes: 13 additions & 11 deletions .github/workflows/run-linter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,19 @@ jobs:
runs-on: ubuntu-latest
name: Lint code
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.9
uses: actions/setup-python@v5
- name: Checkout code
uses: actions/checkout@v4

- name: Install rye
uses: eifinger/setup-rye@v4
with:
python-version: 3.9
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.lock
timeout-minutes: 5
enable-cache: true

- name: Sync dependencies
run: rye sync

- name: Run pylint
run: pylint --exit-zero src/mepo
run: |
source .venv/bin/activate
pylint --exit-zero src/mepo
timeout-minutes: 5
22 changes: 10 additions & 12 deletions .github/workflows/run-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,24 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ['3.9', '3.10', '3.11', '3.12', 'pypy-3.9', 'pypy-3.10']
python-version: ["3.9", "3.10", "3.11", "3.12", "pypy@3.9", "pypy@3.10"]

name: Python ${{ matrix.python-version }} on ${{ matrix.os }}
steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Checkout code
uses: actions/checkout@v4

- name: Install dependencies
- name: Install rye
uses: eifinger/setup-rye@v4

- name: Sync dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.lock
timeout-minutes: 5
rye pin ${{ matrix.python-version }}
rye sync
- name: Run tests
run: |
export PYTHONPATH=$(pwd)/src:$PYTHONPATH
source .venv/bin/activate
python tests/test_mepo_commands.py -v
timeout-minutes: 5

0 comments on commit 2a4f9f9

Please sign in to comment.