Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit 11aedc4

Browse files
authored
Add cruft for automated template sychronization (#125)
1 parent e393728 commit 11aedc4

11 files changed

+157
-15
lines changed

Diff for: .cruft.json

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"template": "https://github.com/PrefectHQ/prefect-collection-template",
3+
"commit": "ff7c2498c022e0722e9ed99a09e7bc58d22b94d9",
4+
"checkout": null,
5+
"context": {
6+
"cookiecutter": {
7+
"full_name": "Prefect Technologies, Inc.",
8+
"email": "[email protected]",
9+
"github_organization": "PrefectHQ",
10+
"collection_name": "prefect-aws",
11+
"collection_slug": "prefect_aws",
12+
"collection_short_description": "Prefect integrations for interacting with AWS.",
13+
"_copy_without_render": [
14+
".github/workflows/*.yml"
15+
],
16+
"_template": "https://github.com/PrefectHQ/prefect-collection-template"
17+
}
18+
},
19+
"directory": null
20+
}

Diff for: .github/PULL_REQUEST_TEMPLATE.md

+29-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,32 @@
1-
<!-- Thanks for contributing to prefect-aws! 🎉-->
1+
<!--
2+
Thanks for opening a pull request to prefect-aws 🎉!
23
3-
## Summary
4-
<!-- A brief summary explaining the purpose of this PR -->
4+
We've got a few requests to help us review contributions:
55
6-
## Relevant Issue(s)
7-
<!-- If this PR addresses any open issues, please let us know which one here -->
6+
- Make sure that your title neatly summarizes the proposed changes.
7+
- Provide a short overview of the change and the value it adds.
8+
- Share an example to help us understand the change in user experience.
9+
- Run `pre-commit install && pre-commit run --all` for linting.
810
9-
## Checklist
10-
- [ ] Summarized PR's changes in the **Unreleased** section of the [CHANGELOG.md](https://github.com/PrefectHQ/prefect-aws/blob/main/CHANGELOG.md)
11+
Happy engineering!
12+
-->
13+
14+
<!-- Include an overview here -->
15+
16+
<!-- Link to issue -->
17+
Closes #
18+
19+
### Example
20+
<!--
21+
Share an example of the change in action.
22+
23+
A code blurb is best. Changes to features should include an example that is executable by a new user.
24+
-->
25+
26+
### Checklist
27+
<!-- These boxes may be checked after opening the pull request. -->
28+
29+
- [ ] This pull request references any related issue by including "Closes #<ISSUE_NUMBER>"
30+
- If no issue exists and your change is not a small fix, please [create an issue](https://github.com/PrefectHQ/prefect-aws/issues/new/choose) first.
31+
- [ ] This pull request includes tests or only affects documentation.
32+
- [ ] Summarized PR's changes in [CHANGELOG.md](https://github.com/PrefectHQ/prefect-aws/blob/main/CHANGELOG.md)

Diff for: .github/workflows/add-to-project.yml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Add issues to integrations board
2+
3+
on:
4+
issues:
5+
types:
6+
- opened
7+
8+
jobs:
9+
10+
add-to-project:
11+
name: Add issue to project
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: tibdex/github-app-token@v1
15+
id: generate-token
16+
name: Generate GitHub token
17+
with:
18+
app_id: ${{ secrets.SYNC_APP_ID }}
19+
private_key: ${{ secrets.SYNC_APP_PRIVATE_KEY }}
20+
21+
- uses: actions/[email protected]
22+
with:
23+
project-url: ${{ secrets.ADD_TO_PROJECT_URL }}
24+
github-token: ${{ steps.generate-token.outputs.token }}

Diff for: .github/workflows/template-sync.yml

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Template Synchronization
2+
on:
3+
schedule:
4+
- cron: "0 0 * * *"
5+
workflow_dispatch:
6+
7+
jobs:
8+
submit-update-pr:
9+
name: Submit update PR
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
14+
- name: Set up Python
15+
uses: actions/setup-python@v4
16+
with:
17+
python-version: 3.9
18+
19+
- name: Install cruft
20+
run: pip install "cookiecutter>=1.7.3,<2.0.0" cruft
21+
22+
- name: Perform updates
23+
run: cruft update -y
24+
25+
- uses: tibdex/github-app-token@v1
26+
id: generate-token
27+
name: Generate GitHub token
28+
with:
29+
app_id: ${{ secrets.SYNC_APP_ID }}
30+
private_key: ${{ secrets.SYNC_APP_PRIVATE_KEY }}
31+
32+
- name: Submit PR
33+
uses: peter-evans/create-pull-request@v4
34+
with:
35+
commit-message: Updating collection with changes to prefect-collection-template
36+
token: ${{ steps.generate-token.outputs.token }}
37+
branch: sync-with-template
38+
delete-branch: true
39+
title: Sync Collection with changes to prefect-collection-template
40+
body: |
41+
Automated PR created to propagate changes from prefect-collection-template to this collection
42+
43+
Feel free to make any necessary changes to this PR before merging.
44+
labels: |
45+
template sync
46+
automated pr

Diff for: MAINTAINERS.md

+11-5
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ pip install -e ".[dev]"
4646
pre-commit install
4747
```
4848

49-
To verify the set up was successful you can run the following:
49+
To verify the setup was successful you can run the following:
5050

5151
- Run the tests for tasks and flows in the collection:
5252
```bash
@@ -69,23 +69,29 @@ This collection has been setup to with [mkdocs](https://www.mkdocs.org/) for aut
6969

7070
### CI Pipeline
7171

72-
This collection comes with [GitHub Actions](https://docs.github.com/en/actions) for testing and linting. To add additional actions, you can add jobs in the `.github/workflows` folder. On pull request, the pipeline will run linting via [`black`](https://black.readthedocs.io/en/stable/), [`flake8`](https://flake8.pycqa.org/en/latest/), [`interrogate`](https://interrogate.readthedocs.io/en/latest/), and unit tests via `pytest` alongside `coverage`.
72+
This collection comes with [GitHub Actions](https://docs.github.com/en/actions) for testing and linting. To add additional actions, you can add jobs in the `.github/workflows` folder. Upon a pull request, the pipeline will run linting via [`black`](https://black.readthedocs.io/en/stable/), [`flake8`](https://flake8.pycqa.org/en/latest/), [`interrogate`](https://interrogate.readthedocs.io/en/latest/), and unit tests via `pytest` alongside `coverage`.
7373

7474
`interrogate` will tell you which methods, functions, classes, and modules have docstrings, and which do not--the job has a fail threshold of 95%, meaning that it will fail if more than 5% of the codebase is undocumented. We recommend following the [Google Python Style Guide](https://google.github.io/styleguide/pyguide.html#38-comments-and-docstrings) for docstring format.
7575

7676
Simiarly, `coverage` ensures that the codebase includes tests--the job has a fail threshold of 80%, meaning that it will fail if more than 20% of the codebase is missing tests.
7777

78+
### Track Issues on Project Board
79+
80+
To automatically add issues to a GitHub Project Board, you'll need a [secret added](https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-an-environment) to the repository. Specifically, a secret named `ADD_TO_PROJECT_URL`, formatted like `https://github.com/orgs/<GITHUB_ORGANIZATION>/projects/<PROJECT_NUMBER>`.
81+
7882
### Package and Publish
7983

8084
GitHub actions will handle packaging and publishing of your collection to [PyPI](https://pypi.org/) so other Prefect users can your collection in their flows.
8185

82-
In order to publish to PyPI, you'll need a PyPI account and generate an API token to authenticate with PyPI when publishing new versions of your collection. The [PyPI documentation](https://pypi.org/help/#apitoken) outlines the steps needed to get an API token.
86+
To publish to PyPI, you'll need a PyPI account and to generate an API token to authenticate with PyPI when publishing new versions of your collection. The [PyPI documentation](https://pypi.org/help/#apitoken) outlines the steps needed to get an API token.
8387

8488
Once you've obtained a PyPI API token, [create a GitHub secret](https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository) named `PYPI_API_TOKEN`.
8589

86-
To create publish a new version of your collection, [create a new GitHub release](https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository#creating-a-release) and tag it with the version that you want to deploy (e.g. v0.3.2). This will trigger workflow to publish the new version on PyPI and deploy the updated docs to GitHub pages.
90+
To publish a new version of your collection, [create a new GitHub release](https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository#creating-a-release) and tag it with the version that you want to deploy (e.g. v0.3.2). This will trigger a workflow to publish the new version on PyPI and deploy the updated docs to GitHub pages.
91+
92+
Upon publishing, a `docs` branch is automatically created. To hook this up to GitHub Pages, simply head over to https://github.com/PrefectHQ/prefect-aws/settings/pages, select `docs` under the dropdown menu, keep the default `/root` folder, `Save`, and upon refresh, you should see a prompt stating "Your site is published at https://PrefectHQ.github.io/prefect-aws". Don't forget to add this link to the repo's "About" section, under "Website" so users can access the docs easily.
8793

88-
Upon publishing, a `docs` branch is automatically created. To hook this up to GitHub Pages, simply head over to https://github.com/PrefectHQ/prefect-aws/settings/pages, select `docs` under the dropdown menu, keep the default `/root` folder, `Save`, and upon refresh, you should see a prompt stating "Your site is published at https://<username>.github.io/<repository>".
94+
Feel free to [submit your collection](https://orion-docs.prefect.io/collections/overview/#listing-in-the-collections-catalog) to the Prefect [Collections Catalog](https://orion-docs.prefect.io/collections/catalog/)!
8995

9096
## Further guidance
9197

Diff for: MANIFEST.in

+12
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,14 @@
1+
# Things to always exclude
2+
global-exclude .git*
3+
global-exclude .ipynb_checkpoints
4+
global-exclude *.py[co]
5+
global-exclude __pycache__/**
6+
7+
# Top-level Config
18
include versioneer.py
29
include prefect_aws/_version.py
10+
include LICENSE
11+
include MANIFEST.in
12+
include setup.cfg
13+
include requirements.txt
14+
include requirements-dev.txt

Diff for: README.md

+9
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,13 @@ Install `prefect-aws`
3737
```bash
3838
pip install prefect-aws
3939
```
40+
Then, register to [view the block](https://orion-docs.prefect.io/ui/blocks/) on Prefect Cloud:
41+
42+
```bash
43+
prefect block register -m prefect_aws.credentials
44+
```
45+
46+
Note, to use the `load` method on Blocks, you must already have a block document [saved through code](https://orion-docs.prefect.io/concepts/blocks/#saving-blocks) or [saved through the UI](https://orion-docs.prefect.io/ui/blocks/).
4047

4148
### AWS Authentication
4249

@@ -131,6 +138,8 @@ If you encounter and bugs while using `prefect-aws`, feel free to open an issue
131138

132139
If you have any questions or issues while using `prefect-aws`, you can find help in either the [Prefect Discourse forum](https://discourse.prefect.io/) or the [Prefect Slack community](https://prefect.io/slack)
133140

141+
Feel free to ⭐️ or watch [`prefect-aws`](https://github.com/PrefectHQ/prefect-aws) for updates too!
142+
134143
## Development
135144

136145
If you'd like to install a version of `prefect-aws` for development, first clone the repository and then perform an editable install with `pip`:

Diff for: docs/img/prefect-logo-mark-solid-white-500.png

15.9 KB
Loading

Diff for: mkdocs.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
site_name: prefect-aws
2-
site_url: https://prefecthq.github.io/prefect-aws
3-
repo_url: https://github.com/prefecthq/prefect-aws
2+
site_url: https://PrefectHQ.github.io/prefect-aws
3+
repo_url: https://github.com/PrefectHQ/prefect-aws
44
edit_uri: edit/main/docs/
55
theme:
66
name: material
@@ -10,7 +10,8 @@ theme:
1010
accent: blue
1111
icon:
1212
repo: fontawesome/brands/github
13-
logo: img/prefect-logo-white.png
13+
logo:
14+
img/prefect-logo-mark-solid-white-500.png
1415
font:
1516
text: Inter
1617
code: Source Code Pro

Diff for: requirements-dev.txt

+1
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ interrogate
1616
coverage
1717
types-boto3 >= 1.0.2
1818
boto3-stubs >= 1.24.39
19+
pillow

Diff for: setup.cfg

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ parentdir_prefix =
2323

2424
[tool:interrogate]
2525
ignore-init-module = True
26+
ignore_init_method = True
2627
exclude = prefect_aws/_version.py, tests, setup.py, versioneer.py, docs, site
2728
fail-under = 95
2829
omit-covered-files = True

0 commit comments

Comments
 (0)