Skip to content

Commit 8d06efe

Browse files
authored
Merge pull request #119 from blaylockbk/use-uv-for-development
CHORE: Use uv for development and tests
2 parents 08277e5 + decc406 commit 8d06efe

20 files changed

Lines changed: 191 additions & 217 deletions

.github/workflows/tests-python.yml

Lines changed: 23 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
name: Tests (Python)
1+
name: Tests (uv)
22

33
on:
44
push:
55
branches: [main]
66
pull_request:
77
branches: [main]
8-
9-
# Allow job to be triggered manually.
108
workflow_dispatch:
119

1210
# Cancel in-progress jobs when pushing to the same branch.
@@ -20,59 +18,41 @@ jobs:
2018
strategy:
2119
fail-fast: false
2220
matrix:
23-
os: ["ubuntu-latest"]
24-
python-version: ["3.9", "3.10", "3.11", "3.12"]
25-
# In order to save resources, only run particular
26-
# matrix slots on other OS than Linux.
2721
include:
28-
- os: "macos-latest"
29-
python-version: "3.12"
30-
- os: "windows-latest"
22+
- os: ubuntu-latest
23+
python-version: "3.10"
24+
- os: ubuntu-latest
25+
python-version: "3.11"
26+
- os: ubuntu-latest
3127
python-version: "3.12"
28+
- os: ubuntu-latest
29+
python-version: "3.13"
30+
- os: macos-latest
31+
python-version: "3.13"
32+
continue-on-error: true
33+
- os: windows-latest
34+
python-version: "3.13"
35+
continue-on-error: true
3236

33-
env:
34-
OS: ${{ matrix.os }}
35-
PYTHON: ${{ matrix.python-version }}
36-
37-
defaults:
38-
run:
39-
shell: bash -el {0}
37+
name: Python ${{ matrix.python-version }} • ${{ matrix.os }}
4038

41-
name: Python ${{ matrix.python-version }} on OS ${{ matrix.os }}
4239
steps:
43-
- name: Acquire sources
40+
- name: Checkout repository
4441
uses: actions/checkout@v4
4542
with:
4643
fetch-depth: 2
4744

48-
- name: Setup Python
49-
uses: actions/setup-python@v5
45+
- name: Install uv
46+
uses: astral-sh/setup-uv@v6
5047
with:
5148
python-version: ${{ matrix.python-version }}
52-
architecture: x64
53-
cache: "pip"
54-
cache-dependency-path: "setup.cfg"
5549

56-
- name: Install project (Linux)
57-
if: runner.os == 'Linux'
58-
run: |
59-
pip3 install --requirement=requirements-test.txt
60-
pip3 install --editable=.
61-
62-
- name: Install project (macOS)
63-
if: runner.os == 'macOS'
64-
run: |
65-
pip3 install --break-system-packages --requirement=requirements-test.txt
66-
pip3 install --break-system-packages --editable=.
67-
68-
- name: Install project (Windows)
69-
if: runner.os == 'Windows'
70-
run: |
71-
pip3 install --requirement=requirements-test.txt
72-
pip3 install --editable=.
50+
- name: Install the project
51+
shell: bash -el {0}
52+
run: uv sync
7353

7454
- name: Run tests
55+
shell: bash -el {0}
7556
env:
7657
TMPDIR: ${{ runner.temp }}
77-
run: |
78-
pytest
58+
run: uv run pytest

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
uv.lock
2+
13
# Don't upload ANY NetCDF files
24
*.nc
35

4-
goes2go/_version.py
6+
src/goes2go/_version.py
57

68
core.*
79

.readthedocs.yml

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,31 @@
1-
# .readthedocs.yml
21
# Read the Docs configuration file
32

43
# Details
54
# - https://docs.readthedocs.io/en/stable/config-file/v2.html
5+
# - https://github.com/astral-sh/uv/issues/10074
6+
# - https://docs.readthedocs.com/platform/stable/build-customization.html#install-dependencies-with-uv
67

78
# Required
89
version: 2
910

1011
build:
1112
os: "ubuntu-22.04"
1213
tools:
13-
python: "3.10"
14-
apt_packages:
15-
- libgeos-dev
16-
17-
# Work around timeout error.
18-
# ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.
19-
# https://stackoverflow.com/questions/43298872/how-to-solve-readtimeouterror-httpsconnectionpoolhost-pypi-python-org-port#comment110786026_43560499
20-
# https://github.com/readthedocs/readthedocs.org/issues/6311#issuecomment-1324426604
21-
# https://docs.readthedocs.io/en/stable/config-file/v2.html#build-jobs
14+
python: "3.13"
2215
jobs:
23-
post_checkout:
24-
- echo "export PIP_DEFAULT_TIMEOUT=100" >> ~/.profile
16+
create_environment:
17+
- asdf plugin add uv
18+
- asdf install uv latest
19+
- asdf global uv latest
20+
- uv venv
21+
- UV_PROJECT_ENVIRONMENT=$READTHEDOCS_VIRTUALENV_PATH uv sync --all-extras --group docs
22+
install:
23+
- "true"
2524

2625
# Build documentation in the docs/ directory with Sphinx
2726
sphinx:
2827
configuration: docs/conf.py
2928

30-
python:
31-
install:
32-
- method: pip
33-
path: .
34-
extra_requirements:
35-
- docs
36-
3729
# Optionally build your docs in additional formats such as PDF
3830
formats:
3931
- pdf

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ G = GOES(satellite=17, product="GLM-L2-LCFA", domain='C')
122122
G = GOES(satellite=17, product="ABI-L1b-Rad", domain='F')
123123
```
124124

125-
> A complete listing of the products available are available [here](https://github.com/blaylockbk/goes2go/blob/main/goes2go/product_table.txt).
125+
> A complete listing of the products available are available [here](https://github.com/blaylockbk/goes2go/blob/main/src/goes2go/product_table.txt).
126126
127127
There are methods to do the following:
128128

docs/_build/html/_sources/index.rst.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ First, create a GOES object to specify the satellite, data product, and domain y
8686
G = GOES(satellite=17, product="ABI-L1b-Rad", domain='F')
8787
8888
89-
.. note:: A complete listing of the products available are available at `here <https://github.com/blaylockbk/goes2go/blob/main/goes2go/product_table.txt>`_.
89+
.. note:: A complete listing of the products available are available at `here <https://github.com/blaylockbk/goes2go/blob/main/src/goes2go/product_table.txt>`_.
9090

9191
There are methods to do the following:
9292

0 commit comments

Comments
 (0)