Initial commit
This commit is contained in:
commit
168423dcf6
|
@ -0,0 +1,33 @@
|
|||
[build-system]
|
||||
requires = ["setuptools >= 61", "wheel"]
|
||||
build-backend = "setuptools.build_meta" # hatch, pbm, poetry, flit, ...
|
||||
|
||||
[project]
|
||||
name = "sequences"
|
||||
description = "Implementation of fib."
|
||||
readme = "README.md"
|
||||
license = {text = "MIT License"}
|
||||
authors = [
|
||||
{name = "Julien Palard", email = "julien@palard.fr"},
|
||||
]
|
||||
requires-python = ">= 3.7"
|
||||
dependencies = [
|
||||
"matplotlib >= 3.1, <4",
|
||||
"sympy >= 1.2, <2",
|
||||
]
|
||||
dynamic = ["version"]
|
||||
|
||||
[project.urls]
|
||||
homepage = "https://github.com/JulienPalard/sequences"
|
||||
|
||||
[project.scripts]
|
||||
fib = "sequences.sequences:main"
|
||||
|
||||
[tool.setuptools]
|
||||
include-package-data = false
|
||||
|
||||
[tool.setuptools.packages]
|
||||
find = {}
|
||||
|
||||
[tool.setuptools.dynamic.version]
|
||||
attr = "sequences.__version__"
|
|
@ -0,0 +1,7 @@
|
|||
"""La doc"""
|
||||
|
||||
__version__ = "0.1b1"
|
||||
|
||||
from sequences.sequences import fib
|
||||
|
||||
__all__ = ["fib"]
|
|
@ -0,0 +1,3 @@
|
|||
from sequences.sequences import main
|
||||
|
||||
main()
|
|
@ -0,0 +1,23 @@
|
|||
# from functools import lru_cache
|
||||
lru_cache = __import__("functools").lru_cache
|
||||
|
||||
|
||||
@lru_cache(1024)
|
||||
def fib(n: int) -> int:
|
||||
"""La doc de fib"""
|
||||
if n < 2:
|
||||
return 1
|
||||
return fib(n-1) + fib(n-2)
|
||||
|
||||
|
||||
def main():
|
||||
import argparse
|
||||
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("n", type=int)
|
||||
args = parser.parse_args()
|
||||
print(fib(args.n))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
Loading…
Reference in New Issue