Skip to content

Commit

Permalink
switch from poetry to uv (#828)
Browse files Browse the repository at this point in the history
  • Loading branch information
kylebarron authored Oct 10, 2024
1 parent eabb3ae commit 0b6715c
Show file tree
Hide file tree
Showing 13 changed files with 2,380 additions and 5,197 deletions.
32 changes: 8 additions & 24 deletions .github/workflows/python-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,33 +36,17 @@ jobs:
with:
python-version: "3.11"

- name: Install and configure Poetry
uses: snok/install-poetry@v1
- name: Install a specific version of uv
uses: astral-sh/setup-uv@v3
with:
version: 1.8.2
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true

- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}

- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root
enable-cache: true
version: "0.4.x"

- name: Build python package
run: |
poetry run maturin develop -m geoarrow-core/Cargo.toml
poetry run maturin develop -m geoarrow-compute/Cargo.toml
poetry run maturin develop -m geoarrow-io/Cargo.toml
- name: Install root project
run: poetry install --no-interaction
uv run maturin develop -m geoarrow-core/Cargo.toml
uv run maturin develop -m geoarrow-compute/Cargo.toml
uv run maturin develop -m geoarrow-io/Cargo.toml
- name: Deploy docs
env:
Expand All @@ -80,5 +64,5 @@ jobs:
# Only push docs if no letters in git tag after the first character
# (usually the git tag will have v as the first character)
if echo $VERSION | cut -c 1- | grep -q "[A-Za-z]"; then
poetry run mike deploy $VERSION latest --update-aliases --push --deploy-prefix python/
uv run mike deploy $VERSION latest --update-aliases --push --deploy-prefix python/
fi
36 changes: 8 additions & 28 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,40 +119,20 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Install and configure Poetry
uses: snok/install-poetry@v1
- name: Install a specific version of uv
uses: astral-sh/setup-uv@v3
with:
version: 1.8.2
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true

- name: Check Poetry lockfile up to date
run: |
poetry check --lock
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v4
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}

- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root

- name: Install root project
run: poetry install --no-interaction
enable-cache: true
version: "0.4.x"

- name: Build rust submodules
run: |
# Note: core module should be first, because it could be depended on
# by others in the future
poetry run maturin develop -m geoarrow-core/Cargo.toml
poetry run maturin develop -m geoarrow-compute/Cargo.toml
poetry run maturin develop -m geoarrow-io/Cargo.toml
uv run maturin develop -m geoarrow-core/Cargo.toml
uv run maturin develop -m geoarrow-compute/Cargo.toml
uv run maturin develop -m geoarrow-io/Cargo.toml
- name: Run python tests
run: |
poetry run pytest tests
uv run pytest tests
1 change: 1 addition & 0 deletions docs/.python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.11
5 changes: 2 additions & 3 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,15 @@ Mkdocs-based website to serve as high-level website and refer people to language
To build website:

```
poetry install
poetry run mkdocs serve
uv run mkdocs serve
```

To deploy: We have a couple manual steps because `mkdocs gh-deploy` _replaces_
any existing content on the `gh-pages` branch and we want an _upsert_ that
doesn't touch the `js/` or `python/` directories, which are deployed separately.

```
poetry run mkdocs build
uv run mkdocs build
git checkout gh-pages
mv site/* ../
git add 404.html assets index.html sitemap.xml sitemap.xml.gz search stylesheets
Expand Down
1,005 changes: 0 additions & 1,005 deletions docs/poetry.lock

This file was deleted.

3 changes: 0 additions & 3 deletions docs/poetry.toml

This file was deleted.

20 changes: 13 additions & 7 deletions docs/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
[tool.poetry]
package-mode = false
[project]
name = "docs"
version = "0.1.0"
description = "Add your description here"
readme = "README.md"
requires-python = ">=3.11"
dependencies = []

[tool.poetry.dependencies]
python = "^3.9"
mkdocs = "^1.4.3"
mkdocs-material = { version = "^9.5", extras = ["imaging"] }
pymdown-extensions = "^10.7"
[tool.uv]
dev-dependencies = [
"mkdocs>=1.6.1",
"mkdocs-material[imaging]>=9.5.40",
"pymdown-extensions>=10.11.2",
]
Loading

0 comments on commit 0b6715c

Please sign in to comment.