Skip to content

Commit 6463554

Browse files
Scaffolded a workspace structure
commit-id:73e24d58
1 parent 8c16096 commit 6463554

File tree

44 files changed

+594
-168
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+594
-168
lines changed

.github/workflows/ci.yml

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
name: CI
22

3-
on: pull_request
3+
on:
4+
pull_request:
5+
push:
6+
branches: ["main"]
47

58
jobs:
69
build:
@@ -14,7 +17,7 @@ jobs:
1417
uses: astral-sh/setup-uv@v5
1518
with:
1619
enable-cache: true
17-
cache-dependency-glob: "uv.lock" # Invalidate the cache if the lockfile has changed
20+
cache-dependency-glob: "uv.lock" # Invalidate the cache if the lockfile has changed
1821

1922
# According to the docs, this solution can be faster than `uv python install`
2023
# because of the external caching performed by GitHub.
@@ -33,7 +36,7 @@ jobs:
3336
run: uv run ruff check
3437

3538
- name: Check types
36-
run: uv run mypy . --config-file pyproject.toml
39+
run: uv run check_types.py
3740

3841
typos:
3942
name: Check typos

check_types.py

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import os
2+
import tomllib
3+
from pathlib import Path
4+
5+
6+
def run_mypy_for_workspace_members() -> None:
7+
manifest_path = Path(__file__).parent / 'pyproject.toml'
8+
manifest = tomllib.loads(manifest_path.read_text())
9+
10+
workspace_members: list[str] = manifest['tool']['uv']['workspace']['members']
11+
12+
for member in map(Path, workspace_members):
13+
member_concrete_paths = list(member.parent.glob(member.name))
14+
longest_name = max((len(str(path.name)) for path in member_concrete_paths)) + 2
15+
16+
for member_path in member_concrete_paths:
17+
name = member_path.name
18+
whitespace = ' ' * (longest_name - len(name))
19+
print(f'{name}{whitespace}', end='', flush=True)
20+
21+
status = os.system(f'uv run mypy {member_path} --config-file pyproject.toml')
22+
23+
if status != 0:
24+
break
25+
26+
27+
if __name__ == '__main__':
28+
run_mypy_for_workspace_members()

development/.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*/**
2+
!test_data/**/*
3+
!*/.gitkeep

development/calibration/.gitkeep

Whitespace-only changes.

development/data/.gitkeep

Whitespace-only changes.

development/result/.gitkeep

Whitespace-only changes.

development/transformation/.gitkeep

Whitespace-only changes.

packages/child-lab-annotation/README.md

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[project]
2+
name = "child-lab-annotation"
3+
version = "0.1.0"
4+
description = "Add your description here"
5+
readme = "README.md"
6+
authors = [
7+
{ name = "Jan Smółka", email = "[email protected]" }
8+
]
9+
requires-python = ">=3.12.7"
10+
dependencies = []
11+
12+
[build-system]
13+
requires = ["hatchling"]
14+
build-backend = "hatchling.build"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

packages/child-lab-annotation/src/child_lab_annotation/py.typed

Whitespace-only changes.

packages/child-lab-cli/README.md

packages/child-lab-cli/hello.py

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

packages/child-lab-cli/pyproject.toml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[project]
2+
name = "child-lab-cli"
3+
version = "0.1.0"
4+
description = "Add your description here"
5+
readme = "README.md"
6+
requires-python = ">=3.12.7"
7+
dependencies = []

packages/child-lab-data/README.md

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[project]
2+
name = "child-lab-data"
3+
version = "0.1.0"
4+
description = "Add your description here"
5+
readme = "README.md"
6+
authors = [
7+
{ name = "Jan Smółka", email = "[email protected]" }
8+
]
9+
requires-python = ">=3.12.7"
10+
dependencies = []
11+
12+
[build-system]
13+
requires = ["hatchling"]
14+
build-backend = "hatchling.build"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

packages/child-lab-data/src/child_lab_data/py.typed

Whitespace-only changes.

packages/child-lab-procedures/README.md

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[project]
2+
name = "child-lab-procedures"
3+
version = "0.1.0"
4+
description = "Add your description here"
5+
readme = "README.md"
6+
authors = [
7+
{ name = "Jan Smółka", email = "[email protected]" }
8+
]
9+
requires-python = ">=3.12.7"
10+
dependencies = []
11+
12+
[build-system]
13+
requires = ["hatchling"]
14+
build-backend = "hatchling.build"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

packages/child-lab-procedures/src/child_lab_procedures/py.typed

Whitespace-only changes.

packages/child-lab-visualization/README.md

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[project]
2+
name = "child-lab-visualization"
3+
version = "0.1.0"
4+
description = "Add your description here"
5+
readme = "README.md"
6+
authors = [
7+
{ name = "Jan Smółka", email = "[email protected]" }
8+
]
9+
requires-python = ">=3.12.7"
10+
dependencies = []
11+
12+
[build-system]
13+
requires = ["hatchling"]
14+
build-backend = "hatchling.build"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

packages/child-lab-visualization/src/child_lab_visualization/py.typed

Whitespace-only changes.

packages/marker-detection/README.md

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[project]
2+
name = "marker-detection"
3+
version = "0.1.0"
4+
description = "Add your description here"
5+
readme = "README.md"
6+
authors = [
7+
{ name = "Jan Smółka", email = "[email protected]" }
8+
]
9+
requires-python = ">=3.12.7"
10+
dependencies = []
11+
12+
[build-system]
13+
requires = ["hatchling"]
14+
build-backend = "hatchling.build"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

packages/marker-detection/src/marker_detection/py.typed

