Skip to content

Commit

Permalink
Add a dedicated uv project to test relative import build
Browse files Browse the repository at this point in the history
  • Loading branch information
Ghelfi committed Jan 27, 2025
1 parent 4d0e68a commit 87f17f8
Show file tree
Hide file tree
Showing 6 changed files with 91 additions and 5 deletions.
5 changes: 1 addition & 4 deletions examples/uv-project-consumer/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,9 @@ description = "Add your description here"
requires-python = ">=3.10"
dependencies = [
"tqdm>=4.66.5",
"uv-project",
"uv-project==0.1.0",
]

[tool.uv.sources]
uv-project = { path = "../uv-project", editable = true }

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
16 changes: 16 additions & 0 deletions examples/uv-project-relative-import/.kraken.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
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.flake8(version_spec="==7.0.0")
python.black(version_spec="==24.4.2")
python.isort(version_spec="==5.13.2")
python.pytest()
python.publish(package_index="local", distributions=python.build(as_version="0.1.0").output_files)
16 changes: 16 additions & 0 deletions examples/uv-project-relative-import/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[project]
name = "uv-project-relative-import"
version = "0.1.0"
description = "Add your description here"
requires-python = ">=3.10"
dependencies = [
"tqdm>=4.66.5",
"uv-project",
]

[tool.uv.sources]
uv-project = { path = "../uv-project", editable = true }

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from uv_project import hello


def main() -> None:
hello()
52 changes: 52 additions & 0 deletions examples/uv-project-relative-import/uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def test__python_project__upgrade_relative_import_version(
tempdir = kraken_project.directory

build_as_version = "0.2.0"
project_name = "uv-project-consumer"
project_name = "uv-project-relative-import"
original_dir = example_dir(project_name)
project_dist = kraken_project.build_directory / "python-dist"

Expand Down

0 comments on commit 87f17f8

Please sign in to comment.