2019-01-21 13:03:46 +00:00
|
|
|
#
|
|
|
|
# spec file for package python-aws-sam-translator
|
|
|
|
#
|
2023-07-05 12:16:14 +00:00
|
|
|
# Copyright (c) 2023 SUSE LLC
|
2019-01-21 13:03:46 +00:00
|
|
|
#
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
2019-06-05 15:43:41 +00:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
|
|
|
#
|
2019-01-21 13:03:46 +00:00
|
|
|
|
|
|
|
|
2019-11-22 10:54:10 +00:00
|
|
|
# Disable tests on SLE-12 due to issues with Python 3.4
|
|
|
|
# see: https://github.com/awslabs/serverless-application-model/issues/1255
|
|
|
|
%if 0%{?suse_version} < 1500
|
|
|
|
%bcond_with test
|
|
|
|
%else
|
|
|
|
%bcond_without test
|
|
|
|
%endif
|
2020-11-26 11:11:06 +00:00
|
|
|
%if 0%{?suse_version} >= 1500
|
2020-11-25 23:19:39 +00:00
|
|
|
%define skip_python2 1
|
|
|
|
%endif
|
2019-01-21 13:03:46 +00:00
|
|
|
Name: python-aws-sam-translator
|
2023-12-06 12:16:43 +00:00
|
|
|
Version: 1.81.0
|
2019-01-21 13:03:46 +00:00
|
|
|
Release: 0
|
|
|
|
Summary: AWS SAM template to AWS CloudFormation template translator
|
2019-06-05 15:43:41 +00:00
|
|
|
License: Apache-2.0
|
2019-11-22 10:54:10 +00:00
|
|
|
URL: https://github.com/awslabs/serverless-application-model
|
2019-06-05 20:23:58 +00:00
|
|
|
Source: https://github.com/awslabs/serverless-application-model/archive/v%{version}.tar.gz#/serverless-application-model-%{version}.tar.gz
|
2023-09-07 11:51:05 +00:00
|
|
|
#Patch0: skip-tests-require-network.patch
|
2019-01-21 13:03:46 +00:00
|
|
|
BuildRequires: %{python_module setuptools}
|
2019-06-05 20:23:58 +00:00
|
|
|
BuildRequires: fdupes
|
2019-06-05 15:43:41 +00:00
|
|
|
BuildRequires: python-rpm-macros
|
2022-11-14 13:22:43 +00:00
|
|
|
Requires: python-boto3 >= 1.19.5
|
|
|
|
Requires: python-jsonschema >= 3.2
|
2023-07-05 12:16:14 +00:00
|
|
|
Requires: python-pydantic >= 1.8
|
|
|
|
Requires: (python-typing_extensions >= 4.4.0 if python-base < 3.7)
|
2020-07-20 12:09:11 +00:00
|
|
|
Requires(post): update-alternatives
|
2021-06-10 08:58:00 +00:00
|
|
|
Requires(postun):update-alternatives
|
2020-05-07 13:13:51 +00:00
|
|
|
BuildArch: noarch
|
|
|
|
%if 0%{?suse_version} < 1500
|
|
|
|
BuildRequires: python
|
|
|
|
%endif
|
2019-01-21 13:03:46 +00:00
|
|
|
# SECTION test requirements
|
2022-11-14 13:22:43 +00:00
|
|
|
BuildRequires: %{python_module PyYAML >= 5.4}
|
|
|
|
BuildRequires: %{python_module boto3 >= 1.19.5}
|
|
|
|
BuildRequires: %{python_module coverage >= 5.3}
|
2020-05-07 13:13:51 +00:00
|
|
|
BuildRequires: %{python_module docopt >= 0.6.2}
|
2022-11-14 13:22:43 +00:00
|
|
|
BuildRequires: %{python_module jsonschema >= 3.2}
|
|
|
|
BuildRequires: %{python_module parameterized >= 0.7.4}
|
2023-07-05 12:16:14 +00:00
|
|
|
BuildRequires: %{python_module pydantic >= 1.8}
|
2019-06-05 20:23:58 +00:00
|
|
|
BuildRequires: %{python_module pytest >= 3.0.7}
|
2022-11-14 13:22:43 +00:00
|
|
|
BuildRequires: %{python_module pytest-cov >= 2.10.1}
|
2022-12-02 12:37:06 +00:00
|
|
|
BuildRequires: %{python_module pytest-rerunfailures}
|
2022-11-14 13:22:43 +00:00
|
|
|
BuildRequires: %{python_module requests >= 2.24.0}
|
2019-01-21 13:03:46 +00:00
|
|
|
%python_subpackages
|
|
|
|
|
|
|
|
%description
|
|
|
|
AWS SAM Translator is a library that transform SAM
|
|
|
|
templates into AWS CloudFormation templates
|
|
|
|
|
|
|
|
%prep
|
2022-11-14 13:22:43 +00:00
|
|
|
%autosetup -p1 -n serverless-application-model-%{version}
|
2020-05-07 13:13:51 +00:00
|
|
|
sed -i -e 's:~=:>=:g' requirements/base.txt
|
2022-12-02 12:37:06 +00:00
|
|
|
# Remove the __init__.py file from bin to avoid installation of this
|
|
|
|
# folder in python_sitelib
|
|
|
|
# https://github.com/aws/serverless-application-model/issues/2588
|
|
|
|
rm bin/__init__.py
|
2019-01-21 13:03:46 +00:00
|
|
|
|
|
|
|
%build
|
|
|
|
%python_build
|
|
|
|
|
|
|
|
%install
|
|
|
|
%python_install
|
2022-03-15 08:48:27 +00:00
|
|
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
2019-01-21 13:03:46 +00:00
|
|
|
|
2019-06-05 20:23:58 +00:00
|
|
|
mkdir -p %{buildroot}%{_bindir}
|
2020-05-07 13:13:51 +00:00
|
|
|
install -D -m 755 bin/sam-translate.py %{buildroot}%{_bindir}/sam-translate
|
2020-07-20 12:09:11 +00:00
|
|
|
%python_clone -a %{buildroot}%{_bindir}/sam-translate
|
2019-06-05 20:23:58 +00:00
|
|
|
|
2019-11-22 10:54:10 +00:00
|
|
|
%if %{with test}
|
2019-06-05 20:23:58 +00:00
|
|
|
%check
|
2019-07-15 11:46:51 +00:00
|
|
|
export LANG=en_US.UTF8
|
2023-09-07 11:51:05 +00:00
|
|
|
donttest="test_plugin_accepts_different_sar_client or test_plugin_accepts_flags or"
|
|
|
|
donttest="$donttest test_plugin_accepts_parameters or test_plugin_default_values or"
|
|
|
|
donttest="$donttest test_plugin_invalid_configuration_raises_exception or test_plugin_must_setup_correct_name or"
|
|
|
|
donttest="$donttest test_must_process_applications or test_must_process_applications_validate or"
|
|
|
|
donttest="$donttest test_process_invalid_applications or test_process_invalid_applications_validate or"
|
|
|
|
donttest="$donttest test_resolve_intrinsics or test_sar_service_calls or test_sar_success_one_app or"
|
|
|
|
donttest="$donttest test_sar_throttling_doesnt_stop_processing or test_sleep_between_sar_checks or"
|
|
|
|
donttest="$donttest test_unexpected_sar_error_stops_processing or test_time_limit_exceeds_between_combined_sar_calls or"
|
|
|
|
donttest="$donttest test_is_service_supported_positive_4_ec2"
|
|
|
|
%pytest -k "not ($donttest)"
|
2019-11-22 10:54:10 +00:00
|
|
|
%endif
|
2019-06-05 20:23:58 +00:00
|
|
|
|
2020-07-20 12:09:11 +00:00
|
|
|
%post
|
|
|
|
%python_install_alternative sam-translate
|
|
|
|
|
|
|
|
%postun
|
|
|
|
%python_uninstall_alternative sam-translate
|
|
|
|
|
2019-01-21 13:03:46 +00:00
|
|
|
%files %{python_files}
|
|
|
|
%doc README.md
|
|
|
|
%license LICENSE
|
2020-07-20 12:09:11 +00:00
|
|
|
%python_alternative %{_bindir}/sam-translate
|
2022-11-14 13:22:43 +00:00
|
|
|
%{python_sitelib}/samtranslator
|
|
|
|
%{python_sitelib}/aws_sam_translator-%{version}*-info
|
2019-01-21 13:03:46 +00:00
|
|
|
|
|
|
|
%changelog
|