containerspec 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.
Files changed (59) hide show
  1. containerspec-0.1.0/.github/CODEOWNERS +1 -0
  2. containerspec-0.1.0/.github/ISSUE_TEMPLATE/bug_report.md +33 -0
  3. containerspec-0.1.0/.github/ISSUE_TEMPLATE/feature_request.md +21 -0
  4. containerspec-0.1.0/.github/dependabot.yml +13 -0
  5. containerspec-0.1.0/.github/pull_request_template.md +23 -0
  6. containerspec-0.1.0/.github/workflows/ci.yml +146 -0
  7. containerspec-0.1.0/.github/workflows/docs.yml +56 -0
  8. containerspec-0.1.0/.github/workflows/publish.yml +46 -0
  9. containerspec-0.1.0/.github/workflows/release-please.yml +36 -0
  10. containerspec-0.1.0/.gitignore +219 -0
  11. containerspec-0.1.0/.python-version +1 -0
  12. containerspec-0.1.0/.release-please-manifest.json +3 -0
  13. containerspec-0.1.0/CHANGELOG.md +20 -0
  14. containerspec-0.1.0/CODE_OF_CONDUCT.md +127 -0
  15. containerspec-0.1.0/LICENSE +21 -0
  16. containerspec-0.1.0/Makefile +45 -0
  17. containerspec-0.1.0/PKG-INFO +570 -0
  18. containerspec-0.1.0/README.md +545 -0
  19. containerspec-0.1.0/SECURITY.md +23 -0
  20. containerspec-0.1.0/docs/api-reference/containerspec.md +8 -0
  21. containerspec-0.1.0/docs/changelog.md +3 -0
  22. containerspec-0.1.0/docs/getting-started/installation.md +85 -0
  23. containerspec-0.1.0/docs/getting-started/quick-start.md +208 -0
  24. containerspec-0.1.0/docs/index.md +36 -0
  25. containerspec-0.1.0/docs/superpowers/plans/2026-07-21-containerspec-library.md +2290 -0
  26. containerspec-0.1.0/docs/superpowers/specs/2026-07-21-containerspec-library-design.md +499 -0
  27. containerspec-0.1.0/mkdocs.yml +100 -0
  28. containerspec-0.1.0/pyproject.toml +93 -0
  29. containerspec-0.1.0/release-please-config.json +32 -0
  30. containerspec-0.1.0/src/containerspec/__init__.py +116 -0
  31. containerspec-0.1.0/src/containerspec/backends.py +247 -0
  32. containerspec-0.1.0/src/containerspec/distros.py +89 -0
  33. containerspec-0.1.0/src/containerspec/layers.py +259 -0
  34. containerspec-0.1.0/src/containerspec/py.typed +0 -0
  35. containerspec-0.1.0/src/containerspec/renderers.py +527 -0
  36. containerspec-0.1.0/src/containerspec/rootfs.py +165 -0
  37. containerspec-0.1.0/src/containerspec/spec.py +551 -0
  38. containerspec-0.1.0/src/containerspec/targets.py +261 -0
  39. containerspec-0.1.0/tests/__init__.py +1 -0
  40. containerspec-0.1.0/tests/conftest.py +14 -0
  41. containerspec-0.1.0/tests/golden/.gitkeep +0 -0
  42. containerspec-0.1.0/tests/golden/root_dockerfile.txt +18 -0
  43. containerspec-0.1.0/tests/golden/rootless_apk_dockerfile.txt +19 -0
  44. containerspec-0.1.0/tests/golden/rootless_apt_dockerfile.txt +40 -0
  45. containerspec-0.1.0/tests/test_api.py +223 -0
  46. containerspec-0.1.0/tests/test_backends.py +460 -0
  47. containerspec-0.1.0/tests/test_build.py +209 -0
  48. containerspec-0.1.0/tests/test_copy_hash.py +86 -0
  49. containerspec-0.1.0/tests/test_dockerfile.py +215 -0
  50. containerspec-0.1.0/tests/test_hash.py +173 -0
  51. containerspec-0.1.0/tests/test_integration.py +347 -0
  52. containerspec-0.1.0/tests/test_layers.py +171 -0
  53. containerspec-0.1.0/tests/test_multistage.py +84 -0
  54. containerspec-0.1.0/tests/test_public_api.py +64 -0
  55. containerspec-0.1.0/tests/test_render_context.py +182 -0
  56. containerspec-0.1.0/tests/test_rootfs.py +248 -0
  57. containerspec-0.1.0/tests/test_scenarios.py +69 -0
  58. containerspec-0.1.0/tests/test_targets.py +255 -0
  59. containerspec-0.1.0/uv.lock +1111 -0
