prefect-cloud 0.1.0a0__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 (42) hide show
  1. prefect_cloud-0.1.0a0/.github/CODEOWNERS +1 -0
  2. prefect_cloud-0.1.0a0/.github/workflows/publish.yaml +28 -0
  3. prefect_cloud-0.1.0a0/.github/workflows/python-tests.yaml +51 -0
  4. prefect_cloud-0.1.0a0/.github/workflows/static-analysis.yaml +50 -0
  5. prefect_cloud-0.1.0a0/.gitignore +186 -0
  6. prefect_cloud-0.1.0a0/.pre-commit-config.yaml +36 -0
  7. prefect_cloud-0.1.0a0/PKG-INFO +68 -0
  8. prefect_cloud-0.1.0a0/README.md +46 -0
  9. prefect_cloud-0.1.0a0/pyproject.toml +54 -0
  10. prefect_cloud-0.1.0a0/src/prefect_cloud/__init__.py +0 -0
  11. prefect_cloud-0.1.0a0/src/prefect_cloud/auth.py +387 -0
  12. prefect_cloud-0.1.0a0/src/prefect_cloud/cli.py +475 -0
  13. prefect_cloud-0.1.0a0/src/prefect_cloud/client.py +833 -0
  14. prefect_cloud-0.1.0a0/src/prefect_cloud/completions.py +54 -0
  15. prefect_cloud-0.1.0a0/src/prefect_cloud/dependencies.py +80 -0
  16. prefect_cloud-0.1.0a0/src/prefect_cloud/deployments.py +87 -0
  17. prefect_cloud-0.1.0a0/src/prefect_cloud/github.py +113 -0
  18. prefect_cloud-0.1.0a0/src/prefect_cloud/pull_steps/__init__.py +0 -0
  19. prefect_cloud-0.1.0a0/src/prefect_cloud/pull_steps/flowify.py +78 -0
  20. prefect_cloud-0.1.0a0/src/prefect_cloud/schemas/actions.py +86 -0
  21. prefect_cloud-0.1.0a0/src/prefect_cloud/schemas/objects.py +160 -0
  22. prefect_cloud-0.1.0a0/src/prefect_cloud/schemas/responses.py +14 -0
  23. prefect_cloud-0.1.0a0/src/prefect_cloud/settings.py +18 -0
  24. prefect_cloud-0.1.0a0/src/prefect_cloud/types.py +57 -0
  25. prefect_cloud-0.1.0a0/src/prefect_cloud/utilities/__init__.py +0 -0
  26. prefect_cloud-0.1.0a0/src/prefect_cloud/utilities/callables.py +671 -0
  27. prefect_cloud-0.1.0a0/src/prefect_cloud/utilities/exception.py +41 -0
  28. prefect_cloud-0.1.0a0/src/prefect_cloud/utilities/flows.py +71 -0
  29. prefect_cloud-0.1.0a0/src/prefect_cloud/utilities/generics.py +63 -0
  30. prefect_cloud-0.1.0a0/src/prefect_cloud/utilities/pendulum.py +78 -0
  31. prefect_cloud-0.1.0a0/src/prefect_cloud/utilities/tui.py +80 -0
  32. prefect_cloud-0.1.0a0/tests/.cursorrules +20 -0
  33. prefect_cloud-0.1.0a0/tests/__init__.py +0 -0
  34. prefect_cloud-0.1.0a0/tests/conftest.py +30 -0
  35. prefect_cloud-0.1.0a0/tests/test_auth.py +513 -0
  36. prefect_cloud-0.1.0a0/tests/test_auth_interactive.py +100 -0
  37. prefect_cloud-0.1.0a0/tests/test_auth_profiles.py +340 -0
  38. prefect_cloud-0.1.0a0/tests/test_client.py +6 -0
  39. prefect_cloud-0.1.0a0/tests/test_run.py +123 -0
  40. prefect_cloud-0.1.0a0/tests/test_schedules.py +308 -0
  41. prefect_cloud-0.1.0a0/tests/test_the_tests.py +2 -0
  42. prefect_cloud-0.1.0a0/uv.lock +819 -0
