## START: Set by rpmautospec ## (rpmautospec version 0.2.6) %define autorelease(e:s:pb:) %{?-p:0.}%{lua: release_number = 4; base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); print(release_number + base_release_number - 1); }%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{?dist} ## END: Set by rpmautospec %bcond_without tests # Use this to package a pre-release #global commit xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx #global snapdate yyyymmdd Name: hatch Version: 1.5.0%{?commit:^%{snapdate}git%(echo '%{commit}' | cut -b -7)} Release: %autorelease Summary: A modern project, package, and virtual env manager %global tag hatch-v%{version} %global ref %{?commit:%{commit}}%{?!commit:%{tag}} %global archivename hatch-%{ref} # The entire source is (SPDX) MIT. Apache-2.0 license text in the tests is used # as a sample license text, not as a license for the source. License: MIT URL: https://github.com/pypa/hatch Source0: %{url}/archive/%{ref}/%{archivename}.tar.gz # For now, we need a helper script to access environments defined with # hatch/hatchling (https://hatch.pypa.io/latest/config/environment/). Source1: extract-hatchling-environments # Written for Fedora in groff_man(7) format based on --help output Source100: hatch.1 Source200: hatch-build.1 Source300: hatch-clean.1 Source400: hatch-config.1 Source401: hatch-config-explore.1 Source402: hatch-config-find.1 Source403: hatch-config-restore.1 Source404: hatch-config-set.1 Source405: hatch-config-show.1 Source406: hatch-config-update.1 Source500: hatch-dep.1 Source501: hatch-dep-hash.1 Source510: hatch-dep-show.1 Source511: hatch-dep-show-table.1 Source600: hatch-env.1 Source700: hatch-new.1 Source800: hatch-publish.1 Source900: hatch-run.1 Source1000: hatch-shell.1 Source1100: hatch-status.1 Source1200: hatch-version.1 # Backport (without changelogs) commits from hatchling 1.9.0 that affect the # “backend” tests. None of these affects source files installed as part of the # binary RPMs for hatch, only the tests and the sources that are packaged # separately as part of python-hatchling (the “backend”). Remove these patches # once a version of hatch newer than hatchling 1.9.0 is released. # Allow valid non-SPDX license values (#451) # https://github.com/pypa/hatch/commit/eb6759415fed6f1a6c9ce647dc95256eff16e2a4 Patch: 0001-Allow-valid-non-SPDX-license-values-451.patch # Improve error messages for SPDX license errors (#461) # https://github.com/pypa/hatch/commit/802062430698a550eaa646408b71b297d8a2588b Patch: 0002-Improve-error-messages-for-SPDX-license-errors-461.patch # Retroactively support License-File core metadata (#463) # https://github.com/pypa/hatch/commit/f6c069a2aefb9a1e82cd3e457cdc1258459862ba Patch: 0003-Retroactively-support-License-File-core-metadata-463.patch # File pattern matching now more closely resembles Git's behavior (#465) # https://github.com/pypa/hatch/commit/dac8659d060c6880ffce6b9ca10f916316954d1a Patch: 0004-File-pattern-matching-now-more-closely-resembles-Git.patch BuildArch: noarch BuildRequires: python3-devel # RHBZ#1985340, RHBZ#2076994 BuildRequires: pyproject-rpm-macros >= 1.2.0 BuildRequires: git-core # For script in %%generate_buildrequires: BuildRequires: python3dist(tomli) Requires: git-core %description Hatch is a modern, extensible Python project manager. Features: • Standardized build system with reproducible builds by default • Robust environment management with support for custom scripts • Easy publishing to PyPI or other sources • Version management • Configurable project generation with sane defaults • Responsive CLI, ~2-3x faster than equivalent tools %prep %autosetup -n %{archivename} -p1 # Loosen the minimum supported version of virtualenv. Upstream wants 20.16.2, # but, as of this writing, Fedora hasn’t updated past 20.15.1 because the # changes in subsequent releases would not had any effect on the RPM package: # # python-virtualenv-20.16.0 is available # https://bugzilla.redhat.com/show_bug.cgi?id=2110822 # “The new version has new versions of embedded wheels and no longer supports # Python 2. Neither is a reason for the upgrade.” # # python-virtualenv-20.16.1 is available # https://bugzilla.redhat.com/show_bug.cgi?id=2111286 # “Features - 20.16.1↵Update Nushell activation scripts to version 0.67↵but # we don't have nushell in Fedora.” # # python-virtualenv-20.16.2 is available # https://bugzilla.redhat.com/show_bug.cgi?id=2111703 # “The latest version updates only the embedded pip, nothing else.” # # python-virtualenv-20.16.3 is available # https://bugzilla.redhat.com/show_bug.cgi?id=2115427 # “Only embedded wheels have been updated.” sed -r -i 's/(virtualenv>=20\.)(16\.2)/\115\.1/' pyproject.toml %generate_buildrequires '%{SOURCE1}' -v %pyproject_buildrequires %{?with_tests:_req/env.test.txt} %build %pyproject_wheel # The Markdown documentation is meant to be built with mkdocs. The HTML result # is unsuitable for packaging due to various bundled and pre-minified # JavaScript and CSS. See https://bugzilla.redhat.com/show_bug.cgi?id=2006555 # for discussion of similar problems with Sphinx and Doxygen. We therefore do # not build or install the documentation. %install %pyproject_install %pyproject_save_files hatch install -t '%{buildroot}%{_mandir}/man1' -D -p -m 0644 \ '%{SOURCE100}' \ '%{SOURCE200}' \ '%{SOURCE300}' \ '%{SOURCE400}' '%{SOURCE401}' '%{SOURCE402}' '%{SOURCE403}' \ '%{SOURCE404}' '%{SOURCE405}' '%{SOURCE406}' \ '%{SOURCE500}' '%{SOURCE501}' '%{SOURCE510}' '%{SOURCE511}' \ '%{SOURCE600}' \ '%{SOURCE700}' \ '%{SOURCE800}' \ '%{SOURCE900}' \ '%{SOURCE1000}' \ '%{SOURCE1100}' \ '%{SOURCE1200}' %check %if %{with tests} # There is no need to deselect mark “requires_internet” manually because it # happens automagically via a runtime connectivity check. # TODO: What is happening here? # > assert zip_info.date_time == (2020, 2, 2, 0, 0, 0) # E assert (2022, 5, 18, 0, 0, 0) == (2020, 2, 2, 0, 0, 0) # E At index 0 diff: 2022 != 2020 # E Full diff: # E - (2020, 2, 2, 0, 0, 0) # E + (2022, 5, 18, 0, 0, 0) k="${k-}${k+ and }not (TestBuildStandard and test_editable_pth)" k="${k-}${k+ and }not (TestBuildStandard and test_editable_exact)" k="${k-}${k+ and }not (TestBuildStandard and test_editable_default)" k="${k-}${k+ and }not (TestBuildStandard and test_default_auto_detection)" k="${k-}${k+ and }not test_explicit_path" k="${k-}${k+ and }not test_default" # Fails with hatchling 1.10.0 because hatch and hatchling are very closely # coupled. Remove the skip when a new version of hatch is released. k="${k-}${k+ and }not (TestFileSelectionDefaults and test_global_exclude)" %pytest -k "${k-}" -vv %else %pyproject_check_import %endif %files -f %{pyproject_files} %license LICENSE.txt %{_bindir}/hatch %{_mandir}/man1/hatch.1* %{_mandir}/man1/hatch-*.1* %changelog * Tue Sep 20 2022 Benjamin A. Beasley 1.5.0-4 - Add a temporary test skip for hatchling 1.10.0 * Sat Sep 10 2022 Benjamin A. Beasley 1.5.0-3 - Use hatchling’s new “prepare_metadata_…” hook support for BR’s * Sat Sep 10 2022 Benjamin A. Beasley 1.5.0-2 - Backport test changes for hatchling 1.9.0 * Thu Sep 01 2022 Benjamin A. Beasley 1.5.0-1 - Update to 1.5.0 (close RHBZ#2121990) * Tue Aug 16 2022 Benjamin A. Beasley 1.4.2-1 - Update to 1.4.2 (close RHBZ#2116097) * Fri Aug 12 2022 Benjamin A. Beasley 1.3.1-6 - Stop loosening pyperclip version bound * Fri Aug 05 2022 Benjamin A. Beasley 1.3.1-5 - Confirm that License is SPDX MIT (no License field change) * Sun Jul 24 2022 Benjamin A. Beasley 1.3.1-4 - Add temporary test skips for hatchling 1.6.0 * Thu Jul 21 2022 Fedora Release Engineering 1.3.1-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild * Tue Jul 12 2022 Benjamin A. Beasley 1.3.1-2 - Update downstream man pages for hatch 1.3.1 * Tue Jul 12 2022 Benjamin A. Beasley 1.3.1-1 - Update to 1.3.1 (close RHBZ#2105825) * Tue Jun 14 2022 Python Maint 1.2.1-3 - Rebuilt for Python 3.11 * Tue May 31 2022 Benjamin A. Beasley 1.2.1-2 - Fix boilerplate for packaging pre-releases, currently unused * Tue May 31 2022 Benjamin A. Beasley 1.2.1-1 - Update to 1.2.1 (close RHBZ#2091789) * Mon May 23 2022 Benjamin A. Beasley 1.2.0-1 - Update to 1.2.0 (close RHBZ#2089095) * Sat May 21 2022 Benjamin A. Beasley 1.1.2-1 - Update to 1.1.2 (close RHBZ#2088851) * Sat May 21 2022 Benjamin A. Beasley 1.1.1^0099c83git20220519-2 - Fix archivename spec file macro * Fri May 20 2022 Benjamin A. Beasley 1.1.1^0099c83git20220519-1 - Updated snapshot that depends on hatchling >=1.0.0 * Wed May 18 2022 Benjamin A. Beasley 1.1.1^2e649eegit20220518-1 - Package a snapshot for full Hatchling 1.0.0 compatibility - Start running the “backend” tests, too * Wed May 18 2022 Benjamin A. Beasley 1.1.1-2 - Run backend tests, too * Fri May 13 2022 Benjamin A. Beasley 1.1.1-1 - Update to 1.1.1 (close RHBZ#2085129) - Update URLs now that PyPA has adopted Hatch * Fri May 06 2022 Benjamin A. Beasley 1.0.0-1 - Update to 1.0.0 (close RHBZ#2035978) * Sun Feb 06 2022 Benjamin A. Beasley 0.23.1-3 - Add man pages * Fri Feb 04 2022 Benjamin A. Beasley 0.23.1-2 - Add a few extra doc files * Fri Feb 04 2022 Benjamin A. Beasley 0.23.1-1 - Update to 0.23.1 (final pre-1.0 release) * Fri Feb 04 2022 Benjamin A. Beasley 0.23.0-15 - Port to pyproject-rpm-macros (“new guidelines”) * Thu Jan 20 2022 Fedora Release Engineering - 0.23.0-12 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild * Thu Jul 22 2021 Fedora Release Engineering - 0.23.0-11 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild * Wed Jul 21 2021 Lumír Balhar - 0.23.0-10 - Fix FTBFS in Fedora rawhide * Fri Jun 04 2021 Python Maint - 0.23.0-9 - Rebuilt for Python 3.10 * Thu Jan 28 2021 Lumír Balhar - 0.23.0-8 - Skip one more test * Tue Jan 26 2021 Lumír Balhar - 0.23.0-7 - Skip broken test (timeouts) * Tue Jan 26 2021 Fedora Release Engineering - 0.23.0-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild * Mon Jan 25 2021 Lumír Balhar - 0.23.0-5 - Extend tests timeout * Tue Jul 28 2020 Fedora Release Engineering - 0.23.0-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild * Tue May 26 2020 Miro Hrončok - 0.23.0-3 - Rebuilt for Python 3.9 * Wed Jan 29 2020 Fedora Release Engineering - 0.23.0-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild * Mon Nov 04 2019 Lumír Balhar - 0.23.0-1 - New upstream version 0.23.0 * Thu Oct 03 2019 Miro Hrončok - 0.20.0-12 - Rebuilt for Python 3.8.0rc1 (#1748018) * Mon Aug 19 2019 Miro Hrončok - 0.20.0-11 - Rebuilt for Python 3.8 * Thu Jul 25 2019 Fedora Release Engineering - 0.20.0-10 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild * Tue Feb 12 2019 Lumír Balhar - 0.20.0-9 - Fix dependency name python3-twine → twine * Fri Feb 01 2019 Fedora Release Engineering - 0.20.0-8 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild * Fri Jul 13 2018 Fedora Release Engineering - 0.20.0-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild * Wed Jun 27 2018 Lumír Balhar - 0.20.0-6 - Bump release to rebuild in side tag f29-python with Python 3.7 * Wed Jun 27 2018 Lumír Balhar - 0.20.0-5 - Fix FTBFS due to failing tests which newly requires internet connection * Tue Jun 19 2018 Miro Hrončok - 0.20.0-4 - Rebuilt for Python 3.7 * Wed Feb 07 2018 Fedora Release Engineering - 0.20.0-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild * Tue Dec 05 2017 Lumir Balhar - 0.20.0-2 - Backslashes removed from description * Wed Nov 15 2017 Lumir Balhar - 0.20.0-1 - New upstream version - New dependencies python-adduserpath (module userpath) and python-toml - One test skipped due to internet connection requirement * Wed Sep 13 2017 Lumir Balhar - 0.11.0-1 - Initial package.