spaceforge 0.1.0.dev0__py3-none-any.whl → 1.0.0__py3-none-any.whl

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 (35) hide show
  1. spaceforge/__init__.py +12 -4
  2. spaceforge/__main__.py +3 -3
  3. spaceforge/_version.py +0 -1
  4. spaceforge/_version_scm.py +34 -0
  5. spaceforge/cls.py +24 -14
  6. spaceforge/conftest.py +89 -0
  7. spaceforge/generator.py +129 -56
  8. spaceforge/plugin.py +199 -22
  9. spaceforge/runner.py +0 -12
  10. spaceforge/schema.json +45 -22
  11. spaceforge/templates/binary_install.sh.j2 +24 -0
  12. spaceforge/templates/ensure_spaceforge_and_run.sh.j2 +24 -0
  13. spaceforge/{generator_test.py → test_generator.py} +265 -53
  14. spaceforge/test_generator_binaries.py +194 -0
  15. spaceforge/test_generator_core.py +180 -0
  16. spaceforge/test_generator_hooks.py +90 -0
  17. spaceforge/test_generator_parameters.py +59 -0
  18. spaceforge/test_plugin.py +357 -0
  19. spaceforge/test_plugin_file_operations.py +118 -0
  20. spaceforge/test_plugin_hooks.py +100 -0
  21. spaceforge/test_plugin_inheritance.py +102 -0
  22. spaceforge/{runner_test.py → test_runner.py} +2 -65
  23. spaceforge/test_runner_cli.py +69 -0
  24. spaceforge/test_runner_core.py +124 -0
  25. spaceforge/test_runner_execution.py +169 -0
  26. spaceforge-1.0.0.dist-info/METADATA +606 -0
  27. spaceforge-1.0.0.dist-info/RECORD +33 -0
  28. spaceforge/plugin_test.py +0 -621
  29. spaceforge-0.1.0.dev0.dist-info/METADATA +0 -163
  30. spaceforge-0.1.0.dev0.dist-info/RECORD +0 -19
  31. /spaceforge/{cls_test.py → test_cls.py} +0 -0
  32. {spaceforge-0.1.0.dev0.dist-info → spaceforge-1.0.0.dist-info}/WHEEL +0 -0
  33. {spaceforge-0.1.0.dev0.dist-info → spaceforge-1.0.0.dist-info}/entry_points.txt +0 -0
  34. {spaceforge-0.1.0.dev0.dist-info → spaceforge-1.0.0.dist-info}/licenses/LICENSE +0 -0
  35. {spaceforge-0.1.0.dev0.dist-info → spaceforge-1.0.0.dist-info}/top_level.txt +0 -0
