Skip to content

Commit 6802e5e

Browse files
v1
0 parents  commit 6802e5e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+5572
-0
lines changed

.github/workflows/checks.yml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Check
2+
on: [pull_request]
3+
permissions:
4+
contents: write
5+
jobs:
6+
check:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v4
10+
- uses: actions/setup-python@v5
11+
with:
12+
python-version: '3.10'
13+
cache: 'pip'
14+
- uses: extractions/setup-just@v1
15+
- run: just install
16+
- run: |
17+
git fetch origin
18+
pre-commit run --from-ref origin/${{ github.event.pull_request.base.ref }} --to-ref ${{ github.event.pull_request.head.sha }}
19+
20+
test:
21+
runs-on: ubuntu-latest
22+
strategy:
23+
fail-fast: false
24+
matrix:
25+
python-version: [ "3.10", "3.11" ]
26+
steps:
27+
- uses: actions/checkout@v4
28+
- uses: actions/setup-python@v5
29+
with:
30+
python-version: ${{ matrix.python-version }}
31+
cache: 'pip'
32+
- uses: extractions/setup-just@v1
33+
- run: just install
34+
- run: just test-with-coverage
35+
- uses: codecov/codecov-action@v4

.github/workflows/deploy.yml

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Deploy
2+
on:
3+
push:
4+
tags:
5+
- "v*.*.*"
6+
workflow_dispatch: {}
7+
jobs:
8+
build:
9+
strategy:
10+
matrix:
11+
python-version: [ "3.10" ]
12+
os:
13+
# --8<-- [start:oses]
14+
- "ubuntu-20.04"
15+
- "windows-latest"
16+
- "macos-latest"
17+
# --8<-- [end:oses]
18+
runs-on: ${{ matrix.os }}
19+
steps:
20+
- uses: actions/checkout@v4
21+
- uses: actions/setup-python@v5
22+
with:
23+
python-version: ${{ matrix.python-version }}
24+
cache: 'pip'
25+
- uses: extractions/setup-just@v1
26+
- run: just install
27+
- run: just build
28+
if: matrix.os == 'ubuntu-20.04'
29+
- uses: actions/upload-artifact@v4
30+
if: matrix.os == 'ubuntu-20.04'
31+
with:
32+
name: dist
33+
path: dist/
34+
- uses: pypa/gh-action-pypi-publish@release/v1
35+
if: matrix.os == 'ubuntu-20.04'
36+
with:
37+
skip-existing: true
38+
- run: just build-binary
39+
- uses: actions/upload-artifact@v4
40+
with:
41+
path: |
42+
orbiter-*
43+
name: binary-${{ matrix.os }}
44+
retention-days: 5
45+
46+
release:
47+
needs: build
48+
runs-on: "ubuntu-latest"
49+
steps:
50+
- uses: actions/download-artifact@v4
51+
- run: ls -R
52+
- uses: softprops/action-gh-release@v1
53+
with:
54+
prerelease: true
55+
generate_release_notes: true
56+
files: |
57+
binary-*/orbiter-*
58+
dist/*

.gitignore

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
.env
2+
site
3+
.coverage
4+
coverage.xml
5+
*.egg-info
6+
__pycache__
7+
*.pyc
8+
.DS_Store
9+
.idea
10+
.vscode
11+
*venv*
12+
orbiter_test
13+
output
14+
build
15+
dist
16+
orbiter-*-*
17+
astro
18+
demo

.pre-commit-config.yaml

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
default_language_version:
2+
python: python3
3+
4+
default_stages: [ commit, push ]
5+
6+
repos:
7+
- repo: https://github.com/pre-commit/pre-commit-hooks
8+
rev: v4.6.0
9+
hooks:
10+
- id: trailing-whitespace
11+
- id: end-of-file-fixer
12+
- id: check-yaml
13+
args: ["--unsafe"]
14+
- id: check-json
15+
- id: check-toml
16+
- id: check-added-large-files
17+
- id: check-merge-conflict
18+
- id: check-vcs-permalinks
19+
- id: debug-statements
20+
- id: detect-private-key
21+
- id: name-tests-test
22+
exclude: ^tests/resources/
23+
- id: trailing-whitespace
24+
- id: detect-aws-credentials
25+
args: [ "--allow-missing-credentials" ]
26+
27+
- repo: https://github.com/Yelp/detect-secrets
28+
rev: v1.5.0
29+
hooks:
30+
- id: detect-secrets
31+
args: [ '--baseline', '.secrets.baseline' ]
32+
33+
- repo: https://github.com/sirosen/texthooks
34+
rev: 0.6.6
35+
hooks: [ { id: fix-smartquotes }, { id: fix-ligatures } ]
36+
37+
- repo: https://github.com/charliermarsh/ruff-pre-commit
38+
rev: 'v0.5.7'
39+
hooks:
40+
- id: ruff
41+
args: [ --fix, --exit-non-zero-on-fix ]
42+
43+
- repo: https://github.com/psf/black
44+
rev: 24.8.0
45+
hooks: [ { id: black, args: [ --config=pyproject.toml ] } ]
46+
47+
- repo: https://github.com/PyCQA/bandit/
48+
rev: 1.7.9
49+
hooks:
50+
- id: bandit
51+
args: [ "-c", "pyproject.toml" ]
52+
additional_dependencies: [ "bandit[toml]" ]
53+
54+
# - repo: https://github.com/adamchainz/blacken-docs
55+
# rev: 1.13.0
56+
# hooks:
57+
# - id: blacken-docs
58+
# additional_dependencies:
59+
# - black==22.12.0

.secrets.baseline

+137
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
{
2+
"version": "1.5.0",
3+
"plugins_used": [
4+
{
5+
"name": "ArtifactoryDetector"
6+
},
7+
{
8+
"name": "AWSKeyDetector"
9+
},
10+
{
11+
"name": "AzureStorageKeyDetector"
12+
},
13+
{
14+
"name": "Base64HighEntropyString",
15+
"limit": 4.5
16+
},
17+
{
18+
"name": "BasicAuthDetector"
19+
},
20+
{
21+
"name": "CloudantDetector"
22+
},
23+
{
24+
"name": "DiscordBotTokenDetector"
25+
},
26+
{
27+
"name": "GitHubTokenDetector"
28+
},
29+
{
30+
"name": "GitLabTokenDetector"
31+
},
32+
{
33+
"name": "HexHighEntropyString",
34+
"limit": 3.0
35+
},
36+
{
37+
"name": "IbmCloudIamDetector"
38+
},
39+
{
40+
"name": "IbmCosHmacDetector"
41+
},
42+
{
43+
"name": "IPPublicDetector"
44+
},
45+
{
46+
"name": "JwtTokenDetector"
47+
},
48+
{
49+
"name": "KeywordDetector",
50+
"keyword_exclude": ""
51+
},
52+
{
53+
"name": "MailchimpDetector"
54+
},
55+
{
56+
"name": "NpmDetector"
57+
},
58+
{
59+
"name": "OpenAIDetector"
60+
},
61+
{
62+
"name": "PrivateKeyDetector"
63+
},
64+
{
65+
"name": "PypiTokenDetector"
66+
},
67+
{
68+
"name": "SendGridDetector"
69+
},
70+
{
71+
"name": "SlackDetector"
72+
},
73+
{
74+
"name": "SoftlayerDetector"
75+
},
76+
{
77+
"name": "SquareOAuthDetector"
78+
},
79+
{
80+
"name": "StripeDetector"
81+
},
82+
{
83+
"name": "TelegramBotTokenDetector"
84+
},
85+
{
86+
"name": "TwilioKeyDetector"
87+
}
88+
],
89+
"filters_used": [
90+
{
91+
"path": "detect_secrets.filters.allowlist.is_line_allowlisted"
92+
},
93+
{
94+
"path": "detect_secrets.filters.common.is_ignored_due_to_verification_policies",
95+
"min_level": 2
96+
},
97+
{
98+
"path": "detect_secrets.filters.heuristic.is_indirect_reference"
99+
},
100+
{
101+
"path": "detect_secrets.filters.heuristic.is_likely_id_string"
102+
},
103+
{
104+
"path": "detect_secrets.filters.heuristic.is_lock_file"
105+
},
106+
{
107+
"path": "detect_secrets.filters.heuristic.is_not_alphanumeric_string"
108+
},
109+
{
110+
"path": "detect_secrets.filters.heuristic.is_potential_uuid"
111+
},
112+
{
113+
"path": "detect_secrets.filters.heuristic.is_prefixed_with_dollar_sign"
114+
},
115+
{
116+
"path": "detect_secrets.filters.heuristic.is_sequential_string"
117+
},
118+
{
119+
"path": "detect_secrets.filters.heuristic.is_swagger_file"
120+
},
121+
{
122+
"path": "detect_secrets.filters.heuristic.is_templated_secret"
123+
}
124+
],
125+
"results": {
126+
"tests/orbiter/objects/test_project.py": [
127+
{
128+
"type": "Secret Keyword",
129+
"filename": "tests/orbiter/objects/test_project.py",
130+
"hashed_secret": "bbe960a25ea311d21d40669e93df2003ba9b90a2",
131+
"is_verified": false,
132+
"line_number": 70
133+
}
134+
]
135+
},
136+
"generated_at": "2024-08-12T21:27:52Z"
137+
}

CONTRIBUTING.md

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
This project welcomes contributions. All Pull Requests should include proper testing, documentation, and follow all
2+
existing checks and practices.
3+
4+
<!-- TOC -->
5+
* [Development Workflow](#development-workflow)
6+
* [Versioning](#versioning)
7+
* [Development](#development)
8+
* [Pre-Commit](#pre-commit)
9+
* [Installing Locally](#installing-locally)
10+
* [Linting](#linting)
11+
* [Testing](#testing)
12+
<!-- TOC -->
13+
14+
# Development Workflow
15+
16+
1. Create a branch off `main`
17+
2. Develop, add tests, ensure all tests are passing
18+
3. Push up to GitHub (running pre-commit)
19+
4. Create a PR, get approval
20+
5. Merge the PR to `main`
21+
6. On `main`: Create a tag with `just tag`
22+
7. Do any manual or integration testing
23+
8. Push the tag to GitHub `just deploy-tag`, which will create
24+
a `Draft` [release](https://github.com/astronomer/orbiter/releases) and upload
25+
to [test.pypi.org](https://test.pypi.org/project/astronomer-orbiter/) via CICD
26+
9. Approve the [release](https://github.com/astronomer/orbiter/releases) on GitHub, which
27+
will upload to [pypi.org](https://pypi.org/project/astronomer-orbiter/) via CICD
28+
29+
## Versioning
30+
31+
- This project follows [Semantic Versioning](https://semver.org/)
32+
33+
## Development
34+
35+
### Just
36+
37+
This project uses [`just` (link)](https://just.systems/)
38+
39+
### Pre-Commit
40+
41+
This project uses [`pre-commit` (link)](https://pre-commit.com/).
42+
43+
Install it with `just install-precommit`
44+
45+
### Installing Locally
46+
47+
Install with `just install`
48+
49+
## Linting
50+
51+
This project
52+
uses [`black` (link)](https://black.readthedocs.io/en/stable/), and [`ruff` (link)](https://beta.ruff.rs/).
53+
They run with pre-commit but you can run them directly with `just lint` in the root.
54+
55+
## Testing
56+
57+
This project utilizes [Doctests](https://docs.python.org/3/library/doctest.html) and `pytest`.
58+
With the `dev` extras installed, you can run all tests with `just test` in the root of the project.
59+
It will automatically pick up it's configuration from `pyproject.toml`

0 commit comments

Comments
 (0)