1988adb
%bcond_without  tests
b0ce943
38946ef
%global         reponame    azure-sdk-for-python
701c069
%global         srcname     azure-core
701c069
701c069
Name:           python-%{srcname}
0f7513d
Version:        1.28.0
3da3a7e
Release:        %autorelease
701c069
Summary:        Azure Core shared client library for Python
38946ef
701c069
License:        MIT
38946ef
URL:            https://github.com/Azure/azure-sdk-for-python
38946ef
Source0:        %{url}/archive/%{srcname}_%{version}/%{srcname}-%{version}.tar.gz
701c069
b8af56b
Epoch:          2
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)
024eb8e
BuildRequires:  python3dist(azure-sdk-tools)
3da3a7e
BuildRequires:  python3dist(flask)
b0ce943
BuildRequires:  python3dist(msrest)
b0ce943
BuildRequires:  python3dist(pytest)
b0ce943
BuildRequires:  python3dist(pytest-aiohttp)
ea49b3f
BuildRequires:  python3dist(python-dotenv)
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}
118111d
%description -n python3-%{srcname} %{_description}
701c069
701c069
Roman Inflianskas 543e6ce
%pyproject_extras_subpkg -n python3-%{srcname} aio
Roman Inflianskas 543e6ce
701c069
%prep
38946ef
# Upstream buries the package into a subdirectory. 😭
38946ef
%setup -c -T
38946ef
tar xzf %{SOURCE0} --strip-components=4 \
38946ef
    %{reponame}-%{srcname}_%{version}/sdk/core/%{srcname}
38946ef
ls -alR
701c069
701c069
701c069
%generate_buildrequires
ea49b3f
%pyproject_buildrequires
701c069
701c069
701c069
%build
701c069
%pyproject_wheel
701c069
701c069
701c069
%install
701c069
%pyproject_install
ea49b3f
%pyproject_save_files azure
701c069
701c069
b0ce943
%check
0ef18d9
%pyproject_check_import
0ef18d9
0ef18d9
%if %{with tests}
1988adb
# azure-core has a flask-based testing server that must be available to run tests.
1988adb
# Disabling async/streaming tests since they require network connectivity to various
1988adb
# APIs on Azure's site.
1988adb
PYTHONPATH=%{buildroot}%{python3_sitelib}:%{buildroot}%{python3_sitearch}:tests/testserver_tests/coretestserver/ \
1988adb
    %pytest \
1988adb
        --ignore=tests/async_tests \
1988adb
        --ignore tests/test_streaming.py \
1988adb
        -k "not test_decompress_plain_no_header \
1988adb
            and not test_compress_plain_no_header \
01c3cc6
            and not test_decompress_compressed_no_header \
9de524b
            and not test_text_and_encoding \
9de524b
            and not test_response_headers" \
1988adb
        tests
b0ce943
%endif
b0ce943
b0ce943
ea49b3f
%files -n python3-%{srcname} -f %{pyproject_files}
38946ef
%license LICENSE
38946ef
%doc CHANGELOG.md CLIENT_LIBRARY_DEVELOPER.md README.md
701c069
701c069
701c069
%changelog
3da3a7e
%autochangelog