Skip to content

Commit

Permalink
use uv-0.3 (#148)
Browse files Browse the repository at this point in the history
* use uv-0.3

* updating setup uv

* updating devcontainer with use ruff formatter in VSCode
  • Loading branch information
shimizukawa authored Aug 23, 2024
1 parent a5d16aa commit 1e1c2fc
Show file tree
Hide file tree
Showing 8 changed files with 1,032 additions and 17 deletions.
12 changes: 8 additions & 4 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
"ghcr.io/devcontainers/features/git:1": {},
"ghcr.io/devcontainers/features/github-cli:1": {},
"ghcr.io/va-h/devcontainers-features/uv:1": {},
"ghcr.io/devcontainers-contrib/features/act:1": {},
"ghcr.io/devcontainers-contrib/features/ruff:1": {}
"ghcr.io/devcontainers-contrib/features/act:1": {}
},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
Expand All @@ -32,7 +30,13 @@
],
// Set *default* container specific settings.json values on container create.
"settings": {
"ruff.path": ["/usr/local/py-utils/bin/ruff"]
"editor.codeActionsOnSave": {
"source.fixAll": "explicit"
},
"[python]": {
"editor.defaultFormatter": "charliermarsh.ruff"
},
"python.defaultInterpreterPath": "/usr/local/bin/python"
}
}
},
Expand Down
7 changes: 6 additions & 1 deletion .devcontainer/on_create_command.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# setup
set -ex

pip install -r dev-requires.txt
curl -LsSf https://astral.sh/uv/install.sh | sh
. $HOME/.cargo/env
uv tool install -U ruff
uv tool install -U tox --with tox-uv
uv sync --extra psycopg2-binary
3 changes: 2 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@ jobs:
- name: Install dependencies
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
uv pip install --system -U setuptools_scm build twine
uv sync
- name: Build package
run: |
. .venv/bin/activate
python -m build --version
python -m build
twine check dist/*
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ jobs:
- name: Install dependencies
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
uv pip install --system --upgrade tox-uv tox-gh-actions
uv sync
- name: Tox tests
run: |
tox -v
.venv/bin/tox -v
env:
DJANGO: ${{ matrix.django-version }}
TEST_WITH_POSTGRES: 1
7 changes: 0 additions & 7 deletions dev-requires.txt

This file was deleted.

4 changes: 2 additions & 2 deletions doc/dev.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ Setup development environment
* Requires supported Python version
* do setup under django-redshift-backend.git repository root as::

$ pip install -U pip setuptools
$ pip install -r dev-requires.txt
$ pip install uv
$ uv sync

Testing
=======
Expand Down
16 changes: 16 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,19 @@ local_scheme = "no-local-version"

[tool.ruff]
exclude = ["django_redshift_backend/_vendor"]

[tool.uv]
dev-dependencies = [
"setuptools>=73.0.1",
"wheel>=0.44.0",
"setuptools-scm>=8.1.0",
"tox-uv>=1.11.2",
"build>=1.2.1",
"twine>=5.1.1",
"django-redshift-backend",
"ruff>=0.6.2",
"tox-gh-actions>=3.2.0",
]

[tool.uv.sources]
django-redshift-backend = { workspace = true }
996 changes: 996 additions & 0 deletions uv.lock

Large diffs are not rendered by default.

0 comments on commit 1e1c2fc

Please sign in to comment.