forked from tarioch/beancounttools
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
201 additions
and
25 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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# .coveragerc to control coverage.py | ||
[run] | ||
branch = True | ||
source = tariochbctools | ||
# omit = bad_file.py | ||
|
||
[paths] | ||
source = | ||
src/ | ||
*/site-packages/ | ||
|
||
[report] | ||
# Regexes for lines to exclude from consideration | ||
exclude_lines = | ||
# Have to re-enable the standard pragma | ||
pragma: no cover | ||
|
||
# Don't complain about missing debug-only code: | ||
def __repr__ | ||
if self\.debug | ||
|
||
# Don't complain if tests don't hit defensive assertion code: | ||
raise AssertionError | ||
raise NotImplementedError | ||
|
||
# Don't complain if non-runnable code isn't run: | ||
if 0: | ||
if __name__ == .__main__.: |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[settings] | ||
profile = black | ||
known_first_party = tariochbctools |
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,54 @@ | ||
exclude: '^docs/conf.py' | ||
|
||
repos: | ||
- repo: git://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.0.1 | ||
hooks: | ||
- id: trailing-whitespace | ||
- id: check-added-large-files | ||
- id: check-ast | ||
- id: check-json | ||
- id: check-merge-conflict | ||
- id: check-xml | ||
- id: check-yaml | ||
- id: debug-statements | ||
- id: end-of-file-fixer | ||
- id: requirements-txt-fixer | ||
- id: mixed-line-ending | ||
args: ['--fix=auto'] # replace 'auto' with 'lf' to enforce Linux/Mac line endings or 'crlf' for Windows | ||
|
||
## If you want to avoid flake8 errors due to unused vars or imports: | ||
# - repo: https://github.com/myint/autoflake.git | ||
# rev: v1.4 | ||
# hooks: | ||
# - id: autoflake | ||
# args: [ | ||
# --in-place, | ||
# --remove-all-unused-imports, | ||
# --remove-unused-variables, | ||
# ] | ||
|
||
- repo: https://github.com/pycqa/isort | ||
rev: 5.9.3 | ||
hooks: | ||
- id: isort | ||
|
||
- repo: https://github.com/psf/black | ||
rev: 21.8b0 | ||
hooks: | ||
- id: black | ||
language_version: python3 | ||
|
||
## If like to embrace black styles even in the docs: | ||
# - repo: https://github.com/asottile/blacken-docs | ||
# rev: v1.9.1 | ||
# hooks: | ||
# - id: blacken-docs | ||
# additional_dependencies: [black] | ||
|
||
- repo: https://gitlab.com/pycqa/flake8 | ||
rev: 3.9.2 | ||
hooks: | ||
- id: flake8 | ||
## You can add flake8 plugins via `additional_dependencies`: | ||
# additional_dependencies: [flake8-bugbear] |
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,22 @@ | ||
# Read the Docs configuration file | ||
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details | ||
|
||
# Required | ||
version: 2 | ||
|
||
# Build documentation in the docs/ directory with Sphinx | ||
sphinx: | ||
configuration: docs/conf.py | ||
|
||
# Build documentation with MkDocs | ||
#mkdocs: | ||
# configuration: mkdocs.yml | ||
|
||
# Optionally build your docs in additional formats such as PDF | ||
formats: | ||
|
||
python: | ||
version: 3.8 | ||
install: | ||
- requirements: docs/requirements.txt |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
""" | ||
Dummy conftest.py for tariochbctools. | ||
If you don't know what this is for, just leave it empty. | ||
Read more about conftest.py under: | ||
- https://docs.pytest.org/en/stable/fixture.html | ||
- https://docs.pytest.org/en/stable/writing_plugins.html | ||
""" | ||
|
||
# import pytest |
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,74 @@ | ||
# Tox configuration file | ||
# Read more under https://tox.readthedocs.org/ | ||
|
||
[tox] | ||
minversion = 3.15 | ||
envlist = default | ||
|
||
|
||
[testenv] | ||
description = invoke pytest to run automated tests | ||
isolated_build = True | ||
setenv = | ||
TOXINIDIR = {toxinidir} | ||
passenv = | ||
HOME | ||
extras = | ||
testing | ||
commands = | ||
pytest {posargs} | ||
|
||
[testenv:lint] | ||
description = static code checks | ||
skip_install = True | ||
deps = | ||
flake8 | ||
commands = | ||
flake8 | ||
|
||
[testenv:{clean,build}] | ||
description = | ||
Build (or clean) the package in isolation according to instructions in: | ||
https://setuptools.readthedocs.io/en/latest/build_meta.html#how-to-use-it | ||
https://github.com/pypa/pep517/issues/91 | ||
https://github.com/pypa/build | ||
# NOTE: build is still experimental, please refer to the links for updates/issues | ||
skip_install = True | ||
changedir = {toxinidir} | ||
deps = | ||
build: build[virtualenv] | ||
commands = | ||
clean: python -c 'from shutil import rmtree; rmtree("build", True); rmtree("dist", True)' | ||
build: python -m build . | ||
# By default `build` produces wheels, you can also explicitly use the flags `--sdist` and `--wheel` | ||
|
||
|
||
[testenv:{docs,doctests}] | ||
description = invoke sphinx-build to build the docs/run doctests | ||
setenv = | ||
DOCSDIR = {toxinidir}/docs | ||
BUILDDIR = {toxinidir}/docs/_build | ||
docs: BUILD = html | ||
doctests: BUILD = doctest | ||
deps = | ||
-r {toxinidir}/docs/requirements.txt | ||
# ^ requirements.txt shared with Read The Docs | ||
commands = | ||
sphinx-build -b {env:BUILD} -d "{env:BUILDDIR}/doctrees" "{env:DOCSDIR}" "{env:BUILDDIR}/{env:BUILD}" {posargs} | ||
|
||
|
||
[testenv:publish] | ||
description = | ||
Publish the package you have been developing to a package index server. | ||
By default, it uses testpypi. If you really want to publish your package | ||
to be publicly accessible in PyPI, use the `-- --repository pypi` option. | ||
skip_install = True | ||
changedir = {toxinidir} | ||
passenv = | ||
TWINE_USERNAME | ||
TWINE_PASSWORD | ||
TWINE_REPOSITORY | ||
deps = twine | ||
commands = | ||
python -m twine check dist/* | ||
python -m twine upload {posargs:--repository testpypi} dist/* |