12
0
forked from pool/python-apipkg

Accepting request 1039166 from devel:languages:python:pytest

- Generate the _version.py file in %prep to remove completely hatch-vcs from
  pyproject to make it build and run tests correctly
- Remove python-hatch-vcs dependency
- Remove python-py dependency
- 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/request/show/1039166
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-apipkg?expand=0&rev=9
This commit is contained in:
2022-12-01 15:58:38 +00:00
committed by Git OBS Bridge
4 changed files with 57 additions and 17 deletions

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a4be31cf8081e660d2cdea6edfb8a0f39f385866abdcfcfa45e5a0887345cb70
size 16346

BIN
apipkg-3.0.1.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.

View File

@@ -1,3 +1,34 @@
-------------------------------------------------------------------
Wed Nov 30 17:05:54 UTC 2022 - Daniel Garcia <daniel.garcia@suse.com>
- 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 <daniel.garcia@suse.com>
- Remove python-hatch-vcs dependency
-------------------------------------------------------------------
Wed Nov 30 12:49:07 UTC 2022 - Daniel Garcia <daniel.garcia@suse.com>
- Remove python-py dependency
-------------------------------------------------------------------
Tue Nov 29 16:53:46 UTC 2022 - Daniel Garcia <daniel.garcia@suse.com>
- 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 <code@bnavigator.de> Sun Oct 17 12:03:03 UTC 2021 - Ben Greiner <code@bnavigator.de>

View File

@@ -1,7 +1,7 @@
# #
# spec file # spec file
# #
# Copyright (c) 2021 SUSE LLC # Copyright (c) 2022 SUSE LLC
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # 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} %global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == "test" %if "%{flavor}" == "test"
%define psuffix -%{flavor} %define psuffix -%{flavor}
@@ -26,7 +25,7 @@
%bcond_with test %bcond_with test
%endif %endif
Name: python-apipkg%{psuffix} Name: python-apipkg%{psuffix}
Version: 2.1.0 Version: 3.0.1
Release: 0 Release: 0
Summary: Namespace control and lazy-import mechanism Summary: Namespace control and lazy-import mechanism
License: MIT License: MIT
@@ -34,10 +33,14 @@ Group: Development/Languages/Python
URL: https://github.com/pytest-dev/apipkg/ URL: https://github.com/pytest-dev/apipkg/
Source: https://files.pythonhosted.org/packages/source/a/apipkg/apipkg-%{version}.tar.gz Source: https://files.pythonhosted.org/packages/source/a/apipkg/apipkg-%{version}.tar.gz
%if %{with test} %if %{with test}
BuildRequires: %{python_module apipkg = %{version}}
BuildRequires: %{python_module pytest} BuildRequires: %{python_module pytest}
%endif %endif
BuildRequires: %{python_module hatchling}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools_scm} BuildRequires: %{python_module setuptools_scm}
BuildRequires: %{python_module setuptools} BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
BuildRequires: fdupes BuildRequires: fdupes
BuildRequires: python-rpm-macros BuildRequires: python-rpm-macros
BuildArch: noarch BuildArch: noarch
@@ -55,32 +58,38 @@ can copy paste the ~200 lines of code into your project.
%prep %prep
%autosetup -p1 -n apipkg-%{version} %autosetup -p1 -n apipkg-%{version}
# Fix Python 2 install error on old setuptools in Leap # Set the package version static, not dynamic, to build without the .git folder
# https://github.com/pypa/setuptools/issues/1136 sed -i ':a;N;$!ba;s/dynamic = \[[^]]*\]/version = "%{version}"/g' pyproject.toml
sed -i '/use_scm_version/ a \ package_dir={"": "src"},' setup.py # 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 %build
%python_build %pyproject_wheel
%install %install
%if ! %{with test} %if ! %{with test}
%python_install %pyproject_install
%python_expand %fdupes -s %{buildroot}%{$python_sitelib} %python_expand %fdupes -s %{buildroot}%{$python_sitelib}
%endif %endif
%check %check
%if %{with test} %if %{with test}
PYTHONPATH=$(pwd)/src # Do not test distribution version, it's broken because pytest doesn't require
%pytest # python-py anymore
%pytest -k 'not test_get_distribution_version'
%endif %endif
%if ! %{with test} %if ! %{with test}
%files %{python_files} %files %{python_files}
%license LICENSE %license LICENSE
%doc README.rst CHANGELOG %doc README.rst
%dir %{python_sitelib}/apipkg %{python_sitelib}/apipkg
%{python_sitelib}/apipkg/* %{python_sitelib}/apipkg-%{version}*-info
%{python_sitelib}/apipkg-%{version}-py%{python_version}.egg-info
%endif %endif
%changelog %changelog