## START: Set by rpmautospec ## (rpmautospec version 0.6.0) ## 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 # Sphinx-generated HTML documentation is not suitable for packaging; see # https://bugzilla.redhat.com/show_bug.cgi?id=2006555 for discussion. # # We can generate PDF documentation as a substitute. %bcond doc_pdf 1 # Not yet packaged (python-aiobotocore) %bcond aiobotocore 0 # Not yet packaged (python-django-fake-model) %bcond django 0 # Only compatibile with python-pg8000 < 1.20 %bcond pg8000 0 # Only compatibile with python-flask-sqlalchemy <= 2.5.1 and flask < 3.0.0 %bcond flask_sqlalchemy %{expr:%{defined fc38}} # All of the tests for the following extensions require network access. (A few # may succeed without it, but this is because they expected a failure, and a # slightly different failure occurred instead.) # # We considered sending a PR upstream to add a “network” pytest mark so we # could deselect these all at once with “-m 'not network',” but pytest would # exit nonzero (failure) for any tox environments for which all tests were # deselected, and that is quite annoying to work around; see # https://github.com/pytest-dev/pytest/issues/5689. Instead we simply do not # consider these environments. %bcond httplib 0 %bcond httpx 0 # Only compatible with pynamodb < 6.0.0 (F38/F39) %bcond pynamodb 0 %bcond requests 0 # The situation here is the same except that there are middleware tests that # *do* all succeed, so we do not need to disable the entire environment. # Instead, the module containing the client tests is ignored with a pytest # flag. %bcond aiohttp 1 Name: python-aws-xray-sdk Summary: AWS X-Ray SDK for the Python programming language Version: 2.13.0 Release: %autorelease # The entire source is Apache-2.0, except that sample-apps/ (packaged in the # -doc subpackage) is MIT-0. License: Apache-2.0 URL: https://github.com/aws/aws-xray-sdk-python # We use the GitHub tarball instead of the PyPI sdist to get documentation # and tests. Source: %{url}/archive/%{version}/aws-xray-sdk-python-%{version}.tar.gz BuildArch: noarch BuildRequires: python3-devel %if %{with doc_pdf} BuildRequires: make BuildRequires: python3dist(sphinx) BuildRequires: python3-sphinx-latex BuildRequires: latexmk %if %{without django} # Not brought in via tox environments, but needed for documentation: BuildRequires: python3dist(django) %endif %endif BuildRequires: postgresql-server %global common_description %{expand: The AWS X-Ray SDK for Python (the SDK) enables Python developers to record and emit information from within their applications to the AWS X-Ray service.} %description %{common_description} %package -n python3-aws-xray-sdk Summary: %{summary} %description -n python3-aws-xray-sdk %{common_description} %package doc Summary: Documentation and examples for aws-xray-sdk License: Apache-2.0 AND MIT-0 %description doc %{common_description} %prep %autosetup -n aws-xray-sdk-python-%{version} -p1 # https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_linters # Remove the version bound on pytest-asyncio: we cannot respect an # exact-version pin, and currently we can’t even satisfy it as a lower-bound. sed -r -i \ -e 's/coverage run.*-m //' \ -e 's/^([[:blank:]]*)(coverage|codecov)\b/\1; \2/' \ -e 's/(pytest-asyncio) == [[:digit:].]+/\1/' \ tox.ini cp -p sample-apps/LICENSE LICENSE.sample-apps %generate_buildrequires %{pyproject_buildrequires -e \ %{toxenv}-core,\ %{?with_aiobotocore:%{toxenv}-ext-aiobotocore,}\ %{?with_aiohttp:%{toxenv}-ext-aiohttp,}\ %{toxenv}-ext-botocore,\ %{toxenv}-ext-bottle,\ %{?with_django:%{toxenv}-ext-django-4,}\ %{toxenv}-ext-flask,\ %{?with_flask_sqlalchemy:%{toxenv}-ext-flask_sqlalchemy,}\ %{?with_httplib:%{toxenv}-ext-httplib,}\ %{?with_httpx:%{toxenv}-ext-httpx},\ %{?with_pg8000:%{toxenv}-ext-pg8000,}\ %{toxenv}-ext-psycopg2,\ %{?with_pynamodb:%{toxenv}-ext-pynamodb,}\ %{?with_requests:%{toxenv}-ext-requests,}\ %{toxenv}-ext-sqlalchemy,\ %{toxenv}-ext-sqlalchemy_core,\ %{toxenv}-ext-sqlite3} %build %pyproject_wheel %if %{with doc_pdf} %make_build -C docs latex \ SPHINXBUILD='sphinx-build' SPHINXOPTS='-j%{?_smp_build_ncpus}' %make_build -C docs/_build/latex LATEXMKOPTS='-quiet' %endif %install %pyproject_install %pyproject_save_files -l aws_xray_sdk install -t '%{buildroot}%{_pkgdocdir}' -p -m 0644 -D \ %{?with_doc_pdf:docs/_build/latex/aws-xray-sdk.pdf} \ CHANGELOG.rst README.md cp -vpr sample-apps/ '%{buildroot}%{_pkgdocdir}' %check # See tox-distributioncheck.ini: %pytest tests/distributioncheck # Tests for the pymysql extension require a running mysql/mariadb server. So # does the following test. We used to do this, using rubygem-mysql2 as an # example, but it has become impractical to keep this working. k="${k-}${k+ and }not test_db_url_with_special_char" %if %{with aiohttp} # See the note above the aiohttp bcond ignore="${ignore-} --ignore=tests/ext/aiohttp/test_client.py" %endif # This will automatically run all the environments for which we generated # dependencies in %%generate_buildrequires. %tox -- -- -v --asyncio-mode=auto ${ignore-} -k "${k-}" %files -n python3-aws-xray-sdk -f %{pyproject_files} %files doc %license LICENSE NOTICE %doc %dir %{_pkgdocdir}/ %doc %{_pkgdocdir}/CHANGELOG.rst %doc %{_pkgdocdir}/README.md %if %{with doc_pdf} %doc %{_pkgdocdir}/aws-xray-sdk.pdf %endif %doc %dir %{_pkgdocdir}/sample-apps/ %doc %{_pkgdocdir}/sample-apps/*/ %license %{_pkgdocdir}/sample-apps/LICENSE %changelog ## START: Generated by rpmautospec * Fri Mar 08 2024 Benjamin A. Beasley - 2.13.0-1 - Update to 2.13.0 (close RHBZ#2268344) * Tue Jan 30 2024 Benjamin A. Beasley - 2.12.1-6 - Stop running tests for the pymysql extension - Setting up the temporary mariadb test server has become impractical * Fri Jan 26 2024 Fedora Release Engineering - 2.12.1-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild * Sun Jan 21 2024 Fedora Release Engineering - 2.12.1-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild * Sun Dec 17 2023 Benjamin A. Beasley - 2.12.1-2 - Assert that %%pyproject_files contains a license file * Sat Nov 04 2023 Benjamin A. Beasley - 2.12.1-1 - Update to 2.12.1 (close RHBZ#2243700) * Fri Aug 18 2023 Benjamin A. Beasley - 2.12.0-2 - Updated patch for Python 3.12 (no consequence to the RPM package) * Tue Aug 08 2023 Benjamin A. Beasley - 2.12.0-1 - Initial package (close RHBZ#2189323) ## END: Generated by rpmautospec