Skip to content

Commit

Permalink
Switch to uv
Browse files Browse the repository at this point in the history
  • Loading branch information
davegaeddert committed Sep 24, 2024
1 parent a9a87a0 commit e87fa4e
Show file tree
Hide file tree
Showing 7 changed files with 362 additions and 577 deletions.
4 changes: 2 additions & 2 deletions .devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"onCreateCommand": "pipx install poetry",
"onCreateCommand": "pipx install uv",
"updateContentCommand": "./scripts/install",
"postCreateCommand": "export PATH=$PATH:.venv/bin",
"postAttachCommand": "poetry run plain dev",
"postAttachCommand": "uv run plain dev",
"customizations": {
"codespaces": {
"openFiles": [
Expand Down
14 changes: 6 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,13 @@ jobs:

steps:
- uses: actions/checkout@v4
- run: pipx install poetry
- uses: actions/setup-python@v4
with:
python-version: "3.11"
cache: poetry
- run: poetry install
- name: Install uv
uses: astral-sh/setup-uv@v2
- name: Set up Python
run: uv python install
- run: |
poetry run plain compile
poetry run plain test
uv run plain compile
uv run plain test
env:
PLAIN_DEBUG: true
PLAIN_SECRET_KEY: testing
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ rm -rf .git
git init
```

Then, install the dependencies (note that you'll need [Poetry](https://python-poetry.org/) installed on your system):
Then, install the dependencies (note that you'll need [uv](https://docs.astral.sh/uv/getting-started/installation/) installed on your system):

```bash
./scripts/install
Expand Down
546 changes: 0 additions & 546 deletions poetry.lock

This file was deleted.

28 changes: 13 additions & 15 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
[tool.poetry]
[project]
name = "app"
version = "0.0.0"
description = ""
authors = ["Your Name <[email protected]>"]
version = "0.1.0"
description = "Add your description here"
readme = "README.md"
requires-python = ">=3.11"
dependencies = [
"plain<1.0.0",
]

[tool.poetry.dependencies]
python = "^3.11"
plain = "<1.0.0"

[tool.poetry.group.dev.dependencies]
"plain.dev" = "<1.0.0"
"plain.pytest" = "<1.0.0"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
[tool.uv]
dev-dependencies = [
"plain-dev<1.0.0",
"plain-pytest<1.0.0",
]
8 changes: 3 additions & 5 deletions scripts/install
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@ if [ ! -f .env ]; then
cp .env.example .env
fi

echo "Installing dependencies with poetry"
poetry config installer.parallel false # Avoid race condition in git repo cloning
poetry config virtualenvs.in-project true
poetry install
echo "Installing dependencies with uv"
uv sync

echo "Installing plain pre-commit hooks"
poetry run plain pre-commit --install
uv run plain pre-commit --install
337 changes: 337 additions & 0 deletions uv.lock

Large diffs are not rendered by default.

0 comments on commit e87fa4e

Please sign in to comment.