2faa505
# Enable tests everywhere except EPEL 9, where python-httpretty is not backported.
11500e6
%if 0%{?rhel} >= 9
2faa505
%bcond_with    tests
2faa505
%else
2faa505
%bcond_without tests
2faa505
%endif
22811cb
2faa505
2faa505
%global         srcname     adal
2faa505
%global         forgeurl    https://github.com/AzureAD/azure-activedirectory-library-for-python
70e9fcd
Version:        1.2.7
2faa505
%global         tag         %{version}
2faa505
%forgemeta
2faa505
2faa505
Name:           python-%{srcname}
2faa505
Release:        %autorelease
2faa505
Summary:        Microsoft Azure Active Directory Authentication Library (ADAL) for Python
f08934c
f08934c
License:        MIT
2faa505
URL:            %forgeurl
2faa505
Source0:        %forgesource
22811cb
# Fix tests with httpretty >= 0.9.0
22811cb
Patch0:         %{name}-1.2.0-tests.patch
f08934c
f08934c
BuildArch:      noarch
f08934c
2faa505
BuildRequires:  python3-devel
f08934c
2faa505
%if %{with tests}
2faa505
BuildRequires:  python3dist(pytest-asyncio)
2faa505
BuildRequires:  python3dist(httpretty)
2faa505
BuildRequires:  python3dist(pytest)
2faa505
%endif
f08934c
2faa505
%global _description %{expand:
2faa505
Microsoft Azure Active Directory Authentication Library (ADAL) for Python.}
f08934c
2faa505
%description %{_description}
f08934c
f08934c
2faa505
%package -n python3-%{srcname}
2faa505
Summary:        %{summary}
2faa505
%{?python_provide:%python_provide python3-%{srcname}}
697eea2
2faa505
%description -n python3-%{srcname} %{_description}
697eea2
697eea2
f08934c
%prep
2faa505
%forgeautosetup -p1
c2f329d
274d813
2faa505
%generate_buildrequires
2faa505
%pyproject_buildrequires
f08934c
f08934c
2faa505
%build
2faa505
%pyproject_wheel
697eea2
f08934c
f08934c
%install
2faa505
%pyproject_install
2faa505
%pyproject_save_files %{srcname}
e90697b
f08934c
2faa505
%if %{with tests}
f08934c
%check
e90697b
%pytest
2faa505
%endif
f08934c
f08934c
2faa505
%files -n python3-%{srcname} -f %{pyproject_files}
f08934c
%doc README.md
f08934c
%license LICENSE
f08934c
f08934c
f08934c
%changelog
2faa505
%autochangelog