[gh-actions] python = 3.9: py39 3.10: py310 # 3.8: py38, rst_linux, rst_mac, readme, linters, coverage-report, qa # 3.11: py311, rst_linux, rst_mac, readme, linters, coverage-report, qa 3.11: py311, rst_linux, rst_mac, readme, coverage-report # 3.9: py39 # 3.10: py310 [tox] # todo: add back the linters and qa # envlist = py39, py310, py311, rst_linux, rst_mac, readme, rst, linters, coverage-report, qa envlist = py39, py310, py311, rst_linux, rst_mac, readme, rst, coverage-report [testenv] ; conda_deps = ; rdkit ; conda_channels = rdkit deps = -r{toxinidir}/requirements_dev.txt commands = # coverage run --rcfile=tox.ini -m pytest tests python -m pip install --upgrade pip # pip install -r requirements.txt # pip install . python -m pytest -c pyproject.toml --cov-config=.coveragerc --cov-report=xml --color=yes selector # pytest --cov-config=.coveragerc --cov=selector/test # can run it if needed # coverage report -m # prevent exit when error is encountered ignore_errors = true [testenv:readme] skip_install = true deps = readme_renderer twine commands = python setup.py sdist bdist_wheel twine check dist/* [testenv:rst_linux] platform = linux skip_install = true deps = doc8 rstcheck==3.3.1 commands = doc8 --config tox.ini book/content/ # ignore code-block related error because # the Sphinx support in rstcheck is minimal. This results in false positives # rstcheck uses Docutils to parse reStructuredText files and extract code blocks # fixme: check updates on the following website in the future # coala.gitbooks.io/projects/content/en/projects/rstcheck-with-better-sphinx-suppor.html rstcheck --recursive book/content/ --report error \ --ignore-directives automodule,autoclass,autofunction,bibliography,code-block \ --ignore-roles cite,mod,class,lineno --ignore-messages code-block [testenv:rst_mac] platform = darwin skip_install = true deps = {[testenv:rst_linux]deps} commands = {[testenv:rst_linux]commands} [testenv:linters] deps = flake8 flake8-docstrings flake8-import-order>=0.9 flake8-colors pep8-naming pylint==2.13.9 # black bandit commands = flake8 selector/ selector/tests setup.py pylint selector --rcfile=tox.ini --disable=similarities # black -l 100 --check ./ # black -l 100 --diff ./ # Use bandit configuration file bandit -r selector -c .bandit.yml ignore_errors = true [testenv:coverage-report] deps = coverage>=4.2 skip_install = true commands = # coverage combine --rcfile=tox.ini coverage report [testenv:qa] deps = {[testenv]deps} {[testenv:linters]deps} {[testenv:coverage-report]deps} commands = {[testenv]commands} {[testenv:linters]commands} # {[testenv:coverage-report]commands} ignore_errors = true # pytest configuration [pytest] addopts = --cache-clear --showlocals -v -r a --cov-report term-missing --cov selector # Do not run tests in the build folder norecursedirs = build # flake8 configuration [flake8] exclude = __init__.py, .tox, .git, __pycache__, build, dist, *.pyc, *.egg-info, .cache, .eggs, _version.py, max-line-length = 100 import-order-style = google ignore = # E121 : continuation line under-indented for hanging indent E121, # E123 : closing bracket does not match indentation of opening bracket’s line E123, # E126 : continuation line over-indented for hanging indent E126, # E226 : missing whitespace around arithmetic operator E226, # E241 : multiple spaces after ‘,’ # E242 : tab after ‘,’ E24, # E704 : multiple statements on one line (def) E704, # W503 : line break occurred before a binary operator W503, # W504 : Line break occurred after a binary operator W504, # D202: No blank lines allowed after function docstring D202, # E203: Whitespace before ':' E203, # E731: Do not assign a lambda expression, use a def E731, # D401: First line should be in imperative mood: 'Do', not 'Does' D401, per-file-ignores = # F401: Unused import # this is used to define the data typing selector/utils.py: F401, # E1101: rdkit.Chem has no attribute xxx # D403: first word of the first line should be properly capitalized selector/feature.py: E1101, D403 # doc8 configuration [doc8] # Ignore target directories and autogenerated files ignore-path = book/content/_build/, build/, selector.egg-info/, selector.egg-info, .*/ # File extensions to use extensions = .rst, .txt # Maximal line length should be 100 max-line-length = 100 # Disable some doc8 checks: # D000: Check RST validity (cannot handle the "linenos" directive) # D002: Trailing whitespace # D004: Found literal carriage return # Both D002 and D004 can be problematic in Windows platform, line ending is `\r\n`, # but in Linux and MacOS, it's "\n" # Known issue of doc8, https://bugs.launchpad.net/doc8/+bug/1756704 # ignore = D000,D002,D004 ignore = D000 # pylint configuration [MASTER] # This is a known issue of pylint with recognizing numpy members # https://github.com/PyCQA/pylint/issues/779 # https://stackoverflow.com/questions/20553551/how-do-i-get-pylint-to-recognize-numpy-members extension-pkg-whitelist=numpy [FORMAT] # Maximum number of characters on a single line. max-line-length=100 [MESSAGES CONTROL] # disable pylint warnings disable= # attribute-defined-outside-init (W0201): # Attribute %r defined outside __init__ Used when an instance attribute is # defined outside the __init__ method. W0201, # too-many-instance-attributes (R0902): # Too many instance attributes (%s/%s) Used when class has too many instance # attributes, try to reduce this to get a simpler (and so easier to use) # class. R0902, # too many branches (R0912) R0912, # too-many-arguments (R0913): # Too many arguments (%s/%s) Used when a function or method takes too many # arguments. R0913, # Too many local variables (r0914) R0914, # Too many statements (R0915) R0915, # fixme (W0511): # Used when a warning note as FIXME or XXX is detected. W0511, # bad-continuation (C0330): # Wrong hanging indentation before block (add 4 spaces). C0330, # wrong-import-order (C0411): # %s comes before %s Used when PEP8 import order is not respected (standard # imports first, then third-party libraries, then local imports) C0411, # arguments-differ (W0221): # Parameters differ from %s %r method Used when a method has a different # number of arguments than in the implemented interface or in an overridden # method. W0221, # unecessary "else" after "return" (R1705) R1705, # Value XX is unsubscriptable (E1136). this is a open issue of pylint # https://github.com/PyCQA/pylint/issues/3139 E1136, # Used when a name doesn't doesn't fit the naming convention associated to its type # (constant, variable, class…). C0103, # Unnecessary pass statement W0107, # Module 'rdkit.Chem' has no 'ForwardSDMolSupplier' member (no-member) E1101, # todo: fix this one later and this is a temporary solution # E0401: Unable to import xxx (import-error) E0401, # R1721: Unnecessary use of a comprehension R1721, # I1101: Module xxx has no yyy member (no-member) I1101, # R0903: Too few public methods (too-few-public-methods) R0903, # R1702: Too many nested blocks (too-many-nested-blocks) R1702, [SIMILARITIES] min-similarity-lines=5 # coverage configuration [run] branch = True parallel = True source = selector [paths] source = selector .tox/*/lib/python*/site-packages/selector .tox/pypy*/site-packages/selector