@@ -0,0 +1 @@
1
+ * @jakekaplan @chrisguidry
@@ -0,0 +1,28 @@
1
+ name: Publish Prefect Cloud to PyPI
2
+ on:
3
+ release:
4
+ types: [published]
5
+ workflow_dispatch:
6
+
7
+ jobs:
8
+ pypi-publish:
9
+ name: Upload to PyPI
10
+ environment: prd
11
+ runs-on: ubuntu-latest
12
+ permissions:
13
+ contents: read # allow access to the repo
14
+ id-token: write # For PyPI's trusted publishing
15
+ steps:
16
+ - name: Checkout
17
+ uses: actions/checkout@v4
18
+ with:
19
+ fetch-depth: 0
20
+
21
+ - name: "Install uv"
22
+ uses: astral-sh/setup-uv@v3
23
+
24
+ - name: Build
25
+ run: uv build
26
+
27
+ - name: Publish to PyPi
28
+ run: uv publish -v dist/*
@@ -0,0 +1,51 @@
1
+ ---
2
+ name: Python Tests
3
+
4
+ "on":
5
+ pull_request:
6
+ paths:
7
+ - .github/workflows/python-tests.yaml
8
+ - "**/*.py"
9
+ - pyproject.toml
10
+ - uv.lock
11
+ push:
12
+ branches:
13
+ - main
14
+ paths:
15
+ - .github/workflows/python-tests.yaml
16
+ - "**/*.py"
17
+ - pyproject.toml
18
+ - uv.lock
19
+
20
+ concurrency:
21
+ group: ${{ github.workflow }}-${{ github.ref }}
22
+ cancel-in-progress: ${{ github.event_name == 'pull_request' }}
23
+
24
+ jobs:
25
+ run_unit_tests:
26
+ name: "Unit tests"
27
+ permissions:
28
+ contents: read
29
+ timeout-minutes: 10
30
+ runs-on: ubuntu-latest
31
+ steps:
32
+ - uses: actions/checkout@v4
33
+ with:
34
+ fetch-depth: 0
35
+ persist-credentials: false
36
+
37
+ - name: Install uv
38
+ uses: astral-sh/setup-uv@v5
39
+ with:
40
+ version: "0.5.26"
41
+ enable-cache: true
42
+ cache-dependency-glob: "uv.lock"
43
+
44
+ - name: Set up Python
45
+ run: uv python install
46
+
47
+ - name: Install Project
48
+ run: uv sync --all-extras --dev
49
+
50
+ - name: Run tests
51
+ run: uv run pytest tests
@@ -0,0 +1,50 @@
1
+ name: Static analysis
2
+
3
+ # on PR and push to main
4
+ on:
5
+ push:
6
+ branches:
7
+ - main
8
+ pull_request:
9
+
10
+ permissions:
11
+ contents: read
12
+
13
+ # Limit concurrency by workflow/branch combination.
14
+ #
15
+ # For pull request builds, pushing additional changes to the
16
+ # branch will cancel prior in-progress and pending builds.
17
+ #
18
+ # For builds triggered on a branch push, additional changes
19
+ # will wait for prior builds to complete before starting.
20
+ #
21
+ # https://docs.github.com/en/actions/using-jobs/using-concurrency
22
+ concurrency:
23
+ group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
24
+ cancel-in-progress: ${{ github.event_name == 'pull_request' }}
25
+
26
+ jobs:
27
+ pre-commit-checks:
28
+ name: Pre-commit checks
29
+ runs-on: ubuntu-latest
30
+
31
+ steps:
32
+ - uses: actions/checkout@v4
33
+ with:
34
+ persist-credentials: false
35
+ fetch-depth: 0
36
+ - name: Install uv
37
+ uses: astral-sh/setup-uv@v5
38
+ with:
39
+ version: "0.5.26"
40
+ enable-cache: true
41
+ cache-dependency-glob: "uv.lock"
42
+
43
+ - name: Set up Python
44
+ run: uv python install
45
+
46
+ - name: Install Project
47
+ run: uv sync --all-extras --dev
48
+
49
+ - name: Run pre-commit
50
+ run: uv run pre-commit run --show-diff-on-failure --color=always --all-files
@@ -0,0 +1,186 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
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
+ # All node modules in any directory
30
+ node_modules/
31
+ _docs/
32
+
33
+
34
+ # PyInstaller
35
+ # Usually these files are written by a python script from a template
36
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
37
+ *.manifest
38
+ *.spec
39
+
40
+ # Installer logs
41
+ pip-log.txt
42
+ pip-delete-this-directory.txt
43
+
44
+ /sandbox/*
45
+ !/sandbox/pyproject.toml
46
+
47
+ # Unit test / coverage reports
48
+ htmlcov/
49
+ .tox/
50
+ .nox/
51
+ .coverage
52
+ .coverage.*
53
+ .cache
54
+ nosetests.xml
55
+ coverage.xml
56
+ *.cover
57
+ *.py,cover
58
+ .hypothesis/
59
+ .pytest_cache/
60
+ .pytest_cache/*
61
+ cover/
62
+
63
+ # Translations
64
+ *.mo
65
+ *.pot
66
+
67
+ # Django stuff:
68
+ *.log
69
+ local_settings.py
70
+ db.sqlite3
71
+ db.sqlite3-journal
72
+
73
+ # Flask stuff:
74
+ instance/
75
+ .webassets-cache
76
+
77
+ # Scrapy stuff:
78
+ .scrapy
79
+
80
+ # Sphinx documentation
81
+ docs/_build/
82
+
83
+ # PyBuilder
84
+ .pybuilder/
85
+ target/
86
+
87
+ # Jupyter Notebook
88
+ .ipynb_checkpoints
89
+
90
+ # IPython
91
+ profile_default/
92
+ ipython_config.py
93
+
94
+ # pyenv
95
+ # For a library or package, you might want to ignore these files since the code is
96
+ # intended to run in multiple environments; otherwise, check them in:
97
+ .python-version
98
+
99
+ # pipenv
100
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
101
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
102
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
103
+ # install all needed dependencies.
104
+ #Pipfile.lock
105
+
106
+ # poetry
107
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
108
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
109
+ # commonly ignored for libraries.
110
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
111
+ #poetry.lock
112
+
113
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow
114
+ __pypackages__/
115
+
116
+ # Celery stuff
117
+ celerybeat-schedule
118
+ celerybeat.pid
119
+
120
+ # SageMath parsed files
121
+ *.sage.py
122
+
123
+ # Environments
124
+ .env
125
+ .venv
126
+ env/
127
+ venv/
128
+ ENV/
129
+ env.bak/
130
+ venv.bak/
131
+ .envrc
132
+
133
+ # Spyder project settings
134
+ .spyderproject
135
+ .spyproject
136
+
137
+ # Rope project settings
138
+ .ropeproject
139
+
140
+ # mkdocs documentation
141
+ /site
142
+
143
+ # mypy
144
+ .mypy_cache/
145
+ .dmypy.json
146
+ dmypy.json
147
+
148
+ # Pyre type checker
149
+ .pyre/
150
+
151
+ # pytype static type analyzer
152
+ .pytype/
153
+
154
+ # Cython debug symbols
155
+ cython_debug/
156
+
157
+ # PyCharm
158
+ # JetBrains specific template is maintainted in a separate JetBrains.gitignore that can
159
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
160
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
161
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
162
+ #.idea/
163
+
164
+ .DS_Store
165
+
166
+ # ruff
167
+ .ruff_cache/**/*
168
+
169
+ # VS Code
170
+ .vscode/
171
+
172
+ local_examples/
173
+
174
+ # Chroma
175
+ .chroma/
176
+
177
+ # versioning
178
+ src/raggy/_version.py
179
+
180
+ # Prefect
181
+ .prefect/
182
+ .prefect/*.json
183
+ .prefectignore
184
+
185
+ # ruff
186
+ .ruff_cache
@@ -0,0 +1,36 @@
1
+ repos:
2
+ - repo: https://github.com/astral-sh/ruff-pre-commit
3
+ rev: "v0.9.4"
4
+ hooks:
5
+ - id: ruff
6
+ language_version: python3
7
+ args: [--fix, --exit-non-zero-on-fix, --show-fixes]
8
+ - id: ruff-format
9
+ - repo: https://github.com/astral-sh/uv-pre-commit
10
+ # uv version.
11
+ rev: 0.5.26
12
+ hooks:
13
+ - id: uv-lock
14
+ - repo: https://github.com/codespell-project/codespell
15
+ rev: v2.2.6
16
+ hooks:
17
+ - id: codespell
18
+ exclude: package-lock.json|_vendor/.*|docs/styles/.*
19
+ - repo: https://github.com/pre-commit/mirrors-mypy
20
+ rev: v1.9.0
21
+ hooks:
22
+ - id: mypy
23
+ additional_dependencies:
24
+ - pydantic>=1.10.0,!=2.0.0,!=2.0.1,!=2.1.0,<3.0.0
25
+ - types-cachetools==5.3.0.5
26
+ - types-pyyaml==6.0.12.9
27
+ - types-toml==0.10.8.20240310
28
+ - types-tzlocal==5.1.0.1
29
+ files:
30
+ ^(
31
+ src/prefect_cloud/github.py|
32
+ src/prefect_cloud/cli.py|
33
+ src/prefect_cloud/setting.py|
34
+ src/prefect_cloud/clients/.*|
35
+ )$
36
+
@@ -0,0 +1,68 @@
1
+ Metadata-Version: 2.4
2
+ Name: prefect-cloud
3
+ Version: 0.1.0a0
4
+ Summary: Package for easily deploying to Prefect Cloud.
5
+ Author-email: "Prefect Technologies, Inc." <help@prefect.io>
6
+ Requires-Python: >=3.12
7
+ Requires-Dist: croniter>=6.0.0
8
+ Requires-Dist: griffe>=1.5.6
9
+ Requires-Dist: httpx>=0.28.1
10
+ Requires-Dist: pendulum>=3.0.0
11
+ Requires-Dist: pydantic-extra-types>=2.10.2
12
+ Requires-Dist: pydantic-settings>=2.7.1
13
+ Requires-Dist: pydantic>=2.10.6
14
+ Requires-Dist: readchar>=4.2.1
15
+ Requires-Dist: rich>=13.9.4
16
+ Requires-Dist: toml>=0.10.2
17
+ Requires-Dist: typer>=0.13.1
18
+ Requires-Dist: typing-extensions>=4.12.2
19
+ Requires-Dist: tzlocal>=5.2
20
+ Requires-Dist: uv>=0.5.26
21
+ Description-Content-Type: text/markdown
22
+
23
+ # prefect-cloud
24
+
25
+ :zap: Deploy your code on Prefect Cloud in seconds! :zap:
26
+
27
+ ## Installation
28
+ All you need is `uv`! See [installation docs here](https://docs.astral.sh/uv/getting-started/installation/)
29
+ ```bash
30
+ $ curl -LsSf https://astral.sh/uv/install.sh | sh
31
+ ```
32
+
33
+ ## Login to Prefect Cloud
34
+ ```bash
35
+ $ uvx prefect cloud login
36
+ ```
37
+
38
+ ## Deploy your workflow from github
39
+
40
+ ```shell
41
+ $ uvx prefect-cloud deploy FUNCTION_NAME --from GITHUB_PY_FILE_URL
42
+ ```
43
+ For example:
44
+ ```shell
45
+ $ uvx prefect-cloud deploy hello_world --from https://github.com/jakekaplan/demo-flows/blob/main/hello_world.py
46
+ ```
47
+ ### From a Private Repo
48
+ ```shell
49
+ # private repo
50
+ $ uvx prefect-cloud deploy FUNCTION_NAME --from GITHUB_PY_FILE_URL --credentials GITHUB_TOKEN
51
+ ```
52
+
53
+ ### With dependencies:
54
+ ```bash
55
+ # a package
56
+ $ uvx prefect-cloud deploy ... --from ... --dependencies pandas
57
+ # multiple packages
58
+ $ uvx prefect-cloud deploy ... --from ... --dependencies "pandas,numpy"
59
+ # requirements file
60
+ $ uvx prefect-cloud deploy ... --from ... --dependencies /path/to/requirements.txt
61
+ # pyproject.toml
62
+ $ uvx prefect-cloud deploy ... --from ... --dependencies /path/to/pyproject.toml
63
+ ```
64
+
65
+ ### With environment variables:
66
+ ```bash
67
+ $ uvx prefect-cloud deploy ... --from ... --env ENV_VAR1=VALUE1 --env ENV_VAR2=VALUE2
68
+ ```
@@ -0,0 +1,46 @@
1
+ # prefect-cloud
2
+
3
+ :zap: Deploy your code on Prefect Cloud in seconds! :zap:
4
+
5
+ ## Installation
6
+ All you need is `uv`! See [installation docs here](https://docs.astral.sh/uv/getting-started/installation/)
7
+ ```bash
8
+ $ curl -LsSf https://astral.sh/uv/install.sh | sh
9
+ ```
10
+
11
+ ## Login to Prefect Cloud
12
+ ```bash
13
+ $ uvx prefect cloud login
14
+ ```
15
+
16
+ ## Deploy your workflow from github
17
+
18
+ ```shell
19
+ $ uvx prefect-cloud deploy FUNCTION_NAME --from GITHUB_PY_FILE_URL
20
+ ```
21
+ For example:
22
+ ```shell
23
+ $ uvx prefect-cloud deploy hello_world --from https://github.com/jakekaplan/demo-flows/blob/main/hello_world.py
24
+ ```
25
+ ### From a Private Repo
26
+ ```shell
27
+ # private repo
28
+ $ uvx prefect-cloud deploy FUNCTION_NAME --from GITHUB_PY_FILE_URL --credentials GITHUB_TOKEN
29
+ ```
30
+
31
+ ### With dependencies:
32
+ ```bash
33
+ # a package
34
+ $ uvx prefect-cloud deploy ... --from ... --dependencies pandas
35
+ # multiple packages
36
+ $ uvx prefect-cloud deploy ... --from ... --dependencies "pandas,numpy"
37
+ # requirements file
38
+ $ uvx prefect-cloud deploy ... --from ... --dependencies /path/to/requirements.txt
39
+ # pyproject.toml
40
+ $ uvx prefect-cloud deploy ... --from ... --dependencies /path/to/pyproject.toml
41
+ ```
42
+
43
+ ### With environment variables:
44
+ ```bash
45
+ $ uvx prefect-cloud deploy ... --from ... --env ENV_VAR1=VALUE1 --env ENV_VAR2=VALUE2
46
+ ```
@@ -0,0 +1,54 @@
1
+ [project]
2
+ name = "prefect-cloud"
3
+ version = "0.1.0a0"
4
+ description = "Package for easily deploying to Prefect Cloud."
5
+ readme = "README.md"
6
+ authors = [
7
+ { name = "Prefect Technologies, Inc.", email = "help@prefect.io"}
8
+ ]
9
+
10
+ requires-python = ">=3.12"
11
+ dependencies = [
12
+ "pydantic-settings>=2.7.1",
13
+ "pydantic>=2.10.6",
14
+ "rich>=13.9.4",
15
+ "typer>=0.13.1",
16
+ "typing-extensions>=4.12.2",
17
+ "uv>=0.5.26",
18
+ "tzlocal>=5.2",
19
+ "httpx>=0.28.1",
20
+ "pydantic-extra-types>=2.10.2",
21
+ "pendulum>=3.0.0",
22
+ "toml>=0.10.2",
23
+ "griffe>=1.5.6",
24
+ "readchar>=4.2.1",
25
+ "croniter>=6.0.0",
26
+ ]
27
+
28
+ [dependency-groups]
29
+ dev = [
30
+ "coverage>=7.6.10",
31
+ "pre-commit>=4.1.0",
32
+ "pytest-asyncio>=0.25.3",
33
+ "pytest-cov>=6.0.0",
34
+ "pytest-xdist>=3.6.1",
35
+ "pytest>=8.3.4",
36
+ "respx>=0.22.0",
37
+ "ruff>=0.9.4",
38
+ "types-toml>=0.10.8.20240310",
39
+ "types-tzlocal>=5.1.0.1",
40
+ ]
41
+
42
+ [project.scripts]
43
+ prefect-cloud = "prefect_cloud:cli.app"
44
+
45
+ [build-system]
46
+ requires = ["hatchling"]
47
+ build-backend = "hatchling.build"
48
+
49
+ [tool.pytest.ini_options]
50
+ asyncio_mode = "auto"
51
+ asyncio_default_fixture_loop_scope = "session"
52
+ testpaths = [
53
+ "tests",
54
+ ]
File without changes