Skip to content

Commit 432e5c9

Browse files
committed
1 parent c0fcaa9 commit 432e5c9

4 files changed

Lines changed: 31 additions & 2 deletions

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,3 +145,6 @@ bazel-*
145145

146146
.DS_Store
147147
.idea/*
148+
149+
# Docs bundled from docsite repo at build time; populated by `uv build` or `smart-tests get docs` in dev
150+
smart_tests/docs/

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,6 @@ build-backend = "setuptools.build_meta"
6161
packages = ["smart_tests"]
6262

6363
[tool.setuptools.package-data]
64-
smart_tests = ["jar/exe_deploy.jar"]
64+
smart_tests = ["jar/exe_deploy.jar", "docs/**/*"]
6565

6666
[tool.setuptools_scm]

setup.py

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
1+
import shutil
2+
import subprocess
3+
import tempfile
4+
from pathlib import Path
5+
16
from setuptools import setup
7+
from setuptools.command.build_py import build_py
8+
9+
10+
class BuildPyWithDocs(build_py):
11+
def run(self):
12+
docs_dst = Path(__file__).parent / 'smart_tests' / 'docs'
13+
if docs_dst.exists():
14+
shutil.rmtree(docs_dst)
15+
16+
with tempfile.TemporaryDirectory() as tmpdir:
17+
subprocess.run(
18+
['git', 'clone', '--depth=1',
19+
'https://github.com/cloudbees/docsite-cloudbees-smart-tests', tmpdir],
20+
check=True,
21+
)
22+
shutil.copytree(Path(tmpdir) / 'docs', docs_dst)
23+
24+
super().run()
25+
226

3-
setup()
27+
setup(cmdclass={'build_py': BuildPyWithDocs})

smart_tests/__main__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from smart_tests.commands.compare import compare
1010
from smart_tests.commands.detect_flakes import detect_flakes
1111
from smart_tests.commands.gate import gate
12+
from smart_tests.commands.get import get
1213
from smart_tests.commands.inspect import inspect
1314
from smart_tests.commands.record import record
1415
from smart_tests.commands.stats import stats
@@ -25,6 +26,7 @@
2526
cli.add_command(compare)
2627
cli.add_command(detect_flakes)
2728
cli.add_command(gate)
29+
cli.add_command(get)
2830

2931

3032
def _load_test_runners():

0 commit comments

Comments
 (0)