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

Commit 1b77f10

Browse files
authored
Updates project to match configuration in prefect-collection-template (#3)
* Updates project to match configuration in prefect-collection-template
1 parent 6b33b86 commit 1b77f10

18 files changed

+2419
-79
lines changed

.gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
prefect_aws/_version.py export-subst

.github/PULL_REQUEST_TEMPLATE.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<!-- Thanks for contributing to prefect-aws! 🎉-->
2+
3+
## Summary
4+
<!-- A brief summary explaining the purpose of this PR -->
5+
6+
## Relevant Issue(s)
7+
<!-- If this PR addresses any open issues, please let us know which one here -->

.github/dependabot.yml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: 2
2+
updates:
3+
4+
- package-ecosystem: "pip"
5+
directory: "/"
6+
schedule:
7+
interval: "daily"
8+
9+
- package-ecosystem: "github-actions"
10+
directory: "/"
11+
schedule:
12+
interval: "daily"

.github/workflows/release.yml

+90
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
name: Build & Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
jobs:
9+
build-release:
10+
name: Build Release
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
15+
- name: Set up Python
16+
uses: actions/setup-python@v2
17+
with:
18+
python-version: 3.7
19+
20+
- name: Install packages
21+
run: |
22+
python -m pip install --upgrade pip build
23+
python -m pip install --upgrade --upgrade-strategy eager -e .[dev]
24+
25+
- name: Build a binary wheel and a source tarball
26+
run: |
27+
python -m build --sdist --wheel --outdir dist/
28+
29+
- name: Publish build artifacts
30+
uses: actions/upload-artifact@v2
31+
with:
32+
name: built-package
33+
path: "./dist"
34+
35+
publish-test-release:
36+
name: Publish release to Test PyPI
37+
needs: [build-release]
38+
environment: "test"
39+
runs-on: ubuntu-latest
40+
41+
steps:
42+
- name: Download build artifacts
43+
uses: actions/download-artifact@v2
44+
with:
45+
name: built-package
46+
path: './dist'
47+
48+
- name: Publish distribution to Test PyPI
49+
uses: pypa/gh-action-pypi-publish@master
50+
with:
51+
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
52+
repository_url: https://test.pypi.org/legacy/
53+
54+
build-and-publish-docs:
55+
name: Build and publish docs
56+
needs: [build-release, publish-test-release]
57+
runs-on: ubuntu-latest
58+
59+
steps:
60+
- uses: actions/checkout@v2
61+
62+
- name: Build docs
63+
run: |
64+
python -m pip install --upgrade pip
65+
python -m pip install --upgrade --upgrade-strategy eager -e .[dev]
66+
mkdocs build
67+
68+
- name: Publish docs
69+
uses: JamesIves/[email protected]
70+
with:
71+
branch: docs
72+
folder: site
73+
74+
publish-release:
75+
name: Publish release to PyPI
76+
needs: [build-release, publish-test-release, build-and-publish-docs]
77+
environment: "prod"
78+
runs-on: ubuntu-latest
79+
80+
steps:
81+
- name: Download build artifacts
82+
uses: actions/download-artifact@v2
83+
with:
84+
name: built-package
85+
path: './dist'
86+
87+
- name: Publish distribution to PyPI
88+
uses: pypa/gh-action-pypi-publish@master
89+
with:
90+
password: ${{ secrets.PYPI_API_TOKEN }}

.github/workflows/static_analysis.yaml

-43
This file was deleted.

.github/workflows/static_analysis.yml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Static analysis
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
pre-commit-checks:
7+
name: Pre-commit checks
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- uses: actions/checkout@v2
12+
with:
13+
persist-credentials: false
14+
15+
- name: Set up Python
16+
uses: actions/setup-python@v2
17+
with:
18+
python-version: 3.9
19+
20+
- name: Install pre-commit
21+
run: |
22+
python -m pip install --upgrade pip
23+
pip install pre-commit
24+
25+
- name: Run pre-commit
26+
run: |
27+
pre-commit run --show-diff-on-failure --color=always --all-files

.github/workflows/tests.yaml .github/workflows/tests.yml

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
name: Tests
22

3-
on:
4-
pull_request:
5-
branches: [main]
3+
on: [pull_request]
64

75
jobs:
86
run-tests:
@@ -14,6 +12,7 @@ jobs:
1412
- 3.7
1513
- 3.8
1614
- 3.9
15+
fail-fast: false
1716
steps:
1817
- uses: actions/checkout@v2
1918

@@ -27,8 +26,11 @@ jobs:
2726
- name: Install dependencies
2827
run: |
2928
python -m pip install --upgrade pip
30-
pip install ".[dev]"
29+
python -m pip install --upgrade --upgrade-strategy eager -e ".[dev]"
3130
3231
- name: Run tests
32+
env:
33+
PREFECT_ORION_DATABASE_CONNECTION_URL: "sqlite+aiosqlite:///./orion-tests.db"
3334
run: |
35+
prefect orion database reset -y
3436
pytest tests -vv

.gitignore

+37-9
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,25 @@ coverage.xml
5151
.hypothesis/
5252
.pytest_cache/
5353

54-
# Logs
54+
# Translations
55+
*.mo
56+
*.pot
57+
58+
# Django stuff:
5559
*.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/
5673

5774
# PyBuilder
5875
target/
@@ -67,9 +84,23 @@ ipython_config.py
6784
# pyenv
6885
.python-version
6986

87+
# pipenv
88+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
89+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
90+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
91+
# install all needed dependencies.
92+
#Pipfile.lock
93+
7094
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
7195
__pypackages__/
7296

97+
# Celery stuff
98+
celerybeat-schedule
99+
celerybeat.pid
100+
101+
# SageMath parsed files
102+
*.sage.py
103+
73104
# Environments
74105
.env
75106
.venv
@@ -79,19 +110,13 @@ ENV/
79110
env.bak/
80111
venv.bak/
81112

82-
# VSCode project settings
83-
.vscode/
84-
85113
# Spyder project settings
86114
.spyderproject
87115
.spyproject
88116

89117
# Rope project settings
90118
.ropeproject
91119

92-
# pyproject configuration
93-
pyproject.toml
94-
95120
# mkdocs documentation
96121
/site
97122

@@ -103,5 +128,8 @@ dmypy.json
103128
# Pyre type checker
104129
.pyre/
105130

106-
# MacOS
107-
.DS_Store
131+
# OS files
132+
.DS_Store
133+
134+
# VS Code
135+
.vscode

.pre-commit-config.yaml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
repos:
2+
- repo: https://github.com/pycqa/isort
3+
rev: 5.10.1
4+
hooks:
5+
- id: isort
6+
language_version: python3
7+
- repo: https://github.com/psf/black
8+
rev: 22.1.0
9+
hooks:
10+
- id: black
11+
language_version: python3
12+
- repo: https://github.com/pycqa/flake8
13+
rev: 4.0.1
14+
hooks:
15+
- id: flake8

MANIFEST.in

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
include versioneer.py
2+
include prefect_aws/_version.py

docs/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ These tasks are designed to work with Prefect 2.0. For more information about ho
1818
Install Prefect and Prefect AWS
1919

2020
```bash
21-
pip install "prefect>=2.0a9" prefect-aws
21+
pip install "prefect>=2.0a12" prefect-aws
2222
```
2323

2424
### Write and run a flow

prefect_aws/credentials.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,25 @@
11
from dataclasses import dataclass
22
from typing import Optional
3+
34
import boto3
45

56

67
@dataclass
78
class AwsCredentials:
89
"""
910
Dataclass used to manage authentication with AWS. AWS authentication is
10-
handled via the `boto3` module. Refer to the [boto3 docs](https://boto3.amazonaws.com/v1/documentation/api/latest/guide/credentials.html)
11+
handled via the `boto3` module. Refer to the
12+
[boto3 docs](https://boto3.amazonaws.com/v1/documentation/api/latest/guide/credentials.html)
1113
for more info about the possible credential configurations.
1214
1315
Args:
1416
aws_access_key_id: A specific AWS access key ID.
1517
aws_secret_access_key: A specific AWS secret access key.
16-
aws_session_token: The session key for your AWS account. This is only needed when you are using temporary credentials.
18+
aws_session_token: The session key for your AWS account.
19+
This is only needed when you are using temporary credentials.
1720
profile_name: The profile to use when creating your session.
1821
region_name: The AWS Region where you want to create new connections.
19-
"""
22+
""" # noqa E501
2023

2124
aws_access_key_id: Optional[str] = None
2225
aws_secret_access_key: Optional[str] = None

prefect_aws/s3.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ def s3_list_objects(
147147
>>> bucket="data_bucket",
148148
>>> aws_credentials=aws_credentials
149149
>>> )
150-
"""
150+
""" # noqa E501
151151
logger = get_logger()
152152
logger.info("Listing objects in bucket %s with prefix %s", bucket, prefix)
153153

requirements-dev.txt requirements_dev.txt

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ pytest
22
black
33
flake8
44
mypy
5-
moto[s3]
65
mkdocs
76
mkdocs-material
8-
mkdocstrings
7+
mkdocstrings
8+
isort
9+
pre-commit
10+
moto[s3]

0 commit comments

Comments
 (0)