Skip to content

Commit

Permalink
Use uv for project management
Browse files Browse the repository at this point in the history
  • Loading branch information
albireox committed Jan 14, 2025
1 parent f470428 commit fe47755
Show file tree
Hide file tree
Showing 7 changed files with 2,325 additions and 3,013 deletions.
25 changes: 13 additions & 12 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,34 @@
name: Linting
name: Lint

on:
push:
paths-ignore:
- 'docs/**'
- '**/*.md'
pull_request:
paths-ignore:
- 'docs/**'
- '**/*.md'

jobs:
build:
runs-on: ubuntu-latest
lint:
name: Lint

strategy:
fail-fast: false
runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'
python-version: '3.13'

- name: Lint with ruff
run: |
pip install ruff
ruff check src/hal
ruff format --check src/hal
uv tool install ruff
ruff check src/ tests/
ruff format --check src/ tests/
34 changes: 15 additions & 19 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,10 @@ on:
name: Create Release

jobs:
build:
name: Build wheels
runs-on: ubuntu-latest
release:
name: Build and publish

strategy:
matrix:
python-version: ['3.12']
runs-on: ubuntu-24.04

permissions:
contents: write
Expand All @@ -23,26 +20,25 @@ jobs:
uses: actions/checkout@v4

- name: Create release
uses: softprops/action-gh-release@v2
uses: taiki-e/create-gh-release-action@v1
with:
name: HAL ${{ github.ref_name }}
title: HAL $version
changelog: CHANGELOG.md
token: ${{ secrets.GITHUB_TOKEN }}

- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true

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

- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel build
- name: Build wheels
run: |
pyproject-build -w
python-version: '3.12'

- name: Build source
- name: Build source and dist
run: |
pyproject-build -s
uv build
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
45 changes: 23 additions & 22 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,55 +4,56 @@ on:
push:
paths-ignore:
- 'docs/**'
- '**/*.md'
pull_request:
paths-ignore:
- 'docs/**'
- '**/*.md'

jobs:
build:
runs-on: ubuntu-latest
test:
name: Test

strategy:
fail-fast: false
matrix:
python-version: ['3.10', '3.11', '3.12']
runs-on: ubuntu-24.04

env:
PYTHONPATH: '/home/runner/work/HAL/HAL/actorkeys/python'
OBSERVATORY: 'APO'

strategy:
fail-fast: false
matrix:
python-version: ['3.10', '3.11', '3.12', '3.13']

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'

- name: Clone actorkeys
uses: actions/checkout@v4
with:
repository: sdss/actorkeys
ref: sdss5
path: actorkeys

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

- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true

- name: Install dependencies
run: |
pip install --upgrade wheel pip setuptools
pip install .
uv sync --no-dev --frozen
- name: Test with pytest
run: |
pip install pytest pytest-mock pytest-asyncio pytest-cov
pytest tests/
env:
OBSERVATORY: 'APO'
uv pip install pytest pytest-mock pytest-asyncio pytest-cov
uv run pytest
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
files: ./coverage.xml
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## Next version

### ⚙️ Engineering

* Use `uv` for project management and workflows.


## 1.3.5 - June 15, 2024

### 🔧 Fixed
Expand Down
Loading

0 comments on commit fe47755

Please sign in to comment.