Skip to content

Commit

Permalink
Merge pull request #1176 from effigies/mnt/hatch
Browse files Browse the repository at this point in the history
MNT: Switch to hatchling build backend
  • Loading branch information
effigies authored Jan 6, 2023
2 parents 02c7a34 + cfa209a commit 2145058
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 28 deletions.
22 changes: 5 additions & 17 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# See also nibabel/.gitignore for test data rules that
# are meant to make you think before you `git add --force`

# Editor temporary/working/backup files #
#########################################
.#*
Expand Down Expand Up @@ -36,23 +39,6 @@
*.py[oc]
*.so

# Packages #
############
# it's better to unpack these files and commit the raw source
# git has its own built in compression methods
*.7z
*.bz2
*.bzip2
*.dmg
*.gz
*.iso
*.jar
*.rar
*.tar
*.tbz2
*.tgz
*.zip

# Python files #
################
build/
Expand All @@ -65,12 +51,14 @@ dist/
.coverage
.ropeproject/
htmlcov/
.*_cache/

# Logs and databases #
######################
*.log
*.sql
*.sqlite
*.sqlite3

# OS generated files #
######################
Expand Down
16 changes: 16 additions & 0 deletions nibabel/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Packages #
############
# it's better to unpack these files and commit the raw source
# git has its own built in compression methods
*.7z
*.bz2
*.bzip2
*.dmg
*.gz
*.iso
*.jar
*.rar
*.tar
*.tbz2
*.tgz
*.zip
2 changes: 2 additions & 0 deletions nibabel/nicom/tests/test_dicomwrappers.py
Original file line number Diff line number Diff line change
Expand Up @@ -622,12 +622,14 @@ def test_image_position(self):
assert MFW(fake_mf).image_position.dtype == float

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

@dicom_test
@pytest.mark.xfail(reason='Not packaged in install', raises=FileNotFoundError)
def test_data_real(self):
# The data in this file is (initially) a 1D gradient so it compresses
# well. This just tests that the data ordering produces a consistent
Expand Down
28 changes: 17 additions & 11 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[build-system]
requires = ["setuptools", "setuptools_scm[toml]>=6.2"]
build-backend = "setuptools.build_meta"
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"

[project]
name = "nibabel"
Expand Down Expand Up @@ -70,13 +70,22 @@ test = [
]
zstd = ["pyzstd >= 0.14.3"]

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

[tool.setuptools.packages.find]
include = ["nibabel*", "nisext*"]
[tool.hatch.build.targets.wheel]
packages = ["nibabel", "nisext"]
exclude = [
# 56MB test file does not need to be installed everywhere
"nibabel/nicom/tests/data/4d_multiframe_test.dcm",
]

[tool.hatch.version]
source = "vcs"
raw-options = { version_scheme = "release-branch-semver" }

[tool.hatch.build.hooks.vcs]
version-file = "nibabel/_version.py"

[tool.blue]
line_length = 99
Expand All @@ -93,6 +102,3 @@ force-exclude = """
profile = "black"
line_length = 99
extend_skip = ["_version.py", "externals"]

[tool.setuptools_scm]
write_to = "nibabel/_version.py"

0 comments on commit 2145058

Please sign in to comment.