Skip to content

Migrate from rye to uv #141

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Feb 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 15 additions & 9 deletions .github/workflows/CD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ on:
types: [released]

env:
PYTHONUNBUFFERED: "1"
FORCE_COLOR: "1"
PYTHONUNBUFFERED: 1
FORCE_COLOR: 1

jobs:
run:
name: Deploy library

permissions:
id-token: write

runs-on: ${{ matrix.os }}
strategy:
matrix:
Expand All @@ -23,12 +23,18 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: eifinger/setup-rye@v2
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
version: 0.5.23

- name: Set up Python
uses: actions/setup-python@v5
with:
enable-cache: true
python-version: ${{matrix.python-version}}

- name: Build library
run: rye build
run: uv build

- name: Push build artifacts to PyPI
uses: pypa/[email protected]
40 changes: 21 additions & 19 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ on:
pull_request:
branches: [main]
paths:
- ".github/workflows/CI.yml"
- "src/**"
- "tests/**"
- .github/workflows/CI.yml
- src/**
- tests/**

env:
PYTHONUNBUFFERED: "1"
FORCE_COLOR: "1"
PYTHONUNBUFFERED: 1
FORCE_COLOR: 1

jobs:
run:
Expand All @@ -24,27 +24,28 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ["3.9", "3.10", "3.11", "3.12"]
python-version: ["3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: eifinger/setup-rye@v2
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
cache-prefix: '${{ matrix.python-version }}-'
version: '0.40.0'
version: 0.5.23

- name: Sync dependencies
run: rye pin ${{ matrix.python-version }} && rye sync --no-lock
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{matrix.python-version}}

- name: Install the cli
run: uv sync --dev

- name: Check code
run: |
rye lint
rye run check-types

- name: Check types
run: rye run check-types
uv run ruff check
uv run pyright

- name: Checkout resonate repository
uses: actions/checkout@v4
Expand All @@ -64,4 +65,5 @@ jobs:
timeout-minutes: 10
env:
RESONATE_STORE_URL: http://localhost:8001
run: rye test
RESONATE_TASKS_URL: http://localhost:8002
run: uv run pytest
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.10
22 changes: 22 additions & 0 deletions .ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[lint]
select = ["ALL"]
ignore = [
"A001",
"A002",
"A005",
"D",
"COM812",
"ISC001",
"S101",
"ARG002",
"ARG003",
]
logger-objects = ["resonate.logging.logger"]

[lint.isort]
combine-as-imports = true
required-imports = ["from __future__ import annotations"]

[lint.per-file-ignores]
"tests/*.py" = ["INP001", "S101", "D"]
"scripts/*.py" = ["INP001"]
75 changes: 5 additions & 70 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
name = "resonate-sdk"
version = "0.4.10"
description = "Distributed Async Await by Resonate HQ, Inc"
authors = [
{ name = "Resonate HQ, Inc", email = "[email protected]" }
]
authors = [{ name = "Resonate HQ, Inc", email = "[email protected]" }]
dependencies = [
"typing-extensions>=4.12.2",
"requests",
Expand All @@ -13,7 +11,7 @@ dependencies = [
"opentelemetry-exporter-otlp-proto-http",
]
readme = "README.md"
requires-python = ">= 3.9"
requires-python = ">= 3.10"
license = { text = "Apache-2.0" }

[project.urls]
Expand All @@ -25,62 +23,16 @@ Source = "https://github.com/resonatehq/resonate-sdk-py"
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.rye]
managed = true
dev-dependencies = [
"mypy>=1.10.0",
"pytest>=8.2.0",
"types-requests>=2.32.0.20240712",
"ruff>=0.6.3",
"pydoctor>=24.11.2",
"pydoclint>=0.5.8",
"vulture>=2.13",
]

[tool.rye.scripts]
check-types = "dmypy run --timeout 60 -- src tests"
find-deadcode = "vulture src tests"

[tool.hatch.metadata]
allow-direct-references = true

[tool.hatch.build.targets.wheel]
packages = ["src/resonate"]


[tool.ruff]
unsafe-fixes = true

[tool.ruff.lint]
select = ["ALL"]
ignore = [
"A001",
"A002",
"D",
"ANN101",
"COM812",
"ISC001",
"S101",
"ARG002",
"ARG003",
]
logger-objects = ["resonate.logging.logger"]

[tool.ruff.lint.isort]
combine-as-imports = true
required-imports = ["from __future__ import annotations"]

[tool.ruff.lint.per-file-ignores]
"tests/*.py" = ["INP001", "S101", "D"]
"scripts/*.py" = ["INP001"]
[dependency-groups]
dev = ["pyright[nodejs]>=1.1.394", "pytest>=8.3.4", "ruff>=0.9.6"]

[tool.pytest.ini_options]
testpaths = ["tests"]
xfail_strict = true
addopts = [
"--import-mode=importlib",
"--strict-markers",
]
addopts = ["--import-mode=importlib", "--strict-markers"]
markers = [
"integration: mark integration tests.",
"unit: mark unittest.",
Expand All @@ -91,20 +43,3 @@ log_cli = true
log_cli_level = "INFO"
log_cli_format = "%(asctime)s [%(levelname)8s] %(message)s (%(filename)s:%(lineno)s)"
log_cli_date_format = "%Y-%m-%d %H:%M:%S"

[tool.mypy]
mypy_path = "src"
plugins = []
follow_imports = "normal"
strict_optional = false
warn_redundant_casts = true
warn_unused_ignores = true
disallow_any_generics = true
check_untyped_defs = true
warn_unused_configs = true
disallow_subclassing_any = true
disallow_incomplete_defs = true
disallow_untyped_decorators = true
disallow_untyped_calls = true
disallow_untyped_defs = true
explicit_package_bases = true
127 changes: 0 additions & 127 deletions requirements-dev.lock

This file was deleted.

Loading