-
Notifications
You must be signed in to change notification settings - Fork 357
/
Copy pathpyproject.toml
121 lines (100 loc) · 3.14 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
[build-system]
requires = ["hatchling>=1.10.0"]
build-backend = "hatchling.build"
[project]
name = "einops"
description = "A new flavour of deep learning operations"
readme = "README.md"
requires-python = ">=3.8" # in sync with target_version
keywords = [
'deep learning',
'neural networks',
'tensor manipulation',
'machine learning',
'scientific computations',
'einops',
]
license = { text = 'MIT' }
classifiers = [
'Intended Audience :: Science/Research',
'Programming Language :: Python :: 3',
'License :: OSI Approved :: MIT License',
]
dependencies = [
# no run-time or installation-time dependencies
]
dynamic = ["version"]
authors = [{ name = 'Alex Rogozhnikov' }]
[project.urls]
Homepage = 'https://github.com/arogozhnikov/einops'
[tool.setuptools]
packages = ['einops', 'einops.layers']
[tool.hatch.version]
path = "einops/__init__.py"
[tool.hatch.build.targets.sdist]
exclude = [
"/.devcontainer",
"/.github",
"/.idea",
"/.pytest_cache",
"/build",
"/dist",
"/docs",
"/docs_src",
"/scripts",
"/log",
]
[tool.hatch.build.targets.wheel]
# should use packages from main section
[tool.hatch.envs.docs]
dependencies = [
"mkdocs~=1.6.1",
"mkdocs-material~=9.5.34",
"mkdocstrings[python]~=0.26.1",
"mkdocs-jupyter~=0.25.0",
# pygments is required by codehilite (highlighting in mkdocs)
"pygments~=2.18.0",
]
[tool.hatch.envs.docs.scripts]
# For examples to build one has to run:
# hatch run docs:build
convert = "python scripts/convert_readme.py"
build = "convert && mkdocs build --clean --strict {args}"
serve = "convert && mkdocs serve --dev-addr localhost:8000 {args}"
deploy = "convert && mkdocs build --clean --strict && mkdocs gh-deploy"
# when mkdocs deployed from github actions, it requires --force. Reason unclear.
deploy_force = "convert && mkdocs build --clean --strict && mkdocs gh-deploy --force"
[tool.hatch.envs.pypi.scripts]
# hatch run pypi:deploy_test
deploy_test = "hatch build --clean && hatch publish -r test"
deploy = "hatch build --clean && hatch publish"
[tool.pytest.ini_options]
# suppressing irrelevant warnings from google's tensorflow and pb2 on m1 mac
# should be removed in 2023
filterwarnings = [
"ignore:Call to deprecated create function FieldDescriptor",
"ignore:Call to deprecated create function Descriptor",
"ignore:Call to deprecated create function EnumDescriptor",
"ignore:Call to deprecated create function EnumValueDescriptor",
"ignore:Call to deprecated create function FileDescriptor",
"ignore:Call to deprecated create function OneofDescriptor",
]
[tool.ruff]
line-length = 120
target-version = 'py38'
cache-dir = "/tmp/ruff_cache" # move cache out of workdir
[tool.ruff.format]
docstring-code-format = false
# do not reformat notebooks
exclude = ["*.ipynb"]
[tool.ruff.lint]
select = ["E4", "E7", "E9", "F", "W"]
# this notebook is not really a notebook,
# but a set of examples to be compared
exclude = ["*Pytorch.ipynb"]
[tool.ruff.lint.per-file-ignores]
"*.ipynb" = [
"E402", # Module level import not at top of cell
"F811", # redefinition of unused
"E702", # Multiple statements on one line (semicolon)
]