diff --git a/.github/workflows/test_docker.yml b/.github/workflows/test_docker.yml index f8739ac..fa60dbe 100644 --- a/.github/workflows/test_docker.yml +++ b/.github/workflows/test_docker.yml @@ -7,11 +7,11 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - version: ['37'] + version: ['38'] container: image: registry.fedoraproject.org/fedora:${{ matrix.version }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up container run: | dnf install -y dnf-plugins-core langpacks-en @@ -45,7 +45,7 @@ jobs: container: image: ubuntu:${{ matrix.version }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up container env: DEBIAN_FRONTEND: noninteractive diff --git a/.github/workflows/test_tox.yml b/.github/workflows/test_tox.yml index fd8d2f2..2b08048 100644 --- a/.github/workflows/test_tox.yml +++ b/.github/workflows/test_tox.yml @@ -17,19 +17,91 @@ jobs: - python-version: '3.7' toxenv: 'py37' - python-version: '3.8' - toxenv: 'py38,coverage,codecov' + toxenv: 'py38' - python-version: '3.9' toxenv: 'py39' - python-version: '3.10' toxenv: 'py310' - python-version: '3.11' toxenv: 'py311' + container: + image: ubuntu:22.04 + steps: + - uses: actions/checkout@v3 + - name: Set up container + env: + DEBIAN_FRONTEND: noninteractive + run: | + apt-get update -q + apt-get install -y libterm-readline-gnu-perl locales software-properties-common + locale-gen en_US.UTF-8 + ln -f -s /usr/share/zoneinfo/UTC /etc/localtime + - name: Install dependencies + env: + DEBIAN_FRONTEND: noninteractive + run: | + add-apt-repository -y universe + add-apt-repository -y ppa:deadsnakes/ppa + add-apt-repository -y ppa:gift/dev + apt-get update -q + apt-get install -y build-essential git libffi-dev python${{ matrix.python-version }} python${{ matrix.python-version }}-dev python${{ matrix.python-version }}-venv python3-distutils python3-pip python3-setuptools + - name: Install tox + run: | + python3 -m pip install tox + - name: Run tests + env: + LANG: en_US.UTF-8 + run: | + tox -e${{ matrix.toxenv }} + coverage: + runs-on: ubuntu-latest + strategy: + matrix: + include: + - python-version: '3.11' + toxenv: 'py311,coverage' + container: + image: ubuntu:22.04 + steps: + - uses: actions/checkout@v3 + - name: Set up container + env: + DEBIAN_FRONTEND: noninteractive + run: | + apt-get update -q + apt-get install -y libterm-readline-gnu-perl locales software-properties-common + locale-gen en_US.UTF-8 + ln -f -s /usr/share/zoneinfo/UTC /etc/localtime + - name: Install dependencies + env: + DEBIAN_FRONTEND: noninteractive + run: | + add-apt-repository -y universe + add-apt-repository -y ppa:deadsnakes/ppa + add-apt-repository -y ppa:gift/dev + apt-get update -q + apt-get install -y build-essential git libffi-dev python${{ matrix.python-version }} python${{ matrix.python-version }}-dev python${{ matrix.python-version }}-venv python3-distutils python3-pip python3-setuptools + - name: Install tox + run: | + python3 -m pip install tox + - name: Run tests with coverage + env: + LANG: en_US.UTF-8 + run: | + tox -e${{ matrix.toxenv }} + - name: Upload coverage report to Codecov + uses: codecov/codecov-action@v3 + lint: + runs-on: ubuntu-latest + strategy: + matrix: + include: - python-version: '3.11' toxenv: 'lint' container: image: ubuntu:22.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up container env: DEBIAN_FRONTEND: noninteractive @@ -50,7 +122,7 @@ jobs: - name: Install tox run: | python3 -m pip install tox - - name: Run tests + - name: Run linter env: LANG: en_US.UTF-8 run: | diff --git a/.pylintrc b/.pylintrc index 876da94..446e1e6 100644 --- a/.pylintrc +++ b/.pylintrc @@ -1,4 +1,4 @@ -# Pylint 2.14.x configuration file +# Pylint 2.17.x configuration file # # This file is generated by l2tdevtools update-dependencies.py, any dependency # related changes should be made in dependencies.ini. @@ -9,6 +9,10 @@ # only in one or another interpreter, leading to false positives when analysed. analyse-fallback-blocks=no +# Clear in-memory caches upon conclusion of linting. Useful if running pylint +# in a server-like mode. +clear-cache-post-run=no + # Load and enable all available extensions. Use --list-extensions to see a list # all available extensions. #enable-all-extensions= @@ -38,7 +42,7 @@ extension-pkg-whitelist= # specified are enabled, while categories only check already-enabled messages. fail-on= -# Specify a score threshold to be exceeded before program exits with error. +# Specify a score threshold under which the program will exit with error. fail-under=10 # Interpret the stdin as a python script, whose filename needs to be passed as @@ -48,13 +52,15 @@ fail-under=10 # Files or directories to be skipped. They should be base names, not paths. ignore=CVS -# Add files or directories matching the regex patterns to the ignore-list. The -# regex matches against paths and can be in Posix or Windows format. +# Add files or directories matching the regular expressions patterns to the +# ignore-list. The regex matches against paths and can be in Posix or Windows +# format. Because '\\' represents the directory delimiter on Windows systems, +# it can't be used as an escape character. ignore-paths= -# Files or directories matching the regex patterns are skipped. The regex -# matches against base names, not paths. The default value ignores Emacs file -# locks +# Files or directories matching the regular expression patterns are skipped. +# The regex matches against base names, not paths. The default value ignores +# Emacs file locks ignore-patterns=^\.# # List of module names for which member attributes should not be checked @@ -93,6 +99,12 @@ py-version=3.11 # recursive=no recursive=yes +# Add paths to the list of the source roots. Supports globbing patterns. The +# source root is an absolute path or a path relative to the current working +# directory used to determine a package namespace for modules located under the +# source root. +source-roots= + # When enabled, pylint would attempt to guess common misconfiguration and emit # user-friendly hints instead of false-positive error messages. suggestion-mode=yes @@ -105,229 +117,6 @@ unsafe-load-any-extension=no #verbose= -[REPORTS] - -# Python expression which should return a score less than or equal to 10. You -# have access to the variables 'fatal', 'error', 'warning', 'refactor', -# 'convention', and 'info' which contain the number of messages in each -# category, as well as 'statement' which is the total number of statements -# analyzed. This score is used by the global evaluation report (RP0004). -evaluation=max(0, 0 if fatal else 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= - -# 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= - -# Tells whether to display a full report or only the messages. -reports=no - -# Activate the evaluation score. -# score=yes -score=no - - -[MESSAGES CONTROL] - -# Only show warnings with the listed confidence levels. Leave empty to show -# all. Valid levels: HIGH, CONTROL_FLOW, INFERENCE, INFERENCE_FAILURE, -# UNDEFINED. -confidence=HIGH, - CONTROL_FLOW, - INFERENCE, - INFERENCE_FAILURE, - UNDEFINED - -# 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 re-enable 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=assignment-from-none, - bad-inline-option, - consider-using-f-string, - deprecated-pragma, - duplicate-code, - file-ignored, - fixme, - locally-disabled, - logging-format-interpolation, - logging-fstring-interpolation, - missing-param-doc, - raise-missing-from, - raw-checker-failed, - super-with-arguments, - suppressed-message, - too-few-public-methods, - too-many-ancestors, - too-many-boolean-expressions, - too-many-branches, - too-many-instance-attributes, - too-many-lines, - too-many-locals, - too-many-nested-blocks, - too-many-public-methods, - too-many-return-statements, - too-many-statements, - unsubscriptable-object, - useless-object-inheritance, - useless-suppression - -# 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 - - -[VARIABLES] - -# List of additional names supposed to be defined in builtins. Remember that -# you should avoid defining new builtins when possible. -additional-builtins= - -# Tells whether unused global variables should be treated as a violation. -allow-global-unused-variables=yes - -# List of names allowed to shadow builtins -allowed-redefined-builtins= - -# 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 - - -[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 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 symbolic message names to ignore for Mixin members. -ignored-checks-for-mixins=no-member, - not-async-context-manager, - not-context-manager, - attribute-defined-outside-init - -# 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,argparse.Namespace - -# 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 - -# Regex pattern to define which classes are considered mixins. -mixin-class-rgx=.*[Mm]ixin - -# List of decorators that change the signature of a decorated function. -signature-mutators= - - -[LOGGING] - -# The type of string formatting that logging methods do. `old` means using % -# formatting, `new` is for `{}` formatting. -logging-format-style=old - -# Logging modules to check that the string format arguments are in logging -# function parameter format. -logging-modules=logging - - -[DESIGN] - -# List of regular expressions of class ancestor names to ignore when counting -# public methods (see R0903) -exclude-too-few-public-methods= - -# List of qualified class names to ignore when counting class parents (see -# R0901) -ignored-parents= - -# Maximum number of arguments for function / method. -# max-args=5 -max-args=10 - -# Maximum number of attributes for a class (see R0902). -max-attributes=7 - -# Maximum number of boolean expressions in an if statement (see R0916). -max-bool-expr=5 - -# 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=6 - -# 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 - - [BASIC] # Naming style matching correct argument names. @@ -460,6 +249,10 @@ no-docstring-rgx=^_ # These decorators are taken in consideration only for invalid-name. property-classes=abc.abstractproperty +# Regular expression matching correct type alias names. If left empty, type +# alias names will be checked with the set naming style. +#typealias-rgx= + # Regular expression matching correct type variable names. If left empty, type # variable names will be checked with the set naming style. #typevar-rgx= @@ -474,13 +267,6 @@ variable-naming-style=snake_case variable-rgx=(([a-z][a-z0-9_]*)|(_[a-z0-9_]*))$ -[EXCEPTIONS] - -# Exceptions that will emit a warning when caught. -overgeneral-exceptions=BaseException, - Exception - - [CLASSES] # Warn about protected attribute access inside special methods @@ -490,41 +276,76 @@ check-protected-access-in-special-methods=no defining-attr-methods=__init__, __new__, setUp, + asyncSetUp, __post_init__ # List of member names, which should be excluded from the protected access # warning. -exclude-protected=_asdict, - _fields, - _replace, - _source, - _make +exclude-protected=_asdict,_fields,_replace,_source,_make,os._exit # 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=mcs valid-metaclass-classmethod-first-arg=cls -[MISCELLANEOUS] +[DESIGN] -# List of note tags to take in consideration, separated by a comma. -notes=FIXME, - XXX, - TODO +# List of regular expressions of class ancestor names to ignore when counting +# public methods (see R0903) +exclude-too-few-public-methods= -# Regular expression of note tags to take in consideration. -notes-rgx= +# List of qualified class names to ignore when counting class parents (see +# R0901) +ignored-parents= +# Maximum number of arguments for function / method. +# max-args=5 +max-args=10 -[FORMAT] +# Maximum number of attributes for a class (see R0902). +max-attributes=7 -# Expected format of line ending, e.g. empty (any line ending), LF or CRLF. -expected-line-ending-format= +# Maximum number of boolean expressions in an if statement (see R0916). +max-bool-expr=5 -# Regexp for a line that is allowed to be longer than the limit. -ignore-long-lines=^\s*(# )??$ +# 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=6 + +# 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 + + +[EXCEPTIONS] + +# Exceptions that will emit a warning when caught. +overgeneral-exceptions=builtins.BaseException,builtins.Exception + + +[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*(# )??$ # Number of spaces of indent required inside a hanging or continued line. indent-after-paren=4 @@ -550,6 +371,188 @@ single-line-class-stmt=no single-line-if-stmt=no +[IMPORTS] + +# List of modules that can be imported at any level, not just the top level +# one. +allow-any-import-level= + +# Allow explicit reexports by alias from a package __init__. +allow-reexport-from-package=no + +# Allow wildcard imports from modules that define __all__. +allow-wildcard-with-all=no + +# Deprecated modules which should not be used, separated by a comma. +deprecated-modules= + +# Output a graph (.gv or any supported image format) of external dependencies +# to the given file (report RP0402 must not be disabled). +ext-import-graph= + +# Output a graph (.gv or any supported image format) of all (i.e. internal and +# external) dependencies to the given file (report RP0402 must not be +# disabled). +import-graph= + +# Output a graph (.gv or any supported image format) of internal dependencies +# to 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 + +# Couples of modules and preferred modules, separated by a comma. +preferred-modules= + + +[LOGGING] + +# The type of string formatting that logging methods do. `old` means using % +# formatting, `new` is for `{}` formatting. +logging-format-style=old + +# Logging modules to check that the string format arguments are in logging +# function parameter format. +logging-modules=logging + + +[MESSAGES CONTROL] + +# Only show warnings with the listed confidence levels. Leave empty to show +# all. Valid levels: HIGH, CONTROL_FLOW, INFERENCE, INFERENCE_FAILURE, +# UNDEFINED. +confidence=HIGH, + CONTROL_FLOW, + INFERENCE, + INFERENCE_FAILURE, + UNDEFINED + +# 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 re-enable 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=assignment-from-none, + bad-inline-option, + consider-using-f-string, + deprecated-pragma, + duplicate-code, + file-ignored, + fixme, + locally-disabled, + logging-format-interpolation, + logging-fstring-interpolation, + missing-param-doc, + raise-missing-from, + raw-checker-failed, + super-with-arguments, + suppressed-message, + too-few-public-methods, + too-many-ancestors, + too-many-boolean-expressions, + too-many-branches, + too-many-instance-attributes, + too-many-lines, + too-many-locals, + too-many-nested-blocks, + too-many-public-methods, + too-many-return-statements, + too-many-statements, + unsubscriptable-object, + useless-object-inheritance, + useless-suppression, + use-symbolic-message-instead + +# 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 + + +[METHOD_ARGS] + +# List of qualified names (i.e., library.method) which require a timeout +# parameter e.g. 'requests.api.get,requests.api.post' +timeout-methods=requests.api.delete,requests.api.get,requests.api.head,requests.api.options,requests.api.patch,requests.api.post,requests.api.put,requests.api.request + + +[MISCELLANEOUS] + +# List of note tags to take in consideration, separated by a comma. +notes=FIXME, + XXX, + TODO + +# Regular expression of note tags to take in consideration. +notes-rgx= + + +[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,argparse.parse_error + + +[REPORTS] + +# Python expression which should return a score less than or equal to 10. You +# have access to the variables 'fatal', 'error', 'warning', 'refactor', +# 'convention', and 'info' which contain the number of messages in each +# category, as well as 'statement' which is the total number of statements +# analyzed. This score is used by the global evaluation report (RP0004). +evaluation=max(0, 0 if fatal else 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= + +# 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= + +# Tells whether to display a full report or only the messages. +reports=no + +# Activate the evaluation score. +# score=yes +score=no + + +[SIMILARITIES] + +# Comments are removed from the similarity computation +ignore-comments=yes + +# Docstrings are removed from the similarity computation +ignore-docstrings=yes + +# Imports are removed from the similarity computation +ignore-imports=yes + +# Signatures are removed from the similarity computation +ignore-signatures=yes + +# Minimum lines number of a similarity. +min-similarity-lines=4 + + [SPELLING] # Limits count of emitted suggestions for spelling mistakes. @@ -579,24 +582,6 @@ spelling-private-dict-file= spelling-store-unknown-words=no -[SIMILARITIES] - -# Comments are removed from the similarity computation -ignore-comments=yes - -# Docstrings are removed from the similarity computation -ignore-docstrings=yes - -# Imports are removed from the similarity computation -ignore-imports=yes - -# Signatures are removed from the similarity computation -ignore-signatures=yes - -# Minimum lines number of a similarity. -min-similarity-lines=4 - - [STRING] # This flag controls whether inconsistent-quotes generates a warning when the @@ -608,49 +593,87 @@ check-quote-consistency=no check-str-concat-over-line-jumps=no -[IMPORTS] +[TYPECHECK] -# List of modules that can be imported at any level, not just the top level -# one. -allow-any-import-level= +# 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 -# Allow wildcard imports from modules that define __all__. -allow-wildcard-with-all=no +# 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= -# Deprecated modules which should not be used, separated by a comma. -deprecated-modules= +# Tells whether to warn about missing members when the owner of the attribute +# is inferred to be None. +ignore-none=yes -# Output a graph (.gv or any supported image format) of external dependencies -# to the given file (report RP0402 must not be disabled). -ext-import-graph= +# 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 -# Output a graph (.gv or any supported image format) of all (i.e. internal and -# external) dependencies to the given file (report RP0402 must not be -# disabled). -import-graph= +# List of symbolic message names to ignore for Mixin members. +ignored-checks-for-mixins=no-member, + not-async-context-manager, + not-context-manager, + attribute-defined-outside-init -# Output a graph (.gv or any supported image format) of internal dependencies -# to the given file (report RP0402 must not be disabled). -int-import-graph= +# 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,argparse.Namespace -# Force import order to recognize a module as part of the standard -# compatibility libraries. -known-standard-library= +# 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 -# Force import order to recognize a module as part of a third party library. -known-third-party=enchant +# 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 -# Couples of modules and preferred modules, separated by a comma. -preferred-modules= +# 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 +# Regex pattern to define which classes are considered mixins. +mixin-class-rgx=.*[Mm]ixin -[REFACTORING] +# List of decorators that change the signature of a decorated function. +signature-mutators= -# 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,argparse.parse_error +[VARIABLES] + +# List of additional names supposed to be defined in builtins. Remember that +# you should avoid defining new builtins when possible. +additional-builtins= + +# Tells whether unused global variables should be treated as a violation. +allow-global-unused-variables=yes + +# List of names allowed to shadow builtins +allowed-redefined-builtins= + +# 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. +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 diff --git a/appveyor.yml b/appveyor.yml index 0a41aa5..f7e7a8a 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -18,8 +18,6 @@ environment: install: - cmd: "%PYTHON%\\python.exe -m pip install -U pip setuptools twine wheel" -- cmd: "%PYTHON%\\python.exe -m pip install pywin32 WMI" -- cmd: "%PYTHON%\\python.exe %PYTHON%\\Scripts\\pywin32_postinstall.py -install" - ps: If ($isWindows) { .\config\appveyor\install.ps1 } - sh: config/appveyor/install.sh diff --git a/config/appveyor/install.ps1 b/config/appveyor/install.ps1 index 7253689..95eecae 100644 --- a/config/appveyor/install.ps1 +++ b/config/appveyor/install.ps1 @@ -1,11 +1,12 @@ # Script to set up tests on AppVeyor Windows. $Dependencies = "" -$Dependencies = ${Dependencies} -split " " -If (i$Dependencies.Count -gt 0) +If ($Dependencies.Length -gt 0) { - $Output = Invoke-Expression -Command "git clone https://github.com/log2timeline/l2tdevtools.git ..\l2tdevtools 2>&1 | %{ '$_' }" + $Dependencies = ${Dependencies} -split " " + + $Output = Invoke-Expression -Command "git clone https://github.com/log2timeline/l2tdevtools.git ..\l2tdevtools 2>&1" | %{ "$_" } Write-Host (${Output} | Out-String) If ($env:APPVEYOR_REPO_BRANCH -eq "main") @@ -20,7 +21,7 @@ If (i$Dependencies.Count -gt 0) $env:PYTHONPATH = "..\l2tdevtools" - $Output = Invoke-Expression -Command "& '${env:PYTHON}\python.exe' ..\l2tdevtools\tools\update.py --download-directory dependencies --machine-type ${env:MACHINE_TYPE} --msi-targetdir ${env:PYTHON} --track ${env:L2TBINARIES_TRACK} ${Dependencies} 2>&1" + $Output = Invoke-Expression -Command "& '${env:PYTHON}\python.exe' ..\l2tdevtools\tools\update.py --download-directory dependencies --machine-type ${env:MACHINE_TYPE} --track ${env:L2TBINARIES_TRACK} ${Dependencies} 2>&1" | %{ "$_" } Write-Host (${Output} | Out-String) } diff --git a/setup.py b/setup.py index 9f7a9d0..84dedff 100755 --- a/setup.py +++ b/setup.py @@ -12,11 +12,6 @@ except ImportError: from distutils.core import find_packages, setup -try: - from distutils.command.bdist_msi import bdist_msi -except ImportError: - bdist_msi = None - try: from distutils.command.bdist_rpm import bdist_rpm except ImportError: @@ -34,22 +29,6 @@ import vstools # pylint: disable=wrong-import-position -if not bdist_msi: - BdistMSICommand = None -else: - class BdistMSICommand(bdist_msi): - """Custom handler for the bdist_msi command.""" - - # pylint: disable=invalid-name - def run(self): - """Builds an MSI.""" - # Command bdist_msi does not support the library version, neither a date - # as a version but if we suffix it with .1 everything is fine. - self.distribution.metadata.version += '.1' - - bdist_msi.run(self) - - if not bdist_rpm: BdistRPMCommand = None else: @@ -195,8 +174,6 @@ def parse_requirements_from_file(path): 'Visual Studio tools for the libyal projects.') command_classes = {} -if BdistMSICommand: - command_classes['bdist_msi'] = BdistMSICommand if BdistRPMCommand: command_classes['bdist_rpm'] = BdistRPMCommand diff --git a/tox.ini b/tox.ini index bdb3ee7..02953e3 100644 --- a/tox.ini +++ b/tox.ini @@ -18,23 +18,7 @@ commands = py3{7,8,9,10,11}: ./run_tests.py coverage: coverage erase coverage: coverage run --source=vstools --omit="*_test*,*__init__*,*test_lib*" run_tests.py - -[testenv:codecov] -skip_install = True -passenv = - CFLAGS - CPPFLAGS - GITHUB_ACTION - GITHUB_HEAD_REF - GITHUB_REF - GITHUB_REPOSITORY - GITHUB_RUN_ID - GITHUB_SHA - LDFLAGS -deps = - codecov < 2.1.10 -commands = - codecov + coverage: coverage xml [testenv:lint] skipsdist = True @@ -48,10 +32,7 @@ setenv = deps = -rrequirements.txt -rtest_requirements.txt - pylint >= 2.14.0, < 2.15.0 + pylint >= 2.17.0, < 2.18.0 commands = pylint --version - # Ignore setup.py for now due to: - # setup.py:15:0: E0001: Cannot import 'distutils.command.bdist_msi' due to - # syntax error 'expected an indented block (, line 347)' (syntax-error) - pylint --rcfile=.pylintrc scripts tests vstools + pylint --rcfile=.pylintrc scripts setup.py tests vstools diff --git a/vstools/libyal.py b/vstools/libyal.py index 49c3749..1f65cf8 100644 --- a/vstools/libyal.py +++ b/vstools/libyal.py @@ -1035,7 +1035,7 @@ def Convert(self, input_directory, output_version): '\tMakefile.in', '', 'distclean: clean', - '\t/bin/rm -f Makefile', + '\t-rm -f Makefile', '', ''])