Accepting request 990375 from home:bnavigator:branches:devel:languages:python

- Fix requirements
  * Don't need sphinx
  * Needs rust and cargo
  * Don't need nox; can't use it in obs as it wants to install
    wheels.
- Fix tests:
  * Plain pytest test suite without is rudimentary
  * At least build the hello-world example
- Use PEP517

OBS-URL: https://build.opensuse.org/request/show/990375
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-setuptools-rust?expand=0&rev=14
This commit is contained in:
Dirk Mueller 2022-07-20 10:10:13 +00:00 committed by Git OBS Bridge
parent 2016c9804b
commit 8b410919ca
2 changed files with 32 additions and 11 deletions

@ -1,3 +1,16 @@
-------------------------------------------------------------------
Wed Jul 20 09:16:41 UTC 2022 - Ben Greiner <code@bnavigator.de>
- Fix requirements
* Don't need sphinx
* Needs rust and cargo
* Don't need nox; can't use it in obs as it wants to install
wheels.
- Fix tests:
* Plain pytest test suite without is rudimentary
* At least build the hello-world example
- Use PEP517
-------------------------------------------------------------------
Mon Jul 18 07:35:46 UTC 2022 - Matej Cepl <mcepl@suse.com>

@ -16,8 +16,6 @@
#
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%global skip_python2 1
Name: python-setuptools-rust
Version: 1.4.1
Release: 0
@ -26,21 +24,25 @@ License: BSD-3-Clause
Group: Development/Languages/Python
URL: https://github.com/PyO3/setuptools-rust
Source: https://files.pythonhosted.org/packages/source/s/setuptools-rust/setuptools-rust-%{version}.tar.gz
BuildRequires: %{python_module base >= 3.7}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module pyparsing}
BuildRequires: %{python_module semantic_version >= 2.8.2}
BuildRequires: %{python_module setuptools >= 62.4}
BuildRequires: %{python_module setuptools_scm}
BuildRequires: %{python_module setuptools_scm >= 6.3.2}
BuildRequires: %{python_module typing_extensions >= 3.7.4.3}
BuildRequires: %{python_module wheel}
BuildRequires: cargo
BuildRequires: fdupes
BuildRequires: python-rpm-macros
BuildRequires: rust
Requires: cargo
Requires: python-semantic_version >= 2.8.2
Requires: python-setuptools >= 62.4
Requires: python-typing_extensions >= 3.7.4.3
Requires: rust
BuildArch: noarch
# SECTION test requirements
BuildRequires: %{python_module Sphinx}
BuildRequires: %{python_module nox}
BuildRequires: %{python_module pytest}
# /SECTION
%python_subpackages
@ -56,22 +58,28 @@ were written in C.
%setup -q -n setuptools-rust-%{version}
%build
%python_build
%pyproject_wheel
%install
%python_install
%pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
export LANG=en_US.UTF-8
%pytest tests/
pushd examples/hello-world
%{python_expand # See noxfile.py
# hello-world is the only example which does not need extra rust packages (via cargo_vendor)
export PYTHONPATH=%{buildroot}%{$python_sitelib}
$python -m pip install --no-build-isolation --target=$PWD/build/exampleinstall/ --no-deps --no-index .
$PWD/build/exampleinstall/bin/hello-world
}
popd
%files %{python_files}
%license LICENSE
%doc README.md
%{python_sitelib}/setuptools_rust-%{version}-py*.egg-info
%dir %{python_sitelib}/setuptools_rust
%{python_sitelib}/setuptools_rust/*py
%pycache_only %{python_sitelib}/setuptools_rust/__pycache__
%{python_sitelib}/setuptools_rust-%{version}*-info
%{python_sitelib}/setuptools_rust
%changelog