Blame awscli2.spec

Michel Lind a52323
%if 0%{?rhel}
Michel Lind a52323
# some tests fail on EL9
Michel Lind a52323
%bcond_with all_tests
Michel Lind a52323
%else
Michel Lind a52323
%bcond_without all_tests
Michel Lind a52323
%endif
Michel Lind a52323
Nikola Forró 677050
%global pkgname aws-cli
Nikola Forró 677050
Nikola Forró 677050
Name:               awscli2
Nikola Forró ec3c8d
Version:            2.13.4
Michel Lind 1ca7be
Release:            1%{?dist}.1
Nikola Forró 677050
Nikola Forró 677050
Summary:            Universal Command Line Environment for AWS, version 2
Nikola Forró 677050
# all files are licensed under Apache-2.0, except:
Nikola Forró 677050
# - awscli/topictags.py is MIT
Nikola Forró 677050
# - awscli/botocore/vendored/six.py is MIT
Nikola Forró 677050
License:            Apache-2.0 AND MIT
Nikola Forró 677050
URL:                https://github.com/aws/aws-cli/tree/v2
Nikola Forró 677050
Nikola Forró 677050
Source0:            https://github.com/aws/aws-cli/archive/%{version}/%{pkgname}-%{version}.tar.gz
Nikola Forró 677050
Nikola Forró ec3c8d
# adapt to whitespace formatting changes and removal of OrderedDict in ruamel-yaml
Nikola Forró ec3c8d
Patch0:             ruamel-yaml-0.17.32.patch
Nikola Forró 677050
Nikola Forró 677050
BuildArch:          noarch
Nikola Forró 677050
Nikola Forró 677050
BuildRequires:      python%{python3_pkgversion}-devel
Nikola Forró 677050
BuildRequires:      python-unversioned-command
Nikola Forró 677050
BuildRequires:      procps-ng
Nikola Forró 677050
Nikola Forró 677050
Recommends:         groff
Nikola Forró 677050
Nikola Forró 9c0250
Provides:           bundled(python3dist(botocore)) = 2.0.0
Nikola Forró 9c0250
Provides:           bundled(python3dist(s3transfer)) = 0.5.1
Nikola Forró 9c0250
Nikola Forró 677050
Provides:           awscli = %{version}-%{release}
Nikola Forró 677050
Obsoletes:          awscli < 2
Nikola Forró 677050
Nikola Forró 677050
# provide an upgrade path from awscli-2 (Amazon Linux)
Nikola Forró 677050
Provides:           awscli-2 = %{version}-%{release}
Nikola Forró 677050
Obsoletes:          awscli-2 < %{version}-%{release}
Nikola Forró 677050
Nikola Forró 677050
# python-awscrt does not build on s390x
Nikola Forró 677050
ExcludeArch:        s390x
Nikola Forró 677050
Nikola Forró 677050
Nikola Forró 677050
%description
Nikola Forró 677050
This package provides version 2 of the unified command line
Nikola Forró 677050
interface to Amazon Web Services.
Nikola Forró 677050
Nikola Forró 677050
Nikola Forró 677050
%prep
Nikola Forró 677050
%autosetup -p1 -n %{pkgname}-%{version}
Nikola Forró 677050
Nikola Forró 677050
# fix permissions
Nikola Forró 677050
find awscli/examples/ -type f -name '*.rst' -executable -exec chmod -x '{}' +
Nikola Forró 677050
Nikola Forró 9c0250
# remove version caps on dependencies
Nikola Forró 9c0250
sed -i 's/,<=\?[^"]*"/"/' pyproject.toml
Nikola Forró 9c0250
Nikola Forró 677050
# use unittest.mock
Nikola Forró 677050
find -type f -name '*.py' -exec sed \
Nikola Forró 677050
    -e 's/^\( *\)import mock$/\1from unittest import mock/' \
Nikola Forró 677050
    -e 's/^\( *\)from mock import mock/\1from unittest import mock/' \
Nikola Forró 677050
    -e 's/^\( *\)from mock import/\1from unittest.mock import/' \
Nikola Forró 677050
    -i '{}' +
