diff --git a/.github/workflows/build_publish_lambda_layer_aarch64.yaml b/.github/workflows/build_publish_lambda_layer_aarch64.yaml index e9512a46..9f16dbb6 100644 --- a/.github/workflows/build_publish_lambda_layer_aarch64.yaml +++ b/.github/workflows/build_publish_lambda_layer_aarch64.yaml @@ -45,6 +45,6 @@ jobs: artifact-name: solarwinds_apm_lambda_aarch64.zip component-version: ${{ needs.build_layer_aarch64.outputs.SW_APM_VERSION }} architecture: arm64 - runtimes: "python3.8 python3.9 python3.10 python3.11" + runtimes: "python3.8 python3.9 python3.10 python3.11 python3.12" publish-dest: ${{ inputs.publish-dest }} secrets: inherit \ No newline at end of file diff --git a/.github/workflows/build_publish_lambda_layer_x86_64.yaml b/.github/workflows/build_publish_lambda_layer_x86_64.yaml index 67164ff9..f6fc01c0 100644 --- a/.github/workflows/build_publish_lambda_layer_x86_64.yaml +++ b/.github/workflows/build_publish_lambda_layer_x86_64.yaml @@ -39,6 +39,6 @@ jobs: artifact-name: solarwinds_apm_lambda_x86_64.zip component-version: ${{ needs.build_layer_x86_64.outputs.SW_APM_VERSION }} architecture: x86_64 - runtimes: "python3.8 python3.9 python3.10 python3.11" + runtimes: "python3.8 python3.9 python3.10 python3.11 python3.12" publish-dest: ${{ inputs.publish-dest }} secrets: inherit \ No newline at end of file diff --git a/.github/workflows/run_tox_tests.yaml b/.github/workflows/run_tox_tests.yaml index 15b796a9..55a84f6f 100644 --- a/.github/workflows/run_tox_tests.yaml +++ b/.github/workflows/run_tox_tests.yaml @@ -19,7 +19,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-minor: ["8", "9", "10", "11"] + python-minor: ["8", "9", "10", "11", "12"] apm-env: ["nh-staging", "ao-prod"] steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/verify_install.yaml b/.github/workflows/verify_install.yaml index 461930a8..ff707370 100644 --- a/.github/workflows/verify_install.yaml +++ b/.github/workflows/verify_install.yaml @@ -56,21 +56,21 @@ jobs: - py3.9-debian10 - py3.9-debian11 - py3.9-rhel8 - - py3.9-ubuntu20.04 - py3.10-alpine3.13 - py3.10-alpine3.16 - py3.10-alpine3.17 - py3.10-amazon2023 - py3.10-debian10 - py3.10-debian11 - - py3.10-ubuntu20.04 - py3.10-ubuntu22.04 - py3.11-alpine3.16 - py3.11-alpine3.17 - py3.11-debian10 - py3.11-debian11 - - py3.11-ubuntu20.04 - - py3.11-ubuntu22.04 + - py3.12-alpine3.19 + - py3.12-alpine3.20 + - py3.12-debian11 + - py3.12-debian12 arch: - x64 - arm64 @@ -103,8 +103,6 @@ jobs: image: python:3.9-bullseye - hostname: py3.9-rhel8 image: registry.fedoraproject.org/f33/python3 - - hostname: py3.9-ubuntu20.04 - image: ubuntu:20.04 - hostname: py3.10-alpine3.13 image: python:3.10-alpine3.13 - hostname: py3.10-alpine3.16 @@ -117,8 +115,6 @@ jobs: image: python:3.10-buster - hostname: py3.10-debian11 image: python:3.10-bullseye - - hostname: py3.10-ubuntu20.04 - image: ubuntu:20.04 - hostname: py3.10-ubuntu22.04 image: ubuntu:22.04 - hostname: py3.11-alpine3.16 @@ -129,10 +125,14 @@ jobs: image: python:3.11-buster - hostname: py3.11-debian11 image: python:3.11-bullseye - - hostname: py3.11-ubuntu20.04 - image: ubuntu:20.04 - - hostname: py3.11-ubuntu22.04 - image: ubuntu:22.04 + - hostname: py3.12-alpine3.19 + image: python:3.12-alpine3.19 + - hostname: py3.12-alpine3.20 + image: python:3.12-alpine3.20 + - hostname: py3.12-debian11 + image: python:3.12-bullseye + - hostname: py3.12-debian12 + image: python:3.12-bookworm # Note: JavaScript Actions (checkout) in Alpine only supported in x64 exclude: - hostname: py3.8-alpine3.12 @@ -157,6 +157,10 @@ jobs: arch: arm64 - hostname: py3.11-alpine3.17 arch: arm64 + - hostname: py3.12-alpine3.19 + arch: arm64 + - hostname: py3.12-alpine3.20 + arch: arm64 container: image: "${{ matrix.image }}" options: --hostname "${{ matrix.hostname }}" diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7545efb6..f5f1343d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -44,7 +44,7 @@ docker-compose run aarch64 ### Regression Tests -Automated testing of this repo uses [tox](https://tox.readthedocs.io) and runs in Python 3.8, 3.9, 3.10, and/or 3.11 because these are the versions supported by [OTel Python](https://github.com/open-telemetry/opentelemetry-python/blob/main/tox.ini). Testing can be run inside a build container which provides all dependencies and a compiled C-extension. Here is how to set up then run unit and integration tests locally: +Automated testing of this repo uses [tox](https://tox.readthedocs.io) and runs in Python 3.8, 3.9, 3.10, 3.11 and/or 3.12 because these are the versions supported by [OTel Python](https://github.com/open-telemetry/opentelemetry-python/blob/main/tox.ini). Testing can be run inside a build container which provides all dependencies and a compiled C-extension. Here is how to set up then run unit and integration tests locally: 1. Create and run a Docker build container as described above. 2. Inside the build container: `make wrapper`. This downloads the version of a C/C++ dependency defined in `extension/VERSION` from SolarWinds Cloud and builds SWIG bindings. diff --git a/Makefile b/Makefile index 95cae169..ec706e75 100644 --- a/Makefile +++ b/Makefile @@ -168,7 +168,7 @@ check-sdist-local: # in the corresponding repo of the Docker images: https://github.com/pypa/manylinux#example. manylinux-wheels: wrapper @echo -e "Generating python agent package any-linux wheels for 64 bit systems" - @set -e; for PYBIN in cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311; do /opt/python/$${PYBIN}/bin/pip -v wheel . -w ./tmp_dist/ --no-deps; done + @set -e; for PYBIN in cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311 cp312-cp312; do /opt/python/$${PYBIN}/bin/pip -v wheel . -w ./tmp_dist/ --no-deps; done @echo -e "Tagging wheels with $(wheel_tag)" @set -e; for whl in ./tmp_dist/*.whl; do auditwheel repair --plat $(wheel_tag) "$$whl" -w ./dist/; done @rm -rf ./tmp_dist @@ -194,9 +194,9 @@ install-lambda-modules: @echo -e "Install upstream dependencies to include in layer" @/opt/python/cp38-cp38/bin/pip3.8 install -t ${target_dir}/python -r lambda/requirements.txt @echo -e "Install other version-specific .so files for deps" - @set -e; for PYBIN in cp39-cp39 cp310-cp310 cp311-cp311; do /opt/python/$${PYBIN}/bin/pip install -t ${target_dir}/$${PYBIN} -r lambda/requirements-so.txt; done - @set -e; for PYBIN in cp39-cp39 cp310-cp310 cp311-cp311; do cp ${target_dir}/$${PYBIN}/charset_normalizer/*.so ${target_dir}/python/charset_normalizer/ && cp ${target_dir}/$${PYBIN}/grpc/_cython/*.so ${target_dir}/python/grpc/_cython/ && cp ${target_dir}/$${PYBIN}/wrapt/*.so ${target_dir}/python/wrapt/; done - @set -e; for PYBIN in cp39-cp39 cp310-cp310 cp311-cp311; do rm -rf ${target_dir}/$${PYBIN} ; done + @set -e; for PYBIN in cp39-cp39 cp310-cp310 cp311-cp311 cp312-cp312; do /opt/python/$${PYBIN}/bin/pip install -t ${target_dir}/$${PYBIN} -r lambda/requirements-so.txt; done + @set -e; for PYBIN in cp39-cp39 cp310-cp310 cp311-cp311 cp312-cp312; do cp ${target_dir}/$${PYBIN}/charset_normalizer/*.so ${target_dir}/python/charset_normalizer/ && cp ${target_dir}/$${PYBIN}/grpc/_cython/*.so ${target_dir}/python/grpc/_cython/ && cp ${target_dir}/$${PYBIN}/wrapt/*.so ${target_dir}/python/wrapt/; done + @set -e; for PYBIN in cp39-cp39 cp310-cp310 cp311-cp311 cp312-cp312; do rm -rf ${target_dir}/$${PYBIN} ; done @echo -e "Install upstream dependencies without deps to include in layer" @/opt/python/cp38-cp38/bin/pip3.8 install -t ${target_dir}/nodeps -r lambda/requirements-nodeps.txt --no-deps @echo -e "Install solarwinds_apm to be packed up in zip archive to target directory." @@ -204,7 +204,7 @@ install-lambda-modules: @echo -e "Removing non-lambda C-extension library files generated by pip install under target directory." @rm -rf ${target_dir}/nodeps/solarwinds_apm/extension/*.so* @echo -e "Building AWS Lambda version of C-extensions for all supported Python versions in target directory." - @set -e; for PYBIN in cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311; do /opt/python/$${PYBIN}/bin/python setup.py build_ext -b ${target_dir}/nodeps; done + @set -e; for PYBIN in cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311 cp312-cp312; do /opt/python/$${PYBIN}/bin/python setup.py build_ext -b ${target_dir}/nodeps; done @echo -e "Copying AWS Lambda specific Oboe library liboboe-1.0-lambda-${platform}.so into target directory." @cp solarwinds_apm/extension/liboboe-1.0-lambda-${platform}.so ${target_dir}/nodeps/solarwinds_apm/extension/liboboe.so @echo -e "Moving no-deps dependencies, needed for full opentelemetry/instrumentation path" diff --git a/pyproject.toml b/pyproject.toml index 439ef6a3..b8aac5b2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -34,6 +34,7 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Typing :: Typed", "Development Status :: 4 - Beta", "Intended Audience :: Developers", diff --git a/solarwinds_apm/version.py b/solarwinds_apm/version.py index 52d3e3d4..c451679c 100644 --- a/solarwinds_apm/version.py +++ b/solarwinds_apm/version.py @@ -1 +1 @@ -__version__ = "2.2.0.0" +__version__ = "2.2.0.1" diff --git a/tests/docker/install/_helper_run_install_tests.sh b/tests/docker/install/_helper_run_install_tests.sh index c92c3809..06a17adc 100755 --- a/tests/docker/install/_helper_run_install_tests.sh +++ b/tests/docker/install/_helper_run_install_tests.sh @@ -58,42 +58,10 @@ echo "Installing test dependencies for Python $python_version on $pretty_name" elif grep Ubuntu /etc/os-release; then ubuntu_version=$(grep VERSION_ID /etc/os-release | sed 's/VERSION_ID="//' | sed 's/"//') - if [ "$ubuntu_version" = "18.04" ] || [ "$ubuntu_version" = "20.04" ]; then + if [ "$ubuntu_version" = "18.04" ] || [ "$ubuntu_version" = "20.04" ] || [ "$ubuntu_version" = "22.04" ] || [ "$ubuntu_version" = "24.04" ]; then apt-get update -y TZ=America ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone - if [ "$python_version" = "3.10" ] || [ "$python_version" = "3.11" ]; then - # py3.10,3.11 not currently on main apt repo for ubuntu 18/20 so use deadsnakes - apt-get install -y software-properties-common - add-apt-repository ppa:deadsnakes/ppa -y - apt-get install -y \ - python3 \ - python3-distutils \ - python3-dev \ - python3-setuptools \ - build-essential \ - unzip \ - wget \ - curl - update-alternatives --install /usr/bin/python python "/usr/bin/python3" 1 - else - apt-get install -y \ - "python$python_version" \ - "python$python_version-distutils" \ - "python$python_version-dev" \ - python3-setuptools \ - build-essential \ - unzip \ - wget \ - curl - update-alternatives --install /usr/bin/python python "/usr/bin/python$python_version" 1 - fi - - elif [ "$ubuntu_version" = "22.04" ]; then - apt-get update -y - TZ=America - ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone - apt-get install -y \ "python$python_version" \ "python$python_version-distutils" \ @@ -105,18 +73,18 @@ echo "Installing test dependencies for Python $python_version on $pretty_name" curl update-alternatives --install /usr/bin/python python "/usr/bin/python$python_version" 1 + # Make sure we don't install py3.6's pip on ubuntu + # Official get-pip documentation: + # https://pip.pypa.io/en/stable/installation/#get-pip-py + wget https://bootstrap.pypa.io/get-pip.py + python get-pip.py + pip install --upgrade pip >/dev/null + else echo "ERROR: Testing on Ubuntu <18.04 not supported." exit 1 fi - # Make sure we don't install py3.6's pip on ubuntu - # Official get-pip documentation: - # https://pip.pypa.io/en/stable/installation/#get-pip-py - wget https://bootstrap.pypa.io/get-pip.py - python get-pip.py - pip install --upgrade pip >/dev/null - elif grep "Amazon Linux" /etc/os-release; then yum update -y if grep "Amazon Linux 2023" /etc/os-release; then diff --git a/tests/docker/install/docker-compose.yml b/tests/docker/install/docker-compose.yml index deb081f2..41c4087e 100755 --- a/tests/docker/install/docker-compose.yml +++ b/tests/docker/install/docker-compose.yml @@ -103,13 +103,6 @@ services: environment: << : *envvars-install-test - py3.9-install-ubuntu20.04: - hostname: "py3.9-ubuntu20.04" - image: "ubuntu:20.04" - << : [*command-install-test, *workdir, *volumes-codebase] - environment: - << : *envvars-install-test - py3.9-install-centos8: hostname: "py3.9-centos8" image: "centos:8" @@ -177,13 +170,6 @@ services: environment: << : *envvars-install-test - py3.10-install-ubuntu20.04: - hostname: "py3.10-ubuntu20.04" - image: "ubuntu:20.04" - << : [*command-install-test, *workdir, *volumes-codebase] - environment: - << : *envvars-install-test - py3.10-install-ubuntu22.04: hostname: "py3.10-ubuntu22.04" image: "ubuntu:22.04" @@ -230,30 +216,48 @@ services: environment: << : *envvars-install-test - py3.11-install-ubuntu20.04: - hostname: "py3.11-ubuntu20.04" - image: "ubuntu:20.04" + py3.11-install-alpine3.16: + hostname: "py3.11-alpine3.16" + image: "python:3.11-alpine3.16" << : [*command-install-test, *workdir, *volumes-codebase] environment: << : *envvars-install-test - py3.11-install-ubuntu22.04: - hostname: "py3.11-ubuntu22.04" - image: "ubuntu:22.04" + py3.11-install-alpine3.17: + hostname: "py3.11-alpine3.17" + image: "python:3.11-alpine3.17" << : [*command-install-test, *workdir, *volumes-codebase] environment: << : *envvars-install-test - py3.11-install-alpine3.16: - hostname: "py3.11-alpine3.16" - image: "python:3.11-alpine3.16" + #-------------------------------------------------------------------- + # Python 3.12 + #-------------------------------------------------------------------- + + py3.12-install-debian11: + hostname: "py3.12-debian11" + image: "python:3.12-bullseye" << : [*command-install-test, *workdir, *volumes-codebase] environment: << : *envvars-install-test - py3.11-install-alpine3.17: - hostname: "py3.11-alpine3.17" - image: "python:3.11-alpine3.17" + py3.12-install-debian12: + hostname: "py3.12-debian12" + image: "python:3.12-bookworm" + << : [*command-install-test, *workdir, *volumes-codebase] + environment: + << : *envvars-install-test + + py3.12-install-alpine3.19: + hostname: "py3.12-alpine3.19" + image: "python:3.12-alpine3.19" + << : [*command-install-test, *workdir, *volumes-codebase] + environment: + << : *envvars-install-test + + py3.12-install-alpine3.20: + hostname: "py3.12-alpine3.20" + image: "python:3.12-alpine3.20" << : [*command-install-test, *workdir, *volumes-codebase] environment: << : *envvars-install-test \ No newline at end of file diff --git a/tox.ini b/tox.ini index 8044bcec..4f6998e3 100644 --- a/tox.ini +++ b/tox.ini @@ -2,9 +2,9 @@ skipsdist = True skip_missing_interpreters = True envlist = - py3{8,9,10,11}-ao-prod - py3{8,9,10,11}-nh-staging - py3{8,9,10,11}-lambda + py3{8,9,10,11,12}-ao-prod + py3{8,9,10,11,12}-nh-staging + py3{8,9,10,11,12}-lambda lint [testenv] @@ -15,31 +15,31 @@ allowlist_externals = echo deps = -rdev-requirements.txt commands_pre = - py3{8,9,10,11}: pip install --upgrade pip - py3{8,9,10,11}: pip install -Ie {toxinidir} + py3{8,9,10,11,12}: pip install --upgrade pip + py3{8,9,10,11,12}: pip install -Ie {toxinidir} commands = pytest {posargs} -[testenv:py3{8,9,10,11}-ao-prod] +[testenv:py3{8,9,10,11,12}-ao-prod] changedir = tests setenv = SW_APM_COLLECTOR = collector.appoptics.com SW_APM_SERVICE_KEY = foo-bar:service-key -[testenv:py3{8,9,10,11}-nh-staging] +[testenv:py3{8,9,10,11,12}-nh-staging] changedir = tests setenv = SW_APM_COLLECTOR = apm.collector.st-ssp.solarwinds.com SW_APM_SERVICE_KEY = foo-bar:service-key -[testenv:py3{8,9,10,11}-lambda] +[testenv:py3{8,9,10,11,12}-lambda] changedir = lambda/tests commands_pre = - py3{8,9,10,11}-lambda: pip install -r requirements.txt + py3{8,9,10,11,12}-lambda: pip install -r requirements.txt -[testenv:py3{8,9,10,11}-lambda-gh] +[testenv:py3{8,9,10,11,12}-lambda-gh] changedir = lambda/tests commands_pre = - py3{8,9,10,11}-lambda: pip install -r requirements.txt + py3{8,9,10,11,12}-lambda: pip install -r requirements.txt [testenv:lint] basepython: python3.9