-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
148 lines (120 loc) · 4.59 KB
/
pyproject.toml
File metadata and controls
148 lines (120 loc) · 4.59 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
[project]
authors = [{name = "Author", email = "author@author.com"}]
dependencies = []
description = "Template"
name = "Template"
requires-python = ">= 3.11"
version = "0.1.0"
scripts = { hello = "project.cli:hello"}
[build-system]
build-backend = "hatchling.build"
requires = ["hatchling"]
[tool.hatch.build.targets.wheel]
packages = ["project"]
[tool.pixi.workspace]
channels = ["conda-forge"]
platforms = ["win-64", "linux-64", "osx-64", "osx-arm64"]
preview = ["pixi-build"]
[tool.pixi.package]
name = "template_project"
[tool.pixi.package.build]
backend = { name = "pixi-build-python", version = "0.3.*" }
[tool.pixi.package.host-dependencies]
hatchling = "*"
[tool.pixi.package.run-dependencies]
click = "*"
[tool.pixi.dependencies]
template_project = { path = "."}
[tool.pixi.pypi-dependencies]
# template = { path = ".", editable = true }
[tool.pixi.feature.build.dependencies]
twine = "*"
[tool.pixi.feature.build.pypi-dependencies]
build = "*"
[tool.pixi.feature.build.tasks]
build_exes = {cmd= "rm -r dist; python -m build"}
push_to_pypi = "python -m twine upload --verbose --repository testpypi dist/*"
[tool.pixi.feature.docs.tasks]
build-docs = "mkdocs build --strict"
docs = { cmd = "mkdocs serve", description = "Serve the docs locally" }
push-gh = "mkdocs gh-deploy"
[tool.pixi.feature.test.tasks]
test = "pytest --junitxml=coverage/junit/test-results.xml --cov=FIXME --cov-report=term --cov-report=xml:coverage/coverage.xml --cov-report=html:coverage/html"
lint = "ruff check"
lint_fix = "ruff check --fix"
lint_gh = "ruff check --output-format=github"
lint_docs_gh = "ruff check --select D,D401 --ignore D417 --output-format=github"
format = "ruff format"
format_diff = "ruff format --diff"
typecheck = "mypy src"
pre-commit-all = "pre-commit run --all-files"
pre-commit-install = "pre-commit install"
[tool.pixi.feature.docs.dependencies]
mkdocs = "*"
mkdocs-click = "*"
mkdocs-material = "*"
mkdocs-macros-plugin = ">=1.3.7,<2"
markupsafe = "*"
mkdocs-git-revision-date-localized-plugin = "*"
mkdocs-exporter = "*"
mkdocstrings-python = "*"
[tool.pixi.feature.test.dependencies]
pytest = "*"
pytest-cov = "*"
ruff = "*"
pre-commit = "*"
mypy = "*"
[tool.pixi.environments]
build = {features = ["build"]}
default = {features = [], solve-group = "default"}
utility = {features = ["test","docs"], solve-group = "default"}
[tool.ruff.lint]
select = [
# General errors and warnings
"E4", # Indentation and alignment issues
"E7", # Syntax errors
"E9", # Runtime errors
"F", # Pyflakes: undefined names, unused imports, etc.
# Style and conventions
"E", # Pycodestyle: overall style conventions
"B", # flake8-bugbear: common pitfalls and potential bugs
"SIM", # flake8-simplify: simplifiable constructs and redundant code
"C90", # flake8-comprehensions: encourages proper use of comprehensions
# Python modernization
"UP", # pyupgrade: encourages modern Python syntax
"A", # flake8-annotations: enforces type hints for better code clarity
"PT", # flake8-pytest-style: improves pytest test readability and conventions
# Imports
"I", # isort: ensures import order
"TID", # flake8-tidy-imports: removes unused or duplicate imports
# Complexity
"C", # McCabe: limits code complexity (cyclomatic complexity)
"PLR", # flake8-pluralize: flags incorrect pluralization in variable names
# Docstring standards
"D", # Pydocstyle: general docstring conventions
"D401", # Enforces imperative mood for docstrings
"RUF", # ruff-docstrings: additional docstring quality checks
# NumPy-specific
"NPY", # numpy-style: enforces proper NumPy conventions and idioms
"NPY001",# Enforces correct use of array shapes and dimensions
"NPY002",# Flags manual creation of identity matrices, suggesting np.eye or np.identity
# Pandas-specific
"PD", # pandas-vet: ensures proper usage of Pandas API
"PD901", # Encourages vectorized operations over DataFrame.apply or loops
"PD002", # Flags usage of .ix, recommending modern alternatives (.loc or .iloc)
# Pathlib-specific
"PTH", # pathlib-pure: promotes using Pathlib instead of os.path
]
ignore = [
# Allow missing parameter documentation in docstrings
"D417", # Relax strict requirements for documenting all parameters
"SIM117", # Allow comparisons to literal True/False for explicit clarity
"NPY003", # Allow slicing without explicitly defining start/stop/step (e.g., [:])
"E501", # personal preference
]
[tool.mypy]
python_version = "3.12"
warn_return_any = true
warn_unused_configs = true
exclude = []
ignore_missing_imports = true