diff --git a/.gitignore b/.gitignore index 6087923..bba3f77 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,12 @@ /pyMapVBVD-0.5.3.tar.gz /pyMapVBVD-0.5.4.tar.gz /pyMapVBVD-0.5.4-test-data.tar.xz +/pyMapVBVD-0.5.5.tar.gz +/pyMapVBVD-0.5.5-test-data.tar.xz +/pyMapVBVD-test-data.tar.xz +/pyMapVBVD-0.5.6.tar.gz +/pyMapVBVD-0.5.7.tar.gz +/pyMapVBVD-test-data.tar.zst +/pymapvbvd-0.6.0.tar.gz +/pymapvbvd-test-data.tar.zst +/pymapvbvd-0.6.1.tar.gz diff --git a/get_test_data.sh b/get_test_data.sh index ab40fbd..395006a 100755 --- a/get_test_data.sh +++ b/get_test_data.sh @@ -11,8 +11,13 @@ Usage: $1 VERSION Generate a source archive containing the test data files for pyMapVBVD that are tracked in git LFS and are not included in the default source archive. The -result will be named pyMapVBVD-\${VERSION}-test-data.tar.xz and will be written +result will be named pymapvbvd-test-data.tar.zst and will be written into the current working directory. + +The script attempts to produce a reproducible archive to avoid uploading +near-duplicate archives to the lookaside cache when the test data does not +change from one version to the next. Accordingly, the top-level directory +pymapvbvd-\${VERSION}/ is omitted from the archived paths. EOF } @@ -40,8 +45,8 @@ GITDIR="$(echo "${FORGEURL}" | sed -r 's@.*/@@')" #SOURCE0="${FORGEURL}/archive/${VERSION}/pdfminer.six-${VERSION}.tar.gz" #TARNAME="$(basename "${SOURCE0}")" -TARDIR="pyMapVBVD-${VERSION}" -NEWTAR="${TARDIR}-test-data.tar.xz" +TARDIR="pymapvbvd-${VERSION}" +NEWTAR='pymapvbvd-test-data.tar.zst' SAVEDIR="${PWD}" XDIR="$(mktemp -d)" @@ -61,8 +66,20 @@ git lfs ls-files -n | ln "${fn}" "${DESTDIR}/$(basename "${fn}")" done -cd "${XDIR}" -tar -cv "${TARDIR}/" | xz -9e > "${NEWTAR}" +cd "${XDIR}/${TARDIR}" +# https://www.gnu.org/software/tar/manual/html_section/Reproducibility.html +# We discard mtimes entirely, since git doesn’t store mtimes and they are just +# the time we did the git clone. +TZ=UTC LC_ALL=C tar \ + --create --verbose \ + --sort=name \ + --format=posix \ + --numeric-owner --owner=0 --group=0 \ + --mode=go+u,go-w \ + --pax-option='delete=atime,delete=ctime' \ + --clamp-mtime --mtime='@0' \ + . | + zstdmt --ultra -22 > "${XDIR}/${NEWTAR}" cd "${SAVEDIR}" mv -v "${XDIR}/${NEWTAR}" . diff --git a/python-pymapvbvd.rpmlintrc b/python-pymapvbvd.rpmlintrc new file mode 100644 index 0000000..bab460e --- /dev/null +++ b/python-pymapvbvd.rpmlintrc @@ -0,0 +1,9 @@ +# Not real spelling errors. +# - "dat" is from the extension ".dat" +# - "twix" is a data format +addFilter(r" spelling-error \('(dat|twix)',") +# This source cannot be a URL because we must use a script to download its +# contents from git-lfs. +addFilter(r" invalid-url Source[0-9]+: pymapvbvd-test-data\.tar\.zst$") +# Bogus; it is a perfectly fine zstandard file. +addFilter(r" inconsistent-file-extension pymapvbvd-test-data\.tar\.zst$") diff --git a/python-pymapvbvd.spec b/python-pymapvbvd.spec index aba8ec0..fbb7b36 100644 --- a/python-pymapvbvd.spec +++ b/python-pymapvbvd.spec @@ -1,40 +1,27 @@ -# In the releases mentioned in the expression, the system versioneer is too old -# for the generated _version.py to have the get_version() function, and too old -# for the License tag to be accurate. We must use the bundled, amalgamated -# versioneer.py to generate _version.py. -# -# Otherwise, we can use the system versioneer to generate _version.py, and can -# remove the bundled, amaglamated versioneer.py to indicate we aren’t using it. -%bcond bundled_versioneer %{expr:0%{?fc37} || 0%{?fc38} || 0%{?el9}} - Name: python-pymapvbvd -Version: 0.5.4 +Version: 0.6.1 Release: %autorelease Summary: Python twix file reader # The entire source is MIT, except: -# - The script versioneer.py and the file pymapvbvd/_version.py, which was -# generated by it, are both Unlicense. +# - The file pymapvbvd/_version.py, which is generated by python-versioneer, +# shares its license (Unlicense, for recent versions of Versioneer); see +# also versioneer.py (which is removed in %%prep) License: MIT AND Unlicense URL: https://github.com/wtclarke/pymapvbvd -Source0: %{pypi_source pyMapVBVD} +Source0: %{pypi_source pymapvbvd} # Generated with Source2: ./get_test_data.sh %%{version} -Source1: pyMapVBVD-%{version}-test-data.tar.xz +Source1: pymapvbvd-test-data.tar.zst Source2: get_test_data.sh -BuildArch: noarch -# The library assumes that the host and the file format are both little-endian. -# The necessary patch would not be trivial. Queried upstream: -# -# Big-endian host support? -# https://github.com/wtclarke/pymapvbvd/issues/35 -# -# A bug will be filed blocking F-ExcludeArch-s390x, per -# https://docs.fedoraproject.org/en-US/packaging-guidelines/#_architecture_build_failures, -# once the package is imported. -ExcludeArch: s390x +BuildSystem: pyproject +BuildOption(generate_buildrequires): -x tests +BuildOption(install): -l mapvbvd -BuildRequires: python3-devel +BuildArch: noarch +# PyMapVBVD assumes the platform is little-endian +# https://bugzilla.redhat.com/show_bug.cgi?id=2225518 +ExcludeArch: s390x %global common_description %{expand: Python port of the Matlab mapVBVD tool for reading Siemens raw data 'twix' @@ -52,50 +39,31 @@ Summary: %{summary} # The generated _version.py has the same license as python3dist(versioneer), # but we do not consider it to be bundled from Versioneer. -%if %{with bundled_versioneer} -# While versioneer.py is a bundled copy of python3dist(versioneer) = 0.28, it -# is not included in the binary RPMs, so we still do not treat it as bundled, -# and there is no corresponding virtual Provides. -%endif %description -n python3-pymapvbvd %{common_description} %prep -%autosetup -n pyMapVBVD-%{version} -p1 -%setup -q -T -D -b 1 -n pyMapVBVD-%{version} -%if %{without bundled_versioneer} +%autosetup -n pymapvbvd-%{version} -p1 +%setup -q -T -D -a 1 -c -n pymapvbvd-%{version} +# We can use the system versioneer to generate _version.py, and can remove the +# bundled, amaglamated versioneer.py to indicate we aren’t using it. rm -v versioneer.py -%endif -%generate_buildrequires +%generate_buildrequires -p export SETUPTOOLS_SCM_PRETEND_VERSION='%{version}' -%if %{with bundled_versioneer} -export PYTHONPATH="${PWD}" -%endif -%pyproject_buildrequires -x tests -%build +%build -p export SETUPTOOLS_SCM_PRETEND_VERSION='%{version}' -%if %{with bundled_versioneer} -export PYTHONPATH="${PWD}" -%endif -%pyproject_wheel -%install -%pyproject_install -%pyproject_save_files mapvbvd - - -%check +%check -a %pytest -v %files -n python3-pymapvbvd -f %{pyproject_files} -# pyproject_files handles LICENSE; verify with “rpm -qL -p …” %doc README.md diff --git a/sources b/sources index 87b5987..8624192 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (pyMapVBVD-0.5.4.tar.gz) = 1512db1aa15dcac460b87f100ecd9539a274f6b740f4024aee283cbc7fe3a0f466accd01e76bc393492c0088a797adaa0ae158c58ee36310ff6b0bac1666fb30 -SHA512 (pyMapVBVD-0.5.4-test-data.tar.xz) = c29bcd449fb39d2449a1c3e555d4d61f80bc09102156d2103366bad610fe70e3c0152e417899db4e51879faec61a6d087576332c16f82bb30eedc2296026bef6 +SHA512 (pymapvbvd-0.6.1.tar.gz) = b1c12e8f4c261522858feea9c66b5c174b37203a73a54aac8e2bbfb3ab7b1933ba44c9c172aa9cf7a97dba0c4554d99042c042fef9b42f73e912f747ceac1d55 +SHA512 (pymapvbvd-test-data.tar.zst) = 638be0a8ad0e0876b13948d657bcf921e18938e964215c0c61b9deb6eb5f3abee449a0391238e8e60ffef55c4ca3b9c2906f4c4fd3655e23eed3567279e72323