Nikola Forró 677050
b00a80
# Fedora does not run coverage tests.
b00a80
# mock is deprecated in Fedora. We use unittest.mock.
0683b1
# pip-tools is not used directly by the unit tests.
b00a80
sed \
b00a80
    -e 's|==.*||' \
b00a80
    -e '/coverage/d' \
b00a80
    -e '/mock/d' \
b00a80
    -e '/pip-tools/d' \
b00a80
    -e '/pytest-cov/d' \
b00a80
    requirements-test.txt > _requirements-test.txt
b00a80
Nikola Forró 677050
Nikola Forró 677050
%generate_buildrequires
b00a80
%pyproject_buildrequires _requirements-test.txt
Nikola Forró 677050
Nikola Forró 677050
Nikola Forró 677050
%build
Nikola Forró 677050
%pyproject_wheel
Nikola Forró 677050
Nikola Forró 677050
Nikola Forró 677050
%install
Nikola Forró 677050
%pyproject_install
Nikola Forró 677050
%pyproject_save_files awscli
Nikola Forró 677050
Nikola Forró 677050
# remove unnecessary scripts
Nikola Forró 677050
rm -vf %{buildroot}%{_bindir}/{aws_bash_completer,aws_zsh_completer.sh,aws.cmd}
Nikola Forró 677050
Nikola Forró 677050
# install shell completion
Nikola Forró 677050
install -Dpm0644 bin/aws_bash_completer \
3a8ae5
  %{buildroot}%{bash_completions_dir}/aws
Nikola Forró 677050
install -Dpm0644 bin/aws_zsh_completer.sh \
3a8ae5
  %{buildroot}%{zsh_completions_dir}/_awscli
Nikola Forró 677050
Nikola Forró 677050
Nikola Forró 677050
%check
Nikola Forró 677050
# it appears that some tests modify the environment and remove PYTHONPATH
Nikola Forró 677050
# so it's not passed to botocore cmd-runner, inject it here
Nikola Forró 677050
sed -i '/self.driver.start(env=env)/i \ \ \ \ \ \ \ \ env["PYTHONPATH"] = "%{buildroot}%{python3_sitelib}"' \
Nikola Forró 677050
    tests/utils/botocore/__init__.py
