Hello tox.
This commit is contained in:
parent
168423dcf6
commit
69862f69af
|
@ -11,10 +11,7 @@ authors = [
|
|||
{name = "Julien Palard", email = "julien@palard.fr"},
|
||||
]
|
||||
requires-python = ">= 3.7"
|
||||
dependencies = [
|
||||
"matplotlib >= 3.1, <4",
|
||||
"sympy >= 1.2, <2",
|
||||
]
|
||||
dependencies = []
|
||||
dynamic = ["version"]
|
||||
|
||||
[project.urls]
|
||||
|
@ -31,3 +28,5 @@ find = {}
|
|||
|
||||
[tool.setuptools.dynamic.version]
|
||||
attr = "sequences.__version__"
|
||||
|
||||
[tool.black]
|
|
@ -1,4 +1,4 @@
|
|||
"""La doc"""
|
||||
"""Sequences implementations."""
|
||||
|
||||
__version__ = "0.1b1"
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
"""Package entry point."""
|
||||
|
||||
from sequences.sequences import main
|
||||
|
||||
main()
|
||||
|
|
|
@ -1,16 +1,19 @@
|
|||
"""Implementation of a few (one actually) integer sequences."""
|
||||
|
||||
# from functools import lru_cache
|
||||
lru_cache = __import__("functools").lru_cache
|
||||
|
||||
|
||||
@lru_cache(1024)
|
||||
def fib(n: int) -> int:
|
||||
"""La doc de fib"""
|
||||
"""Compute the fib sequence value for n."""
|
||||
if n < 2:
|
||||
return 1
|
||||
return fib(n-1) + fib(n-2)
|
||||
return fib(n - 1) + fib(n - 2)
|
||||
|
||||
|
||||
def main():
|
||||
"""Run the fib function from command line."""
|
||||
import argparse
|
||||
|
||||
parser = argparse.ArgumentParser()
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
from sequences import fib
|
||||
|
||||
|
||||
def test_fib_head():
|
||||
assert fib(0) == fib(1) == 1
|
||||
|
||||
|
||||
def test_fib_next():
|
||||
assert fib(2) > 1
|
||||
assert fib(3) > 1
|
|
@ -0,0 +1,53 @@
|
|||
[flake8]
|
||||
max-line-length = 88
|
||||
|
||||
[tox]
|
||||
envlist = py3{7,8,9,10,11,12,13}, flake8, mypy, black, pylint, pydocstyle, isort, ruff, bandit
|
||||
isolated_build = True
|
||||
skip_missing_interpreters = True
|
||||
|
||||
[testenv]
|
||||
deps =
|
||||
pytest
|
||||
commands = pytest
|
||||
|
||||
[testenv:flake8]
|
||||
deps =
|
||||
flake8
|
||||
flake8-bugbear
|
||||
skip_install = True
|
||||
commands = flake8 --max-complexity=8 tests/ sequences
|
||||
|
||||
[testenv:black]
|
||||
deps = black
|
||||
skip_install = True
|
||||
commands = black --check --diff tests/ sequences
|
||||
|
||||
[testenv:mypy]
|
||||
deps = mypy
|
||||
skip_install = True
|
||||
commands = mypy --ignore-missing-imports sequences
|
||||
|
||||
[testenv:pylint]
|
||||
deps = pylint
|
||||
commands = pylint --disable import-outside-toplevel sequences
|
||||
|
||||
[testenv:pydocstyle]
|
||||
deps = pydocstyle
|
||||
skip_install = True
|
||||
commands = pydocstyle sequences
|
||||
|
||||
[testenv:isort]
|
||||
deps = isort
|
||||
skip_install = True
|
||||
commands = isort --profile=black --check sequences
|
||||
|
||||
[testenv:ruff]
|
||||
deps = ruff
|
||||
skip_install = True
|
||||
commands = ruff check sequences
|
||||
|
||||
[testenv:bandit]
|
||||
deps = bandit
|
||||
skip_install = True
|
||||
commands = bandit sequences
|
Loading…
Reference in New Issue