Blob Blame History Raw
# Most of the tests require network access, so they are disabled by default.
%bcond_with  tests

%global         srcname         msal
%global         forgeurl        https://github.com/AzureAD/microsoft-authentication-library-for-python/
Version:        1.15.0
%global         tag             %{version}
%forgemeta

Name:           python-%{srcname}
Release:        %autorelease
Summary:        Microsoft Authentication Library (MSAL) for Python

License:        MIT
URL:            %forgeurl
Source0:        %forgesource
# Use sphinx-rtd-theme to build documentation instead of furo (not available in
# Fedora, see also https://bugzilla.redhat.com/show_bug.cgi?id=1910798)
Patch1:         %{name}-%{version}-doc.patch

BuildArch:      noarch

BuildRequires:  pyproject-rpm-macros

%if %{with tests}
BuildRequires:  python3dist(pytest)
%endif

%global _description %{expand:
The Microsoft Authentication Library for Python
enables applications to integrate with the Microsoft identity platform. It
allows you to sign in users or apps with Microsoft identities (Azure AD,
Microsoft Accounts and Azure AD B2Caccounts) and obtain tokens to call Microsoft
APIs such as Microsoft Graph or your own APIs registered with the Microsoft
identity platform. It is built using industry standard OAuth2 and OpenID Connect
protocols.}

%description %{_description}


%package -n python3-%{srcname}
Summary:        %{summary}
%description -n python3-%{srcname} %{_description}


%package -n python3-%{srcname}-doc
BuildRequires:  python3dist(sphinx)
BuildRequires:  python3dist(sphinx-rtd-theme)
Summary:        Documentation for python-%{srcname}

%description -n python3-%{srcname}-doc
Documentation for python-%{srcname}


%prep
%forgeautosetup -p1


%generate_buildrequires
%pyproject_buildrequires -r


%build
%pyproject_wheel

# Generate documentation.
PYTHONPATH="${PWD}:${PWD}/docs/" sphinx-build docs html %{?_smp_mflags}
rm -rf html/.{doctrees,buildinfo,nojekyll}


%install
%pyproject_install
%pyproject_save_files msal


%if %{with tests}
%check
%pytest --disable-warnings tests
%endif


%files -n python3-%{srcname} -f %{pyproject_files}
%doc contributing.md README.md
%license LICENSE


%files -n python3-%{srcname}-doc
%doc html
%license LICENSE


%changelog
%autochangelog