Skip to content

Commit

Permalink
Fix: Use python venv module first and implement proper platform-speci…
Browse files Browse the repository at this point in the history
…fic paths

Co-Authored-By: ned.twigg@diffplug.com <ned.twigg@diffplug.com>
  • Loading branch information
devin-ai-integration[bot] and nedtwigg committed Dec 11, 2024
1 parent 7029186 commit a4c9689
Showing 1 changed file with 87 additions and 39 deletions.
126 changes: 87 additions & 39 deletions .github/workflows/python-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,93 +18,141 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install uv (Unix)
if: runner.os != 'Windows'

- name: Set up Python environment
shell: bash
run: |
python -m venv .venv
if [ "${{ runner.os }}" = "Windows" ]; then
. .venv/Scripts/activate
else
. .venv/bin/activate
fi
python -m pip install --upgrade pip
python -m pip install uv
uv --version
- name: Install uv (Windows)
if: runner.os == 'Windows'
shell: bash
run: |
python -m pip install --upgrade pip
python -m pip install uv
uv --version
pip install uv
- name: selfie-lib - install dependencies
shell: bash
working-directory: python/selfie-lib
run: |
uv venv
. .venv/bin/activate || . .venv/Scripts/activate
python -m pip install uv
if [ "${{ runner.os }}" = "Windows" ]; then
. ../../.venv/Scripts/activate
else
. ../../.venv/bin/activate
fi
uv pip install -r requirements.txt -r dev-requirements.txt
working-directory: python/selfie-lib
- name: selfie-lib - pytest
shell: bash
working-directory: python/selfie-lib
run: |
. .venv/bin/activate || . .venv/Scripts/activate
if [ "${{ runner.os }}" = "Windows" ]; then
. ../../.venv/Scripts/activate
else
. ../../.venv/bin/activate
fi
python -m pytest -vv
working-directory: python/selfie-lib
- name: selfie-lib - pyright
shell: bash
working-directory: python/selfie-lib
run: |
. .venv/bin/activate || . .venv/Scripts/activate
if [ "${{ runner.os }}" = "Windows" ]; then
. ../../.venv/Scripts/activate
else
. ../../.venv/bin/activate
fi
python -m pyright
working-directory: python/selfie-lib
- name: selfie-lib - ruff
shell: bash
working-directory: python/selfie-lib
run: |
. .venv/bin/activate || . .venv/Scripts/activate
if [ "${{ runner.os }}" = "Windows" ]; then
. ../../.venv/Scripts/activate
else
. ../../.venv/bin/activate
fi
python -m ruff format --check && python -m ruff check
working-directory: python/selfie-lib
- name: pytest-selfie - install dependencies
shell: bash
working-directory: python/pytest-selfie
run: |
uv venv
. .venv/bin/activate || . .venv/Scripts/activate
python -m pip install uv
if [ "${{ runner.os }}" = "Windows" ]; then
. ../../.venv/Scripts/activate
else
. ../../.venv/bin/activate
fi
uv pip install -r requirements.txt -r dev-requirements.txt
working-directory: python/pytest-selfie
- name: pytest-selfie - pyright
shell: bash
working-directory: python/pytest-selfie
run: |
. .venv/bin/activate || . .venv/Scripts/activate
if [ "${{ runner.os }}" = "Windows" ]; then
. ../../.venv/Scripts/activate
else
. ../../.venv/bin/activate
fi
python -m pyright
working-directory: python/pytest-selfie
- name: pytest-selfie - ruff
shell: bash
working-directory: python/pytest-selfie
run: |
. .venv/bin/activate || . .venv/Scripts/activate
if [ "${{ runner.os }}" = "Windows" ]; then
. ../../.venv/Scripts/activate
else
. ../../.venv/bin/activate
fi
python -m ruff format --check && python -m ruff check
working-directory: python/pytest-selfie
- name: example-pytest-selfie - install dependencies
shell: bash
working-directory: python/example-pytest-selfie
run: |
uv venv
. .venv/bin/activate || . .venv/Scripts/activate
python -m pip install uv
if [ "${{ runner.os }}" = "Windows" ]; then
. ../../.venv/Scripts/activate
else
. ../../.venv/bin/activate
fi
uv pip install -r requirements.txt -r dev-requirements.txt
working-directory: python/example-pytest-selfie
- name: example-pytest-selfie - pytest
shell: bash
working-directory: python/example-pytest-selfie
run: |
. .venv/bin/activate || . .venv/Scripts/activate
if [ "${{ runner.os }}" = "Windows" ]; then
. ../../.venv/Scripts/activate
else
. ../../.venv/bin/activate
fi
python -m pytest -vv
working-directory: python/example-pytest-selfie
- name: example-pytest-selfie - pyright
shell: bash
working-directory: python/example-pytest-selfie
run: |
. .venv/bin/activate || . .venv/Scripts/activate
if [ "${{ runner.os }}" = "Windows" ]; then
. ../../.venv/Scripts/activate
else
. ../../.venv/bin/activate
fi
python -m pyright
working-directory: python/example-pytest-selfie
- name: example-pytest-selfie - ruff
shell: bash
working-directory: python/example-pytest-selfie
run: |
. .venv/bin/activate || . .venv/Scripts/activate
if [ "${{ runner.os }}" = "Windows" ]; then
. ../../.venv/Scripts/activate
else
. ../../.venv/bin/activate
fi
python -m ruff format --check && python -m ruff check
working-directory: python/example-pytest-selfie

0 comments on commit a4c9689

Please sign in to comment.