-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathpyproject.toml
More file actions
167 lines (149 loc) · 5.62 KB
/
Copy pathpyproject.toml
File metadata and controls
167 lines (149 loc) · 5.62 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
[build-system]
requires = ["uv_build>=0.12.5,<0.13"]
build-backend = "uv_build"
[project]
name = "ethnicolr2"
version = "0.3.3"
description = "Predict Race/Ethnicity Based on Sequence of Characters in the Name"
readme = "README.md"
authors = [
{ name = "Rajshekar", email = "rajshekar.ch@gmail.com" },
{ name = "Suriyan", email = "suriyant@gmail.com" },
{ name = "Gaurav Sood", email = "gsood07@gmail.com" }
]
license = "MIT"
license-files = ["LICENSE"]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Science/Research",
"Intended Audience :: Developers",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Scientific/Engineering :: Information Analysis",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Text Processing :: Linguistic",
"Operating System :: OS Independent",
]
keywords = ["race", "ethnicity", "names", "demographics", "machine-learning", "census", "pytorch", "lstm"]
requires-python = ">=3.12"
dependencies = [
"click>=8.0.0",
"pandas>=1.3.0",
"torch==2.13.0",
"joblib==1.6.0",
"tqdm==4.70.0",
"scikit-learn==1.9.0",
"huggingface-hub>=1.27.0",
"pyarrow>=14.0.0",
]
[project.urls]
"Homepage" = "https://appeler.github.io/ethnicolr2/"
"Documentation" = "https://appeler.github.io/ethnicolr2/"
"Repository" = "https://github.com/appeler/ethnicolr2"
"Bug Tracker" = "https://github.com/appeler/ethnicolr2/issues"
"Changelog" = "https://github.com/appeler/ethnicolr2/blob/main/CHANGELOG.md"
"Model" = "https://huggingface.co/gojiberries/ethnicolr2"
[dependency-groups]
dev = ["ruff>=0.7.0", "pre-commit>=3.0.0", "pydoclint", "pyright", "pandas-stubs", "types-tqdm"]
test = ["coverage", "pytest", "pytest-cov>=6", "numpy>=1.25.2"]
docs = [
"sphinx",
"furo",
"sphinx-autodoc-typehints",
"myst-parser",
"linkify-it-py",
"sphinx-design",
]
[project.scripts]
census_ln = "ethnicolr2.census_ln:main"
pred_fl_full_name = "ethnicolr2.pred_fl_fn_lstm:main"
pred_fl_last_name = "ethnicolr2.pred_fl_ln_lstm:main"
pred_census_last_name = "ethnicolr2.pred_cen_ln_lstm:main"
ethnicolr2_download_models = "ethnicolr2._setup_hooks:download_cli"
# Testing configuration
[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = "test_*.py"
addopts = "--verbose"
markers = ["live: reaches the Hugging Face Hub"]
# Code quality and formatting tools
[tool.ruff]
line-length = 88
target-version = "py312"
exclude = [
".git",
"__pycache__",
"build",
"dist",
".venv",
"docs/source/examples"
]
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"UP", # pyupgrade
]
ignore = [
"E501", # line too long (handled by formatter)
"B008", # do not perform function calls in argument defaults
]
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401"]
"tests/*" = ["S101"]
[tool.uv.build-backend]
module-name = "ethnicolr2"
module-root = "src"
# Type checking configuration
[tool.pyright]
include = ["src/ethnicolr2"]
exclude = ["**/node_modules", "**/__pycache__", ".venv", "venv", "build", "dist"]
strict = ["src/ethnicolr2"]
reportMissingTypeStubs = false
reportUnknownMemberType = false # For external libraries without stubs
reportUnknownVariableType = false # For pandas/torch operations
reportUnknownParameterType = false # For external library parameters
reportUnknownArgumentType = false # For external library arguments
pythonVersion = "3.12"
pythonPlatform = "All"
# Docstring linting configuration
[tool.pydoclint]
style = "google"
exclude = ["tests/", ".venv/", "venv/", "docs/source/examples/"]
arg-type-hints-in-signature = true
arg-type-hints-in-docstring = false
skip-checking-short-docstrings = false
# Dependency analysis configuration
[tool.deptry]
# Exclude documentation examples, virtual environment, and test files that use numpy
exclude = ["docs/source/examples/", ".venv/", "venv/", "tests/test_input_edge_cases.py", "tests/test_validation.py"]
# Package name mappings for packages with different import vs install names
[tool.deptry.package_module_name_map]
"linkify-it-py" = ["linkify_it_py"]
# Known external dependencies for documentation examples (not part of the main package)
[tool.deptry.per_rule_ignores]
DEP001 = ["docs/source/examples/"] # Allow missing dependencies in documentation examples
DEP002 = ["scikit-learn"] # scikit-learn is needed for model compatibility (joblib files)
DEP003 = ["docs/source/examples/"] # Allow transitive dependencies in documentation examples
DEP004 = ["tests/test_input_edge_cases.py", "tests/test_validation.py"] # Allow test dependencies in test files
[tool.codespell]
# The census tables are surnames, not prose. codespell reported 1,800 findings
# here, essentially all of them real names it mistook for misspellings, which
# drowned the handful of genuine typos in the source. Auto-"correcting" a name
# would also silently corrupt the data these models are trained on.
skip = "*.csv,*.parquet,*.joblib,./src/ethnicolr2/data,./docs/build,./.venv,uv.lock"
[tool.preen]
link_ignore = [
# Alive, but not from a GitHub runner. Both surname tables answer 200 from
# a workstation; from Actions egress the request fails, and it has been
# failing CI on main since 2026-08-24 for a page that has not moved. The
# README that cites them is the right place for those citations.
"census\\.gov/topics/population/genealogy/",
]