-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Draft: allows to use Maturin with UV
- Loading branch information
Showing
15 changed files
with
151 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[[entries]] | ||
id = "cbae7d73-09aa-442f-b099-27a4ae23b3c3" | ||
type = "improvement" | ||
description = "Allows to use uv with maturin" | ||
author = "[email protected]" |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import os | ||
|
||
from kraken.std import python | ||
|
||
python.python_settings(always_use_managed_env=True).add_package_index( | ||
alias="local", | ||
index_url=os.environ["LOCAL_PACKAGE_INDEX"], | ||
credentials=(os.environ["LOCAL_USER"], os.environ["LOCAL_PASSWORD"]), | ||
) | ||
python.install() | ||
python.mypy(version_spec="==1.10.0") | ||
python.update_pyproject_task() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[project] | ||
name = "rust-uv-project-consumer" | ||
version = "0.1.0" | ||
dependencies = [ | ||
"rust-uv-project" | ||
] | ||
requires-python = "~=3.7" | ||
|
||
[build-system] | ||
requires = ["hatchling"] | ||
build-backend = "hatchling.build" |
3 changes: 3 additions & 0 deletions
3
examples/rust-uv-project-consumer/src/rust_uv_project_consumer/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from rust_uv_project import sum_as_string | ||
|
||
sum_as_string(1, 2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import os | ||
|
||
from kraken.std import python | ||
|
||
python.python_settings(always_use_managed_env=True).add_package_index( | ||
alias="local", | ||
index_url=os.environ["LOCAL_PACKAGE_INDEX"], | ||
credentials=(os.environ["LOCAL_USER"], os.environ["LOCAL_PASSWORD"]), | ||
) | ||
python.install() | ||
python.mypy(version_spec="==1.10.0") | ||
python.mypy_stubtest(package="rust_uv_project", ignore_missing_stubs=True) | ||
python.publish(package_index="local", distributions=python.build(as_version="0.1.0").output_files) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[package] | ||
name = "rust-uv-project" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
[lib] | ||
name = "rust_uv_project" | ||
crate-type = ["cdylib"] | ||
|
||
[dependencies] | ||
pyo3 = { version = "0.19", features = ["extension-module"] } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[project] | ||
name = "rust-uv-project" | ||
version = "0.1.0" | ||
description = "" | ||
authors = [] | ||
requires-python = ">=3.8" | ||
|
||
[tool.uv] | ||
dev-dependencies = ["maturin~=1.0"] | ||
|
||
[build-system] | ||
requires = ["maturin~=1.0"] | ||
build-backend = "maturin" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
def sum_as_string(a: int, b: int) -> str: ... |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
use pyo3::prelude::*; | ||
|
||
#[pymodule] | ||
fn rust_uv_project(_py: Python<'_>, m: &PyModule) -> PyResult<()> { | ||
#[pyfn(m)] | ||
fn sum_as_string(a: usize, b: usize) -> String { | ||
(a + b).to_string() | ||
} | ||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters