Skip to content

Commit

Permalink
chore: convert to uv
Browse files Browse the repository at this point in the history
It's so shiny ✨
  • Loading branch information
gadomski committed Oct 10, 2024
1 parent d44efe0 commit 7590595
Show file tree
Hide file tree
Showing 15 changed files with 1,394 additions and 395 deletions.
35 changes: 19 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,13 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: "pip"
cache-dependency-path: scripts/requirements-stac-server.txt
- name: Install stac-api-validator
run: pip install -r scripts/requirements-stac-server.txt
- uses: astral-sh/setup-uv@v3
with:
enable-cache: true
- name: Install Python dependencies
run: uv sync --extra stac-api-validator
- name: Validate
run: scripts/validate-stac-server
run: uv run scripts/validate-stac-server
validate-stac-server-pgstac:
runs-on: ubuntu-latest
services:
Expand All @@ -117,23 +118,25 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: "pip"
cache-dependency-path: scripts/requirements-stac-server.txt
- name: Install stac-api-validator
run: pip install -r scripts/requirements-stac-server.txt
- uses: astral-sh/setup-uv@v3
with:
enable-cache: true
- name: Install Python dependencies
run: uv sync --extra stac-api-validator
- name: Validate
run: scripts/validate-stac-server --pgstac
run: uv run scripts/validate-stac-server --pgstac
validate-stac-geoparquet:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip"
cache-dependency-path: scripts/requirements-stac-geoparquet.txt
- name: Install requirements
run: pip install -r scripts/requirements-stac-geoparquet.txt
python-version: "3.x"
- uses: astral-sh/setup-uv@v3
with:
enable-cache: true
- name: Install Python dependencies
run: uv sync --extra stac-geoparquet
- name: Validate
run: scripts/validate-stac-geoparquet
run: uv run scripts/validate-stac-geoparquet
13 changes: 6 additions & 7 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,15 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Install doc requirements
run: pip install -r requirements-docs.txt
- uses: PyO3/maturin-action@v1
- uses: astral-sh/setup-uv@v3
with:
command: build
args: --manifest-path python/Cargo.toml --out dist
enable-cache: true
- name: Install dev requirements
run: uv sync --extra docs
- name: Install stacrs
run: pip install stacrs --find-links dist --no-index
run: uv sync --no-dev --inexact --directory python
- name: Build docs
run: mkdocs build --strict
run: uv run mkdocs build --strict
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
Expand Down
18 changes: 10 additions & 8 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,24 @@ concurrency:
jobs:
test-stacrs:
runs-on: ubuntu-latest
defaults:
run:
working-directory: python
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Install dev requirements
run: pip install -r python/requirements-dev.txt
- name: Build
run: maturin build --manifest-path python/Cargo.toml --out dist
- name: Install stacrs
run: pip install stacrs --find-links dist --no-index
- uses: astral-sh/setup-uv@v3
with:
enable-cache: true
- name: Install
run: uv sync
- name: Check
run: ruff check python && ruff format --check python && mypy python --config-file=python/pyproject.toml
run: uv run ruff check && uv run ruff format --check && uv run mypy .
- name: Test
run: pytest python/tests
run: uv run pytest
linux:
runs-on: ${{ matrix.platform.runner }}
strategy:
Expand Down
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.12
19 changes: 19 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[project]
name = "stac-rs"
version = "0.0.0"
description = "This package should never be released, its just for uv."
requires-python = ">=3.12"
dependencies = []

[project.optional-dependencies]
docs = ["mkdocs-material[imaging]>=9.5.40", "mkdocstrings[python]>=0.26.1"]
stac-geoparquet = [
"deepdiff>=8.0.1",
"pyarrow>=17.0.0",
"stac-geoparquet>=0.6.0",
]
stac-api-validator = ["setuptools>=75.1.0", "stac-api-validator>=0.6.3"]


[tool.uv.workspace]
members = ["python"]
17 changes: 13 additions & 4 deletions python/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
[build-system]
requires = ["maturin>=1.7,<2.0"]
build-backend = "maturin"

[project]
name = "stacrs"
description = "A no-dependency Python package for STAC, using Rust under the hood."
Expand Down Expand Up @@ -37,3 +33,16 @@ python-source = "python"
[[tool.mypy.overrides]]
module = "pyarrow.*"
ignore_missing_imports = true

[tool.uv]
dev-dependencies = [
"maturin>=1.7.4",
"mypy>=1.11.2",
"pytest>=8.3.3",
"ruff>=0.6.9",
"stac-geoparquet>=0.6.0",
]

[build-system]
requires = ["maturin>=1.7,<2.0"]
build-backend = "maturin"
5 changes: 0 additions & 5 deletions python/requirements-dev.in

This file was deleted.

75 changes: 0 additions & 75 deletions python/requirements-dev.txt

This file was deleted.

3 changes: 0 additions & 3 deletions requirements-docs.in

This file was deleted.

126 changes: 0 additions & 126 deletions requirements-docs.txt

This file was deleted.

3 changes: 0 additions & 3 deletions scripts/requirements-stac-geoparquet.in

This file was deleted.

Loading

0 comments on commit 7590595

Please sign in to comment.