-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyproject.toml
145 lines (130 loc) · 3.61 KB
/
pyproject.toml
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
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "toxic-news"
description = 'Evaluating toxicity of news'
readme = "README.md"
requires-python = ">=3.9"
license = "MIT"
keywords = []
authors = [
{ name = "Daniel Ferreira", email = "[email protected]" },
]
classifiers = [
"Development Status :: 4 - Beta",
"Programming Language :: Python",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
]
dependencies = [
"lxml==4.9.2",
"optimum[onnxruntime]==1.8.6",
"requests==2.30.0",
"loguru==0.7.0",
"pydantic==1.10.7",
"Jinja2==3.1.2",
"pymongo==4.3.3",
"python-dotenv==1.0.0",
"fastapi==0.95.2",
"uvicorn==0.22.0",
"typer[all]==0.9.0",
"aiohttp==3.8.4",
"waybackpy==3.0.6",
"nest-asyncio==1.5.6",
"pytailwindcss==0.1.4",
"tenacity==8.2.2",
"protobuf==3.20.2",
]
dynamic = ["version"]
[project.urls]
Documentation = "https://github.com/dcferreira/toxic-news#readme"
Issues = "https://github.com/dcferreira/toxic-news/issues"
Source = "https://github.com/dcferreira/toxic-news"
[tool.hatch.version]
path = "toxic_news/__about__.py"
[tool.hatch.envs.default]
dependencies = [
"pytest",
"pytest-cov",
"pytest-snapshot",
"pytest-xprocess",
"pytest-asyncio",
"pytest-xdist",
"pytest-mongo",
"black",
"isort",
"ruff",
"pre-commit",
"mypy",
"types-requests",
"lxml-stubs",
"types-tqdm",
]
[tool.hatch.envs.default.scripts]
cov = "pytest --cov-report=term-missing --cov-config=pyproject.toml --cov=toxic_news --cov=tests -m \"not integration and not slow\" {args}"
no-cov = "cov --no-cov {args}"
integration = "no-cov -m integration -n auto {args}"
slow = "no-cov -m slow -n 4 {args}"
full = "pytest -n 4 --dist worksteal {args}"
lint = ["ruff .", "black . --check -q", "isort . --check -q"]
format = ["black .", "isort ."]
types = "mypy ."
build = "docker buildx build . -t toxic-news:local"
serve-docker = "docker compose up"
push = [
"docker tag toxic-news:local us-central1-docker.pkg.dev/toxic-news/toxic-news/toxic-news:latest",
"docker push us-central1-docker.pkg.dev/toxic-news/toxic-news/toxic-news:latest"
]
cli = "python toxic_news/main.py {args}"
update-styles = "tailwindcss -i toxic_news/templates/style.css -o public/style.css"
[tool.hatch.envs.explore]
dependencies = [
"jupyterlab",
"seaborn",
"ipympl",
]
[tool.hatch.envs.explore.scripts]
run = "jupyter lab --no-browser"
[[tool.hatch.envs.test.matrix]]
python = ["39", "310", "311"]
[tool.coverage.run]
branch = true
parallel = true
omit = [
"toxic_news/__about__.py",
]
[tool.coverage.report]
exclude_lines = [
"no cov",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
]
[tool.isort]
profile = "black"
skip = [".hatch"]
[tool.mypy]
check_untyped_defs = true
plugins = ["pydantic.mypy"]
[[tool.mypy.overrides]]
module = [
"detoxify",
"nest_asyncio",
]
ignore_missing_imports = true
[tool.pytest.ini_options]
addopts = "--strict-markers --strict-config -ra"
markers = [
"slow: slow and heavy tests, not sure if these can run in the CI pipeline",
"integration: slow tests, shouldn't be run so often"
]
[tool.pydantic-pycharm-plugin.parsable-types]
HttpUrl = ["str"]
[tool.pydantic-pycharm-plugin]
parsable-type-highlight = "warning"
acceptable-type-highlight = "disable"