Skip to content

Commit

Permalink
Try and use uv conflicting deps
Browse files Browse the repository at this point in the history
  • Loading branch information
delfick committed Dec 1, 2024
1 parent 5d98397 commit 3ab2720
Show file tree
Hide file tree
Showing 6 changed files with 558 additions and 25 deletions.
2 changes: 1 addition & 1 deletion example/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ authors = [
{ name = "Stephen Moore", email = "stephen@delfick.com" },
]
dependencies = [
"django==4.2.9",
"django>=4.2.16",
"psycopg2-binary==2.9.9",
]

Expand Down
30 changes: 22 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,6 @@ authors = [
]
requires-python = ">=3.10"

[tool.uv]
dev-dependencies = [
"tools",
"djangoexample",
"proper_plugin",
"extended_mypy_django_plugin_test_driver",
]

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

Expand All @@ -41,6 +33,28 @@ extended_mypy_django_plugin_test_driver = { workspace = true }
[tool.uv.workspace]
members = ["tools", "example", "scripts/test_helpers", "scripts/proper_plugin"]

[dependency-groups]
dev = [
"tools",
"djangoexample",
"proper_plugin",
"extended_mypy_django_plugin_test_driver",
]
old-django = [
"django==4.2.16"
]
new-django = [
"django==5.1.2"
]

[tool.uv]
conflicts = [
[
{ group = "old-django" },
{ group = "new-django" },
],
]

[tool.ruff]
target-version = "py310"
line-length = 99
Expand Down
8 changes: 8 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
import importlib

import pytest

pytest_plugins = ["pytest_typing_runner", "extended_mypy_django_plugin_test_driver.plugin"]


def pytest_report_header(config: pytest.Config) -> list[str] | None:
return [f"Django: {importlib.metadata.version('django')}"]
2 changes: 1 addition & 1 deletion tools/requirements.uv.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
uv==0.5.4
uv==0.5.5
10 changes: 2 additions & 8 deletions tools/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,9 @@

def run_with_mypy(*args: str, old: bool) -> None:
if old:
withs = [
"--with",
"django==4.2.16",
]
withs = ["--group", "old-django"]
else:
withs = [
"--with",
"django==5.1.2",
]
withs = ["--group", "new-django"]

try:
subprocess.run(["/bin/bash", str(here / "uv"), "run", *withs, *args], check=True)
Expand Down
Loading

0 comments on commit 3ab2720

Please sign in to comment.