## START: Set by rpmautospec
## (rpmautospec version 0.7.3)
## RPMAUTOSPEC: autorelease, autochangelog
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
    release_number = 1;
    base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}"));
    print(release_number + base_release_number - 1);
}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}}
## END: Set by rpmautospec

Name:           python-aws-sam-translator
Summary:        Transform SAM templates into AWS CloudFormation templates
Version:        1.94.0
Release:        %autorelease

License:        Apache-2.0
URL:            https://github.com/aws/serverless-application-model
# We use the GitHub tarball instead of the PyPI tarball to get documentation
# and tests.
Source:         %{url}/archive/v%{version}/serverless-application-model-%{version}.tar.gz

# Downstream-only: omit coverage arguments for pytest
# https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_linters
Patch:          python-aws-sam-translator-1.73.0-no-coverage.patch

# Failing tests on warnings makes sense for upstream CI, but is too strict for
# distribution packaging, where warnings may arise at any time from updated
# dependencies.
Patch:          python-aws-sam-translator-1.73.0-no-warning-error.patch

BuildArch:      noarch
# https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval
ExcludeArch:    %{ix86}

BuildRequires:  python3-devel

# Because most of the dependencies in the “dev” extra (from
# requirements/dev.txt) are unwanted or have version bounds that need to be
# loosened, we list them manually rather than generating BuildRequires from the
# “dev” extra.
# ----------
# Omitted dependencies in the following group are due to:
# https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_linters
#
# coverage>=5.3,<8
# pytest-cov>=2.10,<5
# pytest-xdist>=2.5,<4
BuildRequires:  %{py3_dist pytest-xdist} >= 2.5
# pytest-env>=0.6,<1
BuildRequires:  %{py3_dist pytest-env} >= 0.6
# pytest-rerunfailures>=9.1,<12
BuildRequires:  %{py3_dist pytest-rerunfailures} >= 9.1
# pyyaml~=6.0
BuildRequires:  %{py3_dist pyyaml} >= 6
# ruff~=0.1.0
# ----------
# Test requirements
# pytest>=6.2,<8
BuildRequires:  %{py3_dist pytest} >= 6.2
# parameterized~=0.7
BuildRequires:  %{py3_dist parameterized} >= 0.7
# ----------
# We cannot run the integration tests because they interact with AWS.
#
# Integration tests
# dateparser~=1.1
# boto3>=1.23,<2
# tenacity~=8.0
# ----------
# The description in requirements/dev.txt is not quite correct; requests is
# actually another integration test dependency (see above).
#
# Requirements for examples
# requests~=2.28
# ----------
# https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_linters
#
# formatter
# black==23.10.1
# ruamel.yaml==0.17.21  # It can parse yaml while perserving comments
# ----------
# https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_linters
#
# type check
# mypy~=1.3.0
# ----------
# https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_linters
#
# types
# boto3-stubs[appconfig,serverlessrepo]>=1.19.5,==1.*
# types-PyYAML~=6.0
# types-jsonschema~=3.2

%global common_description %{expand:
%{summary}.

AWS Serverless Application Model (SAM) is an open-source framework for building
serverless applications.}

%description %{common_description}


%package -n     python3-aws-sam-translator
Summary:        %{summary}

# The bundled version is quite close to upstream. It has some “ignore” type
# annotations added, some if statements were reordered (apparently to put this
# library’s common case first for performance), and an LRU cache layer was
# added.
#
# When the type annotations were the only difference, we unbundled this as a
# downstream patch. Now we bundle again, but we have asked upstream about a
# path to unbundling—a request which was mandated by
# https://docs.fedoraproject.org/en-US/packaging-guidelines/#bundling:
#
#   Path to using upstream py27hash as a dependency?
#   https://github.com/aws/serverless-application-model/issues/2815
#
# Upstream refused: “Unfortunately due to how the SAM transform is consumed
# this would be a little tricky, so unless there's customer impact, it's not
# something we're looking to change at this time.”
Provides:       bundled(python3dist(py27hash)) = 1.0.2

Obsoletes:      python-aws-sam-translator-doc < 1.54.0-1

%description -n python3-aws-sam-translator %{common_description}


%prep
%autosetup -n serverless-application-model-%{version} -p1


%generate_buildrequires
%pyproject_buildrequires


%build
%pyproject_wheel


%install
%pyproject_install
%pyproject_save_files samtranslator
# Bug: Source directory bin/ is installed into site-packages
# https://github.com/aws/serverless-application-model/issues/2588
rm -rvf '%{buildroot}%{python3_sitelib}/bin'


%check
# See Makefile target “test”. We cannot run the integration tests because they
# interact with AWS.
AWS_DEFAULT_REGION=us-east-1 PYTHONPATH="${PWD}" %pytest -k "${k-}" -n auto


%files -n python3-aws-sam-translator -f %{pyproject_files}
# pyproject-rpm-macros handles LICENSE/NOTICE/THIRD_PARTY_LICENSES; verify with
# “rpm -qL -p …”
%doc CODE_OF_CONDUCT.md
%doc CONTRIBUTING.md
%doc DESIGN.md
%doc HOWTO.md
%doc README.md
# Contains a handful of reStructuredText files:
%doc docs/


