diff --git a/.gitignore b/.gitignore index f644bb9182..4e9cf81029 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/ @@ -65,12 +51,14 @@ dist/ .coverage .ropeproject/ htmlcov/ +.*_cache/ # Logs and databases # ###################### *.log *.sql *.sqlite +*.sqlite3 # OS generated files # ###################### 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 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 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"