Copied and modified all files to be templatized and pulled in some niceties from https://github.com/ardydedase/cookiecutter-pypackage https://github.com/Nekroze/cookiecutter-pypackage https://raw.githubusercontent.com/tony/cookiecutter-pypackage-pythonicmaster
{ | |||||
"full_name": "Nate Bohman", | |||||
"email": "natrinicle@natrinicle.com", | |||||
"github_username": "Natrinicle", | |||||
"project_name": "Python Boilerplate", | |||||
"project_slug": "{{ cookiecutter.project_name.lower().replace(' ', '_') }}", | |||||
"project_short_description": "Python Boilerplate contains all the boilerplate you need to create a Python package.", | |||||
"release_date": "2020-12-10", | |||||
"pypi_username": "{{ cookiecutter.github_username }}", | |||||
"year": "2020", | |||||
"license": "LGPL-3", | |||||
"status": "Development", | |||||
"version": "0.0.1" | |||||
} |
# https://EditorConfig.org | |||||
# top-most EditorConfig file | |||||
root = true | |||||
# Unix-style newlines with a newline ending every file | |||||
[*] | |||||
end_of_line = lf | |||||
insert_final_newline = true | |||||
# Matches multiple files with brace expansion notation | |||||
# Set default charset | |||||
[*.{js,py}] | |||||
charset = utf-8 | |||||
# 2 space indentation | |||||
[*.{js,json,yaml}] | |||||
indent_style = space | |||||
indent_size = 2 | |||||
# 4 space indentation | |||||
[*.py] | |||||
indent_style = space | |||||
indent_size = 4 | |||||
# Tab indentation (no size specified) | |||||
[{Makefile,*.bat}] | |||||
indent_style = tab | |||||
[LICENSE] | |||||
insert_final_newline = false |
source venv/bin/activate | |||||
unset PS1 |
####### IDE Start ####### | |||||
# Webstorm | |||||
.idea/ | |||||
####### IDE End ####### | |||||
####### MacOS Start ####### | |||||
# General | |||||
.DS_Store | |||||
.AppleDouble | |||||
.LSOverride | |||||
# Icon must end with two \r | |||||
Icon | |||||
# Thumbnails | |||||
._* | |||||
# Files that might appear in the root of a volume | |||||
.DocumentRevisions-V100 | |||||
.fseventsd | |||||
.Spotlight-V100 | |||||
.TemporaryItems | |||||
.Trashes | |||||
.VolumeIcon.icns | |||||
.com.apple.timemachine.donotpresent | |||||
# Directories potentially created on remote AFP share | |||||
.AppleDB | |||||
.AppleDesktop | |||||
Network Trash Folder | |||||
Temporary Items | |||||
.apdisk | |||||
####### MacOS End ####### | |||||
####### Windows Start ####### | |||||
# Windows thumbnail cache files | |||||
Thumbs.db | |||||
ehthumbs.db | |||||
ehthumbs_vista.db | |||||
# Dump file | |||||
*.stackdump | |||||
# Folder config file | |||||
[Dd]esktop.ini | |||||
# Recycle Bin used on file shares | |||||
$RECYCLE.BIN/ | |||||
# Windows Installer files | |||||
*.cab | |||||
*.msi | |||||
*.msix | |||||
*.msm | |||||
*.msp | |||||
# Windows shortcuts | |||||
*.lnk | |||||
####### Windows End ####### | |||||
####### Python Start ####### | |||||
# Byte-compiled / optimized / DLL files | |||||
__pycache__/ | |||||
*.py[cod] | |||||
*$py.class | |||||
# C extensions | |||||
*.so | |||||
# Distribution / packaging | |||||
.Python | |||||
build/ | |||||
develop-eggs/ | |||||
dist/ | |||||
downloads/ | |||||
eggs/ | |||||
.eggs/ | |||||
lib/ | |||||
lib64/ | |||||
parts/ | |||||
sdist/ | |||||
var/ | |||||
wheels/ | |||||
pip-wheel-metadata/ | |||||
share/python-wheels/ | |||||
*.egg-info/ | |||||
.installed.cfg | |||||
*.egg | |||||
MANIFEST | |||||
# PyInstaller | |||||
# Usually these files are written by a python script from a template | |||||
# before PyInstaller builds the exe, so as to inject date/other infos into it. | |||||
*.manifest | |||||
*.spec | |||||
# Installer logs | |||||
pip-log.txt | |||||
pip-delete-this-directory.txt | |||||
pip-selfcheck.json | |||||
# Unit test / coverage reports | |||||
htmlcov/ | |||||
.tox/ | |||||
.nox/ | |||||
.coverage | |||||
.coverage.* | |||||
docs/source/coverage/* | |||||
!docs/source/coverage/*.source.html | |||||
!docs/source/coverage/extract_source.py | |||||
docs/source/api/* | |||||
.cache | |||||
nosetests.xml | |||||
coverage.xml | |||||
*.cover | |||||
*.py,cover | |||||
.hypothesis/ | |||||
.pytest_cache/ | |||||
.pylint.d/ | |||||
# Translations | |||||
*.mo | |||||
*.pot | |||||
# Django stuff: | |||||
*.log | |||||
local_settings.py | |||||
db.sqlite3 | |||||
db.sqlite3-journal | |||||
static/* | |||||
!static/.touch | |||||
# Flask stuff: | |||||
instance/ | |||||
.webassets-cache | |||||
# Scrapy stuff: | |||||
.scrapy | |||||
# Sphinx documentation | |||||
docs/_build/ | |||||
docs/build/ | |||||
# PyBuilder | |||||
target/ | |||||
# Jupyter Notebook | |||||
.ipynb_checkpoints | |||||
# IPython | |||||
profile_default/ | |||||
ipython_config.py | |||||
# pyenv | |||||
.python-version | |||||
# pipenv | |||||
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. | |||||
# However, in case of collaboration, if having platform-specific dependencies or dependencies | |||||
# having no cross-platform support, pipenv may install dependencies that don't work, or not | |||||
# install all needed dependencies. | |||||
#Pipfile.lock | |||||
# PEP 582; used by e.g. github.com/David-OConnor/pyflow | |||||
__pypackages__/ | |||||
# celery beat schedule file | |||||
celerybeat-schedule | |||||
celerybeat.pid | |||||
# SageMath parsed files | |||||
*.sage.py | |||||
# Environments | |||||
.env | |||||
.venv | |||||
env/ | |||||
venv/ | |||||
ENV/ | |||||
env.bak/ | |||||
venv.bak/ | |||||
# Spyder project settings | |||||
.spyderproject | |||||
.spyproject | |||||
# Rope project settings | |||||
.ropeproject | |||||
# mkdocs documentation | |||||
/site | |||||
# mypy | |||||
.mypy_cache/ | |||||
.dmypy.json | |||||
dmypy.json | |||||
# Pyre type checker | |||||
.pyre/ | |||||
####### Python End ####### |
[settings] | |||||
line_length = 88 | |||||
known_first_party = {{ cookiecutter.project_slug }} | |||||
known_third_party = six | |||||
multi_line_output = 3 | |||||
# length_sort = 1 | |||||
# balanced_wrapping = True | |||||
force_grid_wrap = 0 | |||||
include_trailing_comma = True | |||||
use_parentheses = True |
exclude: '^$' | |||||
fail_fast: false | |||||
default_language_version: | |||||
python: python3.9 | |||||
repos: | |||||
- repo: https://github.com/pre-commit/pre-commit-hooks | |||||
rev: v3.3.0 | |||||
hooks: | |||||
- id: check-added-large-files | |||||
- id: check-ast | |||||
types: [file, python] | |||||
- id: check-case-conflict | |||||
- id: check-json | |||||
types: [file, json] | |||||
- id: check-merge-conflict | |||||
- id: check-symlinks | |||||
types: [symlink] | |||||
- id: check-yaml | |||||
args: [--allow-multiple-documents] | |||||
types: [file, yaml] | |||||
- id: detect-private-key | |||||
types: [file, text] | |||||
- id: end-of-file-fixer | |||||
types: [file, python] | |||||
- id: fix-encoding-pragma | |||||
types: [file, python] | |||||
- id: requirements-txt-fixer | |||||
types: [file, text] | |||||
- id: trailing-whitespace | |||||
args: [--markdown-linebreak-ext=md] | |||||
types: [file, text] | |||||
exclude: ^docs/.*/coverage/.*\.html$ | |||||
- repo: https://github.com/PyCQA/isort | |||||
rev: 5.6.4 | |||||
hooks: | |||||
- id: isort | |||||
types: [file, python] | |||||
- repo: https://github.com/psf/black | |||||
rev: stable | |||||
hooks: | |||||
- id: black | |||||
language_version: python3.8 | |||||
- repo: https://gitlab.com/pycqa/flake8 | |||||
rev: 3.8.4 | |||||
hooks: | |||||
- id: flake8 | |||||
exclude: ^setup.py$ | |||||
types: [file, python] | |||||
- repo: local | |||||
hooks: | |||||
- id: check-manifest | |||||
name: Check Manifest | |||||
description: Check package manifest against git committed files. | |||||
always_run: true | |||||
files: '^$' | |||||
entry: check-manifest | |||||
language: python | |||||
types: [file, plain-text] |
[MASTER] | |||||
# A comma-separated list of package or module names from where C extensions may | |||||
# be loaded. Extensions are loading into the active Python interpreter and may | |||||
# run arbitrary code. | |||||
extension-pkg-whitelist= | |||||
# Add files or directories to the blacklist. They should be base names, not | |||||
# paths. | |||||
ignore=CVS | |||||
# Add files or directories matching the regex patterns to the blacklist. The | |||||
# regex matches against base names, not paths. | |||||
ignore-patterns=.tox, | |||||
site-packages, | |||||
_version.py | |||||
# Python code to execute, usually for sys.path manipulation such as | |||||
# pygtk.require(). | |||||
#init-hook="from pylint.config import find_pylintrc; import os, sys; sys.path.append(os.path.dirname(find_pylintrc()))" | |||||
# Use multiple processes to speed up Pylint. Specifying 0 will auto-detect the | |||||
# number of processors available to use. | |||||
jobs=0 | |||||
# Control the amount of potential inferred values when inferring a single | |||||
# object. This can help the performance when dealing with large functions or | |||||
# complex, nested conditions. | |||||
limit-inference-results=100 | |||||
# List of plugins (as comma separated values of python modules names) to load, | |||||
# usually to register additional checkers. | |||||
load-plugins= | |||||
# Pickle collected data for later comparisons. | |||||
persistent=yes | |||||
# Specify a configuration file. | |||||
#rcfile= | |||||
# When enabled, pylint would attempt to guess common misconfiguration and emit | |||||
# user-friendly hints instead of false-positive error messages. | |||||
suggestion-mode=yes | |||||
# Allow loading of arbitrary C extensions. Extensions are imported into the | |||||
# active Python interpreter and may run arbitrary code. | |||||
unsafe-load-any-extension=no | |||||
[MESSAGES CONTROL] | |||||
# Only show warnings with the listed confidence levels. Leave empty to show | |||||
# all. Valid levels: HIGH, INFERENCE, INFERENCE_FAILURE, UNDEFINED. | |||||
confidence= | |||||
# Disable the message, report, category or checker with the given id(s). You | |||||
# can either give multiple identifiers separated by comma (,) or put this | |||||
# option multiple times (only on the command line, not in the configuration | |||||
# file where it should appear only once). You can also use "--disable=all" to | |||||
# disable everything first and then reenable specific checks. For example, if | |||||
# you want to run only the similarities checker, you can use "--disable=all | |||||
# --enable=similarities". If you want to run only the classes checker, but have | |||||
# no Warning level messages displayed, use "--disable=all --enable=classes | |||||
# --disable=W". | |||||
disable=print-statement, | |||||
parameter-unpacking, | |||||
unpacking-in-except, | |||||
old-raise-syntax, | |||||
backtick, | |||||
long-suffix, | |||||
old-ne-operator, | |||||
old-octal-literal, | |||||
import-star-module-level, | |||||
non-ascii-bytes-literal, | |||||
raw-checker-failed, | |||||
bad-inline-option, | |||||
locally-disabled, | |||||
locally-enabled, | |||||
file-ignored, | |||||
suppressed-message, | |||||
useless-suppression, | |||||
deprecated-pragma, | |||||
use-symbolic-message-instead, | |||||
apply-builtin, | |||||
basestring-builtin, | |||||
buffer-builtin, | |||||
cmp-builtin, | |||||
coerce-builtin, | |||||
execfile-builtin, | |||||
file-builtin, | |||||
long-builtin, | |||||
raw_input-builtin, | |||||
reduce-builtin, | |||||
standarderror-builtin, | |||||
unicode-builtin, | |||||
xrange-builtin, | |||||
coerce-method, | |||||
delslice-method, | |||||
getslice-method, | |||||
setslice-method, | |||||
no-absolute-import, | |||||
old-division, | |||||
dict-iter-method, | |||||
dict-view-method, | |||||
next-method-called, | |||||
metaclass-assignment, | |||||
indexing-exception, | |||||
raising-string, | |||||
reload-builtin, | |||||
oct-method, | |||||
hex-method, | |||||
nonzero-method, | |||||
cmp-method, | |||||
input-builtin, | |||||
round-builtin, | |||||
intern-builtin, | |||||
unichr-builtin, | |||||
map-builtin-not-iterating, | |||||
zip-builtin-not-iterating, | |||||
range-builtin-not-iterating, | |||||
filter-builtin-not-iterating, | |||||
using-cmp-argument, | |||||
eq-without-hash, | |||||
div-method, | |||||
idiv-method, | |||||
rdiv-method, | |||||
exception-message-attribute, | |||||
invalid-str-codec, | |||||
sys-max-int, | |||||
bad-python3-import, | |||||
deprecated-string-function, | |||||
deprecated-str-translate-call, | |||||
deprecated-itertools-function, | |||||
deprecated-types-field, | |||||
next-method-defined, | |||||
dict-items-not-iterating, | |||||
dict-keys-not-iterating, | |||||
dict-values-not-iterating, | |||||
deprecated-operator-function, | |||||
deprecated-urllib-function, | |||||
xreadlines-attribute, | |||||
deprecated-sys-function, | |||||
exception-escape, | |||||
comprehension-escape, | |||||
missing-docstring, | |||||
duplicate-code, | |||||
import-error, | |||||
old-style-class, | |||||
ungrouped-imports, | |||||
bad-continuation, | |||||
useless-object-inheritance, | |||||
logging-fstring-interpolation | |||||
# Enable the message, report, category or checker with the given id(s). You can | |||||
# either give multiple identifier separated by comma (,) or put this option | |||||
# multiple time (only on the command line, not in the configuration file where | |||||
# it should appear only once). See also the "--disable" option for examples. | |||||
enable=c-extension-no-member | |||||
[REPORTS] | |||||
# Python expression which should return a note less than 10 (10 is the highest | |||||
# note). You have access to the variables errors warning, statement which | |||||
# respectively contain the number of errors / warnings messages and the total | |||||
# number of statements analyzed. This is used by the global evaluation report | |||||
# (RP0004). | |||||
evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10) | |||||
# Template used to display messages. This is a python new-style format string | |||||
# used to format the message information. See doc for all details. | |||||
msg-template='{path}:{obj}:{line}: [{msg_id}({symbol})] {msg}' | |||||
# Set the output format. Available formats are text, parseable, colorized, json | |||||
# and msvs (visual studio). You can also give a reporter class, e.g. | |||||
# mypackage.mymodule.MyReporterClass. | |||||
output-format=text | |||||
# Tells whether to display a full report or only the messages. | |||||
reports=no | |||||
# Activate the evaluation score. | |||||
score=yes | |||||
[REFACTORING] | |||||
# Maximum number of nested blocks for function / method body | |||||
max-nested-blocks=5 | |||||
# Complete name of functions that never returns. When checking for | |||||
# inconsistent-return-statements if a never returning function is called then | |||||
# it will be considered as an explicit return statement and no message will be | |||||
# printed. | |||||
never-returning-functions=sys.exit | |||||
[BASIC] | |||||
# Naming style matching correct argument names. | |||||
argument-naming-style=snake_case | |||||
# Regular expression matching correct argument names. Overrides argument- | |||||
# naming-style. | |||||
#argument-rgx= | |||||
# Naming style matching correct attribute names. | |||||
attr-naming-style=snake_case | |||||
# Regular expression matching correct attribute names. Overrides attr-naming- | |||||
# style. | |||||
#attr-rgx= | |||||
# Bad variable names which should always be refused, separated by a comma. | |||||
bad-names=foo, | |||||
bar, | |||||
baz, | |||||
toto, | |||||
tutu, | |||||
tata | |||||
# Naming style matching correct class attribute names. | |||||
class-attribute-naming-style=any | |||||
# Regular expression matching correct class attribute names. Overrides class- | |||||
# attribute-naming-style. | |||||
#class-attribute-rgx= | |||||
# Naming style matching correct class names. | |||||
class-naming-style=PascalCase | |||||
# Regular expression matching correct class names. Overrides class-naming- | |||||
# style. | |||||
#class-rgx= | |||||
# Naming style matching correct constant names. | |||||
const-naming-style=UPPER_CASE | |||||
# Regular expression matching correct constant names. Overrides const-naming- | |||||
# style. | |||||
#const-rgx= | |||||
# Minimum line length for functions/classes that require docstrings, shorter | |||||
# ones are exempt. | |||||
docstring-min-length=-1 | |||||
# Naming style matching correct function names. | |||||
function-naming-style=snake_case | |||||
# Regular expression matching correct function names. Overrides function- | |||||
# naming-style. | |||||
#function-rgx= | |||||
# Good variable names which should always be accepted, separated by a comma. | |||||
good-names=e, | |||||
i, | |||||
j, | |||||
k, | |||||
ex, | |||||
Run, | |||||
_ | |||||
# Include a hint for the correct naming format with invalid-name. | |||||
include-naming-hint=no | |||||
# Naming style matching correct inline iteration names. | |||||
inlinevar-naming-style=any | |||||
# Regular expression matching correct inline iteration names. Overrides | |||||
# inlinevar-naming-style. | |||||
#inlinevar-rgx= | |||||
# Naming style matching correct method names. | |||||
method-naming-style=snake_case | |||||
# Regular expression matching correct method names. Overrides method-naming- | |||||
# style. | |||||
#method-rgx= | |||||
# Naming style matching correct module names. | |||||
module-naming-style=snake_case | |||||
# Regular expression matching correct module names. Overrides module-naming- | |||||
# style. | |||||
#module-rgx= | |||||
# Colon-delimited sets of names that determine each other's naming style when | |||||
# the name regexes allow several styles. | |||||
name-group= | |||||
# Regular expression which should only match function or class names that do | |||||
# not require a docstring. | |||||
no-docstring-rgx=^_ | |||||
# List of decorators that produce properties, such as abc.abstractproperty. Add | |||||
# to this list to register other decorators that produce valid properties. | |||||
# These decorators are taken in consideration only for invalid-name. | |||||
property-classes=abc.abstractproperty | |||||
# Naming style matching correct variable names. | |||||
variable-naming-style=snake_case | |||||
# Regular expression matching correct variable names. Overrides variable- | |||||
# naming-style. | |||||
#variable-rgx= | |||||
[FORMAT] | |||||
# Expected format of line ending, e.g. empty (any line ending), LF or CRLF. | |||||
expected-line-ending-format= | |||||
# Regexp for a line that is allowed to be longer than the limit. | |||||
ignore-long-lines=^\s*(# )?<?https?://\S+>?$ | |||||
# Number of spaces of indent required inside a hanging or continued line. | |||||
indent-after-paren=4 | |||||
# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1 | |||||
# tab). | |||||
indent-string=' ' | |||||
# Maximum number of characters on a single line. | |||||
max-line-length=100 | |||||
# Maximum number of lines in a module. | |||||
max-module-lines=3000 | |||||
# List of optional constructs for which whitespace checking is disabled. `dict- | |||||
# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}. | |||||
# `trailing-comma` allows a space between comma and closing bracket: (a, ). | |||||
# `empty-line` allows space-only lines. | |||||
no-space-check=trailing-comma, | |||||
dict-separator | |||||
# Allow the body of a class to be on the same line as the declaration if body | |||||
# contains single statement. | |||||
single-line-class-stmt=no | |||||
# Allow the body of an if to be on the same line as the test if there is no | |||||
# else. | |||||
single-line-if-stmt=no | |||||
[LOGGING] | |||||
# Logging modules to check that the string format arguments are in logging | |||||
# function parameter format. | |||||
logging-modules=logging | |||||
[MISCELLANEOUS] | |||||
# List of note tags to take in consideration, separated by a comma. | |||||
notes=FIXME, | |||||
XXX, | |||||
TODO | |||||
[SIMILARITIES] | |||||
# Ignore comments when computing similarities. | |||||
ignore-comments=yes | |||||
# Ignore docstrings when computing similarities. | |||||
ignore-docstrings=yes | |||||
# Ignore imports when computing similarities. | |||||
ignore-imports=no | |||||
# Minimum lines number of a similarity. | |||||
min-similarity-lines=4 | |||||
[SPELLING] | |||||
# Limits count of emitted suggestions for spelling mistakes. | |||||
max-spelling-suggestions=4 | |||||
# Spelling dictionary name. Available dictionaries: none. To make it working | |||||
# install python-enchant package.. | |||||
spelling-dict= | |||||
# List of comma separated words that should not be checked. | |||||
spelling-ignore-words= | |||||
# A path to a file that contains private dictionary; one word per line. | |||||
spelling-private-dict-file= | |||||
# Tells whether to store unknown words to indicated private dictionary in | |||||
# --spelling-private-dict-file option instead of raising a message. | |||||
spelling-store-unknown-words=no | |||||
[TYPECHECK] | |||||
# List of decorators that produce context managers, such as | |||||
# contextlib.contextmanager. Add to this list to register other decorators that | |||||
# produce valid context managers. | |||||
contextmanager-decorators=contextlib.contextmanager | |||||
# List of members which are set dynamically and missed by pylint inference | |||||
# system, and so shouldn't trigger E1101 when accessed. Python regular | |||||
# expressions are accepted. | |||||
generated-members= | |||||
# Tells whether missing members accessed in mixin class should be ignored. A | |||||
# mixin class is detected if its name ends with "mixin" (case insensitive). | |||||
ignore-mixin-members=yes | |||||
# Tells whether to warn about missing members when the owner of the attribute | |||||
# is inferred to be None. | |||||
ignore-none=yes | |||||
# This flag controls whether pylint should warn about no-member and similar | |||||
# checks whenever an opaque object is returned when inferring. The inference | |||||
# can return multiple potential results while evaluating a Python object, but | |||||
# some branches might not be evaluated, which results in partial inference. In | |||||
# that case, it might be useful to still emit no-member and other checks for | |||||
# the rest of the inferred objects. | |||||
ignore-on-opaque-inference=yes | |||||
# List of class names for which member attributes should not be checked (useful | |||||
# for classes with dynamically set attributes). This supports the use of | |||||
# qualified names. | |||||
ignored-classes=optparse.Values,thread._local,_thread._local | |||||
# List of module names for which member attributes should not be checked | |||||
# (useful for modules/projects where namespaces are manipulated during runtime | |||||
# and thus existing member attributes cannot be deduced by static analysis. It | |||||
# supports qualified module names, as well as Unix pattern matching. | |||||
ignored-modules= | |||||
# Show a hint with possible names when a member name was not found. The aspect | |||||
# of finding the hint is based on edit distance. | |||||
missing-member-hint=yes | |||||
# The minimum edit distance a name should have in order to be considered a | |||||
# similar match for a missing member name. | |||||
missing-member-hint-distance=1 | |||||
# The total number of similar names that should be taken in consideration when | |||||
# showing a hint for a missing member. | |||||
missing-member-max-choices=1 | |||||
[VARIABLES] | |||||
# List of additional names supposed to be defined in builtins. Remember that | |||||
# you should avoid to define new builtins when possible. | |||||
additional-builtins= | |||||
# Tells whether unused global variables should be treated as a violation. | |||||
allow-global-unused-variables=yes | |||||
# List of strings which can identify a callback function by name. A callback | |||||
# name must start or end with one of those strings. | |||||
callbacks=cb_, | |||||
_cb | |||||
# A regular expression matching the name of dummy variables (i.e. expected to | |||||
# not be used). | |||||
dummy-variables-rgx=_+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)|dummy|^ignored_|^unused_ | |||||
# Argument names that match this expression will be ignored. Default to name | |||||
# with leading underscore. | |||||
ignored-argument-names=_.*|^ignored_|^unused_ | |||||
# Tells whether we should check for unused import in __init__ files. | |||||
init-import=no | |||||
# List of qualified module names which can have objects that can redefine | |||||
# builtins. | |||||
redefining-builtins-modules=six.moves,past.builtins,future.builtins,builtins,io | |||||
[CLASSES] | |||||
# List of method names used to declare (i.e. assign) instance attributes. | |||||
defining-attr-methods=__init__, | |||||
__new__, | |||||
setUp | |||||
# List of member names, which should be excluded from the protected access | |||||
# warning. | |||||
exclude-protected=_asdict, | |||||
_fields, | |||||
_replace, | |||||
_source, | |||||
_make | |||||
# List of valid names for the first argument in a class method. | |||||
valid-classmethod-first-arg=cls | |||||
# List of valid names for the first argument in a metaclass class method. | |||||
valid-metaclass-classmethod-first-arg=cls | |||||
[DESIGN] | |||||
# Maximum number of arguments for function / method. | |||||
max-args=15 | |||||
# Maximum number of attributes for a class (see R0902). | |||||
max-attributes=20 | |||||
# Maximum number of boolean expressions in an if statement. | |||||
max-bool-expr=7 | |||||
# Maximum number of branch for function / method body. | |||||
max-branches=12 | |||||
# Maximum number of locals for function / method body. | |||||
max-locals=15 | |||||
# Maximum number of parents for a class (see R0901). | |||||
max-parents=7 | |||||
# Maximum number of public methods for a class (see R0904). | |||||
max-public-methods=20 | |||||
# Maximum number of return / yield for function / method body. | |||||
max-returns=10 | |||||
# Maximum number of statements in function / method body. | |||||
max-statements=50 | |||||
# Minimum number of public methods for a class (see R0903). | |||||
min-public-methods=2 | |||||
[IMPORTS] | |||||
# Allow wildcard imports from modules that define __all__. | |||||
allow-wildcard-with-all=no | |||||
# Analyse import fallback blocks. This can be used to support both Python 2 and | |||||
# 3 compatible code, which means that the block might have code that exists | |||||
# only in one or another interpreter, leading to false positives when analysed. | |||||
analyse-fallback-blocks=no | |||||
# Deprecated modules which should not be used, separated by a comma. | |||||
deprecated-modules=optparse,tkinter.tix | |||||
# Create a graph of external dependencies in the given file (report RP0402 must | |||||
# not be disabled). | |||||
ext-import-graph= | |||||
# Create a graph of every (i.e. internal and external) dependencies in the | |||||
# given file (report RP0402 must not be disabled). | |||||
import-graph= | |||||
# Create a graph of internal dependencies in the given file (report RP0402 must | |||||
# not be disabled). | |||||
int-import-graph= | |||||
# Force import order to recognize a module as part of the standard | |||||
# compatibility libraries. | |||||
known-standard-library= | |||||
# Force import order to recognize a module as part of a third party library. | |||||
known-third-party=enchant | |||||
[EXCEPTIONS] | |||||
# Exceptions that will emit a warning when being caught. Defaults to | |||||
# "Exception". | |||||
overgeneral-exceptions=Exception |
# History | |||||
## {{ cookiecutter.version }} ({{ cookiecutter.release_date }}) | |||||
* Initial release. |
GNU LESSER GENERAL PUBLIC LICENSE | |||||
Version 3, 29 June 2007 | |||||
Copyright (C) 2007 Free Software Foundation, Inc. <http s ://fsf.org/> | |||||
Everyone is permitted to copy and distribute verbatim copies of this license | |||||
document, but changing it is not allowed. | |||||
This version of the GNU Lesser General Public License incorporates the terms | |||||
and conditions of version 3 of the GNU General Public License, supplemented | |||||
by the additional permissions listed below. | |||||
0. Additional Definitions. | |||||
As used herein, "this License" refers to version 3 of the GNU Lesser General | |||||
Public License, and the "GNU GPL" refers to version 3 of the GNU General Public | |||||
License. | |||||
"The Library" refers to a covered work governed by this License, other than | |||||
an Application or a Combined Work as defined below. | |||||
An "Application" is any work that makes use of an interface provided by the | |||||
Library, but which is not otherwise based on the Library. Defining a subclass | |||||
of a class defined by the Library is deemed a mode of using an interface provided | |||||
by the Library. | |||||
A "Combined Work" is a work produced by combining or linking an Application | |||||
with the Library. The particular version of the Library with which the Combined | |||||
Work was made is also called the "Linked Version". | |||||
The "Minimal Corresponding Source" for a Combined Work means the Corresponding | |||||
Source for the Combined Work, excluding any source code for portions of the | |||||
Combined Work that, considered in isolation, are based on the Application, | |||||
and not on the Linked Version. | |||||
The "Corresponding Application Code" for a Combined Work means the object | |||||
code and/or source code for the Application, including any data and utility | |||||
programs needed for reproducing the Combined Work from the Application, but | |||||
excluding the System Libraries of the Combined Work. | |||||
1. Exception to Section 3 of the GNU GPL. | |||||
You may convey a covered work under sections 3 and 4 of this License without | |||||
being bound by section 3 of the GNU GPL. | |||||
2. Conveying Modified Versions. | |||||
If you modify a copy of the Library, and, in your modifications, a facility | |||||
refers to a function or data to be supplied by an Application that uses the | |||||
facility (other than as an argument passed when the facility is invoked), | |||||
then you may convey a copy of the modified version: | |||||
a) under this License, provided that you make a good faith effort to ensure | |||||
that, in the event an Application does not supply the function or data, the | |||||
facility still operates, and performs whatever part of its purpose remains | |||||
meaningful, or | |||||
b) under the GNU GPL, with none of the additional permissions of this License | |||||
applicable to that copy. | |||||
3. Object Code Incorporating Material from Library Header Files. | |||||
The object code form of an Application may incorporate material from a header | |||||
file that is part of the Library. You may convey such object code under terms | |||||
of your choice, provided that, if the incorporated material is not limited | |||||
to numerical parameters, data structure layouts and accessors, or small macros, | |||||
inline functions and templates (ten or fewer lines in length), you do both | |||||
of the following: | |||||
a) Give prominent notice with each copy of the object code that the Library | |||||
is used in it and that the Library and its use are covered by this License. | |||||
b) Accompany the object code with a copy of the GNU GPL and this license document. | |||||
4. Combined Works. | |||||
You may convey a Combined Work under terms of your choice that, taken together, | |||||
effectively do not restrict modification of the portions of the Library contained | |||||
in the Combined Work and reverse engineering for debugging such modifications, | |||||
if you also do each of the following: | |||||
a) Give prominent notice with each copy of the Combined Work that the Library | |||||
is used in it and that the Library and its use are covered by this License. | |||||
b) Accompany the Combined Work with a copy of the GNU GPL and this license | |||||
document. | |||||
c) For a Combined Work that displays copyright notices during execution, include | |||||
the copyright notice for the Library among these notices, as well as a reference | |||||
directing the user to the copies of the GNU GPL and this license document. | |||||
d) Do one of the following: | |||||
0) Convey the Minimal Corresponding Source under the terms of this License, | |||||
and the Corresponding Application Code in a form suitable for, and under terms | |||||
that permit, the user to recombine or relink the Application with a modified | |||||
version of the Linked Version to produce a modified Combined Work, in the | |||||
manner specified by section 6 of the GNU GPL for conveying Corresponding Source. | |||||
1) Use a suitable shared library mechanism for linking with the Library. A | |||||
suitable mechanism is one that (a) uses at run time a copy of the Library | |||||
already present on the user's computer system, and (b) will operate properly | |||||
with a modified version of the Library that is interface-compatible with the | |||||
Linked Version. | |||||
e) Provide Installation Information, but only if you would otherwise be required | |||||
to provide such information under section 6 of the GNU GPL, and only to the | |||||
extent that such information is necessary to install and execute a modified | |||||
version of the Combined Work produced by recombining or relinking the Application | |||||
with a modified version of the Linked Version. (If you use option 4d0, the | |||||
Installation Information must accompany the Minimal Corresponding Source and | |||||
Corresponding Application Code. If you use option 4d1, you must provide the | |||||
Installation Information in the manner specified by section 6 of the GNU GPL | |||||
for conveying Corresponding Source.) | |||||
5. Combined Libraries. | |||||
You may place library facilities that are a work based on the Library side | |||||
by side in a single library together with other library facilities that are | |||||
not Applications and are not covered by this License, and convey such a combined | |||||
library under terms of your choice, if you do both of the following: | |||||
a) Accompany the combined library with a copy of the same work based on the | |||||
Library, uncombined with any other library facilities, conveyed under the | |||||
terms of this License. | |||||
b) Give prominent notice with the combined library that part of it is a work | |||||
based on the Library, and explaining where to find the accompanying uncombined | |||||
form of the same work. | |||||
6. Revised Versions of the GNU Lesser General Public License. | |||||
The Free Software Foundation may publish revised and/or new versions of the | |||||
GNU Lesser General Public License from time to time. Such new versions will | |||||
be similar in spirit to the present version, but may differ in detail to address | |||||
new problems or concerns. | |||||
Each version is given a distinguishing version number. If the Library as you | |||||
received it specifies that a certain numbered version of the GNU Lesser General | |||||
Public License "or any later version" applies to it, you have the option of | |||||
following the terms and conditions either of that published version or of | |||||
any later version published by the Free Software Foundation. If the Library | |||||
as you received it does not specify a version number of the GNU Lesser General | |||||
Public License, you may choose any version of the GNU Lesser General Public | |||||
License ever published by the Free Software Foundation. | |||||
If the Library as you received it specifies that a proxy can decide whether | |||||
future versions of the GNU Lesser General Public License shall apply, that | |||||
proxy's public statement of acceptance of any version is permanent authorization | |||||
for you to choose that version for the Library. |
include *.md | |||||
include .isort.cfg | |||||
include .pre-commit-config.yaml | |||||
include .pylintrc | |||||
include LICENSE | |||||
include pyproject.toml | |||||
include requirements* | |||||
include tox.ini | |||||
include docs/source/conf.py | |||||
include docs/source/coverage/extract_source.py | |||||
include docs/[mM]ake* | |||||
recursive-include . *.gitkeep | |||||
recursive-include docs/source *.rst | |||||
recursive-include docs/source/coverage *.source.html | |||||
recursive-include tests * | |||||
recursive-exclude * __pycache__ | |||||
recursive-exclude * *.py[co] | |||||
graft docs/source/_static | |||||
graft tests/fixtures | |||||
prune docs/source/api |
# {{ cookiecutter.project_name }} | |||||
[![Status](https://img.shields.io/pypi/v/{{ cookiecutter.project_slug }}.svg)](https://pypi.python.org/pypi/{{ cookiecutter.project_slug }}) | |||||
[![Documentation Status](https://readthedocs.org/projects/{{ cookiecutter.project_slug }}/badge/?version=latest)](https://readthedocs.org/projects/{{ cookiecutter.project_slug }}/?badge=latest) | |||||
{{ cookiecutter.project_short_description }} | |||||
## Features | |||||
* TODO |
# Makefile for Sphinx documentation | |||||
# | |||||
# You can set these variables from the command line. | |||||
SPHINXOPTS = | |||||
SPHINXBUILD = sphinx-build | |||||
PAPER = | |||||
SOURCEDIR = source | |||||
BUILDDIR = build | |||||
# User-friendly check for sphinx-build | |||||
ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1) | |||||
$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/) | |||||
endif | |||||
# Internal variables. | |||||
PAPEROPT_a4 = -D latex_paper_size=a4 | |||||
PAPEROPT_letter = -D latex_paper_size=letter | |||||
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . | |||||
# the i18n builder cannot share the environment and doctrees with the others | |||||
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . | |||||
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext | |||||
help: | |||||
@echo "Please use \`make <target>' where <target> is one of" | |||||
@echo " html to make standalone HTML files" | |||||
@echo " dirhtml to make HTML files named index.html in directories" | |||||
@echo " singlehtml to make a single large HTML file" | |||||
@echo " pickle to make pickle files" | |||||
@echo " json to make JSON files" | |||||
@echo " htmlhelp to make HTML files and a HTML help project" | |||||
@echo " qthelp to make HTML files and a qthelp project" | |||||
@echo " devhelp to make HTML files and a Devhelp project" | |||||
@echo " epub to make an epub" | |||||
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" | |||||
@echo " latexpdf to make LaTeX files and run them through pdflatex" | |||||
@echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx" | |||||
@echo " text to make text files" | |||||
@echo " man to make manual pages" | |||||
@echo " texinfo to make Texinfo files" | |||||
@echo " info to make Texinfo files and run them through makeinfo" | |||||
@echo " gettext to make PO message catalogs" | |||||
@echo " changes to make an overview of all changed/added/deprecated items" | |||||
@echo " xml to make Docutils-native XML files" | |||||
@echo " pseudoxml to make pseudoxml-XML files for display purposes" | |||||
@echo " linkcheck to check all external links for integrity" | |||||
@echo " doctest to run all doctests embedded in the documentation (if enabled)" | |||||
clean: | |||||
rm -rf $(BUILDDIR)/* | |||||
html: | |||||
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(SOURCEDIR) $(BUILDDIR)/html | |||||
@echo | |||||
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html." | |||||
dirhtml: | |||||
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(SOURCEDIR) $(BUILDDIR)/dirhtml | |||||
@echo | |||||
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." | |||||
singlehtml: | |||||
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(SOURCEDIR) $(BUILDDIR)/singlehtml | |||||
@echo | |||||
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." | |||||
pickle: | |||||
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(SOURCEDIR) $(BUILDDIR)/pickle | |||||
@echo | |||||
@echo "Build finished; now you can process the pickle files." | |||||
json: | |||||
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(SOURCEDIR) $(BUILDDIR)/json | |||||
@echo | |||||
@echo "Build finished; now you can process the JSON files." | |||||
htmlhelp: | |||||
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(SOURCEDIR) $(BUILDDIR)/htmlhelp | |||||
@echo | |||||
@echo "Build finished; now you can run HTML Help Workshop with the" \ | |||||
".hhp project file in $(BUILDDIR)/htmlhelp." | |||||
qthelp: | |||||
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(SOURCEDIR) $(BUILDDIR)/qthelp | |||||
@echo | |||||
@echo "Build finished; now you can run "qcollectiongenerator" with the" \ | |||||
".qhcp project file in $(BUILDDIR)/qthelp, like this:" | |||||
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/{{ cookiecutter.project_slug }}.qhcp" | |||||
@echo "To view the help file:" | |||||
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/{{ cookiecutter.project_slug }}.qhc" | |||||
devhelp: | |||||
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(SOURCEDIR) $(BUILDDIR)/devhelp | |||||
@echo | |||||
@echo "Build finished." | |||||
@echo "To view the help file:" | |||||
@echo "# mkdir -p $$HOME/.local/share/devhelp/{{ cookiecutter.project_slug }}" | |||||
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/{{ cookiecutter.project_slug }}" | |||||
@echo "# devhelp" | |||||
epub: | |||||
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(SOURCEDIR) $(BUILDDIR)/epub | |||||
@echo | |||||
@echo "Build finished. The epub file is in $(BUILDDIR)/epub." | |||||
latex: | |||||
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(SOURCEDIR) $(BUILDDIR)/latex | |||||
@echo | |||||
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." | |||||
@echo "Run \`make' in that directory to run these through (pdf)latex" \ | |||||
"(use \`make latexpdf' here to do that automatically)." | |||||
latexpdf: | |||||
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(SOURCEDIR) $(BUILDDIR)/latex | |||||
@echo "Running LaTeX files through pdflatex..." | |||||
$(MAKE) -C $(BUILDDIR)/latex all-pdf | |||||
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." | |||||
latexpdfja: | |||||
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(SOURCEDIR) $(BUILDDIR)/latex | |||||
@echo "Running LaTeX files through platex and dvipdfmx..." | |||||
$(MAKE) -C $(BUILDDIR)/latex all-pdf-ja | |||||
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." | |||||
text: | |||||
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(SOURCEDIR) $(BUILDDIR)/text | |||||
@echo | |||||
@echo "Build finished. The text files are in $(BUILDDIR)/text." | |||||
man: | |||||
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(SOURCEDIR) $(BUILDDIR)/man | |||||
@echo | |||||
@echo "Build finished. The manual pages are in $(BUILDDIR)/man." | |||||
texinfo: | |||||
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(SOURCEDIR) $(BUILDDIR)/texinfo | |||||
@echo | |||||
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." | |||||
@echo "Run \`make' in that directory to run these through makeinfo" \ | |||||
"(use \`make info' here to do that automatically)." | |||||
info: | |||||
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(SOURCEDIR) $(BUILDDIR)/texinfo | |||||
@echo "Running Texinfo files through makeinfo..." | |||||
make -C $(BUILDDIR)/texinfo info | |||||
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." | |||||
gettext: | |||||
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale | |||||
@echo | |||||
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." | |||||
changes: | |||||
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(SOURCEDIR) $(BUILDDIR)/changes | |||||
@echo | |||||
@echo "The overview file is in $(BUILDDIR)/changes." | |||||
linkcheck: | |||||
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(SOURCEDIR) $(BUILDDIR)/linkcheck | |||||
@echo | |||||
@echo "Link check complete; look for any errors in the above output " \ | |||||
"or in $(BUILDDIR)/linkcheck/output.txt." | |||||
doctest: | |||||
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(SOURCEDIR) $(BUILDDIR)/doctest | |||||
@echo "Testing of doctests in the sources finished, look at the " \ | |||||
"results in $(BUILDDIR)/doctest/output.txt." | |||||
xml: | |||||
$(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(SOURCEDIR) $(BUILDDIR)/xml | |||||
@echo | |||||
@echo "Build finished. The XML files are in $(BUILDDIR)/xml." | |||||
pseudoxml: | |||||
$(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(SOURCEDIR) $(BUILDDIR)/pseudoxml | |||||
@echo | |||||
@echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml." |
@ECHO OFF | |||||
pushd %~dp0 | |||||
REM Command file for Sphinx documentation | |||||
if "%SPHINXBUILD%" == "" ( | |||||
set SPHINXBUILD=sphinx-build | |||||
) | |||||
set SOURCEDIR=source | |||||
set BUILDDIR=build | |||||
if "%1" == "" goto help | |||||
%SPHINXBUILD% >NUL 2>NUL | |||||
if errorlevel 9009 ( | |||||
echo. | |||||
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx | |||||
echo.installed, then set the SPHINXBUILD environment variable to point | |||||
echo.to the full path of the 'sphinx-build' executable. Alternatively you | |||||
echo.may add the Sphinx directory to PATH. | |||||
echo. | |||||
echo.If you don't have Sphinx installed, grab it from | |||||
echo.http://sphinx-doc.org/ | |||||
exit /b 1 | |||||
) | |||||
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% | |||||
goto end | |||||
:help | |||||
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% | |||||
:end | |||||
popd |
@charset "UTF-8"; | |||||
/* Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 */ | |||||
/* For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt */ | |||||
/* Source file styles */ | |||||
#source p { font-size: 12px; } | |||||
.help_panel, #source p .annotate.long { display: none; position: absolute; z-index: 999; background: #ffffcc; border: 1px solid #888; border-radius: .2em; color: #333; padding: .25em .5em; } | |||||
#source p .annotate.long { white-space: normal; float: right; top: 1.75em; right: 1em; height: auto; } | |||||
#source { padding: 1em 0 1em 3rem; font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace; } | |||||
#source p { margin-top: 0; margin-bottom: 0; } | |||||
#source p { position: relative; white-space: pre; } | |||||
#source p * { box-sizing: border-box; } | |||||
#source p .n { float: left; text-align: right; width: 3rem; box-sizing: border-box; margin-left: -3rem; padding-right: 1em; color: #999; } | |||||
@media (prefers-color-scheme: dark) { #source p .n { color: #777; } } | |||||
#source p .n a { text-decoration: none; color: #999; } | |||||
@media (prefers-color-scheme: dark) { #source p .n a { color: #777; } } | |||||
#source p .n a:hover { text-decoration: underline; color: #999; } | |||||
@media (prefers-color-scheme: dark) { #source p .n a:hover { color: #777; } } | |||||
#source p.highlight .n { background: #ffdd00; } | |||||
#source p .t { display: inline-block; width: 100%; box-sizing: border-box; margin-left: -.5em; padding-left: 0.3em; border-left: 0.2em solid #fff; } | |||||
@media (prefers-color-scheme: dark) { #source p .t { border-color: #1e1e1e; } } | |||||
#source p .t:hover { background: #f2f2f2; } | |||||
@media (prefers-color-scheme: dark) { #source p .t:hover { background: #282828; } } | |||||
#source p .t:hover ~ .r .annotate.long { display: block; } | |||||
#source p .t .com { color: #008000; font-style: italic; line-height: 1px; } | |||||
@media (prefers-color-scheme: dark) { #source p .t .com { color: #6A9955; } } | |||||
#source p .t .key { font-weight: bold; line-height: 1px; } | |||||
#source p .t .str { color: #0451A5; } | |||||
@media (prefers-color-scheme: dark) { #source p .t .str { color: #9CDCFE; } } | |||||
#source p.mis .t { border-left: 0.2em solid #ff0000; } | |||||
#source p.mis.show_mis .t { background: #fdd; } | |||||
@media (prefers-color-scheme: dark) { #source p.mis.show_mis .t { background: #4b1818; } } | |||||
#source p.mis.show_mis .t:hover { background: #f2d2d2; } | |||||
@media (prefers-color-scheme: dark) { #source p.mis.show_mis .t:hover { background: #532323; } } | |||||
#source p.run .t { border-left: 0.2em solid #00dd00; } | |||||
#source p.run.show_run .t { background: #dfd; } | |||||
@media (prefers-color-scheme: dark) { #source p.run.show_run .t { background: #373d29; } } | |||||
#source p.run.show_run .t:hover { background: #d2f2d2; } | |||||
@media (prefers-color-scheme: dark) { #source p.run.show_run .t:hover { background: #404633; } } | |||||
#source p.exc .t { border-left: 0.2em solid #808080; } | |||||
#source p.exc.show_exc .t { background: #eee; } | |||||
@media (prefers-color-scheme: dark) { #source p.exc.show_exc .t { background: #333; } } | |||||
#source p.exc.show_exc .t:hover { background: #e2e2e2; } | |||||
@media (prefers-color-scheme: dark) { #source p.exc.show_exc .t:hover { background: #3c3c3c; } } | |||||
#source p.par .t { border-left: 0.2em solid #dddd00; } | |||||
#source p.par.show_par .t { background: #ffa; } | |||||
@media (prefers-color-scheme: dark) { #source p.par.show_par .t { background: #650; } } | |||||
#source p.par.show_par .t:hover { background: #f2f2a2; } | |||||
@media (prefers-color-scheme: dark) { #source p.par.show_par .t:hover { background: #6d5d0c; } } | |||||
#source p .r { position: absolute; top: 0; right: 2.5em; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; } | |||||
#source p .annotate { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; color: #666; padding-right: .5em; } | |||||
@media (prefers-color-scheme: dark) { #source p .annotate { color: #ddd; } } | |||||
#source p .annotate.short:hover ~ .long { display: block; } | |||||
#source p .annotate.long { width: 30em; right: 2.5em; } | |||||
#source p input { display: none; } | |||||
#source p input ~ .r label.ctx { cursor: pointer; border-radius: .25em; } | |||||
#source p input ~ .r label.ctx::before { content: "▶ "; } | |||||
#source p input ~ .r label.ctx:hover { background: #d5f7ff; color: #666; } | |||||
@media (prefers-color-scheme: dark) { #source p input ~ .r label.ctx:hover { background: #0f3a42; } } | |||||
@media (prefers-color-scheme: dark) { #source p input ~ .r label.ctx:hover { color: #aaa; } } | |||||
#source p input:checked ~ .r label.ctx { background: #aef; color: #666; border-radius: .75em .75em 0 0; padding: 0 .5em; margin: -.25em 0; } | |||||
@media (prefers-color-scheme: dark) { #source p input:checked ~ .r label.ctx { background: #056; } } | |||||
@media (prefers-color-scheme: dark) { #source p input:checked ~ .r label.ctx { color: #aaa; } } | |||||
#source p input:checked ~ .r label.ctx::before { content: "▼ "; } | |||||
#source p input:checked ~ .ctxs { padding: .25em .5em; overflow-y: scroll; max-height: 10.5em; } | |||||
#source p label.ctx { color: #999; display: inline-block; padding: 0 .5em; font-size: .8333em; } | |||||
@media (prefers-color-scheme: dark) { #source p label.ctx { color: #777; } } | |||||
#source p .ctxs { display: block; max-height: 0; overflow-y: hidden; transition: all .2s; padding: 0 .5em; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; white-space: nowrap; background: #aef; border-radius: .25em; margin-right: 1.75em; } | |||||
@media (prefers-color-scheme: dark) { #source p .ctxs { background: #056; } } | |||||
#source p .ctxs span { display: block; text-align: right; } |
#!/usr/bin/env python | |||||
# -*- coding: utf-8 -*- | |||||
# pylint: disable=invalid-name | |||||
# | |||||
# Configuration file for the Sphinx documentation builder. | |||||
# | |||||
# This file does only contain a selection of the most common options. For a | |||||
# full list see the documentation: | |||||
# http://www.sphinx-doc.org/en/master/config | |||||
# -- Path setup -------------------------------------------------------------- | |||||
# If extensions (or modules to document with autodoc) are in another directory, | |||||
# add these directories to sys.path here. If the directory is relative to the | |||||
# documentation root, use os.path.abspath to make it absolute, like shown here. | |||||
# | |||||
import os | |||||
import sys | |||||
# Insert the project root dir as the first element in the PYTHONPATH. | |||||
# This lets us ensure that the source package is imported, and that its | |||||
# version is used. | |||||
# ({{ cookiecutter.project_slug }}/docs/source/conf.py -> {{ cookiecutter.project_slug }}/docs/source -> {{ cookiecutter.project_slug }}/docs -> {{ cookiecutter.project_slug }}) | |||||
sys.path.insert( | |||||
0, os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) | |||||
) | |||||
import {{ cookiecutter.project_slug }} | |||||
# -- Project information ----------------------------------------------------- | |||||
project = "{{ cookiecutter.project_name }}" | |||||
copyright = "{{ cookiecutter.year }}, {{ cookiecutter.full_name }}" # pylint: disable=redefined-builtin | |||||
author = {{ cookiecutter.author }} | |||||
# The version info for the project you're documenting, acts as replacement | |||||
# for |version| and |release|, also used in various other places throughout | |||||
# the built documents. | |||||
# | |||||
# The short X.Y version. | |||||
version = {{ cookiecutter.project_slug }}.__version__ | |||||
# The full version, including alpha/beta/rc tags. | |||||
release = {{ cookiecutter.project_slug }}.__version__ | |||||
# -- General configuration --------------------------------------------------- | |||||
# If your documentation needs a minimal Sphinx version, state it here. | |||||
# | |||||
# needs_sphinx = '1.0' | |||||
# Add any Sphinx extension module names here, as strings. They can be | |||||
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom | |||||
# ones. | |||||
extensions = [ | |||||
"sphinx.ext.autodoc", | |||||
"sphinx.ext.doctest", | |||||
"sphinx.ext.inheritance_diagram", | |||||
"sphinx.ext.intersphinx", | |||||
"sphinx.ext.todo", | |||||
"sphinx.ext.coverage", | |||||
"sphinx.ext.imgmath", | |||||
"sphinx.ext.ifconfig", | |||||
"sphinx.ext.viewcode", | |||||
"sphinx.ext.githubpages", | |||||
"sphinx.ext.napoleon", | |||||
"sphinx_autodoc_typehints", | |||||
"sphinx_automodapi.automodapi", | |||||
"sphinx_automodapi.smart_resolver", | |||||
] | |||||
# Add any paths that contain templates here, relative to this directory. | |||||
templates_path = ["_templates"] | |||||
# The suffix(es) of source filenames. | |||||
# You can specify multiple suffix as a list of string: | |||||
# | |||||
# source_suffix = ['.rst', '.md'] | |||||
source_suffix = ".rst" | |||||
# The master toctree document. | |||||
master_doc = "index" | |||||
# The language for content autogenerated by Sphinx. Refer to documentation | |||||
# for a list of supported languages. | |||||
# | |||||
# This is also used if you do content translation via gettext catalogs. | |||||
# Usually you set "language" from the command line for these cases. | |||||
language = None | |||||
# List of patterns, relative to source directory, that match files and | |||||
# directories to ignore when looking for source files. | |||||
# This pattern also affects html_static_path and html_extra_path. | |||||
exclude_patterns = [] | |||||
# The name of the Pygments (syntax highlighting) style to use. | |||||
pygments_style = "sphinx" | |||||
# List of warnings to suppress when generating documentation. | |||||
suppress_warnings = [ | |||||
"misc.highlighting_failure", | |||||
"ref.doc", | |||||
"ref.numref", | |||||
"ref.ref", | |||||
"toc.secnum", | |||||
] | |||||
# -- Options for HTML output ------------------------------------------------- | |||||
# The theme to use for HTML and HTML Help pages. See the documentation for | |||||
# a list of builtin themes. | |||||
# | |||||
html_theme = "alabaster" | |||||
# Theme options are theme-specific and customize the look and feel of a theme | |||||
# further. For a list of options available for each theme, see the | |||||
# documentation. | |||||
# | |||||
# html_theme_options = {} | |||||
# Add any paths that contain custom static files (such as style sheets) here, | |||||
# relative to this directory. They are copied after the builtin static files, | |||||
# so a file named "default.css" will overwrite the builtin "default.css". | |||||
html_static_path = ["_static"] | |||||
# Custom sidebar templates, must be a dictionary that maps document names | |||||
# to template names. | |||||
# | |||||
# The default sidebars (for documents that don't match any pattern) are | |||||
# defined by theme itself. Builtin themes are using these templates by | |||||
# default: ``['localtoc.html', 'relations.html', 'sourcelink.html', | |||||
# 'searchbox.html']``. | |||||
# | |||||
# html_sidebars = {} | |||||
# -- Options for HTMLHelp output --------------------------------------------- | |||||
# Output file base name for HTML help builder. | |||||
htmlhelp_basename = "{{ cookiecutter.project_slug }}doc" | |||||
# -- Options for LaTeX output ------------------------------------------------ | |||||
latex_elements = { | |||||
# The paper size ('letterpaper' or 'a4paper'). | |||||
# | |||||
# 'papersize': 'letterpaper', | |||||
# The font size ('10pt', '11pt' or '12pt'). | |||||
# | |||||
# 'pointsize': '10pt', | |||||
# Additional stuff for the LaTeX preamble. | |||||
# | |||||
# 'preamble': '', | |||||
# Latex figure (float) alignment | |||||
# | |||||
# 'figure_align': 'htbp', | |||||
} | |||||
# Grouping the document tree into LaTeX files. List of tuples | |||||
# (source start file, target name, title, | |||||
# author, documentclass [howto, manual, or own class]). | |||||
latex_documents = [ | |||||
( | |||||
master_doc, | |||||
"{{ cookiecutter.project_slug }}.tex", | |||||
"{{ cookiecutter.project_name }} Documentation", | |||||
"{{ cookiecutter.full_name }}", | |||||
"manual", | |||||
) | |||||
] | |||||
# The name of an image file (relative to this directory) to place at | |||||
# the top of the title page. | |||||
#latex_logo = None | |||||
# For "manual" documents, if this is true, then toplevel headings | |||||
# are parts, not chapters. | |||||
#latex_use_parts = False | |||||
# If true, show page references after internal links. | |||||
#latex_show_pagerefs = False | |||||
# If true, show URL addresses after external links. | |||||
#latex_show_urls = False | |||||
# Documents to append as an appendix to all manuals. | |||||
#latex_appendices = [] | |||||
# If false, no module index is generated. | |||||
#latex_domain_indices = True | |||||
# -- Options for manual page output ------------------------------------------ | |||||
# One entry per manual page. List of tuples | |||||
# (source start file, name, description, authors, manual section). | |||||
man_pages = [(master_doc, "{{ cookiecutter.project_slug }}", "{{ cookiecutter.project_name }} Documentation", [author], 1)] | |||||
# If true, show URL addresses after external links. | |||||
#man_show_urls = False | |||||
# -- Options for Texinfo output ---------------------------------------------- | |||||
# Grouping the document tree into Texinfo files. List of tuples | |||||
# (source start file, target name, title, author, | |||||
# dir menu entry, description, category) | |||||
texinfo_documents = [ | |||||
( | |||||
master_doc, | |||||
"{{ cookiecutter.project_slug }}", | |||||
"{{ cookiecutter.project_name }} Documentation", | |||||
author, | |||||
"{{ cookiecutter.project_slug }}", | |||||
"{{ cookiecutter.project_short_description }}", | |||||
"Miscellaneous", | |||||
) | |||||
] | |||||
# Documents to append as an appendix to all manuals. | |||||
#texinfo_appendices = [] | |||||
# If false, no module index is generated. | |||||
#texinfo_domain_indices = True | |||||
# How to display URL addresses: 'footnote', 'no', or 'inline'. | |||||
#texinfo_show_urls = 'footnote' | |||||
# If true, do not generate a @detailmenu in the "Top" node's menu. | |||||
#texinfo_no_detailmenu = False | |||||
# -- Options for Epub output ------------------------------------------------- | |||||
# Bibliographic Dublin Core info. | |||||
epub_title = project | |||||
# The unique identifier of the text. This can be a ISBN number | |||||
# or the project homepage. | |||||
# | |||||
# epub_identifier = '' | |||||
# A unique identification for the text. | |||||
# | |||||
# epub_uid = '' | |||||
# A list of files that should not be packed into the epub file. | |||||
epub_exclude_files = ["search.html"] | |||||
# -- Extension configuration ------------------------------------------------- | |||||
# -- Options for intersphinx extension --------------------------------------- | |||||
# Example configuration for intersphinx: refer to the Python standard library. | |||||
# The URL is the first tuple item. Check with | |||||
# "python -m sphinx.ext.intersphinx 'URL/objects.inv'" | |||||
# and use the second tuple item to specify the | |||||
# name if not the default objects.inv | |||||
intersphinx_mapping = { | |||||
"arrow": ("https://arrow.readthedocs.io/en/latest/", None), | |||||
"py3": ("https://docs.python.org/3", None), | |||||
"python": ("https://docs.python.org/3", None), | |||||
"requests": ("https://requests.readthedocs.io/en/master/", None), | |||||
"six": ("https://six.readthedocs.io/", None), | |||||
"urllib3": ("https://urllib3.readthedocs.io/en/latest/", None), | |||||
} | |||||
# -- Options for todo extension ---------------------------------------------- | |||||
# If true, `todo` and `todoList` produce output, else they produce nothing. | |||||
todo_include_todos = True | |||||
# -- Options for autodoc extension ------------------------------------------- | |||||
autodoc_default_options = { | |||||
"member-order": "bysource", | |||||
"special-members": "__init__", | |||||
"exclude-members": "__weakref__", | |||||
"show-inheritance": None, | |||||
} | |||||
# -- Options for automodapi extension ---------------------------------------- | |||||
# This is needed to avoid having methods and attributes of classes | |||||
# being shown multiple times. | |||||
numpydoc_show_class_members = False | |||||
# If True, members that a class inherits from a base class are included | |||||
# in the generated documentation. | |||||
# automodsumm_inherited_members = False | |||||
# -- Options for inheritance-graph extension --------------------------------- | |||||
inheritance_graph_attrs = dict( | |||||
fontsize=14, size=200, splines="spline", ratio="auto", rankdir="LR" | |||||
) | |||||
inheritance_node_attrs = dict(shape="ellipse", fontsize=14, height=0.75) | |||||
# Add custom stylesheets | |||||
def setup(app): | |||||
app.add_css_file("css/coverage.css") |
#!/usr/bin/env python | |||||
# -*- coding: utf-8 -*- | |||||
import os | |||||
import re | |||||
__author__ = "Nate Bohman" | |||||
__credits__ = ["Nate Bohman"] | |||||
__license__ = "LGPL-3" | |||||
__maintainer__ = "Nate Bohman" | |||||
__email__ = "natrinicle@natrinicle.com" | |||||
__status__ = "Production" | |||||
COVERAGE_PATH = os.path.abspath(os.path.dirname(__file__)) | |||||
source_regex = re.compile(r"<div id=\"source.*?</div>", re.DOTALL) | |||||
for filename in os.listdir(COVERAGE_PATH): | |||||
if filename.endswith("_py.html"): | |||||
# Cut off .html and add .source.html | |||||
source_only_filename = "{}.source.html".format(filename[:-5]) | |||||
with open(os.path.join(COVERAGE_PATH, filename), "r") as file: | |||||
contents = file.read() | |||||
source_div = source_regex.search(contents) | |||||
if source_div is not None: | |||||
with open( | |||||
os.path.join(COVERAGE_PATH, source_only_filename), "w" | |||||
) as output_file: | |||||
for line in source_div.group().split("\n"): | |||||
output_file.write("{}\n".format(line)) |
.. {{ cookiecutter.project_slug }} documentation master file, created by | |||||
sphinx-quickstart on Tue Jul 9 22:26:36 2013. | |||||
You can adapt this file completely to your liking, but it should at least | |||||
contain the root `toctree` directive. | |||||
Welcome to {{ cookiecutter.project_name }}'s documentation! | |||||
{{ '=' * (((cookiecutter.project_name | count) * 2) + ("Welcome to 's documentation!" | count)) }} | |||||
Contents: | |||||
.. toctree:: | |||||
:maxdepth: 2 | |||||
installation | |||||
usage | |||||
Indices and tables | |||||
================== | |||||
* :ref:`genindex` | |||||
* :ref:`modindex` | |||||
* :ref:`search` |
.. installation: | |||||
============ | |||||
Installation | |||||
============ | |||||
At the command line:: | |||||
$ python3 -m venv venv | |||||
$ source venv/bin/activate | |||||
$ pip install {{ cookiecutter.project_slug }} |
.. usage: | |||||
======== | |||||
Usage | |||||
======== | |||||
To use {{ cookiecutter.project_name }} in a project:: | |||||
import {{ cookiecutter.project_slug }} |
.. _{{ cookiecutter.project_slug }}.{{ cookiecutter.project_slug }}: | |||||
{{ cookiecutter.project_name }} | |||||
{{ '=' * cookiecutter.project_name | count }} | |||||
.. automodapi:: {{ cookiecutter.project_slug }}.{{ cookiecutter.project_slug }} | |||||
{{ cookiecutter.project_slug }}.{{ cookiecutter.project_slug }} Coverage | |||||
{{ '-' * (((cookiecutter.project_slug | count) * 2) + (". Coverage" | count)) }} | |||||
.. raw:: html | |||||
:file: ../coverage/{{ cookiecutter.project_slug }}_{{ cookiecutter.project_slug }}_py.source.html |
# NOTE: you have to use single-quoted strings in TOML for regular expressions. | |||||
# It's the equivalent of r-strings in Python. Multiline strings are treated as | |||||
# verbose regular expressions by Black. Use [ ] to denote a significant space | |||||
# character. | |||||
[tool.black] | |||||
line-length = 88 | |||||
include = '\.pyi?$' | |||||
exclude = ''' | |||||
/( | |||||
\.eggs | |||||
| \.git | |||||
| \.hg | |||||
| \.mypy_cache | |||||
| \.tox | |||||
| \.venv | |||||
| _build | |||||
| buck-out | |||||
| build | |||||
| dist | |||||
| tests/fixtures | |||||
| docs/source | |||||
)/ | |||||
''' |
-r requirements/prod.txt |
-r test.txt | |||||
black; python_version >= "3.6" | |||||
bumpversion | |||||
check-manifest | |||||
pre-commit | |||||
python-language-server[all] |
-r prod.txt | |||||
coverage | |||||
docutils | |||||
flake8 | |||||
mock | |||||
pygments | |||||
pylint==1.9.4; python_version >= "2.7" and python_version < "3.0" | |||||
pylint; python_version >= "3.4" | |||||
pylint-fail-under | |||||
pytest | |||||
pytest-cov | |||||
pytest-mock | |||||
pytest-runner | |||||
pytest-sugar | |||||
pytest-xdist | |||||
readme-renderer[md] | |||||
sphinx | |||||
sphinx-autodoc-typehints | |||||
sphinx-automodapi | |||||
tox | |||||
twine | |||||
watchdog | |||||
wheel |
[aliases] | |||||
test = pytest | |||||
[bdist_wheel] | |||||
# Only use the --universal setting, if: | |||||
# 1. Your project runs on Python 2 and 3 with no changes (i.e. it does not require 2to3). | |||||
# 2. Your project does not have any C extensions. | |||||
universal = 1 | |||||
[wheel] | |||||
universal = 1 | |||||
#[entry_points] | |||||
# Add here console scripts like: | |||||
# console_scripts = | |||||
# script_name = tsfresh.module:function | |||||
# For example: | |||||
# console_scripts = | |||||
# fibonacci = tsfresh.skeleton:run | |||||
# as well as other entry_points. | |||||
[bumpversion] | |||||
current_version = {{ cookiecutter.version }} | |||||
commit = True | |||||
tag = True | |||||
[bumpversion:file:setup.py] | |||||
[bumpversion:file:{{ cookiecutter.project_slug }}/__init__.py] | |||||
[coverage:run] | |||||
source = {{ cookiecutter.project_slug }} | |||||
[coverage:html] | |||||
directory = docs/source/coverage | |||||
title = "{{ cookiecutter.project_name }} Coverage Report" | |||||
[devpi:upload] | |||||
# Options for the devpi: PyPI server and packaging tool | |||||
formats = bdist_wheel,sdist.tgz | |||||
with-docs = 1 | |||||
[tool:pytest] | |||||
python_files = tests/*.py | |||||
filterwarnings = | |||||
ignore:.*You passed a bytestring.*This will not work on Python 3.*:DeprecationWarning | |||||
[build_sphinx] | |||||
all-files = True | |||||
source-dir = docs/source | |||||
build-dir = docs/build | |||||
builder = html | |||||
[flake8] | |||||
max-line-length = 100 | |||||
ignore = F401, W503 | |||||
exclude = .git,.tox,.venv,tests/*,build/*,doc/_build/*,sphinx/search/*,doc/usage/extensions/example*.py | |||||
application-import-names = {{ cookiecutter.project_slug }} | |||||
import-order-style = smarkets |
#!/usr/bin/env python | |||||
# -*- coding: utf-8 -*- | |||||
import pip | |||||
try: # for pip >= 10 | |||||
from pip._internal.req import parse_requirements | |||||
except ImportError: # for pip <= 9.0.3 | |||||
from pip.req import parse_requirements | |||||
try: | |||||
from setuptools import setup | |||||
except ImportError: | |||||
from distutils.core import setup | |||||
with open("README.md") as readme_file: | |||||
readme = readme_file.read() | |||||
with open("HISTORY.md") as history_file: | |||||
history = history_file.read() | |||||
github_url = "https://github.com/{{ cookiecutter.github_username }}/{{ cookiecutter.project_slug }}" | |||||
## workaround derived from: https://github.com/pypa/pip/issues/7645#issuecomment-578210649 | |||||
parsed_requirements = parse_requirements("requirements/prod.txt", session="workaround") | |||||
parsed_dev_requirements = parse_requirements( | |||||
"requirements/dev.txt", session="workaround" | |||||
) | |||||
parsed_test_requirements = parse_requirements( | |||||
"requirements/test.txt", session="workaround" | |||||
) | |||||
requirements = [str(ir.req) for ir in parsed_requirements] | |||||
dev_requirements = [str(ir.req) for ir in parsed_dev_requirements] | |||||
test_requirements = [str(tr.req) for tr in parsed_test_requirements] | |||||
setup( | |||||
name="{{ cookiecutter.project_slug }}", | |||||
version="{{ cookiecutter.version }}", | |||||
description="{{ cookiecutter.project_short_description }}", | |||||
long_description=readme + "\n\n" + history, | |||||
long_description_content_type="text/markdown", | |||||
author="{{ cookiecutter.full_name }}", | |||||
author_email="{{ cookiecutter.email }}", | |||||
url=github_url, | |||||
license="LGPL-3", | |||||
keywords="{{ cookiecutter.project_slug }}", | |||||
project_urls={"Source": github_url}, | |||||
packages=[ | |||||
"{{ cookiecutter.project_slug }}", | |||||
], | |||||
package_dir={"{{ cookiecutter.project_slug }}": "{{ cookiecutter.project_slug }}"}, | |||||
include_package_data=True, | |||||
install_requires=requirements, | |||||
extras_require={"dev": dev_requirements}, | |||||
tests_require=test_requirements, | |||||
test_suite="tests", | |||||
zip_safe=False, | |||||
classifiers=[ | |||||
"Programming Language :: Python :: 3", | |||||
"License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)", | |||||
"Operating System :: POSIX :: Linux", | |||||
"Natural Language :: English", | |||||
], | |||||
) |
# -*- coding: utf-8 -*- |
# -*- coding: utf-8 -*- | |||||
""" | |||||
Conftest Fixtures | |||||
pytest looks for conftest.py modules throughout the directory structure. Each | |||||
conftest.py provides configuration for the file tree pytest finds it in. You can | |||||
use any fixtures that are defined in a particular conftest.py throughout the file’s | |||||
parent directory and in any subdirectories. This is a great place to put your most | |||||
widely used fixtures. | |||||
""" | |||||
from __future__ import ( | |||||
absolute_import, | |||||
division, | |||||
print_function, | |||||
with_statement, | |||||
unicode_literals, | |||||
) | |||||
import logging | |||||
import os | |||||
import mock | |||||
import pytest | |||||
logger = logging.getLogger(__name__) # pylint: disable=invalid-name | |||||
FIXTURE_PATH = "{}/fixtures".format(os.path.dirname(os.path.abspath(__file__))) | |||||
@pytest.fixture | |||||
def os_path_mock(monkeypatch): | |||||
"""Disable looking up actual paths.""" | |||||
def _return_same(arg): | |||||
return arg | |||||
def _expand_user_mock(path): | |||||
if not path.startswith("~"): | |||||
return path | |||||
if path == "~": | |||||
return "/home/user" | |||||
return "/home/{}".format(path[1:]) | |||||
os_path_mock = mock.Mock() | |||||
attrs = { | |||||
"expanduser.side_effect": _expand_user_mock, | |||||
"realpath.side_effect": _return_same, | |||||
"abspath.side_effect": _return_same, | |||||
} | |||||
os_path_mock.configure_mock(**attrs) | |||||
return os_path_mock |
# -*- coding: utf-8 -*- | |||||
""" | |||||
Tests for `{{ cookiecutter.project_slug }}` module. | |||||
""" | |||||
from __future__ import ( | |||||
absolute_import, | |||||
division, | |||||
print_function, | |||||
with_statement, | |||||
unicode_literals | |||||
) | |||||
import logging | |||||
import pytest | |||||
from {{ cookiecutter.project_slug }} import {{ (cookiecutter.project_slug.title()).replace('_', '') }} | |||||
logger = logging.getLogger(__name__) # pylint: disable=invalid-name | |||||
FIXTURE_PATH = "{}/fixtures".format(os.path.dirname(os.path.abspath(__file__))) | |||||
class Test{{ (cookiecutter.project_slug.title()).replace('_', '') }}: | |||||
def test_one(self): | |||||
pass | |||||
def test_two(self): | |||||
pass |
[tox] | |||||
envlist = cov_init, py{37,38,39}, cov_report, docs, bandit, pylint | |||||
[testenv] | |||||
basepython = | |||||
py37: {env:TOXPYTHON:python3.7} | |||||
py38: {env:TOXPYTHON:python3.8} | |||||
py39: {env:TOXPYTHON:python3.9} | |||||
{bandit,cov_init,cov_report,docs,lint,pur,pylint}: {env:TOXPYTHON:python3} | |||||
setenv = | |||||
COVERAGE_FILE=.coverage.{envname} | |||||
PYTHONPATH={toxinidir}:{toxinidir}/{{ cookiecutter.project_slug }} | |||||
PYTHONUNBUFFERED=yes | |||||
HOME={env:HOME:/tmp} | |||||
passenv = COVERAGE_FILE PYTHONPATH PYTHONUNBUFFERED HOME | |||||
skip_missing_interpreters = True | |||||
alwayscopy = True | |||||
deps = | |||||
-r {toxinidir}/requirements/test.txt | |||||
commands = | |||||
pytest --durations 25 \ | |||||
--basetemp={envtmpdir} \ | |||||
--confcutdir=.. \ | |||||
--cov \ | |||||
-n 0 \ | |||||
{posargs} | |||||
[testenv:cov_init] | |||||
deps = | |||||
coverage | |||||
skip_install = True | |||||
commands = | |||||
coverage erase | |||||
[testenv:cov_report] | |||||
deps = | |||||
coverage | |||||
skip_install = True | |||||
commands = | |||||
coverage combine | |||||
coverage html | |||||
{toxinidir}/docs/source/coverage/extract_source.py | |||||
[testenv:lint] | |||||
deps = | |||||
pre-commit | |||||
twine | |||||
ignore_errors = True | |||||
commands = | |||||
twine check {distdir}/* | |||||
pre-commit run --all-files | |||||
[testenv:pur] | |||||
deps = | |||||
pur | |||||
skip_install = True | |||||
description = | |||||
Update all versioned packages in requirements.txt files | |||||
commands = | |||||
pur -r requirements-all.txt | |||||
[testenv:pylint] | |||||
deps = | |||||
pylint==1.9.4; python_version >= "2.7" and python_version < "3.0" | |||||
pylint; python_version >= "3.4" | |||||
pylint-fail-under | |||||
skip_install = True | |||||
commands = | |||||
pylint-fail-under --rcfile=.pylintrc --fail_under 9.5 {{ cookiecutter.project_slug }} | |||||
[testenv:bandit] | |||||
deps = | |||||
bandit | |||||
skip_install = True | |||||
commands = | |||||
bandit -r {{ cookiecutter.project_slug }} | |||||
[testenv:docs] | |||||
deps = | |||||
-r {toxinidir}/requirements/dev.txt | |||||
skip_install = True | |||||
description = | |||||
Invoke sphinx-build to build the HTML docs | |||||
commands = | |||||
sphinx-build -b linkcheck | |||||
sphinx-build -b html -q {posargs} |
#!/usr/bin/env python | |||||
# -*- coding: utf-8 -*- | |||||
""" | |||||
{{ cookiecutter.project_slug }} | |||||
{{ '-' * cookiecutter.project_slug | count }} | |||||
{{ cookiecutter.project_short_description }} | |||||
""" | |||||
from __future__ import ( | |||||
absolute_import, | |||||
division, | |||||
print_function, | |||||
with_statement, | |||||
unicode_literals, | |||||
) | |||||
from pkgutil import extend_path | |||||
__path__ = extend_path(__path__, __name__) | |||||
from .{{ cookiecutter.project_slug }} import {{ (cookiecutter.project_slug.title()).replace('_', '') }} | |||||
__all__ = ["{{ (cookiecutter.project_slug.title()).replace('_', '') }}"] |
import sys | |||||
# https://lucumr.pocoo.org/2013/5/21/porting-to-python-3-redux/ | |||||
# https://github.com/tony/cookiecutter-pypackage-pythonic/blob/master/%7B%7Bcookiecutter.repo_name%7D%7D/%7B%7Bcookiecutter.repo_name%7D%7D/_compat.py | |||||
PY2 = sys.version_info[0] == 2 | |||||
_identity = lambda x: x | |||||
if PY2: | |||||
unichr = unichr | |||||
text_type = unicode | |||||
string_types = (str, unicode) | |||||
integer_types = (int, long) | |||||
from urllib import urlretrieve | |||||
text_to_native = lambda s, enc: s.encode(enc) | |||||
iterkeys = lambda d: d.iterkeys() | |||||
itervalues = lambda d: d.itervalues() | |||||
iteritems = lambda d: d.iteritems() | |||||
from cStringIO import StringIO as BytesIO | |||||
from StringIO import StringIO | |||||
import cPickle as pickle | |||||
import ConfigParser as configparser | |||||
from itertools import izip, imap | |||||
range_type = xrange | |||||
cmp = cmp | |||||
input = raw_input | |||||
from string import lower as ascii_lowercase | |||||
import urlparse | |||||
def console_to_str(s): | |||||
return s.decode("utf_8") | |||||
exec("def reraise(tp, value, tb=None):\n raise tp, value, tb") | |||||
else: | |||||
unichr = chr | |||||
text_type = str | |||||
string_types = (str,) | |||||
integer_types = (int,) | |||||
text_to_native = lambda s, enc: s | |||||
iterkeys = lambda d: iter(d.keys()) | |||||
itervalues = lambda d: iter(d.values()) | |||||
iteritems = lambda d: iter(d.items()) | |||||
from io import StringIO, BytesIO | |||||
import pickle | |||||
import configparser | |||||
izip = zip | |||||
imap = map | |||||
range_type = range | |||||
cmp = lambda a, b: (a > b) - (a < b) | |||||
input = input | |||||
from string import ascii_lowercase | |||||
import urllib.parse as urllib | |||||
import urllib.parse as urlparse | |||||
from urllib.request import urlretrieve | |||||
console_encoding = sys.__stdout__.encoding | |||||
def console_to_str(s): | |||||
""" From pypa/pip project, pip.backwardwardcompat. License MIT. """ | |||||
try: | |||||
return s.decode(console_encoding) | |||||
except UnicodeDecodeError: | |||||
return s.decode("utf_8") | |||||
def reraise(tp, value, tb=None): | |||||
if value.__traceback__ is not tb: | |||||
raise (value.with_traceback(tb)) | |||||
raise value | |||||
number_types = integer_types + (float,) |
#!/usr/bin/env python | |||||
# -*- coding: utf-8 -*- | |||||
from __future__ import ( | |||||
absolute_import, | |||||
division, | |||||
print_function, | |||||
with_statement, | |||||
unicode_literals | |||||
) | |||||
import logging | |||||
__author__ = "{{ cookiecutter.full_name }}" | |||||
__credits__ = ["{{ cookiecutter.full_name }}"] | |||||
__maintainer__ = "{{ cookiecutter.full_name }}" | |||||
__email__ = "{{ cookiecutter.email }}" | |||||
__license__ = "{{ cookiecutter.license }}" | |||||
__status__ = "{{ cookiecutter.status }}" | |||||
logger = logging.getLogger(__name__) # pylint: disable=invalid-name | |||||
class {{ (cookiecutter.project_slug.title()).replace('_', '') }}: | |||||
"""This is a description of the class.""" | |||||
def __init__(self): | |||||
"""Initialization method.""" | |||||
pass |