Whitespace-only changes.

packages/transformation-buffer/README.md

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[project]
2+
name = "transformation-buffer"
3+
version = "0.1.0"
4+
description = "Add your description here"
5+
readme = "README.md"
6+
authors = [
7+
{ name = "Jan Smółka", email = "[email protected]" }
8+
]
9+
requires-python = ">=3.12.7"
10+
dependencies = []
11+
12+
[build-system]
13+
requires = ["hatchling"]
14+
build-backend = "hatchling.build"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

packages/transformation-buffer/src/transformation_buffer/py.typed

Whitespace-only changes.

packages/video-io/README.md

packages/video-io/pyproject.toml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[project]
2+
name = "video-io"
3+
version = "0.1.0"
4+
description = "Add your description here"
5+
readme = "README.md"
6+
authors = [
7+
{ name = "Jan Smółka", email = "[email protected]" }
8+
]
9+
requires-python = ">=3.12.7"
10+
dependencies = []
11+
12+
[build-system]
13+
requires = ["hatchling"]
14+
build-backend = "hatchling.build"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

packages/video-io/src/video_io/py.typed

Whitespace-only changes.

packages/vpc/README.md

packages/vpc/pyproject.toml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[project]
2+
name = "vpc"
3+
version = "0.1.0"
4+
description = "Add your description here"
5+
readme = "README.md"
6+
authors = [
7+
{ name = "Jan Smółka", email = "[email protected]" }
8+
]
9+
requires-python = ">=3.12.7"
10+
dependencies = []
11+
12+
[build-system]
13+
requires = ["hatchling"]
14+
build-backend = "hatchling.build"

packages/vpc/src/vpc/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

packages/vpc/src/vpc/py.typed

Whitespace-only changes.

pyproject.toml

+52-9
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
[project]
22
name = "child-lab-framework"
33
version = "0.1.0"
4-
description = "UJ ChildLab Computer Vision project"
4+
requires-python = ">=3.12,<3.13"
5+
56
authors = [
67
{ name = "Jan Smółka", email = "[email protected]" },
78
{ name = "Igor Urbanik", email = "[email protected]" },
89
]
9-
requires-python = ">=3.12,<3.13"
10+
11+
description = "UJ ChildLab Computer Vision project"
1012
readme = "README.md"
13+
1114
dependencies = [
1215
"opencv-python>=4.10.0.84",
1316
"ultralytics>=8.2.72",
@@ -16,7 +19,7 @@ dependencies = [
1619
"scipy>=1.14.1",
1720
"pandas>=2.2.2",
1821
"mini-face>=0.1.3",
19-
"depth-pro",
22+
"depth-pro>=0.1.0",
2023
"click>=8.1.7",
2124
"more-itertools>=10.5.0",
2225
"kornia>=0.7.4",
@@ -25,13 +28,50 @@ dependencies = [
2528
]
2629

2730
[dependency-groups]
28-
dev = ["icecream>=2.1.3", "ruff>=0.6.8", "mypy>=1.11.2", "spin>=0.13"]
31+
dev = [
32+
"icecream>=2.1.3",
33+
"ruff>=0.6.8",
34+
"mypy>=1.11.2",
35+
"spin>=0.13",
36+
"pytest>=8.3.4",
37+
"syrupy>=4.8.1",
38+
"pytest-benchmark>=5.1.0",
39+
"hypothesis>=6.129.3",
40+
"basedpyright>=1.28.4",
41+
]
42+
43+
workspace = [
44+
"child-lab-annotation",
45+
"child-lab-cli",
46+
"child-lab-data",
47+
"child-lab-framework",
48+
"child-lab-procedures",
49+
"child-lab-visualization",
50+
"marker-detection",
51+
"transformation-buffer",
52+
"video-io",
53+
"vpc",
54+
]
55+
56+
[tool.uv.workspace]
57+
members = ["packages/*"]
2958

3059
[tool.uv]
31-
compile-bytecode = true
60+
compile-bytecode = false
61+
default-groups = ["dev", "workspace"]
3262

3363
[tool.uv.sources]
3464
depth-pro = { git = "https://github.com/child-lab-uj/depth-pro.git" }
65+
child-lab-annotation = { workspace = true }
66+
child-lab-cli = { workspace = true }
67+
child-lab-data = { workspace = true }
68+
child-lab-framework = { workspace = true }
69+
child-lab-procedures = { workspace = true }
70+
child-lab-visualization = { workspace = true }
71+
marker-detection = { workspace = true }
72+
transformation-buffer = { workspace = true }
73+
video-io = { workspace = true }
74+
vpc = { workspace = true }
3575

3676
[tool.hatch.build.targets.sdist]
3777
include = ["child_lab_framework"]
@@ -52,16 +92,19 @@ quote-style = "single"
5292
indent-style = "space"
5393
docstring-code-format = true
5494

95+
[tool.ruff.lint]
96+
ignore = ["F722"] # Makes using jaxtyping possible
97+
5598
[tool.mypy]
56-
packages = ["child_lab_framework"]
57-
exclude = ["venv"]
99+
exclude = [".venv"]
58100
incremental = true
59101
strict = true
60102
allow_untyped_globals = false
61103
disallow_any_expr = false
104+
disallow_any_explicit = false
105+
disallow_any_decorated = false
106+
disallow_any_generics = false # This option makes using jaxtyping with numpy problematic
62107
disallow_any_unimported = true
63-
disallow_any_decorated = true
64-
disallow_any_generics = true
65108
disallow_subclassing_any = true
66109
disallow_untyped_defs = true
67110
disallow_untyped_calls = true

0 commit comments

Comments
 (0)