Skip to content

Commit

Permalink
test new pyproject
Browse files Browse the repository at this point in the history
  • Loading branch information
Davidham3 committed Dec 20, 2024
1 parent e54c0e1 commit 6d00abc
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 29 deletions.
48 changes: 20 additions & 28 deletions .github/workflows/test_trajdl_vtag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
13 changes: 12 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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"]}

0 comments on commit 6d00abc

Please sign in to comment.