Blob Blame History Raw
%global srcname MonkeyType

%if 0%{?python3_version_nodots} >= 312
# some tests currently fail
%bcond_with all_tests
%bcond_without all_tests

Name:           monkeytype
Version:        23.3.0
Release:        %autorelease
Summary:        Generating Python type annotations from sampled production types
License:        BSD-3-Clause
URL:  {srcname}
# PyPI source has no tests
# Source:        %%{pypi_source %%{srcname}}
Source:         %{url}/archive/v%{version}/%{srcname}-%{version}.tar.gz

BuildArch:      noarch

BuildRequires:  python%{python3_pkgversion}-devel
# Pipfile not supported yet
# Test dependencies:
BuildRequires:  python3dist(pytest)
BuildRequires:  python3dist(django)

%py_provides python%{python3_pkgversion}-%{name}

%global _description %{expand:
MonkeyType collects runtime types of function arguments and return values, and
can automatically generate stub files or even add draft type annotations
directly to your Python code based on the types collected at runtime.}

%description %{_description}

%autosetup -p1 -n %{srcname}-%{version}

%pyproject_buildrequires -r


%pyproject_save_files %{name}

%if %{with all_tests}
%pytest -v
# FAILED tests/ - A...
# FAILED tests/
# FAILED tests/
# FAILED tests/ - Assertio...
# FAILED tests/ - AssertionErr...
# FAILED tests/ - Assertio...
EXCLUDES=" not test_callee_throws_recovers"
EXCLUDES+=" and not test_nested_callee_throws_recovers"
EXCLUDES+=" and not test_caller_handles_callee_exception"
EXCLUDES+=" and not test_generator_trace and not test_return_none"
EXCLUDES+=" and not test_access_property"
%pytest -v -k "$EXCLUDES"

%files -f %{pyproject_files}
%license LICENSE