Skip to content

Commit

Permalink
fixup! Adopting-ish openZIM bootstrap
Browse files Browse the repository at this point in the history
  • Loading branch information
rgaudin committed Sep 4, 2024
1 parent b2d982f commit 1c77a29
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 33 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/CI-wheels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ on:
push:
branches:
- main
- windows

env:
LIBZIM_DL_VERSION: "9.2.3-2"
MACOSX_DEPLOYMENT_TARGET: "12.0"
CIBW_ENVIRONMENT_PASS_LINUX: "LIBZIM_DL_VERSION"
PROFILE: "0"
CIBW_ENVIRONMENT_PASS_LINUX: "LIBZIM_DL_VERSION PROFILE"
CIBW_BUILD_VERBOSITY: "3"


Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/Publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ on:
env:
LIBZIM_DL_VERSION: "9.2.3-2"
MACOSX_DEPLOYMENT_TARGET: "12.0"
CIBW_ENVIRONMENT_PASS_LINUX: "LIBZIM_DL_VERSION"
PROFILE: "0"
CIBW_ENVIRONMENT_PASS_LINUX: "LIBZIM_DL_VERSION PROFILE"
# APPLE_SIGNING_KEYCHAIN_PATH set in prepare keychain step
APPLE_SIGNING_KEYCHAIN_PROFILE: "build-profile"
APPLE_SIGNING_IDENTITY: "${{ secrets.APPLE_SIGNING_IDENTITY }}"
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/QA.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: QA
on: [push]

env:
LIBZIM_DL_VERSION: "9.2.3-2"
MACOSX_DEPLOYMENT_TARGET: "12.0"
PROFILE: "0"

jobs:
lint:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v5
with:
python-version: "3.12"
architecture: x64

- name: Install dependencies (and project)
run: |
pip install -U pip
pip install -e .[lint,scripts,test,check]
- name: Check black formatting
run: inv lint-black

- name: Check ruff
run: inv lint-ruff

# disabled until we add stubs so it has some use
# - name: Check pyright
# run: inv check-pyright
38 changes: 10 additions & 28 deletions .github/workflows/Tests.yaml
Original file line number Diff line number Diff line change
@@ -1,28 +1,13 @@
name: test
name: Tests
on: [push]

env:
LIBZIM_DL_VERSION: "9.2.3-2"
MACOSX_DEPLOYMENT_TARGET: "12.0"
# on by default now but shows intent
PROFILE: "1"

jobs:
lint:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v5
with:
python-version: "3.12"
architecture: x64

- name: Check formatting and linting
run: |
pip install -U invoke
invoke install-dev
invoke check
test:
runs-on: ${{ matrix.os }}
strategy:
Expand All @@ -39,25 +24,22 @@ jobs:
python-version: ${{ matrix.python }}
architecture: x64

- name: Installing dependencies
run: pip install -U pip setuptools build

- name: Building & installing for tests (with profiling)
env:
PROFILE: 1
run: pip install -e .
- name: Install dependencies (and project)
run: |
pip install -U pip
pip install -e .[test,scripts]
- name: move DLLs next to wrapper
if: matrix.os == 'windows-2022'
run: Move-Item -Force -Path .\libzim\*.dll -Destination .\

- name: Testing
run: |
pip install pytest pytest-cov cython
py.test --cov=libzim --cov-report=term --cov-report term-missing .
- name: Run the tests
run: inv coverage --args "-vvv"

- name: Upload coverage report to codecov
if: matrix.os == 'ubuntu-22.04' && matrix.python == '3.11'
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ Users on other platforms can install the source distribution (see [Building](#Bu
```sh
git clone git@github.com:openzim/python-libzim.git && cd python-libzim
# python -m venv env && source env/bin/activate
pip install -U setuptools invoke
invoke download-libzim install-dev build-ext test
pip install -e .
# invoke --list for available development helpers
```

Expand Down

0 comments on commit 1c77a29

Please sign in to comment.