Skip to content

Commit

Permalink
refactor(lib): from two modules to one
Browse files Browse the repository at this point in the history
Poetry, and Python is general, is bad at handling monorepos. So we move from two packages to one, that is fully build with maturin. We also now use PDM instead of Poetry.
  • Loading branch information
jeertmans committed Jan 4, 2024
1 parent b6dfd8d commit 6928581
Show file tree
Hide file tree
Showing 58 changed files with 4,282 additions and 4,879 deletions.
24 changes: 0 additions & 24 deletions .bumpversion.cfg

This file was deleted.

25 changes: 9 additions & 16 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,21 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install Poetry
run: pipx install poetry

- name: Build DiffeRT-core
uses: PyO3/maturin-action@v1
- name: Install PDM
uses: pdm-project/setup-pdm@v3
with:
command: build
working-directory: differt-core
sccache: true
python-version: '3.11'
cache: true

- name: Install Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: poetry
- name: Install Rust
uses: dtolnay/rust-toolchain@stable

- name: Install Differt
- name: Install dependencies
run: |
poetry install --with test
pdm install -G test,github-action
- name: Run pytest and coverage
run: poetry run pytest --cov-report xml --cov=differt tests/
run: pdm run pytest --cov-report xml --cov=differt tests/

- name: Upload to codecov.io
uses: codecov/codecov-action@v3
Expand Down
27 changes: 10 additions & 17 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,32 +34,25 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install Poetry
run: pipx install poetry

- name: Install Python
uses: actions/setup-python@v4
- name: Install PDM
uses: pdm-project/setup-pdm@v3
with:
python-version: '3.10'
cache: poetry
python-version: '3.11'
cache: true

- name: Build DiffeRT-core
uses: PyO3/maturin-action@v1
with:
command: build
working-directory: differt-core
sccache: true
- name: Install Rust
uses: dtolnay/rust-toolchain@stable

- name: Install Differt
- name: Install dependencies
run: |
poetry install --with docs,github-action
pdm install -G docs,github-action
- name: Add Jupyter Kernel
run: |
poetry run python -m ipykernel install --user --name DiffeRT
pdm run python -m ipykernel install --user --name DiffeRT
- name: Build docs
run: cd docs && poetry run make html
run: cd docs && pdm run make html

- name: Upload artifact
if: github.event_name != 'pull_request'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
name: Publish differt-core Python Package

name: Publish Python Package
on:
push:
branches:
Expand All @@ -11,10 +10,6 @@ on:
permissions:
contents: read

defaults:
run:
working-directory: differt-core

jobs:
linux:
runs-on: ubuntu-latest
Expand All @@ -23,7 +18,7 @@ jobs:
target: [x86_64, x86, aarch64, armv7, s390x, ppc64le]
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install Python
uses: actions/setup-python@v4
Expand All @@ -33,7 +28,6 @@ jobs:
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
working-directory: differt-core
target: ${{ matrix.target }}
args: --release --out dist --find-interpreter
sccache: 'true'
Expand All @@ -43,7 +37,7 @@ jobs:
uses: actions/upload-artifact@v3
with:
name: wheels
path: differt-core/dist
path: dist

windows:
runs-on: windows-latest
Expand All @@ -52,7 +46,7 @@ jobs:
target: [x64, x86]
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install Python
uses: actions/setup-python@v4
Expand All @@ -63,7 +57,6 @@ jobs:
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
working-directory: differt-core
target: ${{ matrix.target }}
args: --release --out dist --find-interpreter
sccache: 'true'
Expand All @@ -72,7 +65,7 @@ jobs:
uses: actions/upload-artifact@v3
with:
name: wheels
path: differt-core/dist
path: dist

macos:
runs-on: macos-latest
Expand All @@ -81,7 +74,7 @@ jobs:
target: [x86_64, aarch64]
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install Python
uses: actions/setup-python@v4
Expand All @@ -91,7 +84,6 @@ jobs:
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
working-directory: differt-core
target: ${{ matrix.target }}
args: --release --out dist --find-interpreter
sccache: 'true'
Expand All @@ -100,26 +92,25 @@ jobs:
uses: actions/upload-artifact@v3
with:
name: wheels
path: differt-core/dist
path: dist

sdist:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Build sdist
uses: PyO3/maturin-action@v1
with:
command: sdist
working-directory: differt-core
args: --out dist

- name: Upload sdist
uses: actions/upload-artifact@v3
with:
name: wheels
path: differt-core/dist
path: dist

release:
name: Release
Expand Down
45 changes: 0 additions & 45 deletions .github/workflows/publish_differt.yml

This file was deleted.

Loading

0 comments on commit 6928581

Please sign in to comment.