-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpyproject.toml
More file actions
107 lines (96 loc) · 3.33 KB
/
Copy pathpyproject.toml
File metadata and controls
107 lines (96 loc) · 3.33 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
[build-system]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"
[project]
name = "ngec"
version = "0.1.0"
authors = [
{ name="Andy Halterman", email="ahalterman0@gmail.com" },
]
description = "A pipeline for coding political events from text"
readme = "README.md"
requires-python = ">=3.10"
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
]
dependencies = [
'dateparser>=1.2.0,<2.0',
'einops>=0.8.1', # Required for HF model download, but not installed if vllm is not installed
'elasticsearch==7.17.9',
'elasticsearch-dsl==7.4.1',
'hf-xet>=1.2.0',
'jsonlines>=4.0.0,<5.0',
'mordecai3>=3.4.0',
'numpy>=2.0.0,<3.0',
'pandas>=2.2.0,<3.0',
'platformdirs>=4.0.0,<5.0',
'pylcs>=0.1.1,<1.0',
'rich>=14.0.0,<15.0',
"scikit-learn<=1.7.2", # see #24
'sentence_transformers>=5.0.0,<6.0',
'skops>=0.13.0,<1.0',
'spacy==3.8.7',
'tqdm>=4.60.0,<5.0',
'textacy>=0.13.0,<1.0',
'torch>=2.6.0,<3.0',
'transformers>=4.53.3,<5.0',
'Unidecode>=1.4.0,<2.0',
"xgboost>=3.1.1",
]
[project.optional-dependencies]
models = [
'en-core-web-lg @ https://github.com/explosion/spacy-models/releases/download/en_core_web_lg-3.8.0/en_core_web_lg-3.8.0-py3-none-any.whl',
'en-core-web-trf @ https://github.com/explosion/spacy-models/releases/download/en_core_web_trf-3.8.0/en_core_web_trf-3.8.0-py3-none-any.whl',
]
# vLLM backend (probably needs to be manually installed on macOS)
vllm = [
'vllm>=0.10.0,<1.0',
]
# MLX backend (macOS only)
mlx = [
'mlx>=0.1.0; sys_platform == "darwin"',
"mlx-lm>=0.28.3",
]
[tool.setuptools.packages.find]
where = ["."] # Search for packages in the current directory
[tool.setuptools.package-data]
ngec = [
"assets/*",
"assets/**/*",
"assets/event_models/*",
"assets/actor_sim_model2/*",
"assets/actor_sim_model2/1_Pooling/*",
"assets/actor_sim_model2/eval/*"
]
[tool.uv.sources]
en-core-web-lg = { url = "https://github.com/explosion/spacy-models/releases/download/en_core_web_lg-3.8.0/en_core_web_lg-3.8.0-py3-none-any.whl" }
en-core-web-trf = { url = "https://github.com/explosion/spacy-models/releases/download/en_core_web_trf-3.8.0/en_core_web_trf-3.8.0-py3-none-any.whl" }
mordecai3 = { git = "https://github.com/ahalterman/mordecai3" }
[dependency-groups]
demo-app = [
"streamlit>=1.55.0",
]
dev = [
"dotenv>=0.9.9",
"ipython>=8.37.0",
"pip>=25.3",
"pytest>=8.4.2",
]
[tool.pytest.ini_options]
filterwarnings = [
# Ignore 3rd-party library deprecation warnings
'ignore::DeprecationWarning:spacy',
"ignore:Importing 'parser.split_arg_string' is deprecated, it will only be available in 'shell_completion' in Click 9.0:DeprecationWarning",
# Ignore SWIG deprecation warning from xgboost/scipy
'ignore:.*[Ss]wig.*:DeprecationWarning',
]
markers = [
'external: run tests with external Elasticsearch server (requires config in .env)',
'substantive: substantive correctness tests that may fail for non-coding correctness errors, e.g. "Macron" is wrongly resolved as an actor',
]
addopts = [
"-m not substantive", # By default, skip substantive tests since some fraction fail
# To run: uv runpytest -m substantive OR uv run pytest -m "" to run all tests
]