-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpyproject.toml
More file actions
194 lines (157 loc) · 5.89 KB
/
pyproject.toml
File metadata and controls
194 lines (157 loc) · 5.89 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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
################################################################################
# Build Configuration
################################################################################
[build-system]
build-backend = "hatchling.build"
requires = ["hatchling", "hatch-vcs"]
################################################################################
# Project Configuration
################################################################################
[project]
name = "wordguess"
# You can choose to use dynamic versioning with hatch or static where you add it manually.
# version = "2.0.0"
dynamic = ["version"]
description = "A Python package with essential functions for a word-guessing game, inspired by Wordle."
authors = [
{ name = "Sarisha Das", email = "rishadaz@student.ubc.ca" },
{ name = "Sarah Gauthier", email = "sgauth01@student.ubc.ca" },
{ name = "Yuheng Ouyang", email = "yuhengo@student.ubc.ca" },
{ name = "Harry Yau", email = "chungki@student.ubc.ca" },
]
license = "MIT"
requires-python = ">= 3.10" # Adjust based on the minimum version of Python that you support
readme = {"file" = "README.md", "content-type" = "text/markdown"}
# Please consult https://pypi.org/classifiers/ for a full list.
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3 :: Only",
]
# TODO: add keywords
keywords = []
# TODO: add dependencies
dependencies = []
[project.urls]
Homepage = "https://github.com/UBC-MDS/wordguess"
"Source Code" = "https://github.com/UBC-MDS/wordguess"
"Bug Tracker" = "https://github.com/UBC-MDS/wordguess/issues"
Documentation = "https://github.com/UBC-MDS/wordguess/blob/main/README.md"
Download = "https://pypi.org/project/wordguess/#files"
[project.optional-dependencies]
# The groups below should be in the [development-groups] table
# They are here now because hatch hasn't released support for them but plans to
# in Mid November 2025.
dev = [
"hatch",
"pre-commit",
"hatch-vcs",
]
docs = [
"quartodoc"
]
lint = [
"ruff"
]
build = [
"pip-audit",
"twine",
]
tests = [
"pytest",
"pytest-cov",
"pytest-raises",
"pytest-randomly",
"pytest-xdist",
]
################################################################################
# Tool Configuration
################################################################################
# Hatch is building your package's wheel and sdist
# This tells hatch to only include Python packages (i.e., folders with __init__.py) in the build.
# read more about package building, here:
# https://www.pyopensci.org/python-package-guide/package-structure-code/python-package-distribution-files-sdist-wheel.html
[tool.hatch.build]
only-packages = true
# This tells Hatch to build the package from the src/ directory.
# Read more about src layouts here: https://www.pyopensci.org/python-package-guide/package-structure-code/python-package-structure.html
[tool.hatch.build.targets.wheel]
packages = ["src/wordguess"]
[tool.hatch.version]
source = "vcs"
raw-options = { version_scheme = "no-guess-dev", local_scheme = "no-local-version" }
[tool.hatch.build.hooks.vcs]
version-file = "src/wordguess/__version__.py"
######## Configure pytest for your test suite ########
[tool.pytest.ini_options]
testpaths = ["tests"] # Tells pytest what directory tests are in
markers = ["raises"] # Tells pytest to not raise a warning if you use @pytest.mark.raises
[tool.coverage.paths]
source = [
"src/wordguess",
"*/site-packages/wordguess",
]
[tool.coverage.run]
# Ensures code coverage is measured for branches (conditional statements with different outcomes) in your code.
branch = true
parallel = true
[tool.coverage.report]
# This configures the output test coverage report
exclude_lines = ["pragma: no cover"]
precision = 2
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401"]
# Use UV to create Hatch environments
[tool.hatch.envs.default]
installer = "uv"
################################################################################
# Hatch Environments
################################################################################
#--------------- Build and check your package ---------------#
# This table installs the tools you need to test and build your package
[tool.hatch.envs.build]
description = """Test the installation the package."""
features = [
"build",
]
detached = true
# This table installs created the command hatch run install:check which will build and check your package.
[tool.hatch.envs.build.scripts]
check = [
"hatch build {args:--clean}",
"twine check dist/*",
]
#--------------- Run tests ---------------#
[tool.hatch.envs.test]
description = """Run the test suite."""
features = [
"tests",
]
[[tool.hatch.envs.test.matrix]]
python = ["3.10", "3.11", "3.12", "3.13"]
[tool.hatch.envs.test.scripts]
run = "pytest {args:--cov=wordguess --cov-report=term-missing --cov-report=xml}"
#--------------- Build and preview your documentation ---------------#
# This sets up a hatch environment with associated dependencies that need to be installed
[tool.hatch.envs.docs]
description = """Build or serve the documentation."""
# Install optional dependency test for docs
features = [
"docs",
]
# This table contains the scripts that you can use to build and serve your docs
# hatch run docs:build will build your documentation
# hatch run docs:serve will serve them 'live' on your computer locally
[tool.hatch.envs.docs.scripts]
build = ["sphinx-build {args:-W -b html docs docs/_build}"]
serve = ["sphinx-autobuild docs --watch src/wordguess {args:-b html docs/_build/serve}"]
#--------------- Check security for your dependencies ---------------#
[tool.hatch.envs.audit]
description = """Check dependencies for security vulnerabilities."""
features = [
"build",
]
[tool.hatch.envs.audit.scripts]
check = ["pip-audit"]