Skip to content

Commit 692022f

Browse files
committed
Add sync functions
Add pytests Throw errors instead of returning them
1 parent d5f32ba commit 692022f

23 files changed

+2101
-108
lines changed

.coveragerc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[run]
2+
omit =
3+
build_sync.py
4+
conftest.py
5+
tests/*

.gitignore

Lines changed: 286 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,286 @@
1+
.mypy_cache/
2+
__pycache__/
3+
tags
4+
5+
# Swap
6+
[._]*.s[a-v][a-z]
7+
!*.svg # comment out if you don't need vector files
8+
[._]*.sw[a-p]
9+
[._]s[a-rt-v][a-z]
10+
[._]ss[a-gi-z]
11+
[._]sw[a-p]
12+
13+
# Session
14+
Session.vim
15+
Sessionx.vim
16+
17+
# Temporary
18+
.netrwhist
19+
*~
20+
# Auto-generated tag files
21+
tags
22+
# Persistent undo
23+
[._]*.un~
24+
25+
# Byte-compiled / optimized / DLL files
26+
__pycache__/
27+
*.py[cod]
28+
*$py.class
29+
30+
# C extensions
31+
*.so
32+
33+
# Distribution / packaging
34+
.Python
35+
build/
36+
develop-eggs/
37+
dist/
38+
downloads/
39+
eggs/
40+
.eggs/
41+
lib64/
42+
parts/
43+
sdist/
44+
var/
45+
wheels/
46+
share/python-wheels/
47+
*.egg-info/
48+
.installed.cfg
49+
*.egg
50+
MANIFEST
51+
52+
# PyInstaller
53+
# Usually these files are written by a python script from a template
54+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
55+
*.manifest
56+
*.spec
57+
58+
# Installer logs
59+
pip-log.txt
60+
pip-delete-this-directory.txt
61+
62+
# Unit test / coverage reports
63+
htmlcov/
64+
.tox/
65+
.nox/
66+
.coverage
67+
.coverage.*
68+
.cache
69+
nosetests.xml
70+
coverage.xml
71+
*.cover
72+
*.py,cover
73+
.hypothesis/
74+
.pytest_cache/
75+
cover/
76+
77+
# Translations
78+
*.mo
79+
*.pot
80+
81+
# Django stuff:
82+
*.log
83+
local_settings.py
84+
db.sqlite3
85+
db.sqlite3-journal
86+
87+
# Flask stuff:
88+
instance/
89+
.webassets-cache
90+
91+
# Scrapy stuff:
92+
.scrapy
93+
94+
# Sphinx documentation
95+
docs/_build/
96+
97+
# PyBuilder
98+
.pybuilder/
99+
target/
100+
101+
# Jupyter Notebook
102+
.ipynb_checkpoints
103+
104+
# IPython
105+
profile_default/
106+
ipython_config.py
107+
108+
# pyenv
109+
# For a library or package, you might want to ignore these files since the code is
110+
# intended to run in multiple environments; otherwise, check them in:
111+
# .python-version
112+
113+
# pipenv
114+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
115+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
116+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
117+
# install all needed dependencies.
118+
#Pipfile.lock
119+
120+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
121+
__pypackages__/
122+
123+
# Celery stuff
124+
celerybeat-schedule
125+
celerybeat.pid
126+
127+
# SageMath parsed files
128+
*.sage.py
129+
130+
# Environments
131+
.env
132+
.venv
133+
env/
134+
venv/
135+
ENV/
136+
env.bak/
137+
venv.bak/
138+
139+
# Spyder project settings
140+
.spyderproject
141+
.spyproject
142+
143+
# Rope project settings
144+
.ropeproject
145+
146+
# mkdocs documentation
147+
/site
148+
149+
# mypy
150+
.mypy_cache/
151+
.dmypy.json
152+
dmypy.json
153+
154+
# Pyre type checker
155+
.pyre/
156+
157+
# pytype static type analyzer
158+
.pytype/
159+
160+
# Cython debug symbols
161+
cython_debug/
162+
163+
# Editors
164+
.vscode/
165+
.idea/
166+
167+
# Vagrant
168+
.vagrant/
169+
170+
# Mac/OSX
171+
.DS_Store
172+
173+
# Windows
174+
Thumbs.db
175+
176+
# Source for the following rules: https://raw.githubusercontent.com/github/gitignore/master/Python.gitignore
177+
# Byte-compiled / optimized / DLL files
178+
__pycache__/
179+
*.py[cod]
180+
*$py.class
181+
182+
# C extensions
183+
*.so
184+
185+
# Distribution / packaging
186+
.Python
187+
build/
188+
develop-eggs/
189+
dist/
190+
downloads/
191+
eggs/
192+
.eggs/
193+
lib64/
194+
parts/
195+
sdist/
196+
var/
197+
wheels/
198+
*.egg-info/
199+
.installed.cfg
200+
*.egg
201+
MANIFEST
202+
203+
# PyInstaller
204+
# Usually these files are written by a python script from a template
205+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
206+
*.manifest
207+
*.spec
208+
209+
# Installer logs
210+
pip-log.txt
211+
pip-delete-this-directory.txt
212+
213+
# Unit test / coverage reports
214+
htmlcov/
215+
.tox/
216+
.nox/
217+
.coverage
218+
.coverage.*
219+
.cache
220+
nosetests.xml
221+
coverage.xml
222+
*.cover
223+
.hypothesis/
224+
.pytest_cache/
225+
226+
# Translations
227+
*.mo
228+
*.pot
229+
230+
# Django stuff:
231+
*.log
232+
local_settings.py
233+
db.sqlite3
234+
235+
# Flask stuff:
236+
instance/
237+
.webassets-cache
238+
239+
# Scrapy stuff:
240+
.scrapy
241+
242+
# Sphinx documentation
243+
docs/_build/
244+
245+
# PyBuilder
246+
target/
247+
248+
# Jupyter Notebook
249+
.ipynb_checkpoints
250+
251+
# IPython
252+
profile_default/
253+
ipython_config.py
254+
255+
# pyenv
256+
.python-version
257+
258+
# celery beat schedule file
259+
celerybeat-schedule
260+
261+
# SageMath parsed files
262+
*.sage.py
263+
264+
# Environments
265+
.env
266+
.venv
267+
env/
268+
venv/
269+
ENV/
270+
env.bak/
271+
venv.bak/
272+
273+
# Spyder project settings
274+
.spyderproject
275+
.spyproject
276+
277+
# Rope project settings
278+
.ropeproject
279+
280+
# mkdocs documentation
281+
/site
282+
283+
# mypy
284+
.mypy_cache/
285+
.dmypy.json
286+
dmypy.json

.pre-commit-config.yaml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
exclude: '^.*\.(md|MD)$'
2+
repos:
3+
- repo: https://github.com/pre-commit/pre-commit-hooks
4+
rev: v4.0.1
5+
hooks:
6+
- id: trailing-whitespace
7+
- id: check-added-large-files
8+
- id: end-of-file-fixer
9+
- id: mixed-line-ending
10+
args: ["--fix=lf"]
11+
12+
- repo: https://github.com/pycqa/isort
13+
rev: 5.12.0
14+
hooks:
15+
- id: isort
16+
args:
17+
[
18+
"--profile",
19+
"black",
20+
"--multi-line=3",
21+
"--trailing-comma",
22+
"--force-grid-wrap=0",
23+
"--use-parentheses",
24+
"--line-width=88",
25+
]
26+
27+
- repo: https://github.com/myint/autoflake.git
28+
rev: v1.4
29+
hooks:
30+
- id: autoflake
31+
args:
32+
[
33+
"--in-place",
34+
"--remove-all-unused-imports",
35+
"--ignore-init-module-imports",
36+
]
37+
38+
- repo: https://github.com/psf/black
39+
rev: "23.3.0"
40+
hooks:
41+
- id: black
42+
43+
- repo: https://github.com/asottile/pyupgrade
44+
rev: v2.29.1
45+
hooks:
46+
- id: pyupgrade
47+
args: ["--py37-plus", "--keep-runtime-typing"]
48+
49+
- repo: https://github.com/commitizen-tools/commitizen
50+
rev: v2.20.0
51+
hooks:
52+
- id: commitizen
53+
stages: [commit-msg]

Makefile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
install:
2+
poetry install
3+
4+
install_poetry:
5+
curl -sSL https://install.python-poetry.org | python -
6+
poetry install
7+
8+
tests: install tests_only tests_pre_commit
9+
10+
tests_pre_commit:
11+
poetry run pre-commit run --all-files
12+
13+
run_tests: tests
14+
15+
tests_only:
16+
poetry run pytest --cov=./ --cov-report=xml --cov-report=html -vv
17+
18+
build_sync:
19+
poetry run unasync supafunc tests

0 commit comments

Comments
 (0)