Skip to content

Commit 20220a4

Browse files
committed
first commit
0 parents  commit 20220a4

Some content is hidden

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

66 files changed

+6501
-0
lines changed

.flake8

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[flake8]
2+
max-line-length = 88
3+
max-complexity = 10
4+
select = C,E,F,W,B,B950
5+
ignore = E203,E501,W503
6+
exclude =
7+
.git,
8+
__pycache__,
9+
*.egg-info,
10+
.nox,
11+
.pytest_cache,
12+
.mypy_cache
13+
__init__.py

.github/workflows/build-docs.yml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Build docs
2+
on:
3+
push:
4+
branches: ["main"]
5+
jobs:
6+
deploy:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: "actions/checkout@v3"
10+
- uses: "actions/setup-python@v4"
11+
with:
12+
python-version: 3.8
13+
- name: Install poetry
14+
run: |
15+
python -m pip install --upgrade pip
16+
curl -sSL https://install.python-poetry.org | python3 -
17+
- name: Configure poetry
18+
run: poetry config virtualenvs.create false
19+
- name: Install dependencies
20+
run: poetry install
21+
- run: mkdocs gh-deploy --force

.github/workflows/publish.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Publish on Pypi
2+
on:
3+
release:
4+
types:
5+
- created
6+
7+
jobs:
8+
publish:
9+
name: "Publish release"
10+
runs-on: "ubuntu-latest"
11+
12+
steps:
13+
- uses: "actions/checkout@v3"
14+
- uses: "actions/setup-python@v4"
15+
with:
16+
python-version: 3.8
17+
- name: Install poetry
18+
run: |
19+
python -m pip install --upgrade pip
20+
curl -sSL https://install.python-poetry.org | python3 -
21+
- name: Configure poetry
22+
run: poetry config virtualenvs.create false
23+
- name: Install dependencies
24+
run: poetry install
25+
- name: Publish
26+
env:
27+
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
28+
run: |
29+
poetry config pypi-token.pypi $PYPI_TOKEN
30+
poetry publish --build

.github/workflows/test.yml

+97
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
name: Python package
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
pull_request:
7+
branches: ["main"]
8+
9+
jobs:
10+
tests:
11+
name: "Python ${{ matrix.python-version }}"
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
python-version: ["3.7", "3.8", "3.9", "3.10"]
16+
17+
services:
18+
postgres:
19+
image: postgres:14-alpine
20+
env:
21+
POSTGRES_USER: username
22+
POSTGRES_PASSWORD: password
23+
POSTGRES_DB: test_db
24+
ports:
25+
- 5432:5432
26+
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
27+
28+
mysql:
29+
image: mysql:8
30+
env:
31+
MYSQL_ROOT_PASSWORD: password
32+
MYSQL_USER: username
33+
MYSQL_PASSWORD: password
34+
MYSQL_DATABASE: test_db
35+
ports:
36+
- 3306:3306
37+
options: --health-cmd "mysqladmin ping" --health-interval 10s --health-timeout 5s --health-retries 10
38+
39+
minio:
40+
image: minio/minio:edge-cicd
41+
env:
42+
MINIO_ROOT_USER: minioadmin
43+
MINIO_ROOT_PASSWORD: minioadmin
44+
ports:
45+
- 9000:9000
46+
47+
48+
steps:
49+
- uses: actions/checkout@v3
50+
- name: Set up Python ${{ matrix.python-version }}
51+
uses: actions/setup-python@v4
52+
with:
53+
python-version: ${{ matrix.python-version }}
54+
- name: Install poetry
55+
run: |
56+
python -m pip install --upgrade pip
57+
curl -sSL https://install.python-poetry.org | python3 -
58+
- name: Configure poetry
59+
run: poetry config virtualenvs.create false
60+
- name: Install dependencies
61+
run: poetry install
62+
- name: Lint
63+
run: poetry run bash scripts/lint.sh
64+
- name: Test Local Storage provider & sqlite
65+
env:
66+
ENGINE: 'sqlite:///test.db?check_same_thread=False'
67+
STORAGE_PROVIDER: 'LOCAL'
68+
LOCAL_PATH: '/tmp/storage'
69+
run: poetry run coverage run -m pytest tests
70+
- name: Test Local Storage provider & postgresql
71+
env:
72+
ENGINE: 'postgresql+psycopg2://username:password@localhost:5432/test_db'
73+
STORAGE_PROVIDER: 'LOCAL'
74+
LOCAL_PATH: '/tmp/storage'
75+
run: poetry run coverage run -m pytest tests
76+
- name: Test Local Storage provider & mysql
77+
env:
78+
ENGINE: 'mysql+pymysql://username:password@localhost:3306/test_db'
79+
STORAGE_PROVIDER: 'LOCAL'
80+
LOCAL_PATH: '/tmp/storage'
81+
run: poetry run coverage run -m pytest tests
82+
- name: Test Minio Storage provider & sqlite memory
83+
env:
84+
ENGINE: 'sqlite:///:memory:?check_same_thread=False'
85+
STORAGE_PROVIDER: 'MINIO'
86+
MINIO_KEY: 'minioadmin'
87+
MINIO_SECRET: 'minioadmin'
88+
MINIO_HOST: 'localhost'
89+
MINIO_PORT: 9000
90+
MINIO_SECURE: false
91+
run: poetry run coverage run -m pytest tests
92+
- name: Coverage Report
93+
run: poetry run bash scripts/coverage.sh
94+
- name: Upload coverage
95+
uses: codecov/codecov-action@v3
96+
with:
97+
token: ${{ secrets.CODECOV_TOKEN }}

