Skip to content

Commit 6ad2228

Browse files
[chore] switch to uv (#59)
Everything else is, why not this as well
1 parent 14f0a72 commit 6ad2228

File tree

21 files changed

+1326
-1201
lines changed

21 files changed

+1326
-1201
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ jobs:
7373
- run: npm ci
7474

7575
- name: Test
76-
run: npm run start -- --client ${{ matrix.client }} --server ${{ matrix.server }} --parallel 2
76+
run: npm run start -- --client ${{ matrix.client }} --server ${{ matrix.server }} --parallel 2 --bail
7777

7878
- uses: actions/upload-artifact@v4
7979
if: failure()

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,6 @@ dist
174174
# Finder (MacOS) folder config
175175
.DS_Store
176176

177-
# Codegen
178-
schema.json
179-
180177
# pyc
181178
*.pyc
182179

flake.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@
1515
nodePackages.typescript-language-server
1616
python3
1717
poetry
18+
uv
1819
];
20+
shellHook = ''
21+
export LD_LIBRARY_PATH="${pkgs.stdenv.cc.cc.lib}/lib"
22+
'';
1923
};
2024
in
2125
{

impls/python/README.md

Whitespace-only changes.

impls/python/client.dockerfile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@ FROM python:3.11-slim-bookworm
44

55
WORKDIR /usr/src/river
66

7-
RUN pip install poetry==1.6.1 && poetry config virtualenvs.create false
7+
RUN pip install uv==0.6.8
88

99
COPY pyproject.toml .
10-
COPY poetry.lock .
10+
COPY uv.lock .
11+
COPY README.md .
1112
COPY src src
1213

13-
RUN poetry install
14+
RUN uv sync
1415

1516
# bash is required for "time" in python:3.11-slim-bookworm
16-
CMD ["bash", "-c", "time timeout 120 poetry run python -u -m river_python_test.client --log-cli-level=debug"]
17+
CMD ["bash", "-c", "time timeout 120 uv run python -u -m river_python_test.client --log-cli-level=debug"]

impls/python/generate_client.sh

100644100755
Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
poetry run python -m grpc_tools.protoc \
2-
--proto_path=./src \
1+
#!/usr/bin/env bash
2+
3+
uv run python -m grpc_tools.protoc \
4+
--proto_path=../../protos \
35
--python_out=./src \
46
--mypy_out=./src \
57
--grpc_python_out=./src \
68
--mypy_grpc_out=./src \
7-
./src/river_python_test/protos/service.proto
9+
../../protos/river_python_test/protos/service.proto
810

9-
poetry run python -m river.codegen server --output ./src/protos ./src/river_python_test/protos/service.proto
10-
poetry run python -m river.codegen client --output ./src/protos/client_schema.py --client-name TestCient ./src/schema.json
11+
uv run python -m replit_river.codegen server --output ./src/river_python_test/protos ./src/river_python_test/protos/service.proto
12+
uv run python -m replit_river.codegen client --output ./src/river_python_test/protos/client_schema.py --client-name TestCient ../../schema.json
1113

1214
echo "Completed"

impls/python/poetry.lock

Lines changed: 0 additions & 964 deletions
This file was deleted.

impls/python/pyproject.toml

Lines changed: 34 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,36 @@
1-
[build-system]
2-
requires = ["poetry-core"]
3-
build-backend = "poetry.core.masonry.api"
4-
5-
[tool.poetry]
1+
[project]
62
name = "river-python-test"
73
version = "1.0.0"
84
description = "River toolkit for Python"
9-
authors = ["Replit <eng@replit.com>"]
10-
packages = [
11-
{ include = "river_python_test", from = "src" },
5+
readme = "README.md"
6+
requires-python = ">=3.12"
7+
dependencies = [
8+
"replit-river==0.8.1",
129
]
1310

11+
[build-system]
12+
requires = ["hatchling"]
13+
build-backend = "hatchling.build"
1414

15-
[tool.poetry.scripts]
16-
river-codegen-py = "river.codegen:run"
17-
18-
[tool.poetry.dependencies]
19-
python = "^3.11"
20-
replit_river = "0.8.1"
15+
[tool.hatch.build.targets.wheel]
16+
packages = ["src/river_python_test"]
2117

22-
[tool.poetry.group.dev.dependencies]
23-
pytest = "^7.4.0"
24-
mypy = "^1.4.0"
25-
black = ">=23.3.0"
26-
pytest-cov = "^4.1.0"
27-
ruff = "^0.0.278"
28-
pytest-mock = "^3.11.1"
29-
pytest-asyncio = "^0.21.1"
30-
types-protobuf = "^4.24.0.20240311"
31-
mypy-protobuf = "^3.5.0"
32-
deptry = "^0.14.0"
18+
[dependency-groups]
19+
dev = [
20+
"deptry>=0.23.0",
21+
"mypy>=1.15.0",
22+
"mypy-protobuf>=3.6.0",
23+
"pyright>=1.1.396",
24+
"pytest>=8.3.5",
25+
"pytest-asyncio>=0.25.3",
26+
"pytest-cov>=4.1.0",
27+
"pytest-mock>=3.14.0",
28+
"ruff>=0.11.0",
29+
"types-protobuf>=5.29.1.20250315",
30+
]
3331

3432
[tool.ruff]
35-
select = ["F", "E", "W", "I001"]
33+
lint.select = ["F", "E", "W", "I001"]
3634

3735
# Should be kept in sync with mypy.ini in the project root.
3836
# The VSCode mypy extension can only read /mypy.ini.
@@ -46,23 +44,23 @@ warn_return_any = true
4644
asyncio_mode = "auto" # auto-detect async tests/fixtures
4745
addopts = "--tb=short"
4846
env = [
49-
"DD_DOGSTATSD_DISABLE=true",
50-
"DD_TRACE_ENABLED=false",
47+
"DD_DOGSTATSD_DISABLE=true",
48+
"DD_TRACE_ENABLED=false",
5149
]
5250
filterwarnings = [
53-
"ignore::DeprecationWarning", # google SDKs cause this noise
51+
"ignore::DeprecationWarning", # google SDKs cause this noise
5452
]
5553
markers = [
56-
"e2e: marks tests as end-to-end (deselect with '-m \"not e2e\"')",
54+
"e2e: marks tests as end-to-end (deselect with '-m \"not e2e\"')",
5755
]
5856

5957
[[tool.mypy.overrides]]
6058
module = [
61-
"google.auth.*",
62-
"google.oauth2.*",
63-
"google.cloud.sqlalchemy_spanner.sqlalchemy_spanner.*",
64-
"grpc.*",
65-
"grpc_tools.*",
66-
"nanoid.*",
59+
"google.auth.*",
60+
"google.oauth2.*",
61+
"google.cloud.sqlalchemy_spanner.sqlalchemy_spanner.*",
62+
"grpc.*",
63+
"grpc_tools.*",
64+
"nanoid.*",
6765
]
6866
ignore_missing_imports = true

impls/python/server.dockerfile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@ FROM python:3.11-slim-bookworm
44

55
WORKDIR /usr/src/river
66

7-
RUN pip install poetry==1.6.1 && poetry config virtualenvs.create false
7+
RUN pip install uv==0.6.8
88

99
COPY pyproject.toml .
10-
COPY poetry.lock .
10+
COPY uv.lock .
11+
COPY README.md .
1112
COPY src src
1213

13-
RUN poetry install
14+
RUN uv sync
1415

1516
# bash is required for "time" in python:3.11-slim-bookworm
16-
CMD ["bash", "-c", "time timeout 120 poetry run python -u -m river_python_test.server --log-cli-level=debug"]
17+
CMD ["bash", "-c", "time timeout 120 uv run python -u -m river_python_test.server --log-cli-level=debug"]

0 commit comments

Comments
 (0)