Skip to content

Commit 8b5d247

Browse files
committed
build: migrate setup.{cfg,py} => pyproject.toml
1 parent 27d5543 commit 8b5d247

File tree

5 files changed

+91
-97
lines changed

5 files changed

+91
-97
lines changed

.pre-commit-config.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,10 @@ repos:
3636
- flake8-comprehensions
3737
- flake8-debugger
3838
- flake8-isort
39+
- flake8-pyproject
3940
- flake8-string-format
4041
- repo: https://github.com/google/yapf
41-
rev: v0.32.0
42+
rev: v0.33.0
4243
hooks:
4344
- id: yapf
4445
args: [-i]

LICENCE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright 2020 AMYPAD
1+
Copyright 2020-23 AMYPAD
22

33
Licensed under the Apache License, Version 2.0 (the "License");
44
you may not use this project except in compliance with the License.

pyproject.toml

+88
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,94 @@
11
[build-system]
22
requires = ["setuptools>=42", "wheel", "setuptools_scm[toml]>=3.4"]
3+
build-backend = "setuptools.build_meta"
34

45
[tool.setuptools_scm]
56
write_to = "miutil/_dist_ver.py"
67
write_to_template = "__version__ = '{version}'\n"
8+
9+
[tool.setuptools.packages.find]
10+
exclude = ["tests"]
11+
12+
[project.urls]
13+
documentation = "https://github.com/AMYPAD/miutil/#miutil"
14+
repository = "https://github.com/AMYPAD/miutil"
15+
changelog = "https://github.com/AMYPAD/miutil/releases"
16+
17+
[project]
18+
name = "miutil"
19+
dynamic = ["version"]
20+
maintainers = [{name = "Casper da Costa-Luis", email = "[email protected]"}]
21+
description = "Medical imaging utilities for the AMYPAD and NiftyPET projects"
22+
readme = "README.rst"
23+
requires-python = ">=3.7"
24+
keywords = ["fMRI", "PET", "SPECT", "EEG", "MEG"]
25+
license = {text = "Apache-2.0"}
26+
classifiers = [
27+
"Development Status :: 4 - Beta",
28+
"Intended Audience :: Developers",
29+
"Environment :: GPU",
30+
"Environment :: GPU :: NVIDIA CUDA",
31+
"Intended Audience :: Education",
32+
"Intended Audience :: Healthcare Industry",
33+
"Intended Audience :: Science/Research",
34+
"License :: OSI Approved :: Apache Software License",
35+
"Operating System :: Microsoft :: Windows",
36+
"Operating System :: POSIX :: Linux",
37+
"Programming Language :: Other Scripting Engines",
38+
"Programming Language :: Python :: 3",
39+
"Programming Language :: Python :: 3.7",
40+
"Programming Language :: Python :: 3.8",
41+
"Programming Language :: Python :: 3.9",
42+
"Programming Language :: Python :: 3.10",
43+
"Programming Language :: Python :: 3.11",
44+
"Programming Language :: Python :: 3 :: Only",
45+
"Topic :: Scientific/Engineering :: Medical Science Apps.",
46+
"Topic :: Software Development :: Libraries",
47+
"Topic :: Software Development :: Libraries :: Python Modules",
48+
"Topic :: Software Development :: User Interfaces",
49+
"Topic :: System :: Installation/Setup",
50+
"Topic :: Utilities"]
51+
dependencies = ["tqdm>=4.40.0"]
52+
53+
[project.optional-dependencies]
54+
dev = ["pytest>=6", "pytest-cov", "pytest-timeout", "pytest-xdist"]
55+
nii = ["nibabel>=4.0", "numpy"]
56+
plot = ["matplotlib", "numpy", "scipy"]
57+
cuda = ["argopt", "pynvml"]
58+
web = ["requests"]
59+
mbeautify = ["argopt", "tqdm>=4.42.0", "requests"] # web
60+
61+
[project.scripts]
62+
cuinfo = "miutil.cuinfo:main"
63+
mbeautify = "miutil.mlab.beautify:main"
64+
65+
[tool.flake8]
66+
max_line_length = 99
67+
extend_ignore = ["E261"]
68+
exclude = [".git", "__pycache__", "build", "dist", ".eggs"]
69+
70+
[tool.yapf]
71+
spaces_before_comment = [15, 20]
72+
arithmetic_precedence_indication = true
73+
allow_split_before_dict_value = false
74+
coalesce_brackets = true
75+
column_limit = 99
76+
each_dict_entry_on_separate_line = false
77+
space_between_ending_comma_and_closing_bracket = false
78+
split_before_named_assigns = false
79+
split_before_closing_bracket = false
80+
blank_line_before_nested_class_or_def = false
81+
82+
[tool.isort]
83+
profile = "black"
84+
line_length = 99
85+
multi_line_output = 4
86+
known_first_party = ["miutil", "tests"]
87+
88+
[tool.pytest.ini_options]
89+
minversion = "6.0"
90+
timeout = 15
91+
log_level = "INFO"
92+
python_files = ["tests/test_*.py"]
93+
testpaths = ["tests"]
94+
addopts = "-v --tb=short -rxs -W=error --log-level=debug -n=auto --durations=0 --cov=miutil --cov-report=term-missing --cov-report=xml"

setup.cfg

-92
This file was deleted.

setup.py

-3
This file was deleted.

0 commit comments

Comments
 (0)