## START: Set by rpmautospec ## (rpmautospec version 0.6.0) ## RPMAUTOSPEC: autorelease, autochangelog %define autorelease(e:s:pb:n) %{?-p:0.}%{lua: release_number = 1; base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); print(release_number + base_release_number - 1); }%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} ## END: Set by rpmautospec %bcond tests 1 # These tests are really for python-hatchling; they are more likely than other # tests to fail when the version of hatchling is compatible but does not # exactly match the version of hatchling that existed in the shared git # repository at the time of this Hatch release. Furthermore, it may be # redundant to run these here if we run them in the python-hatchling build. %bcond backend_tests 1 Name: hatch Version: 1.12.0 Release: %autorelease Summary: A modern project, package, and virtual env manager %global tag hatch-v%{version} %global archivename hatch-%{tag} # 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/%{tag}/hatch-%{tag}.tar.gz # 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 Source410: hatch-config-explore.1 Source420: hatch-config-find.1 Source430: hatch-config-restore.1 Source440: hatch-config-set.1 Source450: hatch-config-show.1 Source460: hatch-config-update.1 Source500: hatch-dep.1 Source510: hatch-dep-hash.1 Source520: hatch-dep-show.1 Source521: hatch-dep-show-requirements.1 Source522: hatch-dep-show-table.1 Source600: hatch-env.1 Source610: hatch-env-create.1 Source620: hatch-env-find.1 Source630: hatch-env-prune.1 Source640: hatch-env-remove.1 Source650: hatch-env-run.1 Source660: hatch-env-show.1 Source700: hatch-new.1 Source800: hatch-project.1 Source810: hatch-project-metadata.1 Source900: hatch-publish.1 Source1000: hatch-run.1 Source1100: hatch-shell.1 Source1200: hatch-status.1 Source1300: hatch-version.1 Source1400: hatch-fmt.1 Source1500: hatch-python.1 Source1510: hatch-python-find.1 Source1520: hatch-python-install.1 Source1530: hatch-python-remove.1 Source1540: hatch-python-show.1 Source1550: hatch-python-update.1 Source1600: hatch-self.1 Source1610: hatch-self-report.1 Source1620: hatch-self-restore.1 Source1630: hatch-self-update.1 Source1700: hatch-test.1 # Add pytest.mark.requires_internet to a few more tests # https://github.com/pypa/hatch/pull/1665 Patch: %{url}/pull/1665.patch # Fedora only: Loosen virtualenv version bound to 20.21.1 # # In Fedora, we are currently unable to upgrade virtualenv at all # (https://bugzilla.redhat.com/show_bug.cgi?id=2188155#c6), and therefore # any fixes Hatch needs must instead be backported individually. Patch: 0001-Fedora-only-Loosen-virtualenv-version-bound-to-20.21.patch BuildArch: noarch BuildRequires: python3-devel %if %{with tests} # Upstream uses “hatch test” to run the tests, but this wants to use Python # interpreters downloaded from the Internet # (https://github.com/pypa/hatch/issues/1541), and there is less flexibility # for skipping or ignoring tests than there is when we use pytest directly. # # Test dependencies are listed in src/hatch/env/internal/test.py: # 'coverage-enable-subprocess==1.0', <-- linters/coverage # 'coverage[toml]~=7.4', <-- linters/coverage # 'pytest~=8.1', # 'pytest-mock~=3.12', # 'pytest-randomly~=3.15', # 'pytest-rerunfailures~=14.0', # 'pytest-xdist[psutil]~=3.5', BuildRequires: %{py3_dist pytest} BuildRequires: %{py3_dist pytest-mock} BuildRequires: %{py3_dist pytest-randomly} BuildRequires: %{py3_dist pytest-rerunfailures} BuildRequires: %{py3_dist pytest-xdist[psutil]} # For extracting the list of test “extra-dependencies” from hatch.toml: BuildRequires: tomcli %if %{with backend_tests} # A number of tests in TestBuildBootstrap require cargo. BuildRequires: cargo %endif %endif BuildRequires: git-core 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 and UV • Test execution with known best practices • Static analysis with sane defaults • Built-in Python script runner • Easy publishing to PyPI or other indices • Version management • Best practice project generation • Responsive CLI, ~2-3x faster than equivalent tools %prep %autosetup -n %{archivename} -p1 # https://hatch.pypa.io/latest/config/environment/ tomcli get hatch.toml -F newline-list envs.hatch-test.extra-dependencies | tee _envs.hatch-test.extra-dependencies.txt %generate_buildrequires %if %{with tests} %pyproject_buildrequires _envs.hatch-test.extra-dependencies.txt %else %pyproject_buildrequires %endif %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 -l hatch install -t '%{buildroot}%{_mandir}/man1' -D -p -m 0644 \ '%{SOURCE100}' \ '%{SOURCE200}' \ '%{SOURCE300}' \ '%{SOURCE400}' '%{SOURCE410}' '%{SOURCE420}' '%{SOURCE430}' \ '%{SOURCE440}' '%{SOURCE450}' '%{SOURCE460}' \ '%{SOURCE500}' '%{SOURCE510}' '%{SOURCE520}' '%{SOURCE521}' \ '%{SOURCE522}' \ '%{SOURCE600}' '%{SOURCE610}' '%{SOURCE620}' '%{SOURCE630}' \ '%{SOURCE640}' '%{SOURCE650}' '%{SOURCE660}' \ '%{SOURCE700}' \ '%{SOURCE800}' '%{SOURCE810}' \ '%{SOURCE900}' \ '%{SOURCE1000}' \ '%{SOURCE1100}' \ '%{SOURCE1200}' \ '%{SOURCE1300}' \ '%{SOURCE1400}' \ '%{SOURCE1500}' '%{SOURCE1510}' '%{SOURCE1520}' '%{SOURCE1530}' \ '%{SOURCE1540}' '%{SOURCE1550}' %check %if %{with tests} %if %{with backend_tests} # Without this, we end up with several test failures related to zip timestamps. unset SOURCE_DATE_EPOCH %else ignore="${ignore-} --ignore=tests/backend/" %endif # FAILED tests/cli/test/test_test.py::TestCustomScripts::test_single - # AssertionError: assert [call('test hatch-test.py3.12', shell=True)] == # [call('test hatch-test.py3.13', shell=True)] # This appears to be due to an expectation that the tests are run via “hatch # test” on one of Hatch’s “standard” Python interpreters, rather than on the # system Python. k="${k-}${k+ and }not (TestCustomScripts and test_single)" # https://github.com/pypa/hatch/issues/1670 # hatch.errors.PythonDistributionResolutionError: Could not find a default # source for name='${param}' system='linux' arch='${arch}' abi='gnu' variant='' # # Since we cannot use %%ifarch in a noarch package, we skip tests that fail on # *any* architecture, even if we happen to be building on an architecture where # they pass. The largest set of failing distributions are, for ppc64le/s390x: missing_dists='3.7 3.8 pypy2.7 pypy3.9 pypy3.10' # For aarch64, missing_dists='3.7', and for x86_64, missing_dists=''. for param in ${missing_dists} do k="${k-}${k+ and }not test_custom_source[${param}]" # Requires network (but does fail when it is enabled) k="${k-}${k+ and }not test_installation[${param}]" done # Also, for ppc64le and s390x: k="${k-}${k+ and }not (TestDistributionPaths and test_pypy_custom)" k="${k-}${k+ and }not (TestDistributionVersions and test_pypy_custom)" # Tests requiring network access are automatically disabled via # pytest.mark.requires_internet when network access is not available. # # Note that if built locally with --enable-network, some of these tests may # fail due to issues like missing dependencies for building packages that are # to be test-installed (e.g. because Rawhide’s system Python is a pre-release # for which these packages have not released prebuilt wheels); this is another # consequence of running tests on the system Python rather than via “hatch # test.” We don’t bother tracking these failures. %pytest -k "${k-}" ${ignore-} -vv %else %pyproject_check_import %endif %files -f %{pyproject_files} %{_bindir}/hatch %{_mandir}/man1/hatch.1* %{_mandir}/man1/hatch-*.1* %changelog ## START: Generated by rpmautospec * Fri Aug 09 2024 Benjamin A. Beasley - 1.12.0-1 - Update to 1.12.0 (close RHBZ#2278565) * Thu Jul 18 2024 Fedora Release Engineering - 1.9.7-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild * Sun Jun 09 2024 Python Maint - 1.9.7-2 - Rebuilt for Python 3.13 * Fri Apr 26 2024 Benjamin A. Beasley - 1.9.7-1 - Update to 1.9.7 (close RHBZ#2276819) * Wed Mar 20 2024 Benjamin A. Beasley - 1.9.4-1 - Update to 1.9.4 (close RHBZ#2269103) * Fri Jan 26 2024 Benjamin A. Beasley - 1.9.3-1 - Update to 1.9.3 (close RHBZ#2260285) * Wed Jan 24 2024 Fedora Release Engineering - 1.9.2-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild * Sun Jan 21 2024 Benjamin A. Beasley - 1.9.2-1 - Update to 1.9.2 (close RHBZ#2259393) * Sat Jan 20 2024 Fedora Release Engineering - 1.9.1-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild * Mon Dec 25 2023 Benjamin A. Beasley - 1.9.1-1 - Update to 1.9.1 (close RHBZ#2255798) * Tue Dec 19 2023 Benjamin A. Beasley - 1.9.0-1 - Update to 1.9.0 (close RHBZ#2255183) * Fri Dec 15 2023 Benjamin A. Beasley - 1.8.1-2 - Assert that %%pyproject_files contains a license file * Thu Dec 14 2023 Benjamin A. Beasley - 1.8.1-1 - Update to 1.8.1 (close RHBZ#2254030) * Wed Oct 04 2023 Benjamin A. Beasley - 1.7.0-9 - Skip text_context_formatting for packaging 23.2 * Tue Aug 29 2023 Benjamin A. Beasley - 1.7.0-8 - Patch tests for tomlkit 0.12.1 (fix RHBZ#2235499) * Thu Jul 20 2023 Fedora Release Engineering - 1.7.0-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild * Mon Jul 03 2023 Python Maint - 1.7.0-6 - Rebuilt for Python 3.12 * Sun Jun 18 2023 Benjamin A. Beasley - 1.7.0-5 - Use new (rpm 4.17.1+) bcond style * Sat May 13 2023 Benjamin A. Beasley - 1.7.0-3 - Drop lower-bound on pyproject-rpm-macros * Tue Apr 25 2023 Benjamin A. Beasley - 1.7.0-2 - Patch tests for hatchling 1.14.1 * Mon Apr 03 2023 Benjamin A. Beasley - 1.7.0-1 - Update to 1.7.0 (close RHBZ#2184066) * Thu Jan 19 2023 Fedora Release Engineering - 1.6.3-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild * Sun Jan 01 2023 Benjamin A. Beasley - 1.6.3-5 - With hatchling ≥1.12.0, pyproject_files handles license file * Sat Dec 31 2022 Benjamin A. Beasley - 1.6.3-4 - Patch tests for hatchling 1.12 * Tue Dec 20 2022 Benjamin A. Beasley - 1.6.3-3 - No longer need to patch virtualenv version on F38+ * Tue Dec 20 2022 Benjamin A. Beasley - 1.6.3-2 - Trivial spec file tidying * Tue Oct 25 2022 Benjamin A. Beasley - 1.6.3-1 - Update to 1.6.3 (close RHBZ#2137456) * Thu Oct 20 2022 Benjamin A. Beasley - 1.6.2-1 - Update to 1.6.2 (close RHBZ#2136397) * Mon Oct 17 2022 Benjamin A. Beasley - 1.6.1-1 - Update to 1.6.1 (close RHBZ#2135197) * Sat Oct 15 2022 Benjamin A. Beasley - 1.6.0-3 - Drop BuildRequires on python3dist(tomli) * Tue Oct 11 2022 Benjamin A. Beasley - 1.6.0-2 - Add missing man pages * Mon Oct 10 2022 Benjamin A. Beasley - 1.6.0-1 - Update to 1.6.0 (close RHBZ#2133234) - Update man pages and improve cross-references * 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. ## END: Generated by rpmautospec