Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
85 lines (77 loc) · 3.48 KB
/
Copy pathpyproject.toml
File metadata and controls
85 lines (77 loc) · 3.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
[build-system]
requires = ["setuptools>=80", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "ocp-viewer-core"
version = "1.3.0"
authors = [{ name = "Bernhard Walter", email = "b_walter@arcor.de" }]
description = "Shared viewer core for ocp_vscode, ocp_viewer, Jupyter CadQuery and build123d Studio"
readme = "README.md"
requires-python = ">=3.10"
keywords = [
"3d models",
"3d viewing",
"3d",
"brep",
"cad",
"cadquery",
"opencascade",
"python",
]
license = "Apache-2.0"
classifiers = [
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
]
# No OCP provider is declared, deliberately: the same OCP namespace is shipped
# by cadquery_ocp, cadquery_ocp_novtk and conda's OCP, and naming one would
# break the users of the other two. The host or the user chooses.
# threejs-materials is a show-path dependency, not an optional one: `_tessellate`
# tests `isinstance(node.material, PbrProperties)` to tell a threejs material from
# a build123d one, and an isinstance needs the class. The bound is ocp_vscode's,
# unchanged (vscode-ocp-cad-viewer/pyproject.toml:42), so nothing has to be
# re-resolved when the host adopts the core.
# pillow is the animation module's: `save_as_gif` assembles the frames. Shared
# functionality carries its dependency in the core rather than per host.
# websockets is `websocket.py`'s, for the same reason: the client every host
# speaks through imports it at module level, and it used to be declared only by
# the hosts that happened to reach the module first, which left a plain
# `pip install jupyter-cadquery` importing a package nothing had installed.
# questionary is the `cli` extra instead of a dependency: its one use is the
# prompt in `choose_port`, reached only when several viewers are listening AND
# the shell is not a Jupyter kernel. A host that runs in a kernel takes the
# `input()` branch and can never get there, and build123d Studio does not
# import `websocket` at all - so two of the four hosts were installing a
# package they cannot execute. The two that can - ocp_viewer and ocp_vscode -
# ask for `ocp-viewer-core[cli]`.
dependencies = [
"ocp-tessellate>=3.7.0,<3.8.0",
"orjson",
"pillow",
"threejs-materials>=1.2.0,<1.3.0",
"websockets>=16.0",
]
[project.optional-dependencies]
cli = ["questionary>=2.1,<3.0"]
# The agent's MCP server, `python -m ocp_viewer_core.mcp`, and nothing else:
# only `ocp_viewer_core/mcp/server.py` imports it (`__main__.py` through it), and
# nothing in the core imports that package. Capped below 3: the server is built on the
# 2.x API (`mcp.server.mcpserver.MCPServer`), which a major version may change.
mcp = ["mcp>=2.3,<3"]
dev = ["build", "bump-my-version", "black", "pytest", "twine"]
[project.urls]
"Homepage" = "https://github.com/bernhard-42/ocp-viewer-core"
"Bug Tracker" = "https://github.com/bernhard-42/ocp-viewer-core/issues"
[tool.setuptools.packages.find]
where = ["."]
include = ["ocp_viewer_core*"]
# ruff and ty are the whole toolchain: `ruff check` lints, `ty check` types, and
# nothing reformats. A formatter was dropped deliberately - black rewrapped a
# line onto two and carried the trailing `# noqa` onto the wrong one, where it
# suppressed nothing, so the linter and the formatter undid each other.
[tool.ruff]
target-version = "py310"
line-length = 88
# Version bumping lives in .bumpversion-py.toml and .bumpversion-js.toml, one
# per half: major.minor is the shared contract, the patch level is each half's
# own. See Development.md.