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

CI: port Ubuntu tests away from setup.py #375

Merged
merged 1 commit into from
Sep 2, 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
45 changes: 17 additions & 28 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,40 +88,29 @@ jobs:
run: |
sudo apt-get update -q
sudo apt-get install -y libcairo2-dev ninja-build
python -m pip install --upgrade setuptools
python -m pip install --upgrade pytest flake8 coverage hypothesis wheel poetry meson
python -m pip install --upgrade pygame || true

- name: Build & Test with setuptools
run: |
export CFLAGS="-Werror -coverage"
PYTHONDEVMODE=1 python -m coverage run --branch setup.py test
python -m coverage xml -i
python setup.py sdist
python setup.py bdist_wheel
python setup.py install --root="$(pwd)"/_root_abs

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4

- name: Build & Install with pip
run: |
git clean -xfdf
python -m pip install .
pipx install poetry
pipx install meson
poetry install
poetry run pip install --upgrade pygame || true
poetry run pip install --upgrade numpy || true

- name: Build & Test with meson
run: |
git clean -xfdf
meson --werror _build
meson compile -C _build
meson test -v -C _build
poetry run meson --werror _build
poetry run meson compile -C _build
poetry run meson test -v -C _build
rm -Rf _build

- name: Build & Test with poetry
if: ${{ matrix.python-version != 'pypy-3.10' }}
run: |
git clean -xfdf
poetry install
poetry run python setup.py test
export CFLAGS="-Werror -coverage"
export PYTHONDEVMODE=1
poetry run pip install -e .
poetry run coverage run --branch -m pytest
poetry run coverage xml -i

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4

- name: Run linters
if: ${{ matrix.python-version != 'pypy-3.10' }}
Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
ignore=E402,E741
builtins=buffer,unichr
max-line-length = 100
exclude = build

[coverage:run]
include=
Expand Down
2 changes: 1 addition & 1 deletion tests/test_typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

def test_typing():
mod = types.ModuleType("cairo")
stub = os.path.join(cairo.__path__[0], "__init__.pyi")
stub = os.path.join(os.path.dirname(cairo.__file__), "__init__.pyi")
with open(stub, encoding="utf-8") as h:
code = compile(h.read(), stub, "exec")
exec(code, mod.__dict__)
Expand Down
Loading