-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathPKG-INFO
More file actions
144 lines (109 loc) · 5.21 KB
/
PKG-INFO
File metadata and controls
144 lines (109 loc) · 5.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
Metadata-Version: 2.1
Name: prefect-cpln
Version: 1.0.23
Summary: Prefect integrations for interacting with the Control Plane platform.
Author-email: "Prefect Technologies, Inc." <help@prefect.io>
License: Apache License 2.0
Project-URL: Homepage, https://github.com/controlplane-com/prefect-cpln
Keywords: prefect
Classifier: Natural Language :: English
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: System Administrators
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: exceptiongroup
Requires-Dist: prefect<3.0.0,>=2.20.0
Requires-Dist: tenacity>=8.2.3
Requires-Dist: pyopenssl>=24.1.0
Provides-Extra: dev
Requires-Dist: coverage; extra == "dev"
Requires-Dist: interrogate; extra == "dev"
Requires-Dist: mkdocs-gen-files; extra == "dev"
Requires-Dist: mkdocs-material; extra == "dev"
Requires-Dist: mkdocs; extra == "dev"
Requires-Dist: mkdocstrings[python]; extra == "dev"
Requires-Dist: mypy; extra == "dev"
Requires-Dist: pillow; extra == "dev"
Requires-Dist: pre-commit; extra == "dev"
Requires-Dist: pytest-asyncio; extra == "dev"
Requires-Dist: pytest; extra == "dev"
Requires-Dist: pytest-env; extra == "dev"
Requires-Dist: pytest-timeout; extra == "dev"
Requires-Dist: pytest-xdist; extra == "dev"
# prefect-cpln
<p align="center">
<a href="https://pypi.python.org/pypi/prefect-cpln/" alt="PyPI version">
<img alt="PyPI" src="https://img.shields.io/pypi/v/prefect-cpln?color=26272B&labelColor=090422"></a>
<a href="https://pypistats.org/packages/prefect-cpln/" alt="Downloads">
<img src="https://img.shields.io/pypi/dm/prefect-cpln?color=26272B&labelColor=090422" /></a>
</p>
## Welcome!
`prefect-cpln` is a collection of Prefect tasks, flows, and blocks enabling orchestration, observation and management of Control Plane resources.
Jump to [examples](#example-usage).
## Resources
For more tips on how to use tasks and flows in an integration, check out [Use Integrations](https://docs.prefect.io/integrations/use-integrations)!
### Installation
Install `prefect-cpln` with `pip`:
```bash
pip install prefect-cpln
```
Requires an installation of Python 3.8+.
We recommend using a Python virtual environment manager such as pipenv, conda or virtualenv.
These tasks are designed to work with Prefect 2. For more information about how to use Prefect, please refer to the [Prefect documentation](https://docs.prefect.io/).
Then, to register [blocks](https://docs.prefect.io/integrations/use-integrations#register-blocks-from-an-integration) on Prefect Cloud:
```bash
prefect block register -m prefect_cpln
```
Note, to use the `load` method on Blocks, you must already have a block document [saved through code](https://docs.prefect.io/v3/develop/blocks#saving-blocks) or saved through the UI.
### Example Usage
#### Use `with_options` to customize options on any existing task or flow
```python
from prefect_cpln.flows import run_namespaced_job
customized_run_namespaced_job = run_namespaced_job.with_options(
name="My flow running a Control Plane Job",
retries=2,
retry_delay_seconds=10,
) # this is now a new flow object that can be called
```
For more tips on how to use tasks and flows in an integration, check out [Use Integrations](https://docs.prefect.io/integrations/use-integrations)!
#### List jobs in a specific namespace
```python
from prefect import flow
from prefect_cpln.credentials import CplnCredentials
from prefect_cpln.jobs import list_namespaced_job
@flow
def cpln_orchestrator():
jobs_list = list_namespaced_job(
cpln_credentials=CplnCredentials.load("cpln-creds"),
org="my-org",
gvc="my-gvc",
)
```
## Feedback
If you encounter any bugs while using `prefect-cpln`, feel free to open an issue in the [prefect-cpln](https://github.com/controlplane-com/prefect-cpln) repository.
If you have any questions or issues while using `prefect-cpln`, you can send an email to [support@controlplane.com](mailto:support@controlplane.com).
## Contributing
If you'd like to help contribute to fix an issue or add a feature to `prefect-cpln`, please [propose changes through a pull request from a fork of the repository](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork).
Here are the steps:
1. [Fork the repository](https://docs.github.com/en/get-started/quickstart/fork-a-repo#forking-a-repository)
2. [Clone the forked repository](https://docs.github.com/en/get-started/quickstart/fork-a-repo#cloning-your-forked-repository)
3. Install the repository and its dependencies:
```
pip install -e ".[dev]"
```
4. Make desired changes
5. Add tests
6. Install `pre-commit` to perform quality checks prior to commit:
```
pre-commit install
```
8. `git commit`, `git push`, and create a pull request