Skip to content

Commit 3a8b74a

Browse files
committed
Orient the project around uv.
A small lift to use uv to manage the project lifecycle.
1 parent f06df9f commit 3a8b74a

File tree

7 files changed

+3326
-52
lines changed

7 files changed

+3326
-52
lines changed

.github/workflows/ci.yml

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -33,28 +33,19 @@ jobs:
3333
fail-fast: false
3434
matrix:
3535
python-version: [
36-
"3.8",
3736
"3.9",
3837
"3.10",
3938
"3.11",
4039
"3.12",
40+
"3.13",
4141
]
4242
steps:
43-
- name: Cancel previous
44-
uses: styfle/cancel-workflow-action@0.7.0
45-
with:
46-
access_token: ${{ github.token }}
47-
if: ${{github.ref != 'refs/head/main'}}
48-
- uses: actions/checkout@v2
49-
- name: Set up Python ${{ matrix.python-version }}
50-
uses: actions/setup-python@v4
51-
with:
52-
python-version: ${{ matrix.python-version }}
53-
cache: 'pip'
54-
- name: Install xarray_sql
55-
run: |
56-
pip install -e .[test]
57-
- uses: 'actions/checkout@v4'
58-
- name: Run unit tests
59-
run: |
60-
pytest xarray_sql
43+
- uses: actions/checkout@v4
44+
- name: Install uv and set the python version
45+
uses: astral-sh/setup-uv@v5
46+
with:
47+
python-version: ${{ matrix.python-version }}
48+
- name: Install xarray_sql
49+
run: uv sync --dev
50+
- name: Run unit tests
51+
run: uv run pytest

.github/workflows/lint.yml

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -32,21 +32,12 @@ jobs:
3232
strategy:
3333
fail-fast: false
3434
matrix:
35-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
35+
python-version: ["3.9", "3.13"]
3636
steps:
37-
- name: Cancel previous
38-
uses: styfle/cancel-workflow-action@0.7.0
39-
with:
40-
access_token: ${{ github.token }}
41-
if: ${{github.ref != 'refs/head/main'}}
42-
- uses: actions/checkout@v2
43-
- name: Set up Python ${{ matrix.python-version }}
44-
uses: actions/setup-python@v2
45-
with:
46-
python-version: ${{ matrix.python-version }}
47-
- name: Install linter
48-
run: |
49-
pip install pyink
50-
- name: Lint with pyink
51-
run: |
52-
pyink --check .
37+
- uses: actions/checkout@v4
38+
- name: Install uv and set the python version
39+
uses: astral-sh/setup-uv@v5
40+
with:
41+
python-version: ${{ matrix.python-version }}
42+
- name: Lint with pyink
43+
run: uvx pyink --check .

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,6 @@
33
build
44
dist
55
__pycache__
6-
.pytest_cache
6+
.pytest_cache
7+
.venv
8+
.idea

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.11

CONTRIBUTING.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,11 @@ reading [Xarray's contributing guide](https://docs.xarray.dev/en/stable/contribu
1212

1313
## Developer setup
1414

15-
0. (Recommended) Create a project-specific python
16-
environment. [(mini)Conda](https://docs.anaconda.com/free/miniconda/index.html)
17-
or [Mamba](https://mamba.readthedocs.io/en/latest/)
18-
is preferred.
15+
0. Create a project-specific python
16+
environment with `uv`: https://docs.astral.sh/uv/getting-started/installation/
1917
1. Clone the repository (bonus: [via SSH](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account))
2018
and `cd xarray_sql` (the project root).
21-
1. Install dev dependencies via: `pip install -e ".[dev]`
19+
2. Install dev dependencies via: `uv sync --dev`
2220

2321

2422
## Before submitting a pull request...

pyproject.toml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "xarray_sql"
33
dynamic = ["version"]
44
description = "Querry Xarray with SQL."
55
readme = "README.md"
6-
requires-python = ">=3.8"
6+
requires-python = ">=3.9"
77
license = {text = "Apache-2.0"}
88
authors = [
99
{name = "Alexander Merose", email = "al@merose.com"},
@@ -17,17 +17,17 @@ classifiers = [
1717
"Operating System :: MacOS :: MacOS X",
1818
"Operating System :: Microsoft :: Windows",
1919
"Operating System :: POSIX",
20-
"Programming Language :: Python :: 3.8",
2120
"Programming Language :: Python :: 3.9",
2221
"Programming Language :: Python :: 3.10",
2322
"Programming Language :: Python :: 3.11",
2423
"Programming Language :: Python :: 3.12",
24+
"Programming Language :: Python :: 3.13",
2525
"Topic :: Scientific/Engineering :: Atmospheric Science",
2626
"Topic :: Database :: Front-Ends",
2727
]
2828
dependencies = [
29-
"xarray",
30-
"dask-sql",
29+
"dask-sql>=2024.5.0",
30+
"xarray>=2024.7.0",
3131
]
3232

3333
[project.optional-dependencies]
@@ -36,11 +36,6 @@ test = [
3636
"xarray[io]",
3737
"gcsfs",
3838
]
39-
dev = [
40-
"xarray_sql[test]",
41-
"pyink",
42-
"py-spy"
43-
]
4439

4540
[project.urls]
4641
Homepage = "https://github.com/alxmrs/xarray-sql"
@@ -59,4 +54,11 @@ preview = true
5954
pyink-indentation = 2
6055
pyink-use-majority-quotes = true
6156

62-
[tool.setuptools_scm]
57+
[tool.setuptools_scm]
58+
59+
[dependency-groups]
60+
dev = [
61+
"xarray_sql[test]",
62+
"py-spy>=0.4.0",
63+
"pyink>=24.10.1",
64+
]

0 commit comments

Comments
 (0)