kubesure 0.0.2__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.
@@ -0,0 +1,36 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [ "main" ]
6
+ pull_request:
7
+ branches: [ "main" ]
8
+
9
+ jobs:
10
+ test-cli:
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - name: Checkout code
14
+ uses: actions/checkout@v4
15
+
16
+ - name: Setup UV
17
+ uses: astral-sh/setup-uv@v5
18
+ with:
19
+ enable-cache: true
20
+
21
+ - name: Setup Python
22
+ uses: actions/setup-python@v5
23
+ with:
24
+ python-version: ${{ matrix.python-version }}
25
+
26
+ - name: Install the package locally
27
+ run: pip install .
28
+
29
+ - name: Test the execution of Hello World
30
+ run: |
31
+ kubesure version
32
+ kubesure check ./manifests
33
+
34
+ strategy:
35
+ matrix:
36
+ python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
@@ -0,0 +1,87 @@
1
+ name: Publish Test
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ inputs:
6
+ version_suffix:
7
+ description: 'Version suffix (ex: dev1, rc1)'
8
+ required: false
9
+ default: 'dev'
10
+
11
+ jobs:
12
+ publish-testpypi:
13
+ runs-on: ubuntu-latest
14
+ environment: testpypi
15
+ permissions:
16
+ id-token: write
17
+ contents: read
18
+ steps:
19
+ - name: Checkout code
20
+ uses: actions/checkout@v4
21
+
22
+ - name: Setup UV
23
+ uses: astral-sh/setup-uv@v5
24
+
25
+ - name: Setup Python
26
+ uses: actions/setup-python@v5
27
+ with:
28
+ python-version: "3.14"
29
+
30
+ - name: Apply version suffix
31
+ env:
32
+ VERSION_SUFFIX: ${{ inputs.version_suffix }}
33
+ run: |
34
+ python << 'PY'
35
+ import os
36
+ import re
37
+ from pathlib import Path
38
+
39
+ suffix = (os.environ.get("VERSION_SUFFIX") or "").strip() or "dev0"
40
+ if suffix == "dev":
41
+ suffix = "dev0"
42
+
43
+ pyproject = Path("pyproject.toml").read_text(encoding="utf-8")
44
+ m = re.search(r'^version\s*=\s*"([^"]+)"', pyproject, re.MULTILINE)
45
+ if not m:
46
+ raise SystemExit("Could not read project.version from pyproject.toml")
47
+ base = m.group(1)
48
+
49
+ if suffix.startswith("dev"):
50
+ new_version = f"{base}.{suffix}"
51
+ elif re.match(r"^(rc|a|b)\d+", suffix):
52
+ new_version = f"{base}{suffix}"
53
+ else:
54
+ new_version = f"{base}.{suffix}"
55
+
56
+ pyproject_new = re.sub(
57
+ r'^version\s*=\s*"[^"]+"',
58
+ f'version = "{new_version}"',
59
+ pyproject,
60
+ count=1,
61
+ flags=re.MULTILINE,
62
+ )
63
+ Path("pyproject.toml").write_text(pyproject_new, encoding="utf-8")
64
+
65
+ ver_file = Path("src/kubesure/__version__.py")
66
+ text = ver_file.read_text(encoding="utf-8")
67
+ ver_file.write_text(
68
+ re.sub(
69
+ r"^__version__\s*=\s*'[^']+'",
70
+ f"__version__ = '{new_version}'",
71
+ text,
72
+ count=1,
73
+ flags=re.MULTILINE,
74
+ ),
75
+ encoding="utf-8",
76
+ )
77
+
78
+ print(f"Publishing as {new_version}")
79
+ PY
80
+
81
+ - name: Build with uv
82
+ run: uv build
83
+
84
+ - name: Send to TestPyPI
85
+ uses: pypa/gh-action-pypi-publish@release/v1
86
+ with:
87
+ repository-url: https://test.pypi.org/legacy/
@@ -0,0 +1,87 @@
1
+ name: Publish
2
+
3
+ # TODO: Remove this when the release workflow is ready
4
+ on:
5
+ workflow_dispatch:
6
+ inputs:
7
+ version_tag:
8
+ description: 'Version tag generated by Semantic Release (ex: v0.1.0)'
9
+ required: true
10
+ default: 'latest'
11
+
12
+ # TODO: Uncomment this when the release workflow is ready
13
+ # on:
14
+ # release:
15
+ # types: [published]
16
+
17
+ jobs:
18
+ publish-pypi:
19
+ name: Publish to PyPI
20
+ runs-on: ubuntu-latest
21
+ environment: pypi
22
+ permissions:
23
+ id-token: write
24
+ contents: read
25
+ steps:
26
+ - name: Checkout code
27
+ uses: actions/checkout@v4
28
+
29
+ - name: Setup UV
30
+ uses: astral-sh/setup-uv@v5
31
+
32
+ - name: Setup Python
33
+ uses: actions/setup-python@v5
34
+ with:
35
+ python-version: "3.14"
36
+
37
+ - name: Build (sdist and wheel) with uv
38
+ run: uv build
39
+
40
+ - name: Send to PyPI
41
+ uses: pypa/gh-action-pypi-publish@release/v1
42
+
43
+ publish-docker:
44
+ name: Publish container image
45
+ runs-on: ubuntu-latest
46
+ permissions:
47
+ contents: read
48
+ packages: write
49
+ steps:
50
+ - name: Checkout code
51
+ uses: actions/checkout@v4
52
+
53
+ - name: Setup Docker Buildx
54
+ uses: docker/setup-buildx-action@v3
55
+
56
+ - name: Login to Docker Hub
57
+ uses: docker/login-action@v3
58
+ with:
59
+ username: ${{ vars.DOCKERHUB_USERNAME }}
60
+ password: ${{ secrets.DOCKERHUB_TOKEN }}
61
+
62
+ - name: Login to GitHub Container Registry (GHCR)
63
+ uses: docker/login-action@v3
64
+ with:
65
+ registry: ghcr.io
66
+ username: ${{ github.actor }}
67
+ password: ${{ secrets.GITHUB_TOKEN }}
68
+
69
+ - name: Build and Publish
70
+ uses: docker/build-push-action@v5
71
+ with:
72
+ context: .
73
+ push: true
74
+
75
+ # TODO: Remove this when the release workflow is ready
76
+ tags: |
77
+ ${{ vars.DOCKERHUB_USERNAME }}/kubesure:latest
78
+ ${{ vars.DOCKERHUB_USERNAME }}/kubesure:${{ github.event.inputs.version_tag }}
79
+ ghcr.io/${{ github.repository }}:latest
80
+ ghcr.io/${{ github.repository }}:${{ github.event.inputs.version_tag }}
81
+
82
+ # TODO: Uncomment this when the release workflow is ready
83
+ # tags: |
84
+ # ${{ vars.DOCKERHUB_USERNAME }}/kubesure:latest
85
+ # ${{ vars.DOCKERHUB_USERNAME }}/kubesure:${{ github.event.release.tag_name }}
86
+ # ghcr.io/${{ github.repository }}:latest
87
+ # ghcr.io/${{ github.repository }}:${{ github.event.release.tag_name }}
@@ -0,0 +1,39 @@
1
+ name: Release
2
+
3
+ on:
4
+ workflow_dispatch:
5
+
6
+ permissions:
7
+ contents: write
8
+ id-token: write
9
+
10
+ jobs:
11
+ release:
12
+ runs-on: ubuntu-latest
13
+ concurrency: release
14
+ steps:
15
+ - name: Checkout code
16
+ uses: actions/checkout@v4
17
+ with:
18
+ fetch-depth: 0
19
+
20
+ - name: Set up Python
21
+ uses: actions/setup-python@v5
22
+ with:
23
+ python-version: "3.14"
24
+
25
+ - name: Set up uv
26
+ uses: astral-sh/setup-uv@v5
27
+ with:
28
+ enable-cache: true
29
+
30
+ - name: Install dependencies
31
+ run: uv sync --frozen --group dev
32
+
33
+ - name: Run Python Semantic Release
34
+ env:
35
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37
+ run: |
38
+ uv run semantic-release version
39
+ uv run semantic-release publish
@@ -0,0 +1,404 @@
1
+ # Created by https://www.toptal.com/developers/gitignore/api/python,pycharm,visualstudiocode,intellij,eclipse
2
+ # Edit at https://www.toptal.com/developers/gitignore?templates=python,pycharm,visualstudiocode,intellij,eclipse
3
+
4
+ ### Eclipse ###
5
+ .metadata
6
+ bin/
7
+ tmp/
8
+ *.tmp
9
+ *.bak
10
+ *.swp
11
+ *~.nib
12
+ local.properties
13
+ .settings/
14
+ .loadpath
15
+ .recommenders
16
+
17
+ # External tool builders
18
+ .externalToolBuilders/
19
+
20
+ # Locally stored "Eclipse launch configurations"
21
+ *.launch
22
+
23
+ # PyDev specific (Python IDE for Eclipse)
24
+ *.pydevproject
25
+
26
+ # CDT-specific (C/C++ Development Tooling)
27
+ .cproject
28
+
29
+ # CDT- autotools
30
+ .autotools
31
+
32
+ # Java annotation processor (APT)
33
+ .factorypath
34
+
35
+ # PDT-specific (PHP Development Tools)
36
+ .buildpath
37
+
38
+ # sbteclipse plugin
39
+ .target
40
+
41
+ # Tern plugin
42
+ .tern-project
43
+
44
+ # TeXlipse plugin
45
+ .texlipse
46
+
47
+ # STS (Spring Tool Suite)
48
+ .springBeans
49
+
50
+ # Code Recommenders
51
+ .recommenders/
52
+
53
+ # Annotation Processing
54
+ .apt_generated/
55
+ .apt_generated_test/
56
+
57
+ # Scala IDE specific (Scala & Java development for Eclipse)
58
+ .cache-main
59
+ .scala_dependencies
60
+ .worksheet
61
+
62
+ # Uncomment this line if you wish to ignore the project description file.
63
+ # Typically, this file would be tracked if it contains build/dependency configurations:
64
+ #.project
65
+
66
+ ### Eclipse Patch ###
67
+ # Spring Boot Tooling
68
+ .sts4-cache/
69
+
70
+ ### Intellij ###
71
+ # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
72
+ # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
73
+
74
+ # User-specific stuff
75
+ .idea/**/workspace.xml
76
+ .idea/**/tasks.xml
77
+ .idea/**/usage.statistics.xml
78
+ .idea/**/dictionaries
79
+ .idea/**/shelf
80
+
81
+ # Generated files
82
+ .idea/**/contentModel.xml
83
+
84
+ # Sensitive or high-churn files
85
+ .idea/**/dataSources/
86
+ .idea/**/dataSources.ids
87
+ .idea/**/dataSources.local.xml
88
+ .idea/**/sqlDataSources.xml
89
+ .idea/**/dynamic.xml
90
+ .idea/**/uiDesigner.xml
91
+ .idea/**/dbnavigator.xml
92
+
93
+ # Gradle
94
+ .idea/**/gradle.xml
95
+ .idea/**/libraries
96
+
97
+ # Gradle and Maven with auto-import
98
+ # When using Gradle or Maven with auto-import, you should exclude module files,
99
+ # since they will be recreated, and may cause churn. Uncomment if using
100
+ # auto-import.
101
+ # .idea/artifacts
102
+ # .idea/compiler.xml
103
+ # .idea/jarRepositories.xml
104
+ # .idea/modules.xml
105
+ # .idea/*.iml
106
+ # .idea/modules
107
+ # *.iml
108
+ # *.ipr
109
+
110
+ # CMake
111
+ cmake-build-*/
112
+
113
+ # Mongo Explorer plugin
114
+ .idea/**/mongoSettings.xml
115
+
116
+ # File-based project format
117
+ *.iws
118
+
119
+ # IntelliJ
120
+ out/
121
+
122
+ # mpeltonen/sbt-idea plugin
123
+ .idea_modules/
124
+
125
+ # JIRA plugin
126
+ atlassian-ide-plugin.xml
127
+
128
+ # Cursive Clojure plugin
129
+ .idea/replstate.xml
130
+
131
+ # Crashlytics plugin (for Android Studio and IntelliJ)
132
+ com_crashlytics_export_strings.xml
133
+ crashlytics.properties
134
+ crashlytics-build.properties
135
+ fabric.properties
136
+
137
+ # Editor-based Rest Client
138
+ .idea/httpRequests
139
+
140
+ # Android studio 3.1+ serialized cache file
141
+ .idea/caches/build_file_checksums.ser
142
+
143
+ ### Intellij Patch ###
144
+ # Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
145
+
146
+ # *.iml
147
+ # modules.xml
148
+ # .idea/misc.xml
149
+ # *.ipr
150
+
151
+ # Sonarlint plugin
152
+ # https://plugins.jetbrains.com/plugin/7973-sonarlint
153
+ .idea/**/sonarlint/
154
+
155
+ # SonarQube Plugin
156
+ # https://plugins.jetbrains.com/plugin/7238-sonarqube-community-plugin
157
+ .idea/**/sonarIssues.xml
158
+
159
+ # Markdown Navigator plugin
160
+ # https://plugins.jetbrains.com/plugin/7896-markdown-navigator-enhanced
161
+ .idea/**/markdown-navigator.xml
162
+ .idea/**/markdown-navigator-enh.xml
163
+ .idea/**/markdown-navigator/
164
+
165
+ # Cache file creation bug
166
+ # See https://youtrack.jetbrains.com/issue/JBR-2257
167
+ .idea/$CACHE_FILE$
168
+
169
+ # CodeStream plugin
170
+ # https://plugins.jetbrains.com/plugin/12206-codestream
171
+ .idea/codestream.xml
172
+
173
+ ### PyCharm ###
174
+ # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
175
+ # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
176
+
177
+ # User-specific stuff
178
+
179
+ # Generated files
180
+
181
+ # Sensitive or high-churn files
182
+
183
+ # Gradle
184
+
185
+ # Gradle and Maven with auto-import
186
+ # When using Gradle or Maven with auto-import, you should exclude module files,
187
+ # since they will be recreated, and may cause churn. Uncomment if using
188
+ # auto-import.
189
+ # .idea/artifacts
190
+ # .idea/compiler.xml
191
+ # .idea/jarRepositories.xml
192
+ # .idea/modules.xml
193
+ # .idea/*.iml
194
+ # .idea/modules
195
+ # *.iml
196
+ # *.ipr
197
+
198
+ # CMake
199
+
200
+ # Mongo Explorer plugin
201
+
202
+ # File-based project format
203
+
204
+ # IntelliJ
205
+
206
+ # mpeltonen/sbt-idea plugin
207
+
208
+ # JIRA plugin
209
+
210
+ # Cursive Clojure plugin
211
+
212
+ # Crashlytics plugin (for Android Studio and IntelliJ)
213
+
214
+ # Editor-based Rest Client
215
+
216
+ # Android studio 3.1+ serialized cache file
217
+
218
+ ### PyCharm Patch ###
219
+ # Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
220
+
221
+ # *.iml
222
+ # modules.xml
223
+ # .idea/misc.xml
224
+ # *.ipr
225
+
226
+ # Sonarlint plugin
227
+ # https://plugins.jetbrains.com/plugin/7973-sonarlint
228
+
229
+ # SonarQube Plugin
230
+ # https://plugins.jetbrains.com/plugin/7238-sonarqube-community-plugin
231
+
232
+ # Markdown Navigator plugin
233
+ # https://plugins.jetbrains.com/plugin/7896-markdown-navigator-enhanced
234
+
235
+ # Cache file creation bug
236
+ # See https://youtrack.jetbrains.com/issue/JBR-2257
237
+
238
+ # CodeStream plugin
239
+ # https://plugins.jetbrains.com/plugin/12206-codestream
240
+
241
+ ### Python ###
242
+ # Byte-compiled / optimized / DLL files
243
+ __pycache__/
244
+ *.py[cod]
245
+ *$py.class
246
+
247
+ # C extensions
248
+ *.so
249
+
250
+ # Distribution / packaging
251
+ .Python
252
+ build/
253
+ develop-eggs/
254
+ dist/
255
+ downloads/
256
+ eggs/
257
+ .eggs/
258
+ parts/
259
+ sdist/
260
+ var/
261
+ wheels/
262
+ pip-wheel-metadata/
263
+ share/python-wheels/
264
+ *.egg-info/
265
+ .installed.cfg
266
+ *.egg
267
+ MANIFEST
268
+
269
+ # PyInstaller
270
+ # Usually these files are written by a python script from a template
271
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
272
+ *.manifest
273
+ *.spec
274
+
275
+ # Installer logs
276
+ pip-log.txt
277
+ pip-delete-this-directory.txt
278
+
279
+ # Unit test / coverage reports
280
+ htmlcov/
281
+ .tox/
282
+ .nox/
283
+ .coverage
284
+ .coverage.*
285
+ .cache
286
+ nosetests.xml
287
+ coverage.xml
288
+ *.cover
289
+ *.py,cover
290
+ .hypothesis/
291
+ .pytest_cache/
292
+ pytestdebug.log
293
+
294
+ # Translations
295
+ *.mo
296
+ *.pot
297
+
298
+ # Django stuff:
299
+ *.log
300
+ local_settings.py
301
+ db.sqlite3
302
+ db.sqlite3-journal
303
+
304
+ # Flask stuff:
305
+ instance/
306
+ .webassets-cache
307
+
308
+ # Scrapy stuff:
309
+ .scrapy
310
+
311
+ # Sphinx documentation
312
+ docs/_build/
313
+ doc/_build/
314
+
315
+ # PyBuilder
316
+ target/
317
+
318
+ # Jupyter Notebook
319
+ .ipynb_checkpoints
320
+
321
+ # IPython
322
+ profile_default/
323
+ ipython_config.py
324
+
325
+ # pyenv
326
+ .python-version
327
+
328
+ # pipenv
329
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
330
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
331
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
332
+ # install all needed dependencies.
333
+ #Pipfile.lock
334
+
335
+ # poetry - migrated to uv
336
+ poetry.lock
337
+
338
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow
339
+ __pypackages__/
340
+
341
+ # Celery stuff
342
+ celerybeat-schedule
343
+ celerybeat.pid
344
+
345
+ # SageMath parsed files
346
+ *.sage.py
347
+
348
+ # Environments
349
+ # .env.example
350
+ .env/
351
+ .venv/
352
+ env/
353
+ venv/
354
+ ENV/
355
+ env.bak/
356
+ venv.bak/
357
+ pythonenv*
358
+
359
+ # Spyder project settings
360
+ .spyderproject
361
+ .spyproject
362
+
363
+ # Rope project settings
364
+ .ropeproject
365
+
366
+ # mkdocs documentation
367
+ /site
368
+
369
+ # mypy
370
+ .mypy_cache/
371
+ .dmypy.json
372
+ dmypy.json
373
+
374
+ # Pyre type checker
375
+ .pyre/
376
+
377
+ # pytype static type analyzer
378
+ .pytype/
379
+
380
+ # operating system-related files
381
+ # file properties cache/storage on macOS
382
+ *.DS_Store
383
+ # thumbnail cache on Windows
384
+ Thumbs.db
385
+
386
+ # profiling data
387
+ .prof
388
+
389
+
390
+ ### VisualStudioCode ###
391
+ .vscode/*
392
+ *.code-workspace
393
+
394
+ ### VisualStudioCode Patch ###
395
+ # Ignore all local history of files
396
+ .history
397
+ .ionide
398
+
399
+ # End of https://www.toptal.com/developers/gitignore/api/python,pycharm,visualstudiocode,intellij,eclipse
400
+
401
+ .idea
402
+ .vscode
403
+
404
+ metas.md
@@ -0,0 +1,29 @@
1
+ # Ver https://pre-commit.com
2
+ # commit-msg: mensagens no estilo Conventional Commits (alinhado ao python-semantic-release).
3
+ default_install_hook_types:
4
+ - pre-commit
5
+ - commit-msg
6
+
7
+ repos:
8
+ - repo: https://github.com/pre-commit/pre-commit-hooks
9
+ rev: v6.0.0
10
+ hooks:
11
+ - id: trailing-whitespace
12
+ - id: end-of-file-fixer
13
+ - id: check-yaml
14
+ - id: check-toml
15
+ - id: check-added-large-files
16
+ - id: check-merge-conflict
17
+
18
+ - repo: https://github.com/astral-sh/ruff-pre-commit
19
+ rev: v0.15.7
20
+ hooks:
21
+ - id: ruff
22
+ args: [--fix]
23
+ - id: ruff-format
24
+
25
+ - repo: https://github.com/compilerla/conventional-pre-commit
26
+ rev: v4.4.0
27
+ hooks:
28
+ - id: conventional-pre-commit
29
+ stages: [commit-msg]
@@ -0,0 +1,8 @@
1
+ <!-- version list -->
2
+
3
+ ## v0.0.2 (2026-03-22)
4
+
5
+
6
+ ## v0.0.1 (2026-03-22)
7
+
8
+ - Initial Release
@@ -0,0 +1,19 @@
1
+ FROM python:3.13-slim
2
+
3
+ # Prevent Python from writing .pyc files and force log directly to the terminal
4
+ ENV PYTHONDONTWRITEBYTECODE=1 \
5
+ PYTHONUNBUFFERED=1
6
+
7
+ WORKDIR /app
8
+
9
+ # Copy the project files into the container
10
+ COPY . .
11
+
12
+ # Install Kubesure globally inside the container
13
+ RUN pip install --no-cache-dir .
14
+
15
+ # Define our CLI as the default entrypoint
16
+ ENTRYPOINT ["kubesure"]
17
+
18
+ # If the user runs the container without arguments, display the help
19
+ CMD ["--help"]