-
Notifications
You must be signed in to change notification settings - Fork 236
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
24 changed files
with
414 additions
and
90 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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# 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: | ||
|
||
# Optionally set the version of Python and requirements required to build your docs | ||
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
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
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,38 @@ | ||
# The inspect.formatargspec() function was dropped in Python 3.11 but we need | ||
# need it for when constructing signature changing decorators based on result of | ||
# inspect.getargspec() or inspect.getfullargspec(). The code here implements | ||
# inspect.formatargspec() base on Parameter and Signature from inspect module, | ||
# which were added in Python 3.6. Thanks to Cyril Jouve for the implementation. | ||
|
||
try: | ||
from inspect import Parameter, Signature | ||
except ImportError: | ||
from inspect import formatargspec | ||
else: | ||
def formatargspec(args, varargs=None, varkw=None, defaults=None, | ||
kwonlyargs=(), kwonlydefaults={}, annotations={}): | ||
if kwonlydefaults is None: | ||
kwonlydefaults = {} | ||
ndefaults = len(defaults) if defaults else 0 | ||
parameters = [ | ||
Parameter( | ||
arg, | ||
Parameter.POSITIONAL_OR_KEYWORD, | ||
default=defaults[i] if i >= 0 else Parameter.empty, | ||
annotation=annotations.get(arg, Parameter.empty), | ||
) for i, arg in enumerate(args, ndefaults - len(args)) | ||
] | ||
if varargs: | ||
parameters.append(Parameter(varargs, Parameter.VAR_POSITIONAL)) | ||
parameters.extend( | ||
Parameter( | ||
kwonlyarg, | ||
Parameter.KEYWORD_ONLY, | ||
default=kwonlydefaults.get(kwonlyarg, Parameter.empty), | ||
annotation=annotations.get(kwonlyarg, Parameter.empty), | ||
) for kwonlyarg in kwonlyargs | ||
) | ||
if varkw: | ||
parameters.append(Parameter(varkw, Parameter.VAR_KEYWORD)) | ||
return_annotation = annotations.get('return', Signature.empty) | ||
return str(Signature(parameters, return_annotation=return_annotation)) |
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
Oops, something went wrong.