-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
153 lines (134 loc) · 4 KB
/
pyproject.toml
File metadata and controls
153 lines (134 loc) · 4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
[build-system]
requires = ["setuptools >= 61.0", "setuptools_scm[toml]>=6.0"]
build-backend = "setuptools.build_meta"
[project]
name = "ecooptimizer"
dependencies = [
"pylint",
"rope",
"astor",
"codecarbon",
"asttokens",
"uvicorn",
"fastapi",
"pydantic",
"libcst",
"websockets",
]
version = "0.1.0"
requires-python = ">=3.9"
authors = [
{ name = "Sevhena Walker" },
{ name = "Mya Hussain" },
{ name = "Nivetha Kuruparan" },
{ name = "Ayushi Amin" },
{ name = "Tanveer Brar" },
]
description = "A source code eco optimizer"
readme = "README.md"
license = { file = "LICENSE" }
[project.optional-dependencies]
dev = [
"pytest",
"pytest-cov",
"pytest-mock",
"ruff",
"coverage",
"pyright",
"pre-commit",
]
[project.scripts]
eco-local = "ecooptimizer.__main__:main"
eco-ext = "ecooptimizer.api.__main__:main"
eco-ext-dev = "ecooptimizer.api.__main__:dev"
[project.urls]
Repository = "https://github.com/ssm-lab/capstone--source-code-optimizer"
"Bug Tracker" = "https://github.com/ssm-lab/capstone--source-code-optimizer/issues"
[tool.setuptools_scm]
write_to = "src/ecooptimizer/_version.py"
fallback_version = "0.1.0"
[tool.setuptools]
packages = ["ecooptimizer"]
[tool.setuptools.package-dir]
ecooptimizer = "src/ecooptimizer"
[tool.setuptools.exclude-package-data]
"*" = ["docs/*", "tests/*", ".github/*"]
[tool.pytest.ini_options]
norecursedirs = ["tests/temp*", "tests/input", "tests/_input_copies"]
addopts = ["--basetemp=tests/temp_dir"]
testpaths = ["tests"]
pythonpath = "src"
[tool.coverage.run]
omit = [
"*/__main__.py",
'*/__init__.py',
'*/utils/*',
"*/test_*.py",
"*/analyzers/*_analyzer.py",
"*/api/app.py",
"*/api/routes/show_logs.py",
]
[tool.ruff]
extend-exclude = [
"*tests/input/**/*.py",
"tests/_input_copies",
"tests/temp_dir",
"tests/benchmarking/test_code/**/*.py",
]
line-length = 100
[tool.ruff.lint]
select = [
"E", # Enforce Python Error rules (e.g., syntax errors, exceptions).
"UP", # Check for unnecessary passes and other unnecessary constructs.
"ANN001", # Ensure type annotations are present where needed.
"ANN002",
"ANN003",
"ANN401",
"INP", # Flag invalid Python patterns or usage.
"PTH", # Check path-like or import-related issues.
"F", # Enforce function-level checks (e.g., complexity, arguments).
"B", # Enforce best practices for Python coding (general style rules).
"PT", # Enforce code formatting and Pythonic idioms.
"W", # Enforce warnings (e.g., suspicious constructs or behaviours).
"A", # Flag common anti-patterns or bad practices.
"RUF", # Ruff-specific rules.
"ARG", # Check for function argument issues.,
]
# Avoid enforcing line-length violations (`E501`)
ignore = ["E501", "RUF003"]
# Avoid trying to fix flake8-bugbear (`B`) violations.
unfixable = ["B"]
# Ignore `E402` (import violations) in all `__init__.py` files, and in selected subdirectories.
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["E402"]
"**/{tests,docs,tools}/*" = ["E402", "ANN", "INP001"]
[tool.ruff.lint.flake8-annotations]
suppress-none-returning = true
mypy-init-return = true
[tool.pyright]
include = ["src", "tests"]
exclude = ["tests/input", "tests/_input*", "tests/temp_dir"]
disableBytesTypePromotions = true
reportAttributeAccessIssue = false
reportPropertyTypeMismatch = true
reportFunctionMemberAccess = true
reportMissingImports = true
reportUnusedVariable = "warning"
reportDuplicateImport = "warning"
reportUntypedFunctionDecorator = true
reportUntypedClassDecorator = true
reportUntypedBaseClass = true
reportUntypedNamedTuple = true
reportPrivateUsage = true
reportConstantRedefinition = "warning"
reportDeprecated = "warning"
reportIncompatibleMethodOverride = true
reportIncompatibleVariableOverride = true
reportInconsistentConstructor = true
reportOverlappingOverload = true
reportMissingTypeArgument = true
reportCallInDefaultInitializer = "warning"
reportUnnecessaryIsInstance = "warning"
reportUnnecessaryCast = "warning"
reportUnnecessaryComparison = true
reportMatchNotExhaustive = "warning"