Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
153 lines (136 loc) · 4.78 KB
/
Copy pathpyproject.toml
File metadata and controls
153 lines (136 loc) · 4.78 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
[build-system]
requires = ["setuptools>=68.0", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "lighthouse-cli"
version = "0.1.0"
description = "CLI tool for D2L Brightspace LMS at lighthouse.manipal.edu"
readme = "README.md"
requires-python = ">=3.10"
license = {text = "MIT"}
dependencies = [
"click>=8.2",
"requests>=2.31",
"beautifulsoup4>=4.12",
"cryptography>=41.0,<100",
]
[project.optional-dependencies]
rich = ["rich>=13.0"]
credentials = ["keyring>=24.0", "cryptography>=41.0,<100"]
auth = ["playwright>=1.40"]
cdp = ["websockets>=12,<17"]
dev = [
# Upper bounds stop a lockfile regeneration from silently crossing a
# breaking release; 0.x tools are bounded at the next minor.
"pytest>=9.0,<10",
"pytest-cov>=7.0,<8",
"pytest-xdist>=3.6,<4",
"ruff>=0.16.8,<0.17",
"mypy>=2.0,<3",
"types-requests>=2.31,<3",
"import-linter>=2.0,<3",
"deptry>=0.25,<0.26",
"xenon>=0.9,<0.10",
"radon>=6.0,<7",
"detect-secrets>=1.5,<2",
"pre-commit>=4.0,<5",
]
[project.scripts]
lighthouse = "lighthouse_cli.cli:cli"
[tool.setuptools.packages.find]
include = ["lighthouse_cli*"]
[tool.pytest.ini_options]
testpaths = ["tests"]
[tool.coverage.run]
source = ["lighthouse_cli"]
[tool.coverage.report]
show_missing = true
[tool.ruff]
line-length = 100
target-version = "py310"
exclude = [".venv", "build", "dist"]
[tool.ruff.lint]
select = ["E", "W", "F", "I", "N", "UP", "B", "C4", "RUF"]
ignore = [
"E501", # long URLs/IDs inside literals; the code is not auto-formatted
"RUF001", # typographic arrows/quotes in user-facing docstrings are intentional
"RUF002",
"RUF003",
]
[tool.mypy]
python_version = "3.10"
strict = true
files = ["lighthouse_cli"]
[[tool.mypy.overrides]]
module = ["bs4.*", "keyring.*"]
ignore_missing_imports = true
[tool.importlinter]
root_packages = ["lighthouse_cli"]
[[tool.importlinter.contracts]]
# Layers were derived from the actual import graph (`lint-imports` enforces them;
# CONTRIBUTING explains how to extend them). Every module sits in the lowest layer that is
# above all of its internal dependencies; `|` separates sibling modules that never
# import each other. Breaking a layer (e.g. foundation importing the API client)
# fails CI.
name = "CLI layered architecture (entry point > command groups > workflows > api > foundation)"
type = "layers"
layers = [
"lighthouse_cli.cli",
"lighthouse_cli.assessment_commands",
"lighthouse_cli.quiz_learner_commands | lighthouse_cli.quiz_preview_commands",
"lighthouse_cli.commands | lighthouse_cli.quiz_learner_session | lighthouse_cli.quiz_preview_session",
"lighthouse_cli.course_read_commands | lighthouse_cli.quiz_learner_finish | lighthouse_cli.quiz_preview_finish | lighthouse_cli.show | lighthouse_cli.sync_engine",
"lighthouse_cli.assessment_api | lighthouse_cli.assignments | lighthouse_cli.auth | lighthouse_cli.course_config | lighthouse_cli.quiz_learner_transport | lighthouse_cli.quiz_preview_transport | lighthouse_cli.submit",
"lighthouse_cli.api | lighthouse_cli.session_import",
"lighthouse_cli.session_renewal",
"lighthouse_cli.ms_auth",
"lighthouse_cli.config",
"lighthouse_cli.credential_store | lighthouse_cli.manifest | lighthouse_cli.ms_mfa | lighthouse_cli.quiz_attempt_page",
"lighthouse_cli.connection | lighthouse_cli.display | lighthouse_cli.ms_errors | lighthouse_cli.ms_parse | lighthouse_cli.ms_session | lighthouse_cli.quiz_math | lighthouse_cli.quiz_rules | lighthouse_cli.request_protection | lighthouse_cli.totp | lighthouse_cli.utils",
]
[[tool.importlinter.contracts]]
name = "Foundation helpers never import upper layers"
type = "forbidden"
source_modules = [
"lighthouse_cli.display",
"lighthouse_cli.manifest",
"lighthouse_cli.connection",
"lighthouse_cli.request_protection",
"lighthouse_cli.config",
"lighthouse_cli.credential_store",
"lighthouse_cli.totp",
"lighthouse_cli.utils",
]
forbidden_modules = [
"lighthouse_cli.api",
"lighthouse_cli.assessment_api",
"lighthouse_cli.commands",
"lighthouse_cli.assessment_commands",
"lighthouse_cli.course_read_commands",
"lighthouse_cli.quiz_learner_commands",
"lighthouse_cli.quiz_preview_commands",
"lighthouse_cli.auth",
"lighthouse_cli.cli",
]
[tool.deptry]
# python_version is derived from requires-python; scan the shipped package only.
exclude = ["tests", ".venv", "docs", "scripts"]
[tool.deptry.per_rule_ignores]
# Dev/test/CI tooling: declared for contributors and CI, never imported at runtime.
DEP002 = [
"pytest",
"pytest-cov",
"pytest-xdist",
"ruff",
"mypy",
"types-requests",
"import-linter",
"deptry",
"xenon",
"radon",
"detect-secrets",
"pre-commit",
]
[[tool.mypy.overrides]]
module = "websockets.*"
ignore_missing_imports = true