@@ -1,163 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: spaceforge
3
- Version: 0.1.0.dev0
4
- Summary: A Python framework for building Spacelift plugins
5
- Home-page: https://github.com/spacelift-io/plugins
6
- Author: Spacelift
7
- Author-email: Spacelift <support@spacelift.io>
8
- Maintainer-email: Spacelift <support@spacelift.io>
9
- License: MIT
10
- Project-URL: Homepage, https://github.com/spacelift-io/plugins
11
- Project-URL: Documentation, https://github.com/spacelift-io/plugins#readme
12
- Project-URL: Repository, https://github.com/spacelift-io/plugins
13
- Project-URL: Bug Reports, https://github.com/spacelift-io/plugins/issues
14
- Keywords: spacelift,plugin,framework,infrastructure,devops,spaceforge
15
- Classifier: Development Status :: 3 - Alpha
16
- Classifier: Intended Audience :: Developers
17
- Classifier: Operating System :: OS Independent
18
- Classifier: Programming Language :: Python :: 3
19
- Classifier: Programming Language :: Python :: 3.9
20
- Classifier: Programming Language :: Python :: 3.10
21
- Classifier: Programming Language :: Python :: 3.11
22
- Classifier: Programming Language :: Python :: 3.12
23
- Classifier: Topic :: Software Development :: Libraries :: Python Modules
24
- Classifier: Topic :: System :: Systems Administration
25
- Requires-Python: >=3.9
26
- Description-Content-Type: text/markdown
27
- License-File: LICENSE
28
- Requires-Dist: PyYAML>=6.0
29
- Requires-Dist: click>=8.0.0
30
- Requires-Dist: pydantic>=2.11.7
31
- Provides-Extra: dev
32
- Requires-Dist: pytest>=6.0; extra == "dev"
33
- Requires-Dist: pytest-cov; extra == "dev"
34
- Requires-Dist: black; extra == "dev"
35
- Requires-Dist: isort; extra == "dev"
36
- Requires-Dist: mypy; extra == "dev"
37
- Requires-Dist: types-PyYAML; extra == "dev"
38
- Requires-Dist: setuptools-scm[toml]>=6.2; extra == "dev"
39
- Dynamic: author
40
- Dynamic: home-page
41
- Dynamic: license-file
42
- Dynamic: requires-python
43
-
44
- # Spacelift Plugins
45
-
46
- A monorepo for Spacelift plugins built with the **spaceforge** framework.
47
-
48
- ## Overview
49
-
50
- This repository contains:
51
- - **spaceforge/** - The core Python framework for building Spacelift plugins
52
- - **plugins/wiz/** - Wiz security scanning plugin
53
- - Plugin management and generation tools
54
-
55
- ## Quick Start
56
-
57
- ### Installation
58
-
59
- ```bash
60
- # Install the spaceforge framework
61
- pip install -e .
62
- ```
63
-
64
- ### Creating a Plugin
65
-
66
- 1. Create a new directory for your plugin
67
- 2. Implement your plugin by inheriting from `SpacepyPlugin`:
68
-
69
- ```python
70
- from spaceforge import SpaceforgePlugin, Parameter, Variable, Context
71
-
72
- class MyPlugin(SpaceforgePlugin):
73
- __plugin_name__ = "my-plugin"
74
- __version__ = "1.0.0"
75
- __author__ = "Your Name"
76
-
77
- # Define parameters using pydantic dataclasses
78
- __parameters__ = [
79
- Parameter(
80
- name="api_key",
81
- description="API key for authentication",
82
- required=True,
83
- sensitive=True
84
- )
85
- ]
86
-
87
- # Define contexts using pydantic dataclasses
88
- __contexts__ = [
89
- Context(
90
- name="main",
91
- description="Main plugin context",
92
- env=[
93
- Variable(
94
- key="API_KEY",
95
- value_from_parameter="api_key",
96
- sensitive=True
97
- )
98
- ]
99
- )
100
- ]
101
-
102
- def after_plan(self):
103
- self.logger.info("Running after plan hook")
104
- ```
105
-
106
- 3. Generate the plugin YAML:
107
-
108
- ```bash
109
- python -m spaceforge generate my_plugin.py
110
- ```
111
-
112
- ### Testing Plugins
113
-
114
- ```bash
115
- # Set plugin parameters
116
- export SPACEFORGE_PARAM_NAME="value"
117
-
118
- # Test specific hooks
119
- python -m spaceforge runner after_plan
120
- ```
121
-
122
- ## Architecture
123
-
124
- The spaceforge framework uses a hook-based architecture where plugins:
125
- - Inherit from `SpaceforgePlugin` base class
126
- - Override hook methods (`after_plan`, `before_apply`, etc.)
127
- - Define parameters, contexts, webhooks, and policies using pydantic dataclasses
128
- - Include automatic validation of data structures (e.g., Variables must have either `value` or `value_from_parameter`)
129
- - Are automatically converted to Spacelift plugin YAML format with JSON schema validation
130
-
131
- ## Available Plugins
132
-
133
- - **wiz** - Security scanning plugin for infrastructure as code
134
-
135
- ## Development
136
-
137
- ### Commands
138
-
139
- ```bash
140
- # Generate plugin YAML
141
- python -m spaceforge generate [plugin_file.py] [-o output.yaml]
142
-
143
- # Test plugin execution
144
- python -m spaceforge runner [--plugin-file plugin.py] hook_name
145
-
146
- # Get help
147
- python -m spaceforge --help
148
- ```
149
-
150
- ### Framework Documentation
151
-
152
- See [spaceforge/README.md](spaceforge/README.md) for detailed framework documentation.
153
-
154
- ## Contributing
155
-
156
- 1. Create your plugin in a new directory
157
- 2. Follow the plugin development patterns shown in existing plugins
158
- 3. Generate and test your plugin YAML
159
- 4. Submit a pull request
160
-
161
- ## License
162
-
163
- MIT License
@@ -1,19 +0,0 @@
1
- spaceforge/README.md,sha256=8o1Nuyasb4OxX3E7ZycyducOrR4J19bZcHrLvFeoFNg,7730
2
- spaceforge/__init__.py,sha256=jsfbVuAa-7QX5XCu-d1rGc2qP9Iw1zQOu9ARJM9sm1k,516
3
- spaceforge/__main__.py,sha256=gqj_EAEshdkwcXfERLnyAWveGDoXYJPwPa17BDMSMSA,613
4
- spaceforge/_version.py,sha256=KLlA-mMwGoc8dP7BQAzLprWKT_n6k13anGYGEvf47GA,2166
5
- spaceforge/cls.py,sha256=-oNXg75ddexgU3eo0MtO_1Nv3QiAPEHLqB_r8WJQ7tw,5791
6
- spaceforge/cls_test.py,sha256=nXAgbnFnGdFxrtA7vNXiePjNUASuoYW-lEuQGx9WMGs,468
7
- spaceforge/generator.py,sha256=myAn8C-15S3KKiYUDfaT1UeMdtFBkFA9jKXGV2Ux4l0,13672
8
- spaceforge/generator_test.py,sha256=CGQOD0WrBbbbg6tgiEKo_KZp5nT6GpZdThWRv2VAhsU,23068
9
- spaceforge/plugin.py,sha256=NHCQg01OTWvnUMOpBQAq4rkJQ61coLE-xrG1zV8Hjn8,9549
10
- spaceforge/plugin_test.py,sha256=eTCIVU9VGx0j_rt_L-9HjB0rR6K0Fw-8uQ86pZjNna8,23003
11
- spaceforge/runner.py,sha256=JSABlCiq_qs9knWEq6eUpEE_ZR-r0KcDQLzxErd324Y,3457
12
- spaceforge/runner_test.py,sha256=fws8RaWbZLLek7CQJ-PJjGLsgAMdPXgnHxIYBTRRm4Q,19702
13
- spaceforge/schema.json,sha256=h3G0K5AYXC5p0YCpf8NWlvhzxuvy-SvL4zWWHOUkTpU,10134
14
- spaceforge-0.1.0.dev0.dist-info/licenses/LICENSE,sha256=wyljRrfnWY2ggQKkSCg3Nw2hxwPMmupopaKs9Kpgys8,1065
15
- spaceforge-0.1.0.dev0.dist-info/METADATA,sha256=vmdK_0BZNPhPVsx_9UkgEUR0V8Fked_dnWPFxUlxyMQ,4588
16
- spaceforge-0.1.0.dev0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
17
- spaceforge-0.1.0.dev0.dist-info/entry_points.txt,sha256=qawuuKBSNTGg-njnQnhxxFldFvXYAPej6bF_f3iyQ48,56
18
- spaceforge-0.1.0.dev0.dist-info/top_level.txt,sha256=eVw-Lw4Th0oHM8Gx1Y8YetyNgbNbMBU00yWs-kwGeSs,11
19
- spaceforge-0.1.0.dev0.dist-info/RECORD,,
File without changes