generated from blooop/python_template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyproject.toml
153 lines (128 loc) · 4.27 KB
/
pyproject.toml
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
[project]
name = "rockerc"
version = "0.5.1"
authors = [{ name = "Austin Gregg-Smith", email = "blooop@gmail.com" }]
description = "A tool to parse rockerc.yaml files and pass on the arguments onto rocker"
readme = "README.md"
license = "MIT"
dependencies = [
"rocker>=0.2.17",
"deps-rocker>=0.6",
"off-your-rocker>=0.1.0",
"pyyaml>=5",
]
[tool.pixi.pypi-dependencies]
rockerc = { path = ".", editable = true }
[project.urls]
Source = "https://github.com/blooop/rockerc"
Home = "https://github.com/blooop/rockerc"
[tool.pixi.project]
channels = ["conda-forge"]
platforms = ["linux-64"]
[tool.pixi.dependencies]
python = ">=3.9"
[tool.pixi.feature.py309.dependencies]
python = "3.9.*"
[tool.pixi.feature.py310.dependencies]
python = "3.10.*"
[tool.pixi.feature.py311.dependencies]
python = "3.11.*"
[tool.pixi.feature.py312.dependencies]
python = "3.12.*"
[tool.pixi.feature.py313.dependencies]
python = "3.13.*"
[project.optional-dependencies]
test = [
"black>=23,<=24.10.0",
"pylint>=3.2.5,<=3.3.3",
"pytest-cov>=4.1,<=6.0.0",
"pytest>=7.4,<=8.3.4",
"hypothesis>=6.104.2,<=6.123.2",
"ruff>=0.5.0,<=0.8.5",
"coverage>=7.5.4,<=7.6.10",
]
#These are a list of externally maintained rocker extensions. use pip install rockerc[extensions] to install all of them
extensions = [
"pixi-rocker>=0.0.9",
"palanteer-rocker>=0.0.1",
"lazygit-rocker>=0.0.1",
"ghrocker==0.0.9",
"groot-rocker==0.4.1",
"cargo-rocker==0.0.3",
]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build]
include = ["rockerc"]
[project.scripts]
rockerc = "rockerc.rockerc:run_rockerc"
# Environments
[tool.pixi.environments]
default = { features = ["test"], solve-group = "default" }
py309 = ["py309", "test"]
py310 = ["py310", "test"]
py311 = ["py311", "test"]
py312 = ["py312", "test"]
py313 = ["py313", "test"]
[tool.pixi.tasks]
format = "black ."
check-clean-workspace = "git diff --exit-code"
ruff-lint = "ruff check . --fix"
pylint = "pylint --version && echo 'running pylint...' && pylint $(git ls-files '*.py')"
lint = { depends_on = ["ruff-lint", "pylint"] }
style = { depends_on = ["format", "lint"] }
commit-format = "git commit -a -m'autoformat code' || true"
test = "pytest"
coverage = "coverage run -m pytest && coverage xml -o coverage.xml"
coverage-report = "coverage report -m"
update-lock = "pixi update && git commit -a -m'update pixi.lock' || true"
push = "git push"
update-lock-push = { depends_on = ["update-lock", "push"] }
fix = { depends_on = ["update-lock", "format", "ruff-lint"] }
fix-commit-push = { depends_on = ["fix", "commit-format", "update-lock-push"] }
ci-no-cover = { depends_on = ["style", "test"] }
ci = { depends_on = [
"format",
"ruff-lint",
"pylint",
"coverage",
"coverage-report",
] }
ci-push = { depends_on = ["format", "ruff-lint", "update-lock", "ci", "push"] }
clear-pixi = "rm -rf .pixi pixi.lock"
setup-git-merge-driver = "git config merge.ourslock.driver true"
update-from-template-repo = "./scripts/update_from_template.sh"
[tool.pylint]
extension-pkg-whitelist = ["numpy"]
jobs = 16 #detect number of cores
[tool.pylint.'MESSAGES CONTROL']
disable = "C,logging-fstring-interpolation,line-too-long,fixme,broad-exception-caught,missing-module-docstring,too-many-instance-attributes,too-few-public-methods,too-many-arguments,too-many-locals,too-many-branches,too-many-statements,use-dict-literal,cyclic-import,duplicate-code,too-many-public-methods"
enable = "no-else-return,consider-using-in"
[tool.black]
line-length = 100
[tool.ruff]
line-length = 100 # Same as Black.
target-version = "py310"
[tool.ruff.lint]
# Never enforce `E501` (line length violations).
#"F841" will auto remove unused variables which is annoying during development, pylint catches this anyway
ignore = ["E501", "E902", "F841"]
# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
# Ignore `E402` (import violations) in all `__init__.py` files, and in `path/to/file.py`.
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["E402", "F401"]
[tool.coverage.run]
omit = ["*/test/*", "__init__.py"]
[tool.coverage.report]
exclude_also = [
"def __repr__",
"if False:",
"if 0:",
"raise AssertionError",
"raise NotImplementedError",
"if __name__ == .__main__.:",
"pass",
"(_):",
]