From a370ab8b9713d9c61d47621298c79eda20d015dc397a238b27b7f67a563e0985 Mon Sep 17 00:00:00 2001 From: Daniel Garcia Date: Tue, 29 Nov 2022 16:55:21 +0000 Subject: [PATCH 1/4] - Remove python_module macro definition - Update to 3.0.1: * restore tox.ini to support tox --current-env based packaging - 3.0.0 * add support for python 3.11 and drop dead pythons (thanks hukgo) * migrate to hatch * split up __init__.py * add some type annotations - 2.1.1 * drop the python 3.4 support marker, 2.1.0 broke it 2.1.0 will be yanked after release OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:pytest/python-apipkg?expand=0&rev=12 --- apipkg-2.1.0.tar.gz | 3 --- apipkg-3.0.1.tar.gz | 3 +++ python-apipkg.changes | 15 +++++++++++++++ python-apipkg.spec | 28 +++++++++++++++------------- 4 files changed, 33 insertions(+), 16 deletions(-) delete mode 100644 apipkg-2.1.0.tar.gz create mode 100644 apipkg-3.0.1.tar.gz diff --git a/apipkg-2.1.0.tar.gz b/apipkg-2.1.0.tar.gz deleted file mode 100644 index c01f0b8..0000000 --- a/apipkg-2.1.0.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a4be31cf8081e660d2cdea6edfb8a0f39f385866abdcfcfa45e5a0887345cb70 -size 16346 diff --git a/apipkg-3.0.1.tar.gz b/apipkg-3.0.1.tar.gz new file mode 100644 index 0000000..fddfa71 --- /dev/null +++ b/apipkg-3.0.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3118fbb7b0f6ad8b54bebb7b2db37aa8a9068f5a21a611e47a30f1d3eedea8c8 +size 14026 diff --git a/python-apipkg.changes b/python-apipkg.changes index ffe04f2..e8592c1 100644 --- a/python-apipkg.changes +++ b/python-apipkg.changes @@ -1,3 +1,18 @@ +------------------------------------------------------------------- +Tue Nov 29 16:53:46 UTC 2022 - Daniel Garcia + +- Remove python_module macro definition +- Update to 3.0.1: + * restore tox.ini to support tox --current-env based packaging +- 3.0.0 + * add support for python 3.11 and drop dead pythons (thanks hukgo) + * migrate to hatch + * split up __init__.py + * add some type annotations +- 2.1.1 + * drop the python 3.4 support marker, 2.1.0 broke it + 2.1.0 will be yanked after release + ------------------------------------------------------------------- Sun Oct 17 12:03:03 UTC 2021 - Ben Greiner diff --git a/python-apipkg.spec b/python-apipkg.spec index 515606b..f2e0d3c 100644 --- a/python-apipkg.spec +++ b/python-apipkg.spec @@ -1,7 +1,7 @@ # # spec file # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,7 +16,6 @@ # -%{?!python_module:%define python_module() python-%{**} python3-%{**}} %global flavor @BUILD_FLAVOR@%{nil} %if "%{flavor}" == "test" %define psuffix -%{flavor} @@ -26,7 +25,7 @@ %bcond_with test %endif Name: python-apipkg%{psuffix} -Version: 2.1.0 +Version: 3.0.1 Release: 0 Summary: Namespace control and lazy-import mechanism License: MIT @@ -34,10 +33,16 @@ Group: Development/Languages/Python URL: https://github.com/pytest-dev/apipkg/ Source: https://files.pythonhosted.org/packages/source/a/apipkg/apipkg-%{version}.tar.gz %if %{with test} +BuildRequires: %{python_module apipkg = %{version}} BuildRequires: %{python_module pytest} +BuildRequires: %{python_module py} %endif +BuildRequires: %{python_module hatch-vcs} +BuildRequires: %{python_module hatchling} +BuildRequires: %{python_module pip} BuildRequires: %{python_module setuptools_scm} BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module wheel} BuildRequires: fdupes BuildRequires: python-rpm-macros BuildArch: noarch @@ -55,32 +60,29 @@ can copy paste the ~200 lines of code into your project. %prep %autosetup -p1 -n apipkg-%{version} -# Fix Python 2 install error on old setuptools in Leap -# https://github.com/pypa/setuptools/issues/1136 -sed -i '/use_scm_version/ a \ package_dir={"": "src"},' setup.py +# Set the package version static, not dynamic, to build without the .git folder +sed -i ':a;N;$!ba;s/dynamic = \[[^]]*\]/version = "%{version}"/g' pyproject.toml %build -%python_build +%pyproject_wheel %install %if ! %{with test} -%python_install +%pyproject_install %python_expand %fdupes -s %{buildroot}%{$python_sitelib} %endif %check %if %{with test} -PYTHONPATH=$(pwd)/src %pytest %endif %if ! %{with test} %files %{python_files} %license LICENSE -%doc README.rst CHANGELOG -%dir %{python_sitelib}/apipkg -%{python_sitelib}/apipkg/* -%{python_sitelib}/apipkg-%{version}-py%{python_version}.egg-info +%doc README.rst +%{python_sitelib}/apipkg +%{python_sitelib}/apipkg-%{version}*-info %endif %changelog From 62a4aa49d1d255900c897eaf06903cd78c3ec9788b652f722f3ccf8161130cf2 Mon Sep 17 00:00:00 2001 From: Daniel Garcia Date: Wed, 30 Nov 2022 12:49:29 +0000 Subject: [PATCH 2/4] - Remove python-py dependency OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:pytest/python-apipkg?expand=0&rev=13 --- python-apipkg.changes | 5 +++++ python-apipkg.spec | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/python-apipkg.changes b/python-apipkg.changes index e8592c1..f5e068c 100644 --- a/python-apipkg.changes +++ b/python-apipkg.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Nov 30 12:49:07 UTC 2022 - Daniel Garcia + +- Remove python-py dependency + ------------------------------------------------------------------- Tue Nov 29 16:53:46 UTC 2022 - Daniel Garcia diff --git a/python-apipkg.spec b/python-apipkg.spec index f2e0d3c..b684dc8 100644 --- a/python-apipkg.spec +++ b/python-apipkg.spec @@ -35,7 +35,6 @@ Source: https://files.pythonhosted.org/packages/source/a/apipkg/apipkg-% %if %{with test} BuildRequires: %{python_module apipkg = %{version}} BuildRequires: %{python_module pytest} -BuildRequires: %{python_module py} %endif BuildRequires: %{python_module hatch-vcs} BuildRequires: %{python_module hatchling} @@ -74,7 +73,9 @@ sed -i ':a;N;$!ba;s/dynamic = \[[^]]*\]/version = "%{version}"/g' pyproject.toml %check %if %{with test} -%pytest +# Do not test distribution version, it's broken because pytest doesn't require +# python-py anymore +%pytest -k 'not test_get_distribution_version' %endif %if ! %{with test} From 2a1205e31d96de9991641fa2e4f847f43eeb91893f1c16eefcebd69f02859d8a Mon Sep 17 00:00:00 2001 From: Daniel Garcia Date: Wed, 30 Nov 2022 16:45:34 +0000 Subject: [PATCH 3/4] - Remove python-hatch-vcs dependency OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:pytest/python-apipkg?expand=0&rev=14 --- python-apipkg.changes | 5 +++++ python-apipkg.spec | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/python-apipkg.changes b/python-apipkg.changes index f5e068c..f104497 100644 --- a/python-apipkg.changes +++ b/python-apipkg.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Nov 30 16:45:02 UTC 2022 - Daniel Garcia + +- Remove python-hatch-vcs dependency + ------------------------------------------------------------------- Wed Nov 30 12:49:07 UTC 2022 - Daniel Garcia diff --git a/python-apipkg.spec b/python-apipkg.spec index b684dc8..6cab142 100644 --- a/python-apipkg.spec +++ b/python-apipkg.spec @@ -36,7 +36,6 @@ Source: https://files.pythonhosted.org/packages/source/a/apipkg/apipkg-% BuildRequires: %{python_module apipkg = %{version}} BuildRequires: %{python_module pytest} %endif -BuildRequires: %{python_module hatch-vcs} BuildRequires: %{python_module hatchling} BuildRequires: %{python_module pip} BuildRequires: %{python_module setuptools_scm} @@ -61,6 +60,8 @@ can copy paste the ~200 lines of code into your project. %autosetup -p1 -n apipkg-%{version} # Set the package version static, not dynamic, to build without the .git folder sed -i ':a;N;$!ba;s/dynamic = \[[^]]*\]/version = "%{version}"/g' pyproject.toml +# Remove hatch-vcs dep to avoid cycles +sed -i '/tool.hatch.build.hooks.vcs/d' pyproject.toml %build %pyproject_wheel From 30f55bc2c6d58f71e8c5c4f17c35411ea48b3801efa06a603fada09fbfd1a23d Mon Sep 17 00:00:00 2001 From: Daniel Garcia Date: Wed, 30 Nov 2022 17:07:08 +0000 Subject: [PATCH 4/4] - Generate the _version.py file in %prep to remove completely hatch-vcs from pyproject to make it build and run tests correctly OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:pytest/python-apipkg?expand=0&rev=15 --- python-apipkg.changes | 6 ++++++ python-apipkg.spec | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/python-apipkg.changes b/python-apipkg.changes index f104497..b98121e 100644 --- a/python-apipkg.changes +++ b/python-apipkg.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Nov 30 17:05:54 UTC 2022 - Daniel Garcia + +- Generate the _version.py file in %prep to remove completely hatch-vcs from + pyproject to make it build and run tests correctly + ------------------------------------------------------------------- Wed Nov 30 16:45:02 UTC 2022 - Daniel Garcia diff --git a/python-apipkg.spec b/python-apipkg.spec index 6cab142..38f9e0e 100644 --- a/python-apipkg.spec +++ b/python-apipkg.spec @@ -61,7 +61,12 @@ can copy paste the ~200 lines of code into your project. # Set the package version static, not dynamic, to build without the .git folder sed -i ':a;N;$!ba;s/dynamic = \[[^]]*\]/version = "%{version}"/g' pyproject.toml # Remove hatch-vcs dep to avoid cycles +rm .gitignore sed -i '/tool.hatch.build.hooks.vcs/d' pyproject.toml +cat << EOF > src/apipkg/_version.py +version = "%{version}" +version_tuple = tuple(map(int, version.split("."))) +EOF %build %pyproject_wheel