.gitignore

+190
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,190 @@
1+
2+
### macOS ###
3+
# General
4+
.DS_Store
5+
.AppleDouble
6+
.LSOverride
7+
8+
# Icon must end with two \r
9+
Icon
10+
11+
# Thumbnails
12+
._*
13+
14+
# Files that might appear in the root of a volume
15+
.DocumentRevisions-V100
16+
.fseventsd
17+
.Spotlight-V100
18+
.TemporaryItems
19+
.Trashes
20+
.VolumeIcon.icns
21+
.com.apple.timemachine.donotpresent
22+
23+
# Directories potentially created on remote AFP share
24+
.AppleDB
25+
.AppleDesktop
26+
Network Trash Folder
27+
Temporary Items
28+
.apdisk
29+
30+
### Python ###
31+
# Byte-compiled / optimized / DLL files
32+
__pycache__/
33+
*.py[cod]
34+
*$py.class
35+
36+
# C extensions
37+
*.so
38+
39+
# Distribution / packaging
40+
.Python
41+
build/
42+
develop-eggs/
43+
dist/
44+
downloads/
45+
eggs/
46+
.eggs/
47+
parts/
48+
sdist/
49+
var/
50+
wheels/
51+
pip-wheel-metadata/
52+
share/python-wheels/
53+
*.egg-info/
54+
.installed.cfg
55+
*.egg
56+
MANIFEST
57+
58+
# PyInstaller
59+
*.manifest
60+
*.spec
61+
62+
# Installer logs
63+
pip-log.txt
64+
pip-delete-this-directory.txt
65+
66+
# Unit test / coverage reports
67+
htmlcov/
68+
.tox/
69+
.nox/
70+
.coverage
71+
.coverage.*
72+
.cache
73+
nosetests.xml
74+
coverage.xml
75+
*.cover
76+
*.py,cover
77+
.hypothesis/
78+
.pytest_cache/
79+
pytestdebug.log
80+
81+
# Translations
82+
*.mo
83+
*.pot
84+
85+
# Django stuff:
86+
*.log
87+
local_settings.py
88+
db.sqlite3
89+
db.sqlite3-journal
90+
91+
# Flask stuff:
92+
instance/
93+
.webassets-cache
94+
95+
# Scrapy stuff:
96+
.scrapy
97+
98+
# Sphinx documentation
99+
docs/_build/
100+
doc/_build/
101+
102+
# PyBuilder
103+
target/
104+
105+
# Jupyter Notebook
106+
.ipynb_checkpoints
107+
108+
# IPython
109+
profile_default/
110+
ipython_config.py
111+
112+
# pyenv
113+
.python-version
114+
115+
# pipenv
116+
# Pipfile.lock
117+
118+
# poetry
119+
# poetry.lock
120+
121+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
122+
__pypackages__/
123+
124+
# Celery stuff
125+
celerybeat-schedule
126+
celerybeat.pid
127+
128+
# SageMath parsed files
129+
*.sage.py
130+
131+
# Environments
132+
*.env*
133+
.env/
134+
.venv/
135+
env/
136+
venv/
137+
ENV/
138+
env.bak/
139+
venv.bak/
140+
pythonenv*
141+
142+
# Spyder project settings
143+
.spyderproject
144+
.spyproject
145+
146+
# Rope project settings
147+
.ropeproject
148+
149+
# mkdocs documentation
150+
/public
151+
/site
152+
153+
# mypy
154+
.mypy_cache/
155+
.dmypy.json
156+
dmypy.json
157+
158+
# Pyre type checker
159+
.pyre/
160+
161+
# pytype static type analyzer
162+
.pytype/
163+
164+
# operating system-related files
165+
# *.DS_Store
166+
Thumbs.db
167+
168+
# profiling data
169+
.prof
170+
171+
### VirtualEnv ###
172+
# Virtualenv
173+
[Bb]in
174+
[Ii]nclude
175+
[Ll]ib
176+
[Ll]ib64
177+
[Ll]ocal
178+
pyvenv.cfg
179+
.venv
180+
pip-selfcheck.json
181+
182+
### VisualStudioCode ###
183+
*.code-workspace
184+
.vscode/*
185+
!.vscode/tasks.json
186+
!.vscode/launch.json
187+
.history
188+
.ionide
189+
190+
.idea/

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2022 Jocelin Hounon
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)