-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathpyproject.toml
More file actions
182 lines (158 loc) · 4.82 KB
/
Copy pathpyproject.toml
File metadata and controls
182 lines (158 loc) · 4.82 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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
[project]
name = "ilcdlib"
version = "5.2.0"
license = "Apache-2.0"
description = "A toolkit for reading and writing ILCD format and it's derivatives"
authors = [{ name = "WAP Sustainability", email = "support@wapsustainability.com" }]
maintainers = [{ name = "WAP Sustainability", email = "support@wapsustainability.com" }]
keywords = ["ilcd", "lca", "openepd"]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Software Development :: Libraries :: Python Modules",
]
readme = "README.md"
requires-python = '>=3.11,<4.0'
[project.urls]
GitHub = "https://github.com/cchangelabs/ilcdlib"
[build-system]
requires = ["poetry-core>=2.0.0,<3.0.0"]
build-backend = "poetry.core.masonry.api"
[tool.poetry]
packages = [{ include = "ilcdlib", from = "src" }]
exclude = ["**/test_*.py"]
[tool.poetry.scripts]
ilcdtool = { callable = "ilcdlib:cli.entrypoint" }
[tool.poetry.dependencies]
python = ">=3.11,<4.0"
urllib3 = { version = ">=1.26.17,<3.0.0" }
requests = { version = ">=2.1.0,<3.0.0" }
openepd = { version = ">=7.0.1,<=8.0.0" }
pytz = { version = ">=2023.3" }
cli-rack = { version = ">=1.0.6" }
lxml = { version = ">=4.9.2,<7" }
pydantic = ">=2.0,<3"
[tool.poetry.group.dev.dependencies]
wheel = { version = "~=0.40.0" }
# Unit tests
coverage = { version = "=6.5", extras = ["toml"] }
pytest = "~=7.2"
pytest-subtests = "~=0.4"
pytest-cov = "~=4.0"
teamcity-messages = ">=1.31"
lxml-stubs = { version = ">=0.4.0" }
types-requests = { version = ">=2.1.0" }
# Dev tools
ruff = ">=0.13.0"
licenseheaders = ">=0.8"
mypy = ">=1.18.1"
pre-commit = "~=3.8"
commitizen = ">=4.9,<5.0"
# Type checking
types-dateparser = ">=1.1.3"
types-deprecated = ">=1.2.9"
types-urllib3 = ">=1.26.2"
types-pytz = ">=2023.1"
[tool.commitizen]
version_provider = "pep621"
bump_message = "bump: version $current_version → $new_version"
update_changelog_on_bump = true
pre_bump_hooks = []
version_files = [
"src/ilcdlib/__version__.py",
]
# Tests and Coverage
[tool.pytest.ini_options]
minversion = "7.0"
addopts = "--maxfail=50"
python_files = ["test_*.py"]
required_plugins = ["pytest-subtests", "pytest-cov"]
testpaths = ["src"]
[tool.coverage.run]
branch = false
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
# Don't complain if tests don't hit defensive assertion code:
"raise AssertionError",
"raise NotImplementedError",
# Don't complain about abstract methods, they aren't run:
"@(abc\\.)?abstractmethod",
]
[tool.coverage.html]
directory = "coverage_report/htmlcov"
[tool.mypy]
python_version = "3.11"
show_error_codes = true
ignore_errors = false
warn_return_any = false
disallow_any_generics = false
pretty = true
mypy_path = "$MYPY_CONFIG_FILE_DIR/stubs"
exclude = ["test_.*\\.py$", ]
plugins = ["pydantic.mypy"]
[[tool.mypy.overrides]]
# External libs which doesn't have type hints (py.typed marker)
module = ["cli_rack.*"]
ignore_missing_imports = true
follow_imports = "skip"
[tool.ruff]
line-length = 120
target-version = "py311"
exclude = [".*pyi"]
[tool.ruff.lint.isort]
known-third-party = ["openepd", "ccl_common", "cqd_datamodel"]
force-sort-within-sections = true
[tool.ruff.lint.per-file-ignores]
"**.pyi" = ["UP"]
"test_*.py" = ["D103", "D104", "D100", "D101", "D102", "D106"]
"__version__.py" = ["D104", "D100", "D101", "D102"]
"**/settings/*.py" = ["F405"]
[tool.ruff.lint]
extend-ignore = [
"S101", # Use of assert statement. We have a lot of asserts for mypy type checking.
"S324", # We cannot ignore sha1 hash in codebase because it is used by box.com
"D202",
# W504 line break after binary operator
##### DOCSTRINGS #####
# Missing docstring in public module
"D100",
# Missing docstring in __init__
"D107",
# Missing docstring in magic method
"D105",
# Missing docstring in public package
"D104",
# Missing docstring in public nested class
"D106",
# One black line required before class docstring
"D203",
#`no-blank-line-before-class
"D211",
# Multi-line docstring summary should start at the second line
"D212",
# Multi-line docstring summary should start at the first line
"D213",
# Raw string in exception
"EM101",
# f-string in exception
"EM102",
"B027",
"B024",
"S110",
]
extend-select = ["S", "E", "B", "A", "EM", "UP"]
[tool.ruff.lint.flake8-type-checking]
# Add quotes around type annotations, if doing so would allow
# an import to be moved into a type-checking block.
quote-annotations = true
[tool.ruff.lint.pydocstyle]
convention = "pep257"
[tool.ruff.lint.mccabe]
# Flag errors (`C901`) whenever the complexity level exceeds 15.
max-complexity = 10