Skip to content

Commit 2145058

Browse files
authored
Merge pull request #1176 from effigies/mnt/hatch
MNT: Switch to hatchling build backend
2 parents 02c7a34 + cfa209a commit 2145058

File tree

4 files changed

+40
-28
lines changed

4 files changed

+40
-28
lines changed

.gitignore

+5-17
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# See also nibabel/.gitignore for test data rules that
2+
# are meant to make you think before you `git add --force`
3+
14
# Editor temporary/working/backup files #
25
#########################################
36
.#*
@@ -36,23 +39,6 @@
3639
*.py[oc]
3740
*.so
3841

39-
# Packages #
40-
############
41-
# it's better to unpack these files and commit the raw source
42-
# git has its own built in compression methods
43-
*.7z
44-
*.bz2
45-
*.bzip2
46-
*.dmg
47-
*.gz
48-
*.iso
49-
*.jar
50-
*.rar
51-
*.tar
52-
*.tbz2
53-
*.tgz
54-
*.zip
55-
5642
# Python files #
5743
################
5844
build/
@@ -65,12 +51,14 @@ dist/
6551
.coverage
6652
.ropeproject/
6753
htmlcov/
54+
.*_cache/
6855

6956
# Logs and databases #
7057
######################
7158
*.log
7259
*.sql
7360
*.sqlite
61+
*.sqlite3
7462

7563
# OS generated files #
7664
######################

nibabel/.gitignore

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Packages #
2+
############
3+
# it's better to unpack these files and commit the raw source
4+
# git has its own built in compression methods
5+
*.7z
6+
*.bz2
7+
*.bzip2
8+
*.dmg
9+
*.gz
10+
*.iso
11+
*.jar
12+
*.rar
13+
*.tar
14+
*.tbz2
15+
*.tgz
16+
*.zip

nibabel/nicom/tests/test_dicomwrappers.py

+2
Original file line numberDiff line numberDiff line change
@@ -622,12 +622,14 @@ def test_image_position(self):
622622
assert MFW(fake_mf).image_position.dtype == float
623623

624624
@dicom_test
625+
@pytest.mark.xfail(reason='Not packaged in install', raises=FileNotFoundError)
625626
def test_affine(self):
626627
# Make sure we find orientation/position/spacing info
627628
dw = didw.wrapper_from_file(DATA_FILE_4D)
628629
aff = dw.affine
629630

630631
@dicom_test
632+
@pytest.mark.xfail(reason='Not packaged in install', raises=FileNotFoundError)
631633
def test_data_real(self):
632634
# The data in this file is (initially) a 1D gradient so it compresses
633635
# well. This just tests that the data ordering produces a consistent

pyproject.toml

+17-11
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[build-system]
2-
requires = ["setuptools", "setuptools_scm[toml]>=6.2"]
3-
build-backend = "setuptools.build_meta"
2+
requires = ["hatchling", "hatch-vcs"]
3+
build-backend = "hatchling.build"
44

55
[project]
66
name = "nibabel"
@@ -70,13 +70,22 @@ test = [
7070
]
7171
zstd = ["pyzstd >= 0.14.3"]
7272

73-
[tool.setuptools]
74-
platforms = ["OS Independent"]
75-
provides = ["nibabel", "nisext"]
76-
zip-safe = false
73+
[tool.hatch.build.targets.sdist]
74+
exclude = [".git_archival.txt"]
7775

78-
[tool.setuptools.packages.find]
79-
include = ["nibabel*", "nisext*"]
76+
[tool.hatch.build.targets.wheel]
77+
packages = ["nibabel", "nisext"]
78+
exclude = [
79+
# 56MB test file does not need to be installed everywhere
80+
"nibabel/nicom/tests/data/4d_multiframe_test.dcm",
81+
]
82+
83+
[tool.hatch.version]
84+
source = "vcs"
85+
raw-options = { version_scheme = "release-branch-semver" }
86+
87+
[tool.hatch.build.hooks.vcs]
88+
version-file = "nibabel/_version.py"
8089

8190
[tool.blue]
8291
line_length = 99
@@ -93,6 +102,3 @@ force-exclude = """
93102
profile = "black"
94103
line_length = 99
95104
extend_skip = ["_version.py", "externals"]
96-
97-
[tool.setuptools_scm]
98-
write_to = "nibabel/_version.py"

0 commit comments

Comments
 (0)