Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub Actions maintenance #173

Merged
merged 7 commits into from
Apr 29, 2024
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
12 changes: 8 additions & 4 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,16 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up Python 3.8
uses: actions/setup-python@v2
- name: Set up Python 3.11 with uv
uses: drivendataorg/setup-python-uv-action@v1
with:
python-version: 3.8
python-version: 3.11

- name: Install dependencies
run: |
uv pip install -r dev-requirements.txt

- name: Build examples and docs
run: |
Expand Down
11 changes: 5 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,16 @@ jobs:

steps:

- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
- name: Set up Python 3.11 with uv
uses: drivendataorg/setup-python-uv-action@v1
with:
python-version: 3.7
python-version: 3.11

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r dev-requirements.txt
uv pip install -r dev-requirements.txt
- name: Build package
id: build_package
Expand Down
37 changes: 17 additions & 20 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,16 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up Python 3.8
uses: actions/setup-python@v2
- name: Set up Python 3.11 with uv
uses: drivendataorg/setup-python-uv-action@v1
with:
python-version: 3.8
python-version: 3.11

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r dev-requirements.txt
uv pip install -r dev-requirements.txt

- name: Lint package
run: |
Expand All @@ -40,28 +39,27 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.7, 3.8, 3.9, "3.10"]
python-version: [3.8, 3.9, "3.10", "3.11", "3.12"]

steps:

- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
- name: Set up Python ${{ matrix.python-version }} with uv
uses: drivendataorg/setup-python-uv-action@v1
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r dev-requirements.txt
uv pip install -r dev-requirements.txt

- name: Test Package
run: |
make test

- name: Upload coverage to codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
Expand All @@ -71,21 +69,20 @@ jobs:
- name: Build distribution and test installation
shell: bash
run: |
uv pip install setuptools # Need this because we still use setup.py
make dist
if [[ ${{ matrix.os }} == "windows-latest" ]]; then
PYTHON_BIN=Scripts/python
PYTHON_BIN=Scripts/python.exe
else
PYTHON_BIN=bin/python
fi
echo "=== Testing wheel installation ==="
python -m venv .venv-whl
.venv-whl/$PYTHON_BIN -m pip install --upgrade pip
.venv-whl/$PYTHON_BIN -m pip install dist/deon-*.whl
uv virtualenv .venv-whl --seed
uv pip install dist/deon-*.whl --python=.venv-whl/$PYTHON_BIN
.venv-whl/$PYTHON_BIN -m deon --help
echo "=== Testing source installation ==="
python -m venv .venv-sdist
.venv-sdist/$PYTHON_BIN -m pip install --upgrade pip
.venv-sdist/$PYTHON_BIN -m pip install dist/deon-*.tar.gz --force-reinstall
uv virtualenv .venv-sdist --seed
uv pip install dist/deon-*.tar.gz --python=.venv-sdist/$PYTHON_BIN
.venv-sdist/$PYTHON_BIN -m deon --help

- name: Test Building Docs
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
reqs:
pip install -r dev-requirements.txt

examples: reqs
examples:
deon --output examples/ethics.md --overwrite
deon --output examples/ethics.ipynb --overwrite
deon --output examples/ethics.html --overwrite
Expand Down
3 changes: 2 additions & 1 deletion tests/test_cli.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import pytest
import subprocess
import sys
import itertools as it
from click.testing import CliRunner

Expand Down Expand Up @@ -42,7 +43,7 @@ def test_cli_output(runner, checklist, tmpdir, test_format_configs, arg):
@pytest.mark.parametrize(
"call,format",
it.product(
[["deon"], ["python", "-m", "deon"]],
[["deon"], [sys.executable, "-m", "deon"]],
["ascii", "html", "jupyter", "markdown", "rmarkdown", "rst"],
),
)
Expand Down
Loading