Skip to content

Commit

Permalink
Merge pull request #240 from neutrinoceros/tst/uv_everywhere
Browse files Browse the repository at this point in the history
TST: use uv everywhere in CI
  • Loading branch information
neutrinoceros authored Feb 11, 2025
2 parents 464c1d4 + 2c3cd52 commit 7063cdb
Show file tree
Hide file tree
Showing 7 changed files with 1,376 additions and 50 deletions.
31 changes: 9 additions & 22 deletions .github/workflows/bleeding-edge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,32 +26,19 @@ jobs:
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v5
- name: Setup uv
uses: astral-sh/setup-uv@v5
with:
python-version: 3.13-dev
python-version: '3.13'

- name: Install dependencies
- name: configure uv
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade setuptools wheel
python -m pip install --pre --only-binary ":all:" \
numpy matplotlib scipy h5py \
--extra-index-url \
https://pypi.anaconda.org/scientific-python-nightly-wheels/simple
python -m pip install --pre --only-binary ":all:" \
astropy \
--extra-index-url https://pypi.anaconda.org/astropy/simple/ \
--extra-index-url https://pypi.anaconda.org/liberfa/simple
echo "UV_PRERELEASE=allow" >> $GITHUB_ENV
echo "UV_INDEX=https://pypi.anaconda.org/scientific-python-nightly-wheels/simple https://pypi.anaconda.org/astropy/simple/ https://pypi.anaconda.org/liberfa/simple" >> $GITHUB_ENV
echo "UV_INDEX_STRATEGY=unsafe-best-match" >> $GITHUB_ENV
- name: Build amical
run: |
python -m pip install --requirement requirements/tests.txt --pre
python -m pip install --no-build-isolation .
- run: python -m pip list
run: uv sync --no-editable --group test

- name: Run tests
run: |
pytest --color=yes
run: uv run --no-sync pytest --color=yes
10 changes: 3 additions & 7 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,11 @@ jobs:
steps:
- name: Checkout Source
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Install build dependencies
run: python -m pip install build wheel
- name: Setup uv
uses: astral-sh/setup-uv@v5
- name: Build distributions
shell: bash -l {0}
run: python -m build
run: uv build
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@v1.12.4
with:
Expand Down
26 changes: 8 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,14 @@ jobs:
steps:
- name: Checkout Source
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
- name: Setup uv
uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.python-version }}
- name: Setup package
run: |
python -m pip install --upgrade pip
python -m pip install --requirement requirements/tests.txt
python -m pip install .
- name: Build
run: uv sync --no-editable --group test
- name: Run tests
run: |
pytest --color=yes
run: uv run --no-sync pytest --color=yes


type-check:
Expand All @@ -55,18 +51,12 @@ jobs:
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v5
- name: Setup uv
uses: astral-sh/setup-uv@v5
with:
# Match minimal supported Python version
# to make sure we're not using unparseable syntax
python-version: '3.10'

- name: Build
run: |
python -m pip install --upgrade pip
python -m pip install --requirement requirements/typecheck.txt
python -m pip install .
- name: Run mypy
run: mypy src
run: uv run --group typecheck mypy src
9 changes: 9 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,15 @@ Homepage = "https://github.com/SydneyAstrophotonicInstrumentationLab/AMICAL"
[project.scripts]
amical = "amical._cli.main:main"

[dependency-groups]
typecheck = [
"mypy>=1.14.1",
"types-termcolor>=1.1.6.2",
]
test = [
"pytest>=7.2.1",
]

[tool.hatch.build.targets.sdist]
only-include = [
"src",
Expand Down
1 change: 0 additions & 1 deletion requirements/tests.txt

This file was deleted.

2 changes: 0 additions & 2 deletions requirements/typecheck.txt

This file was deleted.

Loading

0 comments on commit 7063cdb

Please sign in to comment.