-
Notifications
You must be signed in to change notification settings - Fork 57
Expand file tree
/
Copy pathpyproject.toml
More file actions
140 lines (125 loc) · 3.36 KB
/
pyproject.toml
File metadata and controls
140 lines (125 loc) · 3.36 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
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "storymapjs"
version = "0.9.4"
description = "StoryMapJS is a tool for telling stories through the context of places on a map"
readme = "README.md"
requires-python = ">=3.12"
license = {text = "ISC"}
authors = [
{name = "Knight Lab", email = "knightlab@northwestern.edu"},
]
dependencies = [
"boto3==1.34.*",
"Flask==3.0.*",
"Flask-Cors==4.0.*",
"google-api-python-client==2.115.*",
"gunicorn==21.2.*",
"huey==2.5.*",
"oauth2client==4.1.*",
"psycopg2-binary==2.9.*",
"python-slugify==8.0.*",
"requests==2.31.*",
"Werkzeug==3.0.1",
]
[tool.hatch.build.targets.wheel]
packages = ["storymap"]
[project.urls]
Homepage = "https://github.com/NUKnightLab/StoryMapJS"
Issues = "https://github.com/NUKnightLab/StoryMapJS/issues"
[tool.hatch.envs.default]
dependencies = [
"pytest>=8.0",
"pytest-cov>=4.1",
"pytest-mock>=3.12",
]
[tool.hatch.envs.unit]
description = "Unit tests for Flask application (no Docker required)"
dependencies = [
"pytest>=8.0",
"pytest-cov>=4.1",
"pytest-mock>=3.12",
"moto[s3]>=5.0", # Mock AWS services
"fakeredis>=2.21", # Mock Redis for Huey
]
[tool.hatch.envs.unit.scripts]
test = "pytest tests/unit_tests.py -v {args}"
test-cov = "pytest tests/unit_tests.py --cov=storymap --cov-report=term-missing --cov-report=html {args}"
test-watch = "pytest tests/unit_tests.py -v --tb=short -x {args}"
[tool.hatch.envs.integration]
description = "Integration tests for full stack (requires Docker)"
dependencies = [
"pytest>=8.0",
"pytest-docker>=3.1",
"requests>=2.31",
"selenium>=4.16", # For browser testing if needed
]
[tool.hatch.envs.integration.scripts]
test = "pytest tests/integration_tests.py -v {args}"
test-slow = "pytest tests/integration_tests.py -v --tb=long {args}"
[tool.hatch.envs.dev]
description = "Development environment with all tools"
dependencies = [
"pytest>=8.0",
"pytest-cov>=4.1",
"pytest-mock>=3.12",
"pytest-docker>=3.1",
"moto[s3]>=5.0",
"fakeredis>=2.21",
"requests>=2.31",
"ipython>=8.20",
"ruff>=0.2",
]
[tool.hatch.envs.dev.scripts]
unit = "pytest tests/unit_tests.py -v {args}"
integration = "pytest tests/integration_tests.py -v {args}"
all = "pytest tests/ -v {args}"
lint = "ruff check storymap/ tests/"
format = "ruff format storymap/ tests/"
[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = ["test_*.py", "*_test.py", "*_tests.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
addopts = [
"-ra",
"--strict-markers",
"--strict-config",
]
markers = [
"unit: Unit tests that don't require Docker",
"integration: Integration tests that require Docker Compose",
"slow: Slow running tests",
]
[tool.coverage.run]
source = ["storymap"]
omit = [
"*/tests/*",
"*/test_*.py",
]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"raise AssertionError",
"raise NotImplementedError",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
]
[tool.ruff]
line-length = 100
target-version = "py312"
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"B", # flake8-bugbear
"C4", # flake8-comprehensions
]
ignore = [
"E501", # line too long (handled by formatter)
]