-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
32 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,27 +12,19 @@ jobs: | |
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ["3.10", "3.11", "3.12"] | ||
os: [ubuntu-latest] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install build-essential and make | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y build-essential ca-certificates curl libffi-dev libgdbm-dev libncurses5-dev libnss3-dev libreadline-dev libssl-dev make time wget zlib1g-dev | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
- uses: astral-sh/setup-uv@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
cache: 'pip' | ||
|
||
enable-cache: true | ||
cache-dependency-glob: "**/pyproject.toml" | ||
- name: Install PyTorch and dependencies from pyproject.toml | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install torch --index-url https://download.pytorch.org/whl/cpu | ||
python -m pip install .[dev,docs] | ||
uv pip install torch --index-url https://download.pytorch.org/whl/cpu | ||
- name: Cache datasets | ||
id: cache-datasets | ||
|
@@ -41,25 +33,25 @@ jobs: | |
path: ~/.cache/trajdl | ||
key: trajdl-cache-datasets | ||
|
||
- name: Test with pytest | ||
run: | | ||
autoflake -j 0 --remove-all-unused-imports --in-place --recursive --ignore-init-module-imports . | ||
isort -j -1 . | ||
black . | ||
pytest -s | ||
- name: Build package | ||
- uses: pypa/[email protected] | ||
env: | ||
CIBW_ENABLE: cpython-prerelease | ||
CIBW_ARCHS_WINDOWS: auto ARM64 | ||
|
||
# - name: Build SDist | ||
# run: | | ||
# if [ "${{ matrix.python-version }}" = "3.12" ]; then | ||
# python -m build --sdist | ||
# fi | ||
|
||
- name: Check wheels | ||
run: | | ||
if [ "${{ matrix.python-version }}" = "3.12" ]; then | ||
python -m build | ||
else | ||
python -m build --wheel | ||
fi | ||
ls wheelhouse | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: dist-${{ github.ref_name }}-${{ github.sha }}-${{ matrix.python-version }} | ||
path: dist/ | ||
path: wheelhouse/*.whl | ||
retention-days: 1 | ||
overwrite: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ maintainers = [ | |
{ name = "Chao Song", email = "[email protected]" }, | ||
{ name = "Chaoqun Feng", email = "[email protected]" }, | ||
] | ||
requires-python = ">=3.10" | ||
requires-python = ">=3.10,<3.13" | ||
|
||
dependencies = [ | ||
"scikit-learn>=1.3.2", | ||
|
@@ -88,3 +88,14 @@ docs = [ | |
# pytest configuration | ||
[tool.pytest.ini_options] | ||
addopts = "-p no:warnings --cov=trajdl --cov-report html --durations=10" | ||
|
||
[tool.scikit-build] | ||
wheel.expand-macos-universal-tags = true | ||
|
||
[tool.cibuildwheel] | ||
before-all = "uname -a" | ||
build-frontend = "build[uv]" | ||
test-command = "pytest {project}/tests" | ||
|
||
[tool.cibuildwheel.pyodide] | ||
build-frontend = {name = "build", args = ["--exports", "whole_archive"]} |