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
Version:        1.15.0
%global         tag             %{version}

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
Patch1:         %{name}-%{version}-doc.patch

BuildArch:      noarch

BuildRequires:  pyproject-rpm-macros

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

%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

%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}

%forgeautosetup -p1

%pyproject_buildrequires -r


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

%pyproject_save_files msal

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

%files -n python3-%{srcname} -f %{pyproject_files}
%license LICENSE

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