9315784
# RHEL does not include the test dependencies
9315784
%bcond tests %{undefined rhel}
9315784
57d460c
Name:           python-poetry-core
08ec7fa
Version:        1.9.0
8e1a8d3
Release:        %autorelease
57d460c
Summary:        Poetry PEP 517 Build Backend
2f7153c
# SPDX
e5535e7
License:        MIT
57d460c
URL:            https://github.com/python-poetry/poetry-core
57d460c
Source0:        %{url}/archive/%{version}/poetry-core-%{version}.tar.gz
57d460c
57d460c
# This patch moves the vendored requires definition
57d460c
# from vendors/pyproject.toml to pyproject.toml
57d460c
# Intentionally contains the removed hunk to prevent patch aging
08ec7fa
Patch1:         poetry-core-1.9.0-devendor.patch
6f3cd18
57d460c
BuildArch:      noarch
57d460c
BuildRequires:  python3-devel
57d460c
BuildRequires:  pyproject-rpm-macros
57d460c
9315784
%if %{with tests}
57d460c
# for tests (only specified via poetry poetry.dev-dependencies with pre-commit etc.)
0475b7a
BuildRequires:  python3-build
57d460c
BuildRequires:  python3-pytest
57d460c
BuildRequires:  python3-pytest-mock
f56ebca
BuildRequires:  python3-setuptools
8befbdb
BuildRequires:  python3-tomli-w
57d460c
BuildRequires:  python3-virtualenv
57d460c
BuildRequires:  gcc
398044c
BuildRequires:  git-core
9315784
%endif
57d460c
57d460c
57d460c
%global _description %{expand:
57d460c
A PEP 517 build backend implementation developed for Poetry.
57d460c
This project is intended to be a light weight, fully compliant, self-contained
57d460c
package allowing PEP 517 compatible build frontends to build Poetry managed
57d460c
projects.}
57d460c
57d460c
%description %_description
57d460c
57d460c
57d460c
%package -n python3-poetry-core
57d460c
Summary:        %{summary}
57d460c
57d460c
# Previous versions of poetry included poetry-core in it
57d460c
Conflicts:      python%{python3_version}dist(poetry) < 1.1
57d460c
57d460c
%description -n python3-poetry-core %_description
57d460c
57d460c
57d460c
%prep
57d460c
%autosetup -p1 -n poetry-core-%{version}
57d460c
57d460c
57d460c
%generate_buildrequires
57d460c
%pyproject_buildrequires -r
57d460c
57d460c
57d460c
%build
57d460c
# we debundle the deps after we use the bundled deps in previous step to parse the deps 🤯
e5535e7
rm -r src/poetry/core/_vendor
57d460c
57d460c
%pyproject_wheel
57d460c
57d460c
57d460c
%install
57d460c
%pyproject_install
57d460c
%pyproject_save_files poetry
57d460c
57d460c
57d460c
%check
9315784
%if %{with tests}
57d460c
# don't use %%tox here because tox.ini runs "poetry install"
57d460c
# TODO investigate failures in test_default_with_excluded_data, test_default_src_with_excluded_data
57d460c
%pytest -k "not with_excluded_data"
9315784
%else
9315784
%pyproject_check_import
9315784
%endif
57d460c
57d460c
57d460c
%files -n python3-poetry-core -f %{pyproject_files}
57d460c
%doc README.md
57d460c
%license LICENSE
57d460c
57d460c
57d460c
%changelog
8e1a8d3
%autochangelog