Skip to content

Commit 01eca74

Browse files
committed
Add uv project metadata
1 parent 2c78489 commit 01eca74

3 files changed

Lines changed: 73 additions & 0 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
/bazel-*
22
/.idea
3+
.venv/
34
.DS_Store
45
*.pyc
56
*.egg-info/
67
*.swp
78
node_modules
9+
uv.lock

DEVELOPMENT.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,17 @@ $ source tf/bin/activate
2323
(tf)$ pip uninstall -y tb-nightly
2424
```
2525

26+
If you prefer [uv](https://github.com/astral-sh/uv), you can manage the same
27+
development environment from the repository root with:
28+
29+
```sh
30+
$ uv sync --extra tensorflow
31+
$ uv run bazel run //tensorboard -- --logdir /path/to/logs
32+
```
33+
34+
This gives `uv` enough project metadata to manage dependencies from the repo
35+
root, while still using Bazel for the actual TensorBoard build.
36+
2637
TensorBoard builds are done with [Bazel](https://bazel.build), so you may need to [install Bazel](https://docs.bazel.build/versions/master/install.html). The Bazel build will automatically "vulcanize" all the HTML files and generate a "binary" launcher script. When HTML is vulcanized, it means all the script tags and HTML imports are inlined into one big HTML file. Then the Bazel build puts that index.html file inside a static assets zip. The python HTTP server then reads static assets from that zip while serving.
2738

2839
You can build and run TensorBoard via Bazel (from within the TensorFlow nightly virtualenv) as follows:

pyproject.toml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,63 @@
1+
[build-system]
2+
requires = ["setuptools>=64", "wheel"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "tensorboard"
7+
dynamic = ["version", "dependencies"]
8+
description = "TensorBoard lets you watch Tensors Flow"
9+
readme = {file = "tensorboard/pip_package/README.rst", content-type = "text/x-rst"}
10+
requires-python = ">=3.9"
11+
license = {text = "Apache 2.0"}
12+
authors = [{name = "Google Inc.", email = "packages@tensorflow.org"}]
13+
keywords = [
14+
"tensorflow",
15+
"tensorboard",
16+
"tensor",
17+
"machine learning",
18+
"visualizer",
19+
]
20+
classifiers = [
21+
"Development Status :: 4 - Beta",
22+
"Intended Audience :: Developers",
23+
"Intended Audience :: Education",
24+
"Intended Audience :: Science/Research",
25+
"License :: OSI Approved :: Apache Software License",
26+
"Programming Language :: Python :: 3",
27+
"Programming Language :: Python :: 3.9",
28+
"Programming Language :: Python :: 3.10",
29+
"Programming Language :: Python :: 3.11",
30+
"Programming Language :: Python :: 3 :: Only",
31+
"Topic :: Scientific/Engineering :: Mathematics",
32+
"Topic :: Software Development :: Libraries",
33+
"Topic :: Software Development :: Libraries :: Python Modules",
34+
]
35+
36+
[project.scripts]
37+
tensorboard = "tensorboard.main:run_main"
38+
39+
[project.entry-points."tensorboard_plugins"]
40+
projector = "tensorboard.plugins.projector.projector_plugin:ProjectorPlugin"
41+
42+
[project.optional-dependencies]
43+
tensorflow = ["tf-nightly"]
44+
45+
[tool.setuptools.dynamic]
46+
version = {attr = "tensorboard.version.VERSION"}
47+
dependencies = {file = ["tensorboard/pip_package/requirements.txt"]}
48+
49+
[tool.setuptools.packages.find]
50+
include = ["tensorboard", "tensorboard.*"]
51+
exclude = ["tensorboard.pip_package", "tensorboard.pip_package.*"]
52+
53+
[tool.setuptools.package-data]
54+
tensorboard = ["webfiles.zip"]
55+
"tensorboard.plugins.projector" = [
56+
"tf_projector_plugin/index.js",
57+
"tf_projector_plugin/projector_binary.html",
58+
"tf_projector_plugin/projector_binary.js",
59+
]
60+
161
[tool.black]
262
line-length = 80
363
target-version = ["py36", "py37", "py38"]

0 commit comments

Comments
 (0)