ssl-pydev 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ssl_pydev-0.1.0/.gitignore +86 -0
- ssl_pydev-0.1.0/LICENSE +21 -0
- ssl_pydev-0.1.0/PKG-INFO +87 -0
- ssl_pydev-0.1.0/README.md +53 -0
- ssl_pydev-0.1.0/pyproject.toml +179 -0
- ssl_pydev-0.1.0/src/ssl_pydev/__init__.py +1 -0
- ssl_pydev-0.1.0/src/ssl_pydev/cli.py +86 -0
- ssl_pydev-0.1.0/src/ssl_pydev/scripts/__init__.py +0 -0
- ssl_pydev-0.1.0/src/ssl_pydev/scripts/build.sh +21 -0
- ssl_pydev-0.1.0/src/ssl_pydev/scripts/build_native.sh +25 -0
- ssl_pydev-0.1.0/src/ssl_pydev/scripts/publish.sh +28 -0
- ssl_pydev-0.1.0/src/ssl_pydev/scripts/publish_ci.sh +28 -0
- ssl_pydev-0.1.0/src/ssl_pydev/scripts/setup-env.sh +74 -0
- ssl_pydev-0.1.0/src/ssl_pydev/scripts/validate_docs.sh +44 -0
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
## C-specific ignores
|
|
2
|
+
# Prerequisites
|
|
3
|
+
*.d
|
|
4
|
+
|
|
5
|
+
# Compiled Object files
|
|
6
|
+
*.slo
|
|
7
|
+
*.lo
|
|
8
|
+
*.o
|
|
9
|
+
*.obj
|
|
10
|
+
|
|
11
|
+
# Precompiled Headers
|
|
12
|
+
*.gch
|
|
13
|
+
*.pch
|
|
14
|
+
|
|
15
|
+
# Linker files
|
|
16
|
+
*.ilk
|
|
17
|
+
|
|
18
|
+
# Debugger Files
|
|
19
|
+
*.pdb
|
|
20
|
+
|
|
21
|
+
# Compiled Dynamic libraries
|
|
22
|
+
*.so
|
|
23
|
+
*.dylib
|
|
24
|
+
*.dll
|
|
25
|
+
|
|
26
|
+
# Fortran module files
|
|
27
|
+
*.mod
|
|
28
|
+
*.smod
|
|
29
|
+
|
|
30
|
+
# Compiled Static libraries
|
|
31
|
+
*.lai
|
|
32
|
+
*.la
|
|
33
|
+
*.a
|
|
34
|
+
*.lib
|
|
35
|
+
|
|
36
|
+
# Executables
|
|
37
|
+
*.exe
|
|
38
|
+
*.out
|
|
39
|
+
*.app
|
|
40
|
+
|
|
41
|
+
# debug information files
|
|
42
|
+
*.dwo
|
|
43
|
+
|
|
44
|
+
## Python-specific ignores
|
|
45
|
+
__pycache__/
|
|
46
|
+
*.py[cod]
|
|
47
|
+
*$py.class
|
|
48
|
+
*.so
|
|
49
|
+
*.egg
|
|
50
|
+
*.egg-info/
|
|
51
|
+
dist/
|
|
52
|
+
build/
|
|
53
|
+
*.whl
|
|
54
|
+
.venv/
|
|
55
|
+
|
|
56
|
+
# Development tools
|
|
57
|
+
.pytest_cache/
|
|
58
|
+
.ruff_cache/
|
|
59
|
+
.tox/
|
|
60
|
+
.coverage
|
|
61
|
+
htmlcov/
|
|
62
|
+
cov.xml
|
|
63
|
+
.mypy_cache/
|
|
64
|
+
.vscode/
|
|
65
|
+
.idea/
|
|
66
|
+
|
|
67
|
+
# External dependencies
|
|
68
|
+
external/
|
|
69
|
+
|
|
70
|
+
# Temporary files
|
|
71
|
+
*.tmp
|
|
72
|
+
*.temp
|
|
73
|
+
*~
|
|
74
|
+
.DS_Store
|
|
75
|
+
|
|
76
|
+
## Others
|
|
77
|
+
/tmp
|
|
78
|
+
/output
|
|
79
|
+
|
|
80
|
+
_version.py
|
|
81
|
+
|
|
82
|
+
# Doc site
|
|
83
|
+
site
|
|
84
|
+
|
|
85
|
+
# Security scan results
|
|
86
|
+
semgrep-results.json
|
ssl_pydev-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Jesús Bautista Villar
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
ssl_pydev-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: ssl_pydev
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Shared local-dev CLI for Swarm Systems Lab Python projects
|
|
5
|
+
Author-email: Jesus Bautista Villar <jesbauti20@gmail.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
License-File: LICENSE
|
|
8
|
+
Requires-Python: >=3.12
|
|
9
|
+
Provides-Extra: dev
|
|
10
|
+
Requires-Dist: build>=1.2.2; extra == 'dev'
|
|
11
|
+
Requires-Dist: pre-commit>=3.0; extra == 'dev'
|
|
12
|
+
Requires-Dist: pytest-cov>=4.0; extra == 'dev'
|
|
13
|
+
Requires-Dist: pytest>=7.0; extra == 'dev'
|
|
14
|
+
Requires-Dist: ruff>=0.9.0; extra == 'dev'
|
|
15
|
+
Requires-Dist: semgrep>=1.54.0; extra == 'dev'
|
|
16
|
+
Requires-Dist: tox-uv>=1.9; extra == 'dev'
|
|
17
|
+
Requires-Dist: tox>=4.18; extra == 'dev'
|
|
18
|
+
Requires-Dist: twine>=5.1.1; extra == 'dev'
|
|
19
|
+
Requires-Dist: ty>=0.0.14; extra == 'dev'
|
|
20
|
+
Provides-Extra: lint
|
|
21
|
+
Requires-Dist: ruff>=0.9.0; extra == 'lint'
|
|
22
|
+
Requires-Dist: semgrep>=1.54.0; extra == 'lint'
|
|
23
|
+
Provides-Extra: pre-commit
|
|
24
|
+
Requires-Dist: pre-commit>=3.0; extra == 'pre-commit'
|
|
25
|
+
Provides-Extra: release
|
|
26
|
+
Requires-Dist: build>=1.2.2; extra == 'release'
|
|
27
|
+
Requires-Dist: twine>=5.1.1; extra == 'release'
|
|
28
|
+
Provides-Extra: tests
|
|
29
|
+
Requires-Dist: pytest-cov>=4.0; extra == 'tests'
|
|
30
|
+
Requires-Dist: pytest>=7.0; extra == 'tests'
|
|
31
|
+
Provides-Extra: type-checking
|
|
32
|
+
Requires-Dist: ty>=0.0.14; extra == 'type-checking'
|
|
33
|
+
Description-Content-Type: text/markdown
|
|
34
|
+
|
|
35
|
+
# ssl_pydev
|
|
36
|
+
|
|
37
|
+
Shared local-dev CLI for `Swarm-Systems-Lab` Python projects. Wraps the same
|
|
38
|
+
build/publish/docs-validation logic that `ssl_ci`'s composite actions run in CI,
|
|
39
|
+
packaged here so it can be installed **once per machine** instead of copy-pasted
|
|
40
|
+
into every project's `scripts/` directory.
|
|
41
|
+
|
|
42
|
+
## Install
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
uv tool install ssl_pydev
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
This installs a single `ssl-pydev` command, available from any project
|
|
49
|
+
directory, independent of that project's own virtualenv/dependencies.
|
|
50
|
+
|
|
51
|
+
## Usage
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
ssl-pydev setup-env --extras dev,tests
|
|
55
|
+
ssl-pydev build
|
|
56
|
+
ssl-pydev build-native # for compiled-extension (pybind11/scikit-build-core) projects
|
|
57
|
+
ssl-pydev publish # uv-based publish, requires UV_PUBLISH_* env vars
|
|
58
|
+
ssl-pydev publish-ci # twine-based publish, requires TWINE_* env vars
|
|
59
|
+
ssl-pydev validate-docs
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Every command operates on the current working directory, so run it from the
|
|
63
|
+
root of the project you want to act on - same as the `scripts/*.sh` files it
|
|
64
|
+
replaces. A project's `justfile` recipes become one-liners, e.g.:
|
|
65
|
+
|
|
66
|
+
```just
|
|
67
|
+
setup:
|
|
68
|
+
ssl-pydev setup-env --extras dev,lint,tests,type-checking,pre-commit
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Relationship to `ssl_ci`
|
|
72
|
+
|
|
73
|
+
- `ssl_ci` holds the **GitHub Actions** side: reusable workflows and composite
|
|
74
|
+
actions that CI calls directly via `uses:`.
|
|
75
|
+
- `ssl_pydev` (this repo) holds the **local-dev** side: the same logic,
|
|
76
|
+
installed once per developer machine via `uv tool install`.
|
|
77
|
+
|
|
78
|
+
Today the two are maintained in parallel (the underlying `.sh` scripts started
|
|
79
|
+
as copies of each other). Once this package has at least one published
|
|
80
|
+
release, the plan is to update `ssl_ci`'s composite actions to install and
|
|
81
|
+
call `ssl_pydev` themselves, so there's a single source of truth used by
|
|
82
|
+
both CI and local dev.
|
|
83
|
+
|
|
84
|
+
## Versioning
|
|
85
|
+
|
|
86
|
+
Released the same way as the other `Swarm-Systems-Lab` packages: tag `vX.Y.Z`,
|
|
87
|
+
push, and `ssl_ci`'s `publish.yml` builds and uploads to PyPI.
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# ssl_pydev
|
|
2
|
+
|
|
3
|
+
Shared local-dev CLI for `Swarm-Systems-Lab` Python projects. Wraps the same
|
|
4
|
+
build/publish/docs-validation logic that `ssl_ci`'s composite actions run in CI,
|
|
5
|
+
packaged here so it can be installed **once per machine** instead of copy-pasted
|
|
6
|
+
into every project's `scripts/` directory.
|
|
7
|
+
|
|
8
|
+
## Install
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
uv tool install ssl_pydev
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
This installs a single `ssl-pydev` command, available from any project
|
|
15
|
+
directory, independent of that project's own virtualenv/dependencies.
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
ssl-pydev setup-env --extras dev,tests
|
|
21
|
+
ssl-pydev build
|
|
22
|
+
ssl-pydev build-native # for compiled-extension (pybind11/scikit-build-core) projects
|
|
23
|
+
ssl-pydev publish # uv-based publish, requires UV_PUBLISH_* env vars
|
|
24
|
+
ssl-pydev publish-ci # twine-based publish, requires TWINE_* env vars
|
|
25
|
+
ssl-pydev validate-docs
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Every command operates on the current working directory, so run it from the
|
|
29
|
+
root of the project you want to act on - same as the `scripts/*.sh` files it
|
|
30
|
+
replaces. A project's `justfile` recipes become one-liners, e.g.:
|
|
31
|
+
|
|
32
|
+
```just
|
|
33
|
+
setup:
|
|
34
|
+
ssl-pydev setup-env --extras dev,lint,tests,type-checking,pre-commit
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Relationship to `ssl_ci`
|
|
38
|
+
|
|
39
|
+
- `ssl_ci` holds the **GitHub Actions** side: reusable workflows and composite
|
|
40
|
+
actions that CI calls directly via `uses:`.
|
|
41
|
+
- `ssl_pydev` (this repo) holds the **local-dev** side: the same logic,
|
|
42
|
+
installed once per developer machine via `uv tool install`.
|
|
43
|
+
|
|
44
|
+
Today the two are maintained in parallel (the underlying `.sh` scripts started
|
|
45
|
+
as copies of each other). Once this package has at least one published
|
|
46
|
+
release, the plan is to update `ssl_ci`'s composite actions to install and
|
|
47
|
+
call `ssl_pydev` themselves, so there's a single source of truth used by
|
|
48
|
+
both CI and local dev.
|
|
49
|
+
|
|
50
|
+
## Versioning
|
|
51
|
+
|
|
52
|
+
Released the same way as the other `Swarm-Systems-Lab` packages: tag `vX.Y.Z`,
|
|
53
|
+
push, and `ssl_ci`'s `publish.yml` builds and uploads to PyPI.
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = [
|
|
3
|
+
"hatchling",
|
|
4
|
+
"hatch-vcs",
|
|
5
|
+
]
|
|
6
|
+
build-backend = "hatchling.build"
|
|
7
|
+
|
|
8
|
+
[project]
|
|
9
|
+
name = "ssl_pydev"
|
|
10
|
+
dynamic = ["version"]
|
|
11
|
+
description = "Shared local-dev CLI for Swarm Systems Lab Python projects"
|
|
12
|
+
readme = "README.md"
|
|
13
|
+
requires-python = ">=3.12"
|
|
14
|
+
license = { text = "MIT" }
|
|
15
|
+
authors = [
|
|
16
|
+
{ name = "Jesus Bautista Villar", email = "jesbauti20@gmail.com" }
|
|
17
|
+
]
|
|
18
|
+
dependencies = []
|
|
19
|
+
|
|
20
|
+
[project.scripts]
|
|
21
|
+
ssl-pydev = "ssl_pydev.cli:main"
|
|
22
|
+
|
|
23
|
+
# --- Optional dependencies for tooling ---
|
|
24
|
+
[project.optional-dependencies]
|
|
25
|
+
dev = [
|
|
26
|
+
"tox>=4.18",
|
|
27
|
+
"tox-uv>=1.9",
|
|
28
|
+
"ruff>=0.9.0",
|
|
29
|
+
"semgrep>=1.54.0",
|
|
30
|
+
"pytest>=7.0",
|
|
31
|
+
"pytest-cov>=4.0",
|
|
32
|
+
"pre-commit>=3.0",
|
|
33
|
+
"ty>=0.0.14",
|
|
34
|
+
"build>=1.2.2",
|
|
35
|
+
"twine>=5.1.1",
|
|
36
|
+
]
|
|
37
|
+
lint = [
|
|
38
|
+
"ruff>=0.9.0",
|
|
39
|
+
"semgrep>=1.54.0",
|
|
40
|
+
]
|
|
41
|
+
tests = [
|
|
42
|
+
"pytest>=7.0",
|
|
43
|
+
"pytest-cov>=4.0",
|
|
44
|
+
]
|
|
45
|
+
pre-commit = [
|
|
46
|
+
"pre-commit>=3.0",
|
|
47
|
+
]
|
|
48
|
+
type-checking = [
|
|
49
|
+
"ty>=0.0.14",
|
|
50
|
+
]
|
|
51
|
+
release = [
|
|
52
|
+
"build>=1.2.2",
|
|
53
|
+
"twine>=5.1.1",
|
|
54
|
+
]
|
|
55
|
+
|
|
56
|
+
# --- Hatch Configuration ---
|
|
57
|
+
[tool.hatch.version]
|
|
58
|
+
source = "vcs"
|
|
59
|
+
|
|
60
|
+
[tool.hatch.version.raw-options]
|
|
61
|
+
local_scheme = "no-local-version"
|
|
62
|
+
|
|
63
|
+
[tool.hatch.build.targets.wheel]
|
|
64
|
+
packages = ["src/ssl_pydev"]
|
|
65
|
+
artifacts = ["src/ssl_pydev/scripts/*.sh"]
|
|
66
|
+
|
|
67
|
+
[tool.hatch.build.targets.sdist]
|
|
68
|
+
include = ["src", "README.md", "LICENSE"]
|
|
69
|
+
exclude = ["tests"]
|
|
70
|
+
|
|
71
|
+
# --- Tool Configuration ---
|
|
72
|
+
[tool.ruff]
|
|
73
|
+
line-length = 100
|
|
74
|
+
target-version = "py312"
|
|
75
|
+
|
|
76
|
+
[tool.ruff.lint]
|
|
77
|
+
select = [
|
|
78
|
+
"E", "F", "W", "I", "UP", "B", "A", "C4", "T20", "SIM", "RUF", "S",
|
|
79
|
+
]
|
|
80
|
+
ignore = [
|
|
81
|
+
"D100", "D104", "E501", "F403", "F401",
|
|
82
|
+
]
|
|
83
|
+
|
|
84
|
+
[tool.ruff.lint.per-file-ignores]
|
|
85
|
+
"tests/**" = ["S101", "S603"]
|
|
86
|
+
"src/ssl_pydev/cli.py" = ["T201", "S603", "S607"]
|
|
87
|
+
|
|
88
|
+
[tool.ruff.format]
|
|
89
|
+
quote-style = "double"
|
|
90
|
+
indent-style = "space"
|
|
91
|
+
|
|
92
|
+
[tool.pytest.ini_options]
|
|
93
|
+
testpaths = ["tests"]
|
|
94
|
+
python_files = ["test_*.py"]
|
|
95
|
+
addopts = ["-v", "--tb=short", "--strict-markers"]
|
|
96
|
+
|
|
97
|
+
[tool.coverage.run]
|
|
98
|
+
source = ["src/ssl_pydev"]
|
|
99
|
+
omit = ["tests/*"]
|
|
100
|
+
|
|
101
|
+
# Use uv for fast, reproducible environments
|
|
102
|
+
[tool.tox]
|
|
103
|
+
requires = ["tox-uv>=1.0"]
|
|
104
|
+
env_list = [
|
|
105
|
+
"pre-commit",
|
|
106
|
+
"lint",
|
|
107
|
+
"security",
|
|
108
|
+
"tests",
|
|
109
|
+
"py312",
|
|
110
|
+
"py313",
|
|
111
|
+
"py314",
|
|
112
|
+
"build",
|
|
113
|
+
]
|
|
114
|
+
|
|
115
|
+
[tool.tox.env_run_base]
|
|
116
|
+
passenv = ["*"]
|
|
117
|
+
|
|
118
|
+
[tool.tox.env.pre-commit]
|
|
119
|
+
description = "Run pre-commit hooks"
|
|
120
|
+
extras = ["pre-commit"]
|
|
121
|
+
commands = [
|
|
122
|
+
["pre-commit", "run", "--all-files", "--show-diff-on-failure"],
|
|
123
|
+
]
|
|
124
|
+
|
|
125
|
+
[tool.tox.env.lint]
|
|
126
|
+
description = "Run ruff linting and formatting"
|
|
127
|
+
extras = ["lint"]
|
|
128
|
+
commands = [
|
|
129
|
+
["ruff", "check", "src", "tests"],
|
|
130
|
+
["ruff", "format", "--check", "src", "tests"],
|
|
131
|
+
]
|
|
132
|
+
|
|
133
|
+
[tool.tox.env.security]
|
|
134
|
+
description = "Run semgrep security scans"
|
|
135
|
+
extras = ["lint"]
|
|
136
|
+
commands = [
|
|
137
|
+
["semgrep", "--config", "p/ci", "--config", ".semgrep.yml"],
|
|
138
|
+
]
|
|
139
|
+
|
|
140
|
+
[tool.tox.env.type-checking]
|
|
141
|
+
description = "Run ty type checks"
|
|
142
|
+
extras = ["type-checking"]
|
|
143
|
+
commands = [
|
|
144
|
+
["ty", "check"],
|
|
145
|
+
]
|
|
146
|
+
|
|
147
|
+
[tool.tox.env.tests]
|
|
148
|
+
extras = ["tests"]
|
|
149
|
+
commands = [
|
|
150
|
+
["pytest", "--cov=ssl_pydev", "--cov-report", "term", "--cov-report", "xml:cov.xml"],
|
|
151
|
+
]
|
|
152
|
+
|
|
153
|
+
[tool.tox.env.py312]
|
|
154
|
+
base_python = ["python3.12"]
|
|
155
|
+
extras = ["tests"]
|
|
156
|
+
commands = [
|
|
157
|
+
["pytest", "tests"],
|
|
158
|
+
]
|
|
159
|
+
|
|
160
|
+
[tool.tox.env.py313]
|
|
161
|
+
base_python = ["python3.13"]
|
|
162
|
+
extras = ["tests"]
|
|
163
|
+
commands = [
|
|
164
|
+
["pytest", "tests"],
|
|
165
|
+
]
|
|
166
|
+
|
|
167
|
+
[tool.tox.env.py314]
|
|
168
|
+
base_python = ["python3.14"]
|
|
169
|
+
extras = ["tests"]
|
|
170
|
+
commands = [
|
|
171
|
+
["pytest", "tests"],
|
|
172
|
+
]
|
|
173
|
+
|
|
174
|
+
[tool.tox.env.build]
|
|
175
|
+
description = "Build sdist and wheel artifacts"
|
|
176
|
+
extras = ["release"]
|
|
177
|
+
commands = [
|
|
178
|
+
["python", "-m", "build", "--sdist", "--wheel", "--outdir", "dist"],
|
|
179
|
+
]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Shared local-dev CLI for Swarm Systems Lab Python projects."""
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"""ssl_pydev CLI - shared local-dev commands for Swarm Systems Lab Python projects.
|
|
2
|
+
|
|
3
|
+
These wrap the same scripts ssl_ci's composite actions use in CI, packaged here so
|
|
4
|
+
they can be installed once per machine (``uv tool install ssl-pydev``) instead
|
|
5
|
+
of being copy-pasted into every project's scripts/ directory.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
import argparse
|
|
9
|
+
import subprocess
|
|
10
|
+
import sys
|
|
11
|
+
from importlib import resources
|
|
12
|
+
|
|
13
|
+
SCRIPTS_MAP = {
|
|
14
|
+
"setup-env": "setup-env.sh",
|
|
15
|
+
"build": "build.sh",
|
|
16
|
+
"build-native": "build_native.sh",
|
|
17
|
+
"publish": "publish.sh",
|
|
18
|
+
"publish-ci": "publish_ci.sh",
|
|
19
|
+
"validate-docs": "validate_docs.sh",
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
EPILOG = """
|
|
23
|
+
Examples:
|
|
24
|
+
ssl-pydev setup-env --extras dev,tests
|
|
25
|
+
ssl-pydev build
|
|
26
|
+
ssl-pydev build-native
|
|
27
|
+
ssl-pydev publish-ci
|
|
28
|
+
ssl-pydev validate-docs
|
|
29
|
+
|
|
30
|
+
All commands accept additional arguments which are passed through to the
|
|
31
|
+
underlying script. Commands run against the current working directory, so
|
|
32
|
+
invoke this from the root of the project you want to act on.
|
|
33
|
+
"""
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def _get_script(command: str) -> str:
|
|
37
|
+
"""Return the path to a bundled script by command name."""
|
|
38
|
+
if command not in SCRIPTS_MAP:
|
|
39
|
+
raise ValueError(f"Unknown command: {command}")
|
|
40
|
+
|
|
41
|
+
script_ref = resources.files("ssl_pydev.scripts").joinpath(SCRIPTS_MAP[command])
|
|
42
|
+
if not script_ref.is_file():
|
|
43
|
+
raise FileNotFoundError(f"Bundled script not found: {script_ref}")
|
|
44
|
+
return str(script_ref)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def _run_script(command: str, args: list) -> int:
|
|
48
|
+
"""Execute a bundled script with the given arguments."""
|
|
49
|
+
try:
|
|
50
|
+
script_path = _get_script(command)
|
|
51
|
+
except (FileNotFoundError, ValueError) as e:
|
|
52
|
+
print(f"Error: {e}", file=sys.stderr)
|
|
53
|
+
return 1
|
|
54
|
+
|
|
55
|
+
result = subprocess.run(["bash", script_path, *args], check=False)
|
|
56
|
+
return result.returncode
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
def main() -> int:
|
|
60
|
+
"""Main CLI entry point."""
|
|
61
|
+
if len(sys.argv) < 2 or sys.argv[1] in ["-h", "--help", "help"]:
|
|
62
|
+
parser = argparse.ArgumentParser(
|
|
63
|
+
prog="ssl-pydev",
|
|
64
|
+
description="Swarm Systems Lab shared local-dev CLI",
|
|
65
|
+
formatter_class=argparse.RawDescriptionHelpFormatter,
|
|
66
|
+
epilog=EPILOG,
|
|
67
|
+
)
|
|
68
|
+
subparsers = parser.add_subparsers(dest="command", help="Available commands")
|
|
69
|
+
for cmd in sorted(SCRIPTS_MAP.keys()):
|
|
70
|
+
subparsers.add_parser(cmd, help=f"Run {cmd}")
|
|
71
|
+
parser.print_help()
|
|
72
|
+
return 0
|
|
73
|
+
|
|
74
|
+
command = sys.argv[1]
|
|
75
|
+
script_args = sys.argv[2:]
|
|
76
|
+
|
|
77
|
+
if command not in SCRIPTS_MAP:
|
|
78
|
+
print(f"Error: Unknown command '{command}'", file=sys.stderr)
|
|
79
|
+
print(f"Available commands: {', '.join(sorted(SCRIPTS_MAP.keys()))}", file=sys.stderr)
|
|
80
|
+
return 1
|
|
81
|
+
|
|
82
|
+
return _run_script(command, script_args)
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
if __name__ == "__main__":
|
|
86
|
+
sys.exit(main())
|
|
File without changes
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
# Build sdist + wheel for a pure-Python project. Bootstraps the venv if needed.
|
|
5
|
+
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
6
|
+
ROOT_DIR="$(pwd)"
|
|
7
|
+
|
|
8
|
+
if [ ! -d "$ROOT_DIR/.venv" ]; then
|
|
9
|
+
"$SCRIPT_DIR/setup-env.sh" --extras dev,release
|
|
10
|
+
fi
|
|
11
|
+
|
|
12
|
+
. .venv/bin/activate
|
|
13
|
+
|
|
14
|
+
echo "Preparing build output directory"
|
|
15
|
+
rm -rf dist
|
|
16
|
+
mkdir -p dist
|
|
17
|
+
|
|
18
|
+
echo "Running tox build environment"
|
|
19
|
+
uv run tox -e build
|
|
20
|
+
|
|
21
|
+
echo "Build artifacts placed in dist/"
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
# Build sdist + cibuildwheel wheels for a compiled-extension project.
|
|
5
|
+
# Bootstraps the venv if needed.
|
|
6
|
+
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
7
|
+
ROOT_DIR="$(pwd)"
|
|
8
|
+
|
|
9
|
+
if [ ! -d "$ROOT_DIR/.venv" ]; then
|
|
10
|
+
"$SCRIPT_DIR/setup-env.sh" --extras dev,release
|
|
11
|
+
fi
|
|
12
|
+
|
|
13
|
+
. .venv/bin/activate
|
|
14
|
+
|
|
15
|
+
echo "Preparing build output directory"
|
|
16
|
+
rm -rf dist
|
|
17
|
+
mkdir -p dist
|
|
18
|
+
|
|
19
|
+
echo "Running tox build environment (sdist + wheel)"
|
|
20
|
+
uv run tox -e build
|
|
21
|
+
|
|
22
|
+
echo "Running tox cibuildwheel environment (multiplatform wheels)"
|
|
23
|
+
uv run tox -e cibuildwheel
|
|
24
|
+
|
|
25
|
+
echo "Build artifacts placed in dist/"
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
# Local publish using uv's built-in publishing support.
|
|
5
|
+
# SCRIPT_DIR: where this script is located (for finding setup-env.sh)
|
|
6
|
+
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
7
|
+
ROOT_DIR="$(pwd)"
|
|
8
|
+
|
|
9
|
+
if [ ! -d "$ROOT_DIR/.venv" ]; then
|
|
10
|
+
"$SCRIPT_DIR/setup-env.sh" --extras dev,release
|
|
11
|
+
fi
|
|
12
|
+
|
|
13
|
+
. .venv/bin/activate
|
|
14
|
+
|
|
15
|
+
if [ -z "${UV_PUBLISH_USERNAME-}" ] || [ -z "${UV_PUBLISH_PASSWORD-}" ] || [ -z "${UV_PUBLISH_REPOSITORY_URL-}" ]; then
|
|
16
|
+
echo "Missing publishing credentials (UV_PUBLISH_USERNAME / UV_PUBLISH_PASSWORD / UV_PUBLISH_REPOSITORY_URL)" >&2
|
|
17
|
+
exit 1
|
|
18
|
+
fi
|
|
19
|
+
|
|
20
|
+
if [ ! -d dist ] || [ -z "$(ls -A dist 2>/dev/null)" ]; then
|
|
21
|
+
echo "No artifacts found in dist/ - nothing to publish" >&2
|
|
22
|
+
exit 1
|
|
23
|
+
fi
|
|
24
|
+
|
|
25
|
+
echo "Publishing artifacts from dist/ using uv"
|
|
26
|
+
uv publish --repository-url "$UV_PUBLISH_REPOSITORY_URL" --username "$UV_PUBLISH_USERNAME" --password "$UV_PUBLISH_PASSWORD" dist/*
|
|
27
|
+
|
|
28
|
+
echo "Publish finished"
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
# CI-friendly publish using twine with credentials from the environment.
|
|
5
|
+
# SCRIPT_DIR: where this script is located (for finding setup-env.sh)
|
|
6
|
+
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
7
|
+
ROOT_DIR="$(pwd)"
|
|
8
|
+
|
|
9
|
+
if [ ! -d "$ROOT_DIR/.venv" ]; then
|
|
10
|
+
"$SCRIPT_DIR/setup-env.sh" --extras dev,release
|
|
11
|
+
fi
|
|
12
|
+
|
|
13
|
+
. .venv/bin/activate
|
|
14
|
+
|
|
15
|
+
if [ -z "${TWINE_USERNAME-}" ] || [ -z "${TWINE_PASSWORD-}" ] || [ -z "${TWINE_REPOSITORY_URL-}" ]; then
|
|
16
|
+
echo "Missing publishing credentials (TWINE_USERNAME / TWINE_PASSWORD / TWINE_REPOSITORY_URL)" >&2
|
|
17
|
+
exit 1
|
|
18
|
+
fi
|
|
19
|
+
|
|
20
|
+
if [ ! -d dist ] || [ -z "$(ls -A dist 2>/dev/null)" ]; then
|
|
21
|
+
echo "No artifacts found in dist/ - nothing to publish" >&2
|
|
22
|
+
exit 1
|
|
23
|
+
fi
|
|
24
|
+
|
|
25
|
+
echo "Publishing artifacts from dist/ using twine"
|
|
26
|
+
python -m twine upload --verbose --non-interactive --repository-url "$TWINE_REPOSITORY_URL" dist/*
|
|
27
|
+
|
|
28
|
+
echo "Publish finished"
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
# Bootstraps a uv-managed virtualenv for the calling project.
|
|
5
|
+
# Mirrors ssl_ci's actions/env-setup/setup-env.sh - this is the local-dev counterpart.
|
|
6
|
+
|
|
7
|
+
EXTRA_LIST=()
|
|
8
|
+
ALL_EXTRAS=0
|
|
9
|
+
FROZEN=1
|
|
10
|
+
EXTRA_PACKAGES=()
|
|
11
|
+
|
|
12
|
+
usage() {
|
|
13
|
+
echo "Usage: $0 [--extras <comma-separated>] [--all-extras] [--no-frozen] [--with <pkg> ...]" >&2
|
|
14
|
+
exit 1
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
while [[ $# -gt 0 ]]; do
|
|
18
|
+
case "$1" in
|
|
19
|
+
--extras)
|
|
20
|
+
[[ $# -ge 2 ]] || usage
|
|
21
|
+
IFS=',' read -r -a EXTRA_LIST <<< "$2"
|
|
22
|
+
shift 2
|
|
23
|
+
;;
|
|
24
|
+
--all-extras)
|
|
25
|
+
ALL_EXTRAS=1
|
|
26
|
+
shift
|
|
27
|
+
;;
|
|
28
|
+
--no-frozen)
|
|
29
|
+
FROZEN=0
|
|
30
|
+
shift
|
|
31
|
+
;;
|
|
32
|
+
--with)
|
|
33
|
+
[[ $# -ge 2 ]] || usage
|
|
34
|
+
EXTRA_PACKAGES+=("$2")
|
|
35
|
+
shift 2
|
|
36
|
+
;;
|
|
37
|
+
*)
|
|
38
|
+
usage
|
|
39
|
+
;;
|
|
40
|
+
esac
|
|
41
|
+
done
|
|
42
|
+
|
|
43
|
+
if ! command -v uv >/dev/null 2>&1; then
|
|
44
|
+
curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
45
|
+
export PATH="$HOME/.local/bin:$PATH"
|
|
46
|
+
fi
|
|
47
|
+
|
|
48
|
+
if ! command -v just >/dev/null 2>&1; then
|
|
49
|
+
curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- --to ~/.local/bin
|
|
50
|
+
export PATH="$HOME/.local/bin:$PATH"
|
|
51
|
+
fi
|
|
52
|
+
|
|
53
|
+
if [ ! -d .venv ]; then
|
|
54
|
+
uv venv .venv
|
|
55
|
+
fi
|
|
56
|
+
|
|
57
|
+
. .venv/bin/activate
|
|
58
|
+
|
|
59
|
+
SYNC_ARGS=(sync)
|
|
60
|
+
((FROZEN)) && SYNC_ARGS+=("--frozen")
|
|
61
|
+
|
|
62
|
+
if ((ALL_EXTRAS)); then
|
|
63
|
+
SYNC_ARGS+=("--all-extras")
|
|
64
|
+
elif [ ${#EXTRA_LIST[@]} -gt 0 ]; then
|
|
65
|
+
for extra in "${EXTRA_LIST[@]}"; do
|
|
66
|
+
SYNC_ARGS+=("--extra" "$extra")
|
|
67
|
+
done
|
|
68
|
+
fi
|
|
69
|
+
|
|
70
|
+
uv "${SYNC_ARGS[@]}"
|
|
71
|
+
|
|
72
|
+
if [ ${#EXTRA_PACKAGES[@]} -gt 0 ]; then
|
|
73
|
+
uv add "${EXTRA_PACKAGES[@]}"
|
|
74
|
+
fi
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Validate the documentation build output without rebuilding it.
|
|
3
|
+
|
|
4
|
+
set -euo pipefail
|
|
5
|
+
IFS=$'\n\t'
|
|
6
|
+
|
|
7
|
+
PROJECT_ROOT="$(pwd)"
|
|
8
|
+
SITE_DIR="${SITE_DIR:-$PROJECT_ROOT/site}"
|
|
9
|
+
MKDOCS_CONFIG="${MKDOCS_CONFIG:-$PROJECT_ROOT/mkdocs.yml}"
|
|
10
|
+
|
|
11
|
+
echo "Validating documentation build output..."
|
|
12
|
+
|
|
13
|
+
if [[ ! -f "$MKDOCS_CONFIG" ]]; then
|
|
14
|
+
echo "Error: mkdocs config not found at $MKDOCS_CONFIG" >&2
|
|
15
|
+
exit 1
|
|
16
|
+
fi
|
|
17
|
+
|
|
18
|
+
if [[ ! -d "$SITE_DIR" ]]; then
|
|
19
|
+
echo "Error: site directory not found at $SITE_DIR" >&2
|
|
20
|
+
echo "Build the docs first (e.g., just docs-build)." >&2
|
|
21
|
+
exit 1
|
|
22
|
+
fi
|
|
23
|
+
|
|
24
|
+
if [[ ! -s "$SITE_DIR/index.html" ]]; then
|
|
25
|
+
echo "Error: missing or empty index.html in $SITE_DIR" >&2
|
|
26
|
+
exit 1
|
|
27
|
+
fi
|
|
28
|
+
|
|
29
|
+
html_count=$(find "$SITE_DIR" -type f -name '*.html' | wc -l | tr -d ' ')
|
|
30
|
+
if [[ "$html_count" -lt 2 ]]; then
|
|
31
|
+
echo "Error: expected more than one HTML file in $SITE_DIR" >&2
|
|
32
|
+
exit 1
|
|
33
|
+
fi
|
|
34
|
+
|
|
35
|
+
if [[ -f "$SITE_DIR/search/search_index.json" ]]; then
|
|
36
|
+
if [[ ! -s "$SITE_DIR/search/search_index.json" ]]; then
|
|
37
|
+
echo "Warning: search index exists but is empty" >&2
|
|
38
|
+
fi
|
|
39
|
+
else
|
|
40
|
+
echo "Warning: search index not found at $SITE_DIR/search/search_index.json" >&2
|
|
41
|
+
fi
|
|
42
|
+
|
|
43
|
+
echo "Documentation validation successful."
|
|
44
|
+
echo "Validated $html_count HTML files in $SITE_DIR"
|