Skip to content
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
29 changes: 12 additions & 17 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,26 @@ jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Set PATH
run: echo "${HOME}/.local/bin" >> $GITHUB_PATH

- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
with:
python-version: "3.8"
enable-cache: true

- name: Install dependencies
run: |
curl -sSL https://install.python-poetry.org | python - --version 1.2.2
poetry install -E training
run: uv sync --locked --extra training

- name: Run tests
run: |
poetry run pytest
run: uv run --no-sync pytest

- name: Build wheels
run: |
poetry version $(git tag --points-at HEAD)
poetry build
uv version "$(git tag --points-at HEAD)"
uv build

- name: Upload
env:
USERNAME: __token__
PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
poetry publish --username=$USERNAME --password=$PASSWORD
UV_PUBLISH_USERNAME: __token__
UV_PUBLISH_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: uv publish
45 changes: 13 additions & 32 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,49 +10,30 @@ jobs:
python-version: [3.8, 3.9]

steps:
- name: Set PATH
run: echo "${HOME}/.local/bin" >> $GITHUB_PATH

- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
with:
python-version: ${{ matrix.python-version }}

- name: Cache pip
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }}-${{ hashFiles('poetry.lock') }}-${ GITHUB_REF }
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
enable-cache: true

- name: Install inference dependencies
run: |
curl -sSL https://install.python-poetry.org | python - --version 1.2.2
poetry install --no-root --without dev
run: uv sync --locked --no-default-groups --group test

- name: Run inference tests
run: |
poetry run pytest -s lantern --ignore lantern/early_stopping.py
run: uv run --no-sync pytest -s lantern --ignore lantern/early_stopping.py

- name: Install training dependencies
run: |
curl -sSL https://install.python-poetry.org | python - --version 1.2.2
poetry install --no-root -E training
run: uv sync --locked --extra training

- name: Run all tests
run: |
poetry run pytest -s
run: uv run --no-sync pytest -s

- name: Lint
run: |
poetry run black --check lantern
run: uv run --no-sync black --check lantern

- name: Build wheels
run: |
poetry build
run: uv build

build-docs:
runs-on: ubuntu-latest
Expand All @@ -61,14 +42,14 @@ jobs:
python-version: [3.8]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Cache pip
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('docs/source/requirements.txt') }}-${ GITHUB_REF }
Expand Down
Loading
Loading