Blob Blame History Raw
# some test dependencies are unwanted in RHEL
%if 0%{?rhel}
%bcond_with tests
%bcond_without tests

Name:           micropipenv
Version:        1.5.0
Release:        %autorelease
Summary:        A simple wrapper around pip to support Pipenv and Poetry files

License:        LGPL-3.0-or-later
URL:  {name}
Source0:        %{url}/archive/v%{version}.tar.gz
BuildArch:      noarch

BuildRequires:  python3-devel

%py_provides    python3-%{name}

Recommends:     micropipenv+toml

A lightweight wrapper for pip to support Pipenv and Poetry lock files or
converting them to pip-tools compatible output.

%pyproject_extras_subpkg -n %{name} toml

# Remove shebang line from the module
sed -i '1{\@^#!/usr/bin/env python@d}' %{name}.py

%pyproject_buildrequires -r %{?with_tests:-t} -x toml


%pyproject_save_files %{name}

%if %{with tests}
# skipped tests requires internet or checks pip version
%pytest -m "not online" -k "not test_check_pip_version and not test_install_invalid_toml_file"

%files -f %pyproject_files
%doc README.rst