%changelog
## START: Generated by rpmautospec
* Fri Nov 22 2024 Packit <hello@packit.dev> - 1.94.0-1
- Update to 1.94.0 upstream release
- Resolves: rhbz#2327937

* Thu Nov 21 2024 Packit <hello@packit.dev> - 1.93.0-1
- Update to 1.93.0 upstream release
- Resolves: rhbz#2327911

* Sat Nov 09 2024 Packit <hello@packit.dev> - 1.92.0-1
- Update to 1.92.0 upstream release
- Resolves: rhbz#2324818

* Thu Aug 22 2024 Benjamin A. Beasley <code@musicinmybrain.net> - 1.91.0-1
- Update to 1.91.0 (close RHBZ#2306012)

* Thu Aug 15 2024 Benjamin A. Beasley <code@musicinmybrain.net> - 1.90.0-1
- Update to 1.90.0 (close RHBZ#2305054)

* Fri Jul 19 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.89.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild

* Sat Jun 29 2024 Python Maint <python-maint@redhat.com> - 1.89.0-2
- Rebuilt for Python 3.13

* Fri May 17 2024 Benjamin A. Beasley <code@musicinmybrain.net> - 1.89.0-1
- Update to 1.89.0 (close RHBZ#2280907)

* Thu May 09 2024 Benjamin A. Beasley <code@musicinmybrain.net> - 1.88.0-1
- Update to 1.88.0 (close RHBZ#2279416)

* Fri Apr 05 2024 Benjamin A. Beasley <code@musicinmybrain.net> - 1.87.0-2
- Fix import path issue with pytest 8 (fix RHBZ#2273606)

* Thu Apr 04 2024 Benjamin A. Beasley <code@musicinmybrain.net> - 1.87.0-1
- Update to 1.87.0 (close RHBZ#2273503)

* Fri Mar 08 2024 Benjamin A. Beasley <code@musicinmybrain.net> - 1.86.0-1
- Update to 1.86.0 (close RHBZ#2268507)

* Thu Feb 15 2024 Benjamin A. Beasley <code@musicinmybrain.net> - 1.85.0-1
- Update to 1.85.0 (close RHBZ#2264464)

* Sat Feb 03 2024 Benjamin A. Beasley <code@musicinmybrain.net> - 1.84.0-1
- Update to 1.84.0 (close RHBZ#2262467)

* Mon Jan 29 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.83.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild

* Fri Jan 26 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.83.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild

* Sun Jan 21 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.83.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild

* Fri Jan 05 2024 Benjamin A. Beasley <code@musicinmybrain.net> - 1.83.0-1
- Update to 1.83.0 (close RHBZ#2256890)

* Wed Dec 06 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 1.82.0-1
- Update to 1.82.0 (close RHBZ#2253089)

* Thu Nov 23 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 1.81.0-1
- Update to 1.81.0 (close RHBZ#2251126)

* Thu Nov 16 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 1.80.0-1
- Update to 1.80.0 (close RHBZ#2250158)

* Tue Oct 24 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 1.79.0-1
- Update to 1.79.0 (close RHBZ#2244119)

* Mon Oct 09 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 1.77.0-1
- Update to 1.77.0 (close RHBZ#2242409)

* Fri Sep 29 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 1.76.0-1
- Update to 1.76.0 (close RHBZ#2241267)

* Wed Sep 20 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 1.75.0-1
- Update to 1.75.0 (close RHBZ#2239737)

* Fri Sep 01 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 1.74.0-1
- Update to 1.74.0 (close RHBZ#2236625)

* Sat Aug 12 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 1.73.0-1
- Update to 1.73.0 (close RHBZ#2230760)

* Sat Aug 12 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 1.72.0-3
- Do not fail tests on warnings

* Sat Aug 12 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 1.72.0-2
- Use a patch instead of sed to drop pytest coverage options

* Sat Jul 29 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 1.72.0-1
- Update to 1.72.0 (close RHBZ#2227388)

* Fri Jul 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.71.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild

* Wed Jul 12 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 1.71.0-1
- Update to 1.71.0 (close RHBZ#2220644)

* Tue Jul 04 2023 Python Maint <python-maint@redhat.com> - 1.70.0-2
- Rebuilt for Python 3.12

* Tue Jun 27 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 1.70.0-1
- Update to 1.70.0 (close RHBZ#2216824)

* Fri Jun 16 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 1.69.0-1
- Update to 1.69.0 (close RHBZ#2215389)

* Fri May 26 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 1.68.0-1
- Update to 1.68.0 (close RHBZ#2210127)

* Wed May 17 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 1.67.0-1
- Update to 1.67.0 (close RHBZ#2207773)

* Tue May 16 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 1.66.0-1
- Update to 1.66.0 (close RHBZ#2190313)

* Tue May 16 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 1.65.0-3
- Do not generate “dev” dependencies

* Mon May 15 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 1.65.0-2
- Drop unnecessary generated BR on python3dist(ruamel-yaml)

* Thu Apr 20 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 1.65.0-1
- Update to 1.65.0 (close RHBZ#2188159)

* Fri Apr 07 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 1.64.0-1
- Update to 1.64.0 (close RHBZ#2185049)

* Tue Mar 28 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 1.63.0-1
- Update to 1.63.0 (close RHBZ#2182222)

* Wed Mar 15 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 1.62.0-1
- Update to 1.62.0 (close RHBZ#2178359)

* Mon Mar 13 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 1.61.0-1
- Update to 1.61.0 (close RHBZ#2177319)

* Wed Mar 01 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 1.60.1-1
- Update to 1.60.1 (close RHBZ#2174238)

* Tue Feb 28 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 1.60.0-1
- Update to 1.60.0 (close RHBZ#2173745)

* Fri Feb 17 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 1.59.0-2
- Allow newer python3-typing-extensions

* Thu Feb 09 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 1.59.0-1
- Update to 1.59.0 (close RHBZ#2168407)

* Wed Jan 25 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 1.58.1-2
- Record upstream refusal to pursue unbundling py27hash

* Wed Jan 25 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 1.58.1-1
- Update to 1.58.1 (close RHBZ#2163574)

* Wed Jan 25 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 1.58.0-2
- Drop 32-bit support; base package is now noarch

* Wed Jan 25 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 1.58.0-1
- Update to 1.58.0

* Fri Jan 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.57.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild

* Thu Jan 12 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 1.57.0-1
- Update to 1.57.0 (close RHBZ#2160531)

* Fri Jan 06 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 1.56.0-1
- Update to 1.56.0 (close RHBZ#2158630)

* Wed Dec 21 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 1.55.0-2
- Rely on PYTEST_XDIST_AUTO_NUM_WORKERS

* Wed Nov 30 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 1.55.0-1
- Update to 1.55.0 (close RHBZ#2149189)

* Fri Nov 11 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 1.54.0-1
- Update to 1.54.0 (close RHBZ#2141855)
- Merge the -doc subpackage back into the base package since upstream no
  longer supports generating documentation with Sphinx

* Fri Nov 11 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 1.53.0-3
- Use an improved patch for jsonschema 4.x support

* Fri Nov 11 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 1.53.0-2
- Unpin pytest-xdist to allow major version 3

* Fri Oct 14 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 1.53.0-1
- Update to 1.53.0 (fix RHBZ#2133876)

* Fri Oct 07 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 1.52.0-1
- Update to 1.52.0 (close RHBZ#2132824)

* Fri Sep 16 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 1.51.0-1
- Update to 1.51.0 (close RHBZ#2126554)

* Tue Aug 23 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 1.50.0-2
- Parallelize sphinx-build

* Fri Aug 19 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 1.50.0-1
- Update to 1.50.0 (close RHBZ#2119149)

* Thu Aug 11 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 1.49.0-1
- Update to 1.49.0 (close RHBZ#2116533)

* Thu Aug 11 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 1.48.0-2
- Update License to SPDX

* Tue Jul 26 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 1.48.0-1
- Update to 1.48.0 (close RHBZ#2111073)

* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.47.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild

* Tue Jul 12 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 1.47.0-1
- Update to 1.47.0 (close RHBZ#2106488)

* Thu Jul 07 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 1.46.0-5
- Run tests in parallel

* Tue Jun 28 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 1.46.0-4
- Allow jsonschema 4.x (fix RHBZ#2101856)

* Wed Jun 15 2022 Python Maint <python-maint@redhat.com> - 1.46.0-3
- Rebuilt for Python 3.11

* Tue Jun 14 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 1.46.0-2
- Unpin dev dependency on “parameterized”

* Tue Jun 07 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 1.46.0-1
- Update to 1.46.0 (close RHBZ#2094478)

* Tue May 03 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 1.45.0-2
- Work around a failing test on 32-bit builders

* Thu Apr 07 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 1.45.0-1
- Update to 1.45.0 (close RHBZ#2072691)

* Tue Mar 29 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 1.44.0-1
- Update to 1.44.0 (close RHBZ#2069359)

* Thu Mar 24 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 1.43.0-1
- Update to 1.43.0 (close RHBZ#2066966)

* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.42.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild

* Thu Jan 06 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 1.42.0-4
- Remove PyPI mock dependency (upstream PR#2184)

* Fri Dec 17 2021 Benjamin A. Beasley <code@musicinmybrain.net> - 1.42.0-3
- Patch out pytest-cov build dependency

* Fri Dec 17 2021 Benjamin A. Beasley <code@musicinmybrain.net> - 1.42.0-2
- Add missing license files in -doc subpackage

* Wed Dec 15 2021 Benjamin A. Beasley <code@musicinmybrain.net> - 1.42.0-1
- Initial package (close RHBZ#2030436)
## END: Generated by rpmautospec