diff --git a/python-boto3.spec b/python-boto3.spec index ff306e6..f56723d 100644 --- a/python-boto3.spec +++ b/python-boto3.spec @@ -1,3 +1,5 @@ +%bcond tests 1 + Name: python-boto3 Version: 1.34.11 Release: 2%{?dist} @@ -5,7 +7,7 @@ Summary: The AWS SDK for Python License: Apache-2.0 URL: https://github.com/boto/boto3 -Source: %{pypi_source boto3} +Source: %{url}/archive/%{version}/boto3-%{version}.tar.gz BuildArch: noarch BuildRequires: python3-devel @@ -13,6 +15,15 @@ BuildRequires: python3-devel # Save space by hardlinking duplicate JSON resource files BuildRequires: hardlink +%if %{with tests} +# Test dependencies are in requirements-dev.txt; most are Window-specific or +# are for coverage analysis and are undesired, so we list those we need +# manually: +BuildRequires: %{py3_dist pytest} +# Run tests in parallel. Tests are numerous and painfully slow, so this helps! +BuildRequires: %{py3_dist pytest-xdist} +%endif + %global _description %{expand: Boto3 is the Amazon Web Services (AWS) Software Development Kit (SDK) for Python, which allows Python developers to write software that makes use of @@ -23,10 +34,10 @@ services like Amazon S3 and Amazon EC2.} %package -n python3-boto3 Summary: %{summary} -# Optional dependencies for import “smoke test”: -# -# boto3-1.34.7/boto3/s3/transfer.py -# 185: # This feature requires awscrt>=0.19.18 +# Optional dependency that enables additional functionality and additional +# tests, and is needed for the import-only “smoke test”: +# boto3-1.34.7/boto3/s3/transfer.py +# 185: # This feature requires awscrt>=0.19.18 BuildRequires: %{py3_dist awscrt} >= 0.19.18 Recommends: %{py3_dist awscrt} >= 0.19.18 @@ -34,8 +45,9 @@ Recommends: %{py3_dist awscrt} >= 0.19.18 %prep %setup -q -n boto3-%{version} -# Remove online tests -rm -rf tests/integration +# Remove a bundled and pre-compiled/pre-minified JavaScript library. It would +# be used for the generated HTML documentation, which we do not package. +rm -v docs/source/_static/shortbreadv1.js %generate_buildrequires %pyproject_buildrequires @@ -53,9 +65,15 @@ hardlink -c '%{buildroot}%{python3_sitelib}/boto3' %pyproject_save_files boto3 %check +%if %{with tests} +# Integration tests require network access and real AWS resources. +%pytest --ignore=tests/integration -v -n auto +%else %pyproject_check_import +%endif %files -n python3-boto3 -f %{pyproject_files} +%doc CHANGELOG.rst %doc README.rst %license LICENSE @@ -69,6 +87,7 @@ hardlink -c '%{buildroot}%{python3_sitelib}/boto3' - Port to pyproject-rpm-macros - Save space by hardlinking duplicate JSON resource files - Add a weak dependency on python3-awscrt +- Switch to the GitHub source archive and run the unit and functional tests * Tue Jan 02 2024 Gwyn Ciesla - 1.34.11-1 - 1.34.11 diff --git a/sources b/sources index 742de29..b55db52 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (boto3-1.34.11.tar.gz) = 7a6fd58acae0ad77dfd3849440f2be2f9e8c906becf6253908d7f2c6dd4699e5ce4278dc0ca1739309cede51f2ff55a13fdee0936dcf3562257c2a2a1f84e647 +SHA512 (boto3-1.34.11.tar.gz) = 82b1920f1a5ad0e23364815a6b0552efceb7f49e17e585370917f63c1b74ea746eddc4f3d8c055d1eac7ca1cdbe5ac2bd304ce66e2ee12edf75ea2e261e88c56