@@ -0,0 +1 @@
1
+ * @rich-evans
@@ -0,0 +1,33 @@
1
+ ---
2
+ name: Bug Report
3
+ about: Report a bug or unexpected behavior
4
+ labels: bug
5
+ ---
6
+
7
+ ## Description
8
+
9
+ A clear description of what the bug is.
10
+
11
+ ## Reproduction
12
+
13
+ ```python
14
+ # Minimal code to reproduce the issue
15
+ ```
16
+
17
+ ## Expected Behavior
18
+
19
+ What you expected to happen.
20
+
21
+ ## Actual Behavior
22
+
23
+ What actually happened (include full error output).
24
+
25
+ ## Environment
26
+
27
+ - containerspec version:
28
+ - Python version:
29
+ - OS:
30
+
31
+ ## Additional Context
32
+
33
+ Any other context (logs, .env file contents with secrets redacted, etc.).
@@ -0,0 +1,21 @@
1
+ ---
2
+ name: Feature Request
3
+ about: Suggest a new feature or enhancement
4
+ labels: enhancement
5
+ ---
6
+
7
+ ## Problem
8
+
9
+ What problem does this feature solve? What's the current limitation?
10
+
11
+ ## Proposed Solution
12
+
13
+ Describe the feature or change you'd like to see.
14
+
15
+ ## Alternatives Considered
16
+
17
+ Any alternative approaches you've considered.
18
+
19
+ ## Additional Context
20
+
21
+ Any other context, examples, or references.
@@ -0,0 +1,13 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: pip
4
+ directory: /
5
+ schedule:
6
+ interval: weekly
7
+ open-pull-requests-limit: 5
8
+
9
+ - package-ecosystem: github-actions
10
+ directory: /
11
+ schedule:
12
+ interval: weekly
13
+ open-pull-requests-limit: 5
@@ -0,0 +1,23 @@
1
+ ## Summary
2
+
3
+ Brief description of what this PR does and why.
4
+
5
+ ## Changes
6
+
7
+ - Change 1
8
+ - Change 2
9
+
10
+ ## Testing
11
+
12
+ Describe how you tested these changes (commands run, tests added, etc.).
13
+
14
+ ```bash
15
+ uv run pytest
16
+ uv run pyright src
17
+ uv run ruff check .
18
+ uv run ruff format --check .
19
+ ```
20
+
21
+ ## Related Issues
22
+
23
+ Fixes #123
@@ -0,0 +1,146 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ concurrency:
10
+ group: ci-${{ github.ref }}
11
+ cancel-in-progress: true
12
+
13
+ permissions:
14
+ contents: read
15
+
16
+ jobs:
17
+ lint:
18
+ runs-on: ubuntu-latest
19
+ steps:
20
+ - uses: actions/checkout@v7
21
+
22
+ - name: Install uv
23
+ uses: astral-sh/setup-uv@v7
24
+ with:
25
+ enable-cache: true
26
+
27
+ - name: Set up Python
28
+ run: uv python install 3.12
29
+
30
+ - name: Install dependencies
31
+ run: uv sync --group dev
32
+
33
+ - name: Lint with ruff
34
+ run: uv run ruff check .
35
+
36
+ - name: Check formatting
37
+ run: uv run ruff format --check .
38
+
39
+ typecheck:
40
+ runs-on: ubuntu-latest
41
+ steps:
42
+ - uses: actions/checkout@v7
43
+
44
+ - name: Install uv
45
+ uses: astral-sh/setup-uv@v7
46
+ with:
47
+ enable-cache: true
48
+
49
+ - name: Set up Python
50
+ run: uv python install 3.12
51
+
52
+ - name: Install dependencies
53
+ run: uv sync --group dev
54
+
55
+ - name: Type check with pyright
56
+ run: uv run pyright src
57
+
58
+ test:
59
+ runs-on: ubuntu-latest
60
+ strategy:
61
+ matrix:
62
+ python-version: ["3.12", "3.13", "3.14"]
63
+
64
+ steps:
65
+ - uses: actions/checkout@v7
66
+
67
+ - name: Install uv
68
+ uses: astral-sh/setup-uv@v7
69
+ with:
70
+ enable-cache: true
71
+
72
+ - name: Set up Python ${{ matrix.python-version }}
73
+ run: uv python install ${{ matrix.python-version }}
74
+
75
+ - name: Install dependencies
76
+ run: uv sync --group dev
77
+
78
+ - name: Run tests
79
+ run: uv run pytest tests/
80
+
81
+ security:
82
+ runs-on: ubuntu-latest
83
+ steps:
84
+ - uses: actions/checkout@v7
85
+
86
+ - name: Install uv
87
+ uses: astral-sh/setup-uv@v7
88
+ with:
89
+ enable-cache: true
90
+
91
+ - name: Set up Python
92
+ run: uv python install 3.12
93
+
94
+ - name: Install dependencies
95
+ run: uv sync --group dev
96
+
97
+ - name: Run pip-audit
98
+ run: uv run pip-audit
99
+
100
+ build:
101
+ runs-on: ubuntu-latest
102
+ needs: [lint, typecheck, test, security]
103
+ steps:
104
+ - uses: actions/checkout@v7
105
+
106
+ - name: Install uv
107
+ uses: astral-sh/setup-uv@v7
108
+ with:
109
+ enable-cache: true
110
+
111
+ - name: Set up Python
112
+ run: uv python install 3.12
113
+
114
+ - name: Build package
115
+ run: uv build
116
+
117
+ - name: Check package contents
118
+ run: |
119
+ ls -la dist/
120
+ uv run python -m tarfile -l dist/*.tar.gz
121
+ uv run python -m zipfile -l dist/*.whl
122
+
123
+ - name: Assert wheel ships py.typed marker
124
+ run: |
125
+ set -euo pipefail
126
+ listing="$(uv run python -m zipfile -l dist/*.whl)"
127
+ echo "$listing" | grep -q "containerspec/py.typed"
128
+
129
+ - name: Test installation from wheel
130
+ run: |
131
+ uv venv test-env
132
+ uv pip install --python test-env/bin/python dist/*.whl
133
+ cd /tmp && $GITHUB_WORKSPACE/test-env/bin/python -c "import containerspec; print(containerspec.__version__)"
134
+
135
+ - name: Test installation from source distribution
136
+ run: |
137
+ uv venv test-src-env
138
+ uv pip install --python test-src-env/bin/python dist/*.tar.gz
139
+ cd /tmp && $GITHUB_WORKSPACE/test-src-env/bin/python -c "import containerspec; print(containerspec.__version__)"
140
+
141
+ - name: Upload build artifacts
142
+ uses: actions/upload-artifact@v7
143
+ with:
144
+ name: dist
145
+ path: dist/
146
+ retention-days: 7
@@ -0,0 +1,56 @@
1
+ name: Deploy Docs
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ paths:
7
+ - "docs/**"
8
+ - "src/containerspec/**"
9
+ - "mkdocs.yml"
10
+ - ".github/workflows/docs.yml"
11
+ workflow_dispatch:
12
+
13
+ permissions:
14
+ contents: read
15
+ pages: write
16
+ id-token: write
17
+
18
+ concurrency:
19
+ group: "pages"
20
+ cancel-in-progress: false
21
+
22
+ jobs:
23
+ build:
24
+ runs-on: ubuntu-latest
25
+ steps:
26
+ - uses: actions/checkout@v7
27
+
28
+ - name: Install uv
29
+ uses: astral-sh/setup-uv@v7
30
+ with:
31
+ enable-cache: true
32
+
33
+ - name: Set up Python
34
+ run: uv python install 3.12
35
+
36
+ - name: Install dependencies
37
+ run: uv sync --group dev
38
+
39
+ - name: Build MkDocs site
40
+ run: uv run mkdocs build --strict
41
+
42
+ - name: Upload artifact
43
+ uses: actions/upload-pages-artifact@v5
44
+ with:
45
+ path: site
46
+
47
+ deploy:
48
+ needs: build
49
+ runs-on: ubuntu-latest
50
+ environment:
51
+ name: github-pages
52
+ url: ${{ steps.deployment.outputs.page_url }}
53
+ steps:
54
+ - name: Deploy to GitHub Pages
55
+ id: deployment
56
+ uses: actions/deploy-pages@v5
@@ -0,0 +1,46 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ workflow_call:
5
+ inputs:
6
+ release_created:
7
+ required: true
8
+ type: boolean
9
+ tag_name:
10
+ required: true
11
+ type: string
12
+ release:
13
+ types: [published]
14
+ workflow_dispatch:
15
+
16
+ permissions:
17
+ id-token: write
18
+ contents: read
19
+
20
+ jobs:
21
+ publish:
22
+ runs-on: ubuntu-latest
23
+ if: inputs.release_created || github.event_name == 'release' || github.event_name == 'workflow_dispatch'
24
+
25
+ steps:
26
+ - uses: actions/checkout@v7
27
+
28
+ - name: Install uv
29
+ uses: astral-sh/setup-uv@v7
30
+ with:
31
+ version: "latest"
32
+
33
+ - name: Set up Python
34
+ run: uv python install
35
+
36
+ - name: Install dependencies
37
+ run: uv sync --all-extras --group dev
38
+
39
+ - name: Run tests
40
+ run: uv run pytest tests/ -v
41
+
42
+ - name: Build package
43
+ run: uv build
44
+
45
+ - name: Publish to PyPI
46
+ run: uv publish
@@ -0,0 +1,36 @@
1
+ name: Release Please
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+
8
+ permissions:
9
+ contents: write
10
+ pull-requests: write
11
+ id-token: write
12
+ issues: write
13
+
14
+ jobs:
15
+ release-please:
16
+ runs-on: ubuntu-latest
17
+ outputs:
18
+ release_created: ${{ steps.release.outputs.release_created }}
19
+ tag_name: ${{ steps.release.outputs.tag_name }}
20
+ steps:
21
+ - uses: googleapis/release-please-action@v5
22
+ id: release
23
+ with:
24
+ release-type: python
25
+ config-file: release-please-config.json
26
+ manifest-file: .release-please-manifest.json
27
+ token: ${{ secrets.GITHUB_TOKEN }}
28
+
29
+ publish:
30
+ needs: release-please
31
+ if: needs.release-please.outputs.release_created
32
+ uses: ./.github/workflows/publish.yml
33
+ with:
34
+ release_created: true
35
+ tag_name: ${{ needs.release-please.outputs.tag_name }}
36
+ secrets: inherit
@@ -0,0 +1,219 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[codz]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py.cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ # Pipfile.lock
96
+
97
+ # UV
98
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ # uv.lock
102
+
103
+ # poetry
104
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
105
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
106
+ # commonly ignored for libraries.
107
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
108
+ # poetry.lock
109
+ # poetry.toml
110
+
111
+ # pdm
112
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
113
+ # pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
114
+ # https://pdm-project.org/en/latest/usage/project/#working-with-version-control
115
+ # pdm.lock
116
+ # pdm.toml
117
+ .pdm-python
118
+ .pdm-build/
119
+
120
+ # pixi
121
+ # Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
122
+ # pixi.lock
123
+ # Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
124
+ # in the .venv directory. It is recommended not to include this directory in version control.
125
+ .pixi
126
+
127
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
128
+ __pypackages__/
129
+
130
+ # Celery stuff
131
+ celerybeat-schedule
132
+ celerybeat.pid
133
+
134
+ # Redis
135
+ *.rdb
136
+ *.aof
137
+ *.pid
138
+
139
+ # RabbitMQ
140
+ mnesia/
141
+ rabbitmq/
142
+ rabbitmq-data/
143
+
144
+ # ActiveMQ
145
+ activemq-data/
146
+
147
+ # SageMath parsed files
148
+ *.sage.py
149
+
150
+ # Environments
151
+ .env
152
+ .envrc
153
+ .venv
154
+ env/
155
+ venv/
156
+ ENV/
157
+ env.bak/
158
+ venv.bak/
159
+
160
+ # Spyder project settings
161
+ .spyderproject
162
+ .spyproject
163
+
164
+ # Rope project settings
165
+ .ropeproject
166
+
167
+ # mkdocs documentation
168
+ /site
169
+
170
+ # mypy
171
+ .mypy_cache/
172
+ .dmypy.json
173
+ dmypy.json
174
+
175
+ # Pyre type checker
176
+ .pyre/
177
+
178
+ # pytype static type analyzer
179
+ .pytype/
180
+
181
+ # Cython debug symbols
182
+ cython_debug/
183
+
184
+ # PyCharm
185
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
186
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
187
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
188
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
189
+ # .idea/
190
+
191
+ # Abstra
192
+ # Abstra is an AI-powered process automation framework.
193
+ # Ignore directories containing user credentials, local state, and settings.
194
+ # Learn more at https://abstra.io/docs
195
+ .abstra/
196
+
197
+ # Visual Studio Code
198
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
199
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
200
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
201
+ # you could uncomment the following to ignore the entire vscode folder
202
+ # .vscode/
203
+ # Temporary file for partial code execution
204
+ tempCodeRunnerFile.py
205
+
206
+ # Ruff stuff:
207
+ .ruff_cache/
208
+
209
+ # PyPI configuration file
210
+ .pypirc
211
+
212
+ # Marimo
213
+ marimo/_static/
214
+ marimo/_lsp/
215
+ __marimo__/
216
+
217
+ # Streamlit
218
+ .streamlit/secrets.toml
219
+ .serena/
@@ -0,0 +1 @@
1
+ 3.12
@@ -0,0 +1,3 @@
1
+ {
2
+ ".": "0.1.0"
3
+ }
@@ -0,0 +1,20 @@
1
+ # Changelog
2
+
3
+ ## 0.1.0 (2026-07-22)
4
+
5
+
6
+ ### Features
7
+
8
+ * containerspec v0.1.0 — fluent, content-hashed image builder ([a905a65](https://github.com/AZX-PBC-OSS/containerspec/commit/a905a6573ad43783b45e891b2c9d8137f416787f))
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * remove .serena from repo, add to .gitignore ([b57e3fc](https://github.com/AZX-PBC-OSS/containerspec/commit/b57e3fc4345e952f31237441d1328793e09128c7))
14
+
15
+ ## Changelog
16
+
17
+ All notable changes to this project will be documented in this file.
18
+
19
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
20
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).