Nikola Forró 677050
Nikola Forró 677050
export TESTS_REMOVE_REPO_ROOT_FROM_PATH=1 TZ=UTC
Michel Lind a52323
# =========================== short test summary info ============================
Michel Lind a52323
# FAILED tests/functional/cloudfront/test_sign.py::TestSign::test_canned_policy
Michel Lind a52323
# FAILED tests/functional/cloudfront/test_sign.py::TestSign::test_custom_policy
Michel Lind a52323
# FAILED tests/functional/ssm/test_start_session.py::TestSessionManager::test_start_session_fails
Michel Lind a52323
# FAILED tests/functional/ssm/test_start_session.py::TestSessionManager::test_start_session_success
Michel Lind a52323
# ERROR tests/functional/autocomplete/test_completion_files.py
Michel Lind a52323
# ERROR tests/functional/botocore/test_waiter_config.py
Michel Lind a52323
# ======= 4 failed, 64966 passed, 7 skipped, 2 errors in 874.01s (0:14:34) =======
Michel Lind a52323
#
Michel Lind a52323
# the latter are weird
Michel Lind a52323
# ==================================== ERRORS ====================================
Michel Lind a52323
# ___ ERROR collecting tests/functional/autocomplete/test_completion_files.py ____
Michel Lind a52323
# ImportError while importing test module '/builddir/build/BUILD/aws-cli-2.13.4/tests/functional/autocomplete/test_completion_files.py'.
Michel Lind a52323
# Hint: make sure your test modules/packages have valid Python names.
Michel Lind a52323
# Traceback:
Michel Lind a52323
# /usr/lib64/python3.9/importlib/__init__.py:127: in import_module
Michel Lind a52323
#     return _bootstrap._gcd_import(name[level:], package, level)
Michel Lind a52323
# tests/functional/autocomplete/test_completion_files.py:14: in <module>
Michel Lind a52323
#     from jsonschema import Draft4Validator
Michel Lind a52323
# /usr/lib/python3.9/site-packages/jsonschema/__init__.py:34: in <module>
Michel Lind a52323
#     __version__ = metadata.version("jsonschema")
Michel Lind a52323
# /usr/lib64/python3.9/importlib/metadata.py:569: in version
Michel Lind a52323
#     return distribution(distribution_name).version
Michel Lind a52323
# /usr/lib64/python3.9/importlib/metadata.py:542: in distribution
Michel Lind a52323
#     return Distribution.from_name(distribution_name)
Michel Lind a52323
# /usr/lib64/python3.9/importlib/metadata.py:196: in from_name
Michel Lind a52323
#     raise PackageNotFoundError(name)
Michel Lind a52323
# E   importlib.metadata.PackageNotFoundError: jsonschema
Michel Lind a52323
# _______ ERROR collecting tests/functional/botocore/test_waiter_config.py _______
Michel Lind a52323
# ImportError while importing test module '/builddir/build/BUILD/aws-cli-2.13.4/tests/functional/botocore/test_waiter_config.py'.
Michel Lind a52323
# Hint: make sure your test modules/packages have valid Python names.
Michel Lind a52323
# Traceback:
Michel Lind a52323
# /usr/lib64/python3.9/importlib/__init__.py:127: in import_module
Michel Lind a52323
#     return _bootstrap._gcd_import(name[level:], package, level)
Michel Lind a52323
# tests/functional/botocore/test_waiter_config.py:14: in <module>
Michel Lind a52323
#     from jsonschema import Draft4Validator
Michel Lind a52323
# /usr/lib/python3.9/site-packages/jsonschema/__init__.py:34: in <module>
Michel Lind a52323
#     __version__ = metadata.version("jsonschema")
Michel Lind a52323
# /usr/lib64/python3.9/importlib/metadata.py:569: in version
Michel Lind a52323
#     return distribution(distribution_name).version
Michel Lind a52323
# /usr/lib64/python3.9/importlib/metadata.py:542: in distribution
Michel Lind a52323
#     return Distribution.from_name(distribution_name)
Michel Lind a52323
# /usr/lib64/python3.9/importlib/metadata.py:196: in from_name
Michel Lind a52323
#     raise PackageNotFoundError(name)
Michel Lind a52323
# E   importlib.metadata.PackageNotFoundError: jsonschema
Michel Lind a52323
# =========================== short test summary info ============================
Michel Lind a52323
# ERROR tests/functional/autocomplete/test_completion_files.py
Michel Lind a52323
# ERROR tests/functional/botocore/test_waiter_config.py
Michel Lind a52323
# ============ 64963 passed, 7 skipped, 2 errors in 942.68s (0:15:42) ============
Michel Lind a52323
#
Michel Lind a52323
# =========================== short test summary info ============================
Michel Lind a52323
# FAILED tests/unit/test_utils.py::TestIgnoreCtrlC::test_ctrl_c_is_ignored - Va...
Michel Lind a52323
# FAILED tests/unit/customizations/test_sessionmanager.py::TestSessionManager::test_start_session_when_no_profile_is_passed
Michel Lind a52323
# FAILED tests/unit/customizations/ecs/test_executecommand_startsession.py::TestExecuteCommand::test_execute_command_success
Michel Lind a52323
# ============ 3 failed, 64962 passed, 7 skipped in 858.78s (0:14:18) ============
Michel Lind a52323
#
Michel Lind a52323
# =========================== short test summary info ============================
Michel Lind a52323
# FAILED tests/functional/test_no_event_streams.py::test_no_event_stream_unless_allowed
Michel Lind a52323
# FAILED tests/functional/test_output.py::TestYAMLStream::test_yaml_stream_paginated_response
Michel Lind a52323
# FAILED tests/functional/test_output.py::TestYAMLStream::test_yaml_stream_removes_response_metadata_for_all_responses
Michel Lind a52323
# FAILED tests/functional/botocore/test_paginate.py::TestRDSPagination::test_can_specify_zero_marker
Michel Lind a52323
# FAILED tests/functional/botocore/test_paginate.py::TestAutoscalingPagination::test_repeated_build_full_results
Michel Lind a52323
# FAILED tests/functional/botocore/test_paginate.py::TestCloudwatchLogsPagination::test_token_with_triple_underscores
Michel Lind a52323
# FAILED tests/functional/lightsail/test_push_container_image.py::TestPushContainerImageTest::test_start_lightsailctl_success
Michel Lind a52323
# FAILED tests/functional/lightsail/test_push_container_image.py::TestPushContainerImageTest::test_start_lightsailctl_with_cabundle_ssuccess
Michel Lind a52323
# FAILED tests/functional/lightsail/test_push_container_image.py::TestPushContainerImageTest::test_start_lightsailctl_with_con_timeout_ssuccess
Michel Lind a52323
# FAILED tests/functional/lightsail/test_push_container_image.py::TestPushContainerImageTest::test_start_lightsailctl_with_no_paginate_ssuccess
Michel Lind a52323
# FAILED tests/functional/lightsail/test_push_container_image.py::TestPushContainerImageTest::test_start_lightsailctl_with_no_sign_request_ssuccess
Michel Lind a52323
# FAILED tests/functional/lightsail/test_push_container_image.py::TestPushContainerImageTest::test_start_lightsailctl_with_no_verify_ssl_ssuccess
Michel Lind a52323
# FAILED tests/functional/lightsail/test_push_container_image.py::TestPushContainerImageTest::test_start_lightsailctl_with_output_json_ssuccess
Michel Lind a52323
# FAILED tests/functional/lightsail/test_push_container_image.py::TestPushContainerImageTest::test_start_lightsailctl_with_read_timeout_ssuccess
Michel Lind a52323
# FAILED tests/functional/lightsail/test_push_container_image.py::TestPushContainerImageTest::test_start_lightsailctl_with_region_success
Michel Lind a52323
# FAILED tests/functional/lightsail/test_push_container_image.py::TestPushContainerImageTest::test_start_lightsailctl_with_url_success
Michel Lind a52323
# =========== 16 failed, 64945 passed, 7 skipped in 858.70s (0:14:18) ============
Michel Lind a52323
# 
Michel Lind a52323
%if %{with all_tests}
Nikola Forró 677050
%pytest --verbose --numprocesses=auto --dist=loadfile tests/unit tests/functional
Michel Lind a52323
%else
Michel Lind a52323
EXCLUDES="not test_canned_policy and not test_custom_policy"
Michel Lind a52323
EXCLUDES+=" and not test_start_session_fails and not test_start_session_success"
Michel Lind a52323
EXCLUDES+=" and not test_ctrl_c_is_ignored and not test_start_session_when_no_profile_is_passed"
Michel Lind a52323
EXCLUDES+=" and not test_execute_command_success"
Michel Lind a52323
EXCLUDES+=" and not test_no_event_stream_unless_allowed"
Michel Lind a52323
EXCLUDES+=" and not test_yaml_stream_paginated_response and not test_yaml_stream_removes_response_metadata_for_all_responses"
Michel Lind a52323
EXCLUDES+=" and not test_can_specify_zero_marker and not test_repeated_build_full_results"
Michel Lind a52323
EXCLUDES+=" and not test_token_with_triple_underscore"
Michel Lind a52323
%pytest --verbose --numprocesses=auto --dist=loadfile tests/unit tests/functional \
Michel Lind a52323
  -k "$EXCLUDES" --ignore=tests/functional/autocomplete/test_completion_files.py \
Michel Lind a52323
  --ignore=tests/functional/botocore/test_waiter_config.py \
Michel Lind a52323
  --ignore=tests/functional/lightsail/test_push_container_image.py
Michel Lind a52323
%endif
Nikola Forró 677050
Nikola Forró 677050
Nikola Forró 677050
%files -f %{pyproject_files}
Nikola Forró 677050
%license LICENSE.txt
Nikola Forró 677050
%doc README.rst
Nikola Forró 677050
%{_bindir}/aws
Nikola Forró 677050
%{_bindir}/aws_completer
3a8ae5
%{bash_completions_dir}/aws
3a8ae5
%{zsh_completions_dir}/_awscli
Nikola Forró 677050
Nikola Forró 677050
Nikola Forró 677050
%changelog
Michel Lind 1ca7be
* Mon Sep 11 2023 Michel Lind <salimma@centosproject.org> - 2.13.4-1.1
Michel Lind 1ca7be
- Initial Hyperscale release, adapted from 2.13.4-1.fc38