-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* docs init * docs for concurrency * method as metaclass instead of wrapper * serializer docs update * pandas method docs * polars method docs * pandas serializer docs * polars serializer docs * mkdocs dependencies * prefect serializer type and method discriminators * versioneer and build * build fix * github test and release workflows * fixed index page * mit license * workflow pipenv dependency fix
- Loading branch information
1 parent
f1165c7
commit d97a5d3
Showing
30 changed files
with
1,487 additions
and
271 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
# Auto detect text files and perform LF normalization | ||
* text=auto | ||
* text=autosrc/prefecto/_version.py export-subst |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
name: Build & Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v*" | ||
|
||
jobs: | ||
build-release: | ||
name: Build Release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.7 | ||
|
||
- name: Install packages | ||
run: | | ||
python -m pip install --upgrade pip build | ||
python -m pip install pipenv | ||
pipenv install --dev --skip-lock | ||
- name: Build a binary wheel and a source tarball | ||
run: | | ||
python -m build --sdist --wheel --outdir dist/ | ||
- name: Publish build artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: built-package | ||
path: "./dist" | ||
|
||
publish-release: | ||
name: Publish release to PyPI | ||
needs: [build-release] | ||
environment: "prod" | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Download build artifacts | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: built-package | ||
path: './dist' | ||
|
||
- name: Publish distribution to PyPI | ||
uses: pypa/gh-action-pypi-publish@master | ||
with: | ||
password: ${{ secrets.PYPI_API_TOKEN }} | ||
verbose: true | ||
|
||
build-and-publish-docs: | ||
name: Build and publish docs | ||
needs: [build-release, publish-release] | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python 3.10 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
cache: pip | ||
cache-dependency-path: Pipfile | ||
|
||
- name: Build docs | ||
run: | | ||
python -m pip install --upgrade pip pyOpenSSL pipenv | ||
pipenv install --dev --skip-lock | ||
mkdocs build | ||
- name: Publish docs | ||
uses: JamesIves/[email protected] | ||
with: | ||
branch: docs | ||
folder: site |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: Static analysis | ||
|
||
on: [pull_request] | ||
|
||
permissions: | ||
contents: read | ||
|
||
# Limit concurrency by workflow/branch combination. | ||
# | ||
# For pull request builds, pushing additional changes to the | ||
# branch will cancel prior in-progress and pending builds. | ||
# | ||
# For builds triggered on a branch push, additional changes | ||
# will wait for prior builds to complete before starting. | ||
# | ||
# https://docs.github.com/en/actions/using-jobs/using-concurrency | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: ${{ github.event_name == 'pull_request' }} | ||
|
||
jobs: | ||
pre-commit-checks: | ||
name: Pre-commit checks | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
persist-credentials: false | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.9 | ||
|
||
- name: Install pre-commit | ||
run: | | ||
pip install pre-commit | ||
- name: Run pre-commit | ||
run: | | ||
pre-commit run --show-diff-on-failure --color=always --all-files |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: Tests | ||
|
||
on: [pull_request] | ||
|
||
jobs: | ||
run-tests: | ||
name: Run Tests | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: | ||
- "3.7" | ||
- "3.8" | ||
- "3.9" | ||
- "3.10" | ||
fail-fast: false | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
cache: pip | ||
cache-dependency-path: Pipfile | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip pipenv | ||
pipenv install --dev --skip-lock | ||
- name: Run tests | ||
env: | ||
PREFECT_SERVER_DATABASE_CONNECTION_URL: "sqlite+aiosqlite:///./collection-tests.db" | ||
run: | | ||
prefect server database reset -y | ||
coverage run --branch -m pytest tests -vv | ||
coverage report | ||
- name: Run mkdocs build | ||
run: | | ||
mkdocs build --verbose --clean |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# BatchTask | ||
|
||
::: src.prefecto.concurrency.BatchTask | ||
options: | ||
members: | ||
- map |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Prefecto | ||
|
||
![Pacha papi](./assets/pacha-prefecto.jpeg) | ||
|
||
A handy helper for [Prefect](https://www.prefect.io/) development. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# License | ||
|
||
MIT License | ||
|
||
Copyright (c) 2023 Dominic Tarro | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# ExtendedSerializer | ||
|
||
Type: `ext` | ||
|
||
::: src.prefecto.serializers.core.ExtendedSerializer | ||
options: | ||
members: | ||
- get_method | ||
- dumps | ||
- loads |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Functions | ||
|
||
## get_method | ||
|
||
::: src.prefecto.serializers.core.get_method |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Method | ||
|
||
::: src.prefecto.serializers.core.Method | ||
options: | ||
members: | ||
- read | ||
- write |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# Methods | ||
|
||
`Method` classes for serializing `pandas.DataFrame`. | ||
|
||
## CSV | ||
|
||
Discriminator: `pandas.csv` | ||
|
||
::: src.prefecto.serializers.pandas.CSV | ||
options: | ||
show_source: true | ||
|
||
## Excel | ||
|
||
Discriminator: `pandas.excel` | ||
|
||
::: src.prefecto.serializers.pandas.Excel | ||
options: | ||
show_source: true | ||
|
||
## Feather | ||
|
||
Discriminator: `pandas.feather` | ||
|
||
::: src.prefecto.serializers.pandas.Feather | ||
options: | ||
show_source: true | ||
|
||
## JSON | ||
|
||
Discriminator: `pandas.json` | ||
|
||
::: src.prefecto.serializers.pandas.JSON | ||
options: | ||
show_source: true | ||
|
||
## JSONL | ||
|
||
Discriminator: `pandas.jsonl` | ||
|
||
::: src.prefecto.serializers.pandas.JSONL | ||
options: | ||
show_source: true | ||
|
||
## Parquet | ||
|
||
Discriminator: `pandas.parquet` | ||
|
||
::: src.prefecto.serializers.pandas.Parquet | ||
options: | ||
show_source: true | ||
|
||
## Pickle | ||
|
||
Discriminator: `pandas.pickle` | ||
|
||
::: src.prefecto.serializers.pandas.Pickle | ||
options: | ||
show_source: true | ||
|
||
## TSV | ||
|
||
Discriminator: `pandas.tsv` | ||
|
||
::: src.prefecto.serializers.pandas.TSV | ||
options: | ||
show_source: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# PandasSerializer | ||
|
||
Type: `pandas` | ||
|
||
::: src.prefecto.serializers.pandas.PandasSerializer | ||
options: | ||
show_source: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Methods | ||
|
||
`Method` classes for serializing `polars.DataFrame`. | ||
|
||
## CSV | ||
|
||
Discriminator: `polars.csv` | ||
|
||
::: src.prefecto.serializers.polars.CSV | ||
options: | ||
show_source: true | ||
|
||
## Excel | ||
|
||
Discriminator: `polars.excel` | ||
|
||
::: src.prefecto.serializers.polars.Excel | ||
options: | ||
show_source: true | ||
|
||
## JSON | ||
|
||
Discriminator: `polars.json` | ||
|
||
::: src.prefecto.serializers.polars.JSON | ||
options: | ||
show_source: true | ||
|
||
## NDJSON | ||
|
||
Discriminator: `polars.ndjson` | ||
|
||
::: src.prefecto.serializers.polars.NDJSON | ||
options: | ||
show_source: true | ||
|
||
## Parquet | ||
|
||
Discriminator: `polars.parquet` | ||
|
||
::: src.prefecto.serializers.polars.Parquet | ||
options: | ||
show_source: true | ||
|
||
## TSV | ||
|
||
Discriminator: `polars.tsv` | ||
|
||
::: src.prefecto.serializers.polars.TSV | ||
options: | ||
show_source: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# PolarsSerializer | ||
|
||
Type: `polars` | ||
|
||
::: src.prefecto.serializers.polars.PolarsSerializer | ||
options: | ||
show_source: true |
Oops, something went wrong.