Blame python-azure-core.spec

75e715a
# Enable tests everywhere except EPEL 9, where flask/pytest-aiohttp are not backported.
75e715a
%if 0%{?el9} || 0%{?centos} >= 9
75e715a
%bcond_with    tests
75e715a
%else
75e715a
%bcond_without tests
75e715a
%endif
b0ce943
701c069
%global         srcname     azure-core
701c069
701c069
Name:           python-%{srcname}
682f25f
Version:        1.21.1
3da3a7e
Release:        %autorelease
701c069
Summary:        Azure Core shared client library for Python
701c069
License:        MIT
701c069
URL:            https://pypi.org/project/%{srcname}/
701c069
Source0:        %{pypi_source %{srcname} %{version} zip}
701c069
1b91e70
Epoch:          1
1b91e70
701c069
BuildArch:      noarch
701c069
118111d
BuildRequires:  python3-devel
701c069
b0ce943
%if %{with tests}
3da3a7e
BuildRequires:  python3dist(azure-devtools)
3da3a7e
BuildRequires:  python3dist(azure-mgmt-keyvault)
3da3a7e
BuildRequires:  python3dist(azure-mgmt-resource)
3da3a7e
BuildRequires:  python3dist(azure-sdk-tools)
3da3a7e
BuildRequires:  python3dist(flask)
b0ce943
BuildRequires:  python3dist(msrest)
b0ce943
BuildRequires:  python3dist(pytest)
b0ce943
BuildRequires:  python3dist(pytest-aiohttp)
b0ce943
BuildRequires:  python3dist(trio)
b0ce943
%endif
b0ce943
701c069
%global _description %{expand:
701c069
Azure Core shared client library for Python}
701c069
701c069
%description %{_description}
701c069
701c069
118111d
%package -n python3-%{srcname}
701c069
Summary:        %{summary}
a3f52bf
Obsoletes:      python3-azure-sdk < 5.0.1
118111d
%description -n python3-%{srcname} %{_description}
701c069
701c069
701c069
%prep
701c069
%autosetup -n %{srcname}-%{version}
701c069
701c069
701c069
%generate_buildrequires
701c069
%pyproject_buildrequires -r
701c069
701c069
701c069
%build
701c069
%pyproject_wheel
701c069
3da3a7e
# Temporarily install the coretestserver package from the tests directory.
3da3a7e
pushd tests/testserver_tests/coretestserver
3da3a7e
    %pyproject_wheel
3da3a7e
popd
3da3a7e
701c069
701c069
%install
701c069
%pyproject_install
701c069
701c069
b0ce943
%if %{with tests}
b0ce943
%check
3da3a7e
# Disable some tests that require network access.
3da3a7e
%pytest --disable-warnings tests \
3da3a7e
    --ignore=tests/test_streaming.py \
3da3a7e
    --ignore-glob=tests/async_tests/*.py \
3da3a7e
    -k "not test_decompress_plain_no_header \
3da3a7e
        and not test_compress_plain_no_header \
3da3a7e
        and not test_decompress_compressed_no_header \
3da3a7e
        and not test_decompress_compressed_header \
9ca1612
        and not test_aiohttp_loop \
9ca1612
        and not test_text_and_encoding"
3da3a7e
3da3a7e
# Remove the temporarily installed coretestserver.
3da3a7e
rm -rf %{buildroot}%{python3_sitelib}/coretestserver*
b0ce943
%endif
b0ce943
b0ce943
3da3a7e
%files -n python3-%{srcname}
701c069
%doc README.md
3da3a7e
%{python3_sitelib}/azure
3da3a7e
%{python3_sitelib}/azure_core-%{version}.dist-info
701c069
701c069
701c069
%changelog
3da3a7e
%autochangelog