Spaces:
Sleeping
Sleeping
Léo Bourrel
commited on
Commit
·
c30f79e
1
Parent(s):
585b6ba
feat: Add pyproject && setup to make app as package
Browse files- pyproject.toml +91 -0
- setup.py +11 -0
pyproject.toml
ADDED
@@ -0,0 +1,91 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Packages configs
|
2 |
+
[project]
|
3 |
+
name = "sorbobotapp"
|
4 |
+
version = "0.0.1"
|
5 |
+
requires-python = ">=3.10"
|
6 |
+
readme = "README.md"
|
7 |
+
|
8 |
+
[build-system]
|
9 |
+
requires = ["setuptools"]
|
10 |
+
|
11 |
+
## coverage
|
12 |
+
|
13 |
+
[tool.coverage.run]
|
14 |
+
branch = true
|
15 |
+
|
16 |
+
[tool.coverage.report]
|
17 |
+
skip_empty = true
|
18 |
+
fail_under = 70.00
|
19 |
+
precision = 2
|
20 |
+
|
21 |
+
## black
|
22 |
+
|
23 |
+
[tool.black]
|
24 |
+
target-version = ['py310']
|
25 |
+
|
26 |
+
## ruff
|
27 |
+
# Recommended ruff config for now, to be updated as we go along.
|
28 |
+
[tool.ruff]
|
29 |
+
target-version = 'py310'
|
30 |
+
|
31 |
+
# See all rules at https://beta.ruff.rs/docs/rules/
|
32 |
+
select = [
|
33 |
+
"E", # pycodestyle
|
34 |
+
"W", # pycodestyle
|
35 |
+
"F", # Pyflakes
|
36 |
+
"B", # flake8-bugbear
|
37 |
+
"C4", # flake8-comprehensions
|
38 |
+
"D", # flake8-docstrings
|
39 |
+
"I", # isort
|
40 |
+
"SIM", # flake8-simplify
|
41 |
+
"TCH", # flake8-type-checking
|
42 |
+
"TID", # flake8-tidy-imports
|
43 |
+
"Q", # flake8-quotes
|
44 |
+
"UP", # pyupgrade
|
45 |
+
"PT", # flake8-pytest-style
|
46 |
+
"RUF", # Ruff-specific rules
|
47 |
+
]
|
48 |
+
|
49 |
+
ignore = [
|
50 |
+
"E501", # "Line too long"
|
51 |
+
# -> line length already regulated by black
|
52 |
+
"PT011", # "pytest.raises() should specify expected exception"
|
53 |
+
# -> would imply to update tests every time you update exception message
|
54 |
+
"SIM102", # "Use a single `if` statement instead of nested `if` statements"
|
55 |
+
# -> too restrictive
|
56 |
+
"D100",
|
57 |
+
]
|
58 |
+
|
59 |
+
[tool.ruff.pydocstyle]
|
60 |
+
# Automatically disable rules that are incompatible with Google docstring convention
|
61 |
+
convention = "google"
|
62 |
+
|
63 |
+
[tool.ruff.pycodestyle]
|
64 |
+
max-doc-length = 88
|
65 |
+
|
66 |
+
[tool.ruff.flake8-tidy-imports]
|
67 |
+
ban-relative-imports = "all"
|
68 |
+
|
69 |
+
[tool.ruff.flake8-type-checking]
|
70 |
+
strict = true
|
71 |
+
runtime-evaluated-base-classes = ["pydantic.BaseModel"]
|
72 |
+
# Pydantic needs to be able to evaluate types at runtime
|
73 |
+
# see https://pypi.org/project/flake8-type-checking/ for flake8-type-checking documentation
|
74 |
+
# see https://beta.ruff.rs/docs/settings/#flake8-type-checking-runtime-evaluated-base-classes for ruff documentation
|
75 |
+
|
76 |
+
[tool.ruff.per-file-ignores]
|
77 |
+
# Allow missing docstrings for tests
|
78 |
+
"tests/**/*.py" = ["D100", "D103"]
|
79 |
+
|
80 |
+
## mypy
|
81 |
+
|
82 |
+
[tool.mypy]
|
83 |
+
python_version = "3.10"
|
84 |
+
# Enable all optional error checking flags, providing stricter type checking; see https://mypy.readthedocs.io/en/stable/getting_started.html#strict-mode-and-configuration
|
85 |
+
strict = true
|
86 |
+
|
87 |
+
# Type-check the interiors of functions without type annotations; if missing, mypy won't check function bodies without type hints, for instance those coming from third-party libraries
|
88 |
+
check_untyped_defs = true
|
89 |
+
|
90 |
+
# Make __init__.py file optional for package definitions; if missing, mypy requires __init__.py at packages roots, see https://mypy.readthedocs.io/en/stable/running_mypy.html#mapping-file-paths-to-modules
|
91 |
+
explicit_package_bases = true
|
setup.py
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/usr/bin/env python
|
2 |
+
|
3 |
+
from distutils.core import setup
|
4 |
+
|
5 |
+
setup(
|
6 |
+
name="sorbobotapp",
|
7 |
+
version="0.0.1",
|
8 |
+
authors=["Leo Bourrel <leo@ia-lab.fr>"],
|
9 |
+
package_dir={"": "sorbobotapp"},
|
10 |
+
)
|
11 |
+
|