From 56db684206568ad1d5e18e2de537e5090fec2ba3 Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Thu, 5 Jan 2023 21:54:09 -0500 Subject: [PATCH 1/4] MNT: Switch to hatch build backend --- pyproject.toml | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 934dedec95..c5b6c35899 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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" @@ -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 @@ -93,6 +102,3 @@ force-exclude = """ profile = "black" line_length = 99 extend_skip = ["_version.py", "externals"] - -[tool.setuptools_scm] -write_to = "nibabel/_version.py" From 620e74b1da932dbe249929a07e30faf2927bf26f Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Fri, 6 Jan 2023 07:41:48 -0500 Subject: [PATCH 2/4] MNT: Move think-before-you-act gitignores out of top level --- .gitignore | 20 +++----------------- nibabel/.gitignore | 16 ++++++++++++++++ 2 files changed, 19 insertions(+), 17 deletions(-) create mode 100644 nibabel/.gitignore diff --git a/.gitignore b/.gitignore index f644bb9182..983dd5aecf 100644 --- a/.gitignore +++ b/.gitignore @@ -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 # ######################################### .#* @@ -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/ diff --git a/nibabel/.gitignore b/nibabel/.gitignore new file mode 100644 index 0000000000..a89322fea3 --- /dev/null +++ b/nibabel/.gitignore @@ -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 From 299290ced8c0a041155e9aa034e1814cab761442 Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Fri, 6 Jan 2023 07:42:51 -0500 Subject: [PATCH 3/4] MNT: Add some caching entries to gitignore --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 983dd5aecf..4e9cf81029 100644 --- a/.gitignore +++ b/.gitignore @@ -51,12 +51,14 @@ dist/ .coverage .ropeproject/ htmlcov/ +.*_cache/ # Logs and databases # ###################### *.log *.sql *.sqlite +*.sqlite3 # OS generated files # ###################### From cfa209a3e721a4d180700161e95f479c7a84706a Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Fri, 6 Jan 2023 07:53:39 -0500 Subject: [PATCH 4/4] TEST: Mark large data file test as xfail --- nibabel/nicom/tests/test_dicomwrappers.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nibabel/nicom/tests/test_dicomwrappers.py b/nibabel/nicom/tests/test_dicomwrappers.py index 3efa7f3aab..62076c042a 100755 --- a/nibabel/nicom/tests/test_dicomwrappers.py +++ b/nibabel/nicom/tests/test_dicomwrappers.py @@ -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