Skip to content
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

Support for uv projects #408

Open
isinyaaa opened this issue Nov 27, 2024 · 3 comments
Open

Support for uv projects #408

isinyaaa opened this issue Nov 27, 2024 · 3 comments

Comments

@isinyaaa
Copy link

uv is a Rust-based project and package manager for Python.
It is considerably simpler than poetry, which is why I personally prefer it, so I hope it would be easy to integrate with.
I have done some experiments with both the default build system (hatchling) and using setuptools but haven't had any success accessing the library that should be exported by pydust.

I wonder if this has to do with the include statement, although I have noticed that the build script compiles to a .so, and I'm on an ARM64 Mac, so there might be an issue there too.

@henryiii
Copy link

I would think that this would "just work" now with Poetry 2.0 and its new support for standard configuration. If you update to PEP 621 style configuration and poetry-core 2.0 I think you can use uv.

@henryiii
Copy link

This seems to work, as applied to the template repo:

-[tool.poetry]
+[project]
 name = "ziggy-pydust-template"
 version = "0.1.0"
 description = ""
-authors = ["Fulcrum Inc. <[email protected]>"]
+authors = [{name = "Fulcrum Inc", email = "[email protected]"}]
 readme = "README.md"
+dependencies = []
+requires-python = ">=3.11"
+
+[tool.poetry]
 packages = [{ include = "fibonacci" }]
 include = [
     { path = "src/", format = "sdist" },
@@ -18,21 +22,26 @@ include = [
 [tool.poetry.build]
 script = "build.py"

-[tool.poetry.dependencies]
-python = "^3.11"
-
 [tool.poetry.group.dev.dependencies]
 ziggy-pydust = "0.23.2"
-pytest = "^8.0.0"
-ruff = "^0.4.0"
+pytest = ">=8.0.0"
+ruff = ">=0.4.0"
 black = "^23.7.0"

+[dependency-groups]
+dev = [
+    "ziggy-pydust==0.23.2",
+    "pytest>=8",
+    "ruff>=0.4.0",
+    "black~=23.7.0",
+]
+
 [tool.black]
 line-length = 120

 [tool.ruff]
 line-length = 120
-select = ["F", "E", "W", "UP", "I001", "I002"]
+lint.select = ["F", "E", "W", "UP", "I001", "I002"]

@henryiii
Copy link

(I'm assuming this warning is unrelated:

/Users/henryschreiner/.cache/uv/builds-v0/.tmpZsKYCP/lib/python3.12/site-packages/pydust/config.py:92: UserWarning: A custom validator is returning a value other than `self`.
Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.
See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.
  return ToolPydust(**pyproject["tool"].get("pydust", {}))

)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants