From ff57866a18eb4ac3993c598b6f497303ece2c6fb Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Thu, 21 Mar 2024 09:56:22 +0100 Subject: [PATCH 01/11] docs: Add Django 4.2 and 5.0 to supported (#2010) --- docs/supported-technologies.asciidoc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/supported-technologies.asciidoc b/docs/supported-technologies.asciidoc index 9a3b314d1..51358b0fd 100644 --- a/docs/supported-technologies.asciidoc +++ b/docs/supported-technologies.asciidoc @@ -42,6 +42,8 @@ We support these Django versions: * 3.1 * 3.2 * 4.0 + * 4.2 + * 5.0 For upcoming Django versions, we generally aim to ensure compatibility starting with the first Release Candidate. From f732b90e36ff5e831e112364d164b4b48fb8d717 Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Thu, 21 Mar 2024 09:56:41 +0100 Subject: [PATCH 02/11] ci: add Flask 2.1+ and 3.0 to matrix (#2011) --- .ci/.matrix_exclude.yml | 12 ++++++++++++ .ci/.matrix_framework.yml | 4 ++-- .ci/.matrix_framework_full.yml | 4 ++++ .gitignore | 1 + docs/supported-technologies.asciidoc | 4 ++++ tests/requirements/reqs-flask-2.0.txt | 2 +- tests/requirements/reqs-flask-2.1.txt | 4 ++++ tests/requirements/reqs-flask-2.2.txt | 4 ++++ tests/requirements/reqs-flask-2.3.txt | 4 ++++ tests/requirements/reqs-flask-3.0.txt | 3 +++ 10 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 tests/requirements/reqs-flask-2.1.txt create mode 100644 tests/requirements/reqs-flask-2.2.txt create mode 100644 tests/requirements/reqs-flask-2.3.txt create mode 100644 tests/requirements/reqs-flask-3.0.txt diff --git a/.ci/.matrix_exclude.yml b/.ci/.matrix_exclude.yml index b3e735566..eb7d57779 100644 --- a/.ci/.matrix_exclude.yml +++ b/.ci/.matrix_exclude.yml @@ -40,6 +40,18 @@ exclude: # Flask - VERSION: pypy-3 FRAMEWORK: flask-0.11 # see https://github.com/pallets/flask/commit/6e46d0cd, 0.11.2 was never released + - VERSION: python-3.6 + FRAMEWORK: flask-2.1 + - VERSION: python-3.6 + FRAMEWORK: flask-2.2 + - VERSION: python-3.6 + FRAMEWORK: flask-2.3 + - VERSION: python-3.6 + FRAMEWORK: flask-3.0 + - VERSION: python-3.7 + FRAMEWORK: flask-2.3 + - VERSION: python-3.7 + FRAMEWORK: flask-3.0 # Python 3.10 removed a bunch of classes from collections, now in collections.abc - VERSION: python-3.10 FRAMEWORK: django-1.11 diff --git a/.ci/.matrix_framework.yml b/.ci/.matrix_framework.yml index 007827327..df04f639c 100644 --- a/.ci/.matrix_framework.yml +++ b/.ci/.matrix_framework.yml @@ -8,8 +8,8 @@ FRAMEWORK: - django-4.2 - django-5.0 - flask-0.12 - - flask-1.1 - - flask-2.0 + - flask-2.3 + - flask-3.0 - jinja2-3 - opentelemetry-newest - opentracing-newest diff --git a/.ci/.matrix_framework_full.yml b/.ci/.matrix_framework_full.yml index 1cb11ae16..cb4361711 100644 --- a/.ci/.matrix_framework_full.yml +++ b/.ci/.matrix_framework_full.yml @@ -19,6 +19,10 @@ FRAMEWORK: - flask-1.0 - flask-1.1 - flask-2.0 + - flask-2.1 + - flask-2.2 + - flask-2.3 + - flask-3.0 - jinja2-2 - jinja2-3 - celery-4-flask-1.0 diff --git a/.gitignore b/.gitignore index 88e0a400b..65dc23f5e 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ *.egg *.db *.pid +*.swp .coverage* .DS_Store .idea diff --git a/docs/supported-technologies.asciidoc b/docs/supported-technologies.asciidoc index 51358b0fd..f170617a2 100644 --- a/docs/supported-technologies.asciidoc +++ b/docs/supported-technologies.asciidoc @@ -61,6 +61,10 @@ We support these Flask versions: * 1.0 * 1.1 * 2.0 + * 2.1 + * 2.2 + * 2.3 + * 3.0 [float] [[supported-aiohttp]] diff --git a/tests/requirements/reqs-flask-2.0.txt b/tests/requirements/reqs-flask-2.0.txt index d68be1afa..62397f9b5 100644 --- a/tests/requirements/reqs-flask-2.0.txt +++ b/tests/requirements/reqs-flask-2.0.txt @@ -1,4 +1,4 @@ -Flask>=2.0,<3 +Flask>=2.0,<2.1 blinker>=1.1 itsdangerous -r reqs-base.txt diff --git a/tests/requirements/reqs-flask-2.1.txt b/tests/requirements/reqs-flask-2.1.txt new file mode 100644 index 000000000..84d89b8b9 --- /dev/null +++ b/tests/requirements/reqs-flask-2.1.txt @@ -0,0 +1,4 @@ +Flask>=2.1,<2.2 +blinker>=1.1 +itsdangerous +-r reqs-base.txt diff --git a/tests/requirements/reqs-flask-2.2.txt b/tests/requirements/reqs-flask-2.2.txt new file mode 100644 index 000000000..0b244a851 --- /dev/null +++ b/tests/requirements/reqs-flask-2.2.txt @@ -0,0 +1,4 @@ +Flask>=2.2,<2.3 +blinker>=1.1 +itsdangerous +-r reqs-base.txt diff --git a/tests/requirements/reqs-flask-2.3.txt b/tests/requirements/reqs-flask-2.3.txt new file mode 100644 index 000000000..08434994e --- /dev/null +++ b/tests/requirements/reqs-flask-2.3.txt @@ -0,0 +1,4 @@ +Flask>=2.3,<3 +blinker>=1.1 +itsdangerous +-r reqs-base.txt diff --git a/tests/requirements/reqs-flask-3.0.txt b/tests/requirements/reqs-flask-3.0.txt new file mode 100644 index 000000000..92120aa14 --- /dev/null +++ b/tests/requirements/reqs-flask-3.0.txt @@ -0,0 +1,3 @@ +Flask>=3.0,<3.1 +itsdangerous +-r reqs-base.txt From db4029207038e42d89fd55279594c575fe633265 Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Fri, 22 Mar 2024 19:37:56 +0100 Subject: [PATCH 03/11] CONTRIBUTING: add more hints on what is required to cut a release (#1989) * CONTRIBUTING: open PRs to the main branch * CONTRIBUTING: add more hints on what you need to setup for releasing Fixes #1991 --- CONTRIBUTING.md | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f31f6c3c9..014b4828d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -64,7 +64,7 @@ Once your changes are ready to submit for review: 1. Submit a pull request - Push your local changes to your forked copy of the repository and [submit a pull request](https://help.github.com/articles/using-pull-requests). + Push your local changes to your forked copy of the repository and [submit a pull request](https://help.github.com/articles/using-pull-requests) to the `main` branch. In the pull request, choose a title which sums up the changes that you have made, and in the body provide more details about what your changes do. @@ -174,6 +174,11 @@ should "Squash and merge". ### Releasing +Releases tags are signed so you need to have a PGP key set up, you can follow Github documentation on [creating a key](https://docs.github.com/en/authentication/managing-commit-signature-verification/generating-a-new-gpg-key) and +on [telling git about it](https://docs.github.com/en/authentication/managing-commit-signature-verification/telling-git-about-your-signing-key). Alternatively you can sign with a SSH key, remember you have to upload your key +again even if you want to use the same key you are using for authorization. +Then make sure you have SSO figured out for the key you are using to push to github, see [Github documentation](https://docs.github.com/articles/authenticating-to-a-github-organization-with-saml-single-sign-on/). + If you have commit access, the process is as follows: 1. Update the version in `elasticapm/version.py` according to the scale of the change. (major, minor or patch) @@ -182,13 +187,14 @@ If you have commit access, the process is as follows: 1. For Majors: Add the new major version to `conf.yaml` in the [elastic/docs](https://github.com/elastic/docs) repo. 1. Commit changes with message `update CHANGELOG and bump version to X.Y.Z` where `X.Y.Z` is the version in `elasticapm/version.py` -1. Open a PR against `main` with these changes +1. Open a PR against `main` with these changes leaving the body empty 1. Once the PR is merged, fetch and checkout `upstream/main` 1. Tag the commit with `git tag -s vX.Y.Z`, for example `git tag -s v1.2.3`. Copy the changelog for the release to the tag message, removing any leading `#`. -1. Reset the current major branch (`1.x`, `2.x` etc) to point to the current main, e.g. `git branch -f 1.x main` 1. Push tag upstream with `git push upstream --tags` (and optionally to your own fork as well) -1. Update major branch, e.g. `1.x` on upstream with `git push upstream 1.x` +1. Open a PR from `main` to the major branch, e.g. `1.x` to update it. In order to keep history you may want to + merge with the `rebase` strategy. It is crucial that `main` and the major branch have the same content. 1. After tests pass, Github Actions will automatically build and push the new release to PyPI. 1. Edit and publish the [draft Github release](https://github.com/elastic/apm-agent-python/releases) - created by Github Actions. Copy the changelog into the body of the release. + created by Github Actions. Substitute the generated changelog with one hand written into the body of the + release and move the agent layer ARNs under a `
` block with a `summary`. From d43253f4d88683b5e4b719934d700e697d2c7607 Mon Sep 17 00:00:00 2001 From: Adrien Mannocci Date: Wed, 27 Mar 2024 14:05:24 +0100 Subject: [PATCH 04/11] fix: only set ELASTIC_CI_POST_VERSION when needed (Closes #2015) (#2016) Signed-off-by: Adrien Mannocci --- .github/workflows/packages.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/packages.yml b/.github/workflows/packages.yml index 3f63467fe..4f04d78a4 100644 --- a/.github/workflows/packages.yml +++ b/.github/workflows/packages.yml @@ -16,10 +16,6 @@ on: permissions: contents: read -# Override the version if there is no tag release. -env: - ELASTIC_CI_POST_VERSION: ${{ startsWith(github.ref, 'refs/tags') && '' || github.run_id }} - jobs: build: runs-on: ubuntu-latest @@ -28,6 +24,11 @@ jobs: - uses: actions/setup-python@v5 with: python-version: "3.10" + - name: Override the version if there is no tag release. + run: | + if [[ "${GITHUB_REF}" != refs/tags/* ]]; then + echo "ELASTIC_CI_POST_VERSION=${{ github.run_id }}" >> "${GITHUB_ENV}" + fi - name: Install wheel run: pip install --user wheel - name: Building universal wheel @@ -41,4 +42,3 @@ jobs: path: | dist/*.whl dist/*tar.gz - From b78d465fc69f61a48a1d9649d6af373ca51dcfce Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 29 Mar 2024 12:05:14 +0100 Subject: [PATCH 05/11] build(deps): bump the github-actions group with 1 update (#2013) Bumps the github-actions group with 1 update: [geekyeggo/delete-artifact](https://github.com/geekyeggo/delete-artifact). Updates `geekyeggo/delete-artifact` from 4.1.0 to 5.0.0 - [Release notes](https://github.com/geekyeggo/delete-artifact/releases) - [Changelog](https://github.com/GeekyEggo/delete-artifact/blob/main/CHANGELOG.md) - [Commits](https://github.com/geekyeggo/delete-artifact/compare/65041433121f7239077fa20be14c0690f70569de...24928e75e6e6590170563b8ddae9fac674508aa1) --- updated-dependencies: - dependency-name: geekyeggo/delete-artifact dependency-type: direct:production update-type: version-update:semver-major dependency-group: github-actions ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cae9a846e..381c317b0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -215,6 +215,6 @@ jobs: with: name: html-coverage-report path: htmlcov - - uses: geekyeggo/delete-artifact@65041433121f7239077fa20be14c0690f70569de + - uses: geekyeggo/delete-artifact@24928e75e6e6590170563b8ddae9fac674508aa1 with: name: coverage-reports From 36883408722cc33dbc390740a5f6a38ce31fa79a Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Fri, 29 Mar 2024 21:55:35 +0100 Subject: [PATCH 06/11] Add ability to override default serialization (#2018) * utils: add simplejson based JSON handling Add an alternative json serialization and deserialization implementation using simplejson configured to be JSON compliant by converting floats like nan, +inf and -inf to null . The idea is to permit users to use a different serialization if they need a different behaviour. Refs #1886 * client: fix overriding of transport json serializer We get a string from config so need to import it. --- elasticapm/base.py | 3 +- elasticapm/utils/json_encoder.py | 6 +- elasticapm/utils/simplejson_encoder.py | 58 +++++++++++++++ tests/client/client_tests.py | 13 ++++ tests/requirements/reqs-base.txt | 1 + tests/utils/json_utils/tests.py | 7 ++ tests/utils/json_utils/tests_simplejson.py | 86 ++++++++++++++++++++++ 7 files changed, 168 insertions(+), 6 deletions(-) create mode 100644 elasticapm/utils/simplejson_encoder.py create mode 100644 tests/utils/json_utils/tests_simplejson.py diff --git a/elasticapm/base.py b/elasticapm/base.py index 5f50dc79d..ff2fd6e25 100644 --- a/elasticapm/base.py +++ b/elasticapm/base.py @@ -155,7 +155,8 @@ def __init__(self, config=None, **inline) -> None: "processors": self.load_processors(), } if config.transport_json_serializer: - transport_kwargs["json_serializer"] = config.transport_json_serializer + json_serializer_func = import_string(config.transport_json_serializer) + transport_kwargs["json_serializer"] = json_serializer_func self._api_endpoint_url = urllib.parse.urljoin( self.config.server_url if self.config.server_url.endswith("/") else self.config.server_url + "/", diff --git a/elasticapm/utils/json_encoder.py b/elasticapm/utils/json_encoder.py index c40e0accd..3918bb233 100644 --- a/elasticapm/utils/json_encoder.py +++ b/elasticapm/utils/json_encoder.py @@ -31,13 +31,9 @@ import datetime import decimal +import json import uuid -try: - import json -except ImportError: - import simplejson as json - class BetterJSONEncoder(json.JSONEncoder): ENCODERS = { diff --git a/elasticapm/utils/simplejson_encoder.py b/elasticapm/utils/simplejson_encoder.py new file mode 100644 index 000000000..f538ffdac --- /dev/null +++ b/elasticapm/utils/simplejson_encoder.py @@ -0,0 +1,58 @@ +# BSD 3-Clause License +# +# Copyright (c) 2012, the Sentry Team, see AUTHORS for more details +# Copyright (c) 2019, Elasticsearch BV +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. +# +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +# * Neither the name of the copyright holder nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + + +import simplejson as json + +from elasticapm.utils.json_encoder import BetterJSONEncoder + + +class BetterSimpleJSONEncoder(json.JSONEncoder): + ENCODERS = BetterJSONEncoder.ENCODERS + + def default(self, obj): + if type(obj) in self.ENCODERS: + return self.ENCODERS[type(obj)](obj) + try: + return super(BetterSimpleJSONEncoder, self).default(obj) + except TypeError: + return str(obj) + + +def better_decoder(data): + return data + + +def dumps(value, **kwargs): + return json.dumps(value, cls=BetterSimpleJSONEncoder, ignore_nan=True, **kwargs) + + +def loads(value, **kwargs): + return json.loads(value, object_hook=better_decoder) diff --git a/tests/client/client_tests.py b/tests/client/client_tests.py index af266b710..84e473fc8 100644 --- a/tests/client/client_tests.py +++ b/tests/client/client_tests.py @@ -48,6 +48,11 @@ import elasticapm from elasticapm.base import Client from elasticapm.conf.constants import ERROR + +try: + from elasticapm.utils.simplejson_encoder import dumps as simplejson_dumps +except ImportError: + simplejson_dumps = None from tests.fixtures import DummyTransport, TempStoreClient from tests.utils import assert_any_record_contains @@ -228,6 +233,14 @@ def test_custom_transport(elasticapm_client): assert isinstance(elasticapm_client._transport, DummyTransport) +@pytest.mark.skipIf(simplejson_dumps is None) +@pytest.mark.parametrize( + "elasticapm_client", [{"transport_json_serializer": "elasticapm.utils.simplejson_encoder.dumps"}], indirect=True +) +def test_custom_transport_json_serializer(elasticapm_client): + assert elasticapm_client._transport._json_serializer == simplejson_dumps + + @pytest.mark.parametrize("elasticapm_client", [{"processors": []}], indirect=True) def test_empty_processor_list(elasticapm_client): assert elasticapm_client.processors == [] diff --git a/tests/requirements/reqs-base.txt b/tests/requirements/reqs-base.txt index 42bac1bb8..747e42631 100644 --- a/tests/requirements/reqs-base.txt +++ b/tests/requirements/reqs-base.txt @@ -30,6 +30,7 @@ pytz ecs_logging structlog wrapt>=1.14.1,<1.15.0 +simplejson pytest-asyncio==0.21.0 ; python_version >= '3.7' asynctest==0.13.0 ; python_version >= '3.7' diff --git a/tests/utils/json_utils/tests.py b/tests/utils/json_utils/tests.py index 7cbef4b36..28791e79d 100644 --- a/tests/utils/json_utils/tests.py +++ b/tests/utils/json_utils/tests.py @@ -36,6 +36,8 @@ import decimal import uuid +import pytest + from elasticapm.utils import json_encoder as json @@ -69,6 +71,11 @@ def test_decimal(): assert json.dumps(res) == "1.0" +@pytest.mark.parametrize("res", [float("nan"), float("+inf"), float("-inf")]) +def test_float_invalid_json(res): + assert json.dumps(res) != "null" + + def test_unsupported(): res = object() assert json.dumps(res).startswith('" Date: Tue, 2 Apr 2024 10:00:41 +0200 Subject: [PATCH 07/11] tests/client: fix pytest mark skipif syntax (#2019) For some reason tests passed with this but now are failing because pytest test does not recognize skipIf. --- tests/client/client_tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/client/client_tests.py b/tests/client/client_tests.py index 84e473fc8..a61248c85 100644 --- a/tests/client/client_tests.py +++ b/tests/client/client_tests.py @@ -233,7 +233,7 @@ def test_custom_transport(elasticapm_client): assert isinstance(elasticapm_client._transport, DummyTransport) -@pytest.mark.skipIf(simplejson_dumps is None) +@pytest.mark.skipif(simplejson_dumps is None, reason="no test without simplejson") @pytest.mark.parametrize( "elasticapm_client", [{"transport_json_serializer": "elasticapm.utils.simplejson_encoder.dumps"}], indirect=True ) From 309337624d5435587b179a39cbddbfc6b7008ae7 Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Wed, 3 Apr 2024 09:20:37 +0200 Subject: [PATCH 08/11] tests: require Werkzeug < 3 for flask 2.0 tests (#2020) Otherwise it'll skip tests becasue flask import does not work. --- tests/requirements/reqs-flask-2.0.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/requirements/reqs-flask-2.0.txt b/tests/requirements/reqs-flask-2.0.txt index 62397f9b5..dc3cb6572 100644 --- a/tests/requirements/reqs-flask-2.0.txt +++ b/tests/requirements/reqs-flask-2.0.txt @@ -1,4 +1,5 @@ Flask>=2.0,<2.1 +Werkzeug<3 blinker>=1.1 itsdangerous -r reqs-base.txt From a79d8b2c67c772a0451da1536b360a0cb404a504 Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Wed, 3 Apr 2024 09:20:59 +0200 Subject: [PATCH 09/11] Use docker compose subcommand instead of docker-compose (#2022) --- CONTRIBUTING.md | 4 ++-- tests/scripts/docker/run_tests.sh | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 014b4828d..21180e9f1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -108,7 +108,7 @@ that is a fixture which is defined #### Adding new instrumentations to the matrix build For tests that require external dependencies like databases, or for testing different versions of the same library, -we use a matrix build that leverages Docker and docker-compose. +we use a matrix build that leverages Docker. The setup requires a little bit of boilerplate to get started. In this example, we will create an instrumentation for the "foo" database, by instrumenting its Python driver, `foodriver`. @@ -153,7 +153,7 @@ In this example, we will create an instrumentation for the "foo" database, by in image: foobase:latest You'll also have to add a `DOCKER_DEPS` environment variable to `tests/scripts/envs/foo.sh` which tells the matrix - to spin up the given docker-compose service before running your tests. + to spin up the given Docker compose service before running your tests. You may also need to add things like hostname configuration here. DOCKER_DEPS="foo" diff --git a/tests/scripts/docker/run_tests.sh b/tests/scripts/docker/run_tests.sh index 9a89f93be..de518dc32 100755 --- a/tests/scripts/docker/run_tests.sh +++ b/tests/scripts/docker/run_tests.sh @@ -2,7 +2,7 @@ set -ex function cleanup { - PYTHON_VERSION=${1} docker-compose down -v + PYTHON_VERSION=${1} docker compose down -v if [[ $CODECOV_TOKEN ]]; then cd .. @@ -42,7 +42,7 @@ echo "Running tests for ${1}/${2}" if [[ -n $DOCKER_DEPS ]] then - PYTHON_VERSION=${1} docker-compose up -d ${DOCKER_DEPS} + PYTHON_VERSION=${1} docker compose up -d ${DOCKER_DEPS} fi # CASS_DRIVER_NO_EXTENSIONS is set so we don't build the Cassandra C-extensions, @@ -57,7 +57,7 @@ if ! ${CI}; then . fi -PYTHON_VERSION=${1} docker-compose run \ +PYTHON_VERSION=${1} docker compose run \ -e PYTHON_FULL_VERSION=${1} \ -e LOCAL_USER_ID=$LOCAL_USER_ID \ -e LOCAL_GROUP_ID=$LOCAL_GROUP_ID \ From 2e2ea47d7d143f74d3217e9206f98242e780b3c1 Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Wed, 3 Apr 2024 09:38:55 +0200 Subject: [PATCH 10/11] Remove vendored wrapt references (#2021) --- .flake8 | 1 - .gitignore | 1 - pyproject.toml | 1 - tests/scripts/license_headers_check.sh | 2 +- 4 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.flake8 b/.flake8 index f629a9d29..7be07fbeb 100644 --- a/.flake8 +++ b/.flake8 @@ -1,6 +1,5 @@ [flake8] exclude= - elasticapm/utils/wrapt/**, build/**, src/**, tests/**, diff --git a/.gitignore b/.gitignore index 65dc23f5e..12eae962b 100644 --- a/.gitignore +++ b/.gitignore @@ -19,7 +19,6 @@ pip-log.txt /docs/doctrees /example_project/*.db tests/.schemacache -elasticapm/utils/wrapt/_wrappers*.so coverage .tox .eggs diff --git a/pyproject.toml b/pyproject.toml index 167532517..019a7b666 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,6 @@ exclude = ''' | _build | build | dist - | elasticapm/utils/wrapt # The following are specific to Black, you probably don't want those. | blib2to3 diff --git a/tests/scripts/license_headers_check.sh b/tests/scripts/license_headers_check.sh index dc239df96..9ba9655e0 100755 --- a/tests/scripts/license_headers_check.sh +++ b/tests/scripts/license_headers_check.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash if [[ $# -eq 0 ]] then - FILES=$(find . -iname "*.py" -not -path "./elasticapm/utils/wrapt/*" -not -path "./dist/*" -not -path "./build/*" -not -path "./tests/utils/stacks/linenos.py") + FILES=$(find . -iname "*.py" -not -path "./dist/*" -not -path "./build/*" -not -path "./tests/utils/stacks/linenos.py") else FILES=$@ fi From 711788ba62f9162bcbd18575f1b792865e202c6b Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Wed, 3 Apr 2024 17:04:30 +0200 Subject: [PATCH 11/11] update CHANGELOG and bump version to 6.22.0 (#2023) --- CHANGELOG.asciidoc | 8 ++++++++ elasticapm/version.py | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 588030c14..03f4e048f 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -32,6 +32,14 @@ endif::[] [[release-notes-6.x]] === Python Agent version 6.x +[[release-notes-6.22.0]] +==== 6.22.0 - 2024-04-03 + +[float] +===== Features + +* Add ability to override default JSON serialization {pull}2018[#2018] + [[release-notes-6.21.4]] ==== 6.21.4 - 2024-03-19 diff --git a/elasticapm/version.py b/elasticapm/version.py index d2ebe8c73..c8799817e 100644 --- a/elasticapm/version.py +++ b/elasticapm/version.py @@ -28,5 +28,5 @@ # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -__version__ = (6, 21, 4) +__version__ = (6, 22, 0) VERSION = ".".join(map(str, __version__))