Skip to content

Commit a9da52c

Browse files
mitchh456quinnmilMitch Hartwegtim-schilling
authored
3.0.0rc1 Release (#769)
* 756 development tooling updates (#758) * update isort and black versions. run linting * add [tool.poetry] section to support poetry venv * 757 remove support for unused frameworks - pt 1 (#760) * update isort and black versions. run linting * add [tool.poetry] section to support poetry venv * remove old django versions from tox.ini * remove pyramid and cherrypy support. limit django support to >3.2 * ignore .idea/, replace celery in tox * update manual testing example re-link to broken celery issue for clarification * remove eol python versions (#762) * remove eol python versions * updtae CI workflows to only handle 3.8+ * remove pyramid from setup, delete ubuntu 18 job * restore comment for celery version --------- Co-authored-by: Mitch Hartweg <[email protected]> --------- Co-authored-by: Mitch Hartweg <[email protected]> Co-authored-by: mitchh456 <[email protected]> * remove nameko and starlett/api files for python <3.6 (#763) Co-authored-by: Mitch Hartweg <[email protected]> * 764 update agent to fully support python 311 (#765) * add py311 to test envs, use partial to create wrapt decorator for error service thread * remove py3.5+ check for one test, specify <3.11 for realloc test because forcing realloc doesn't work in 3.11 --------- Co-authored-by: Mitch Hartweg <[email protected]> * Dev tim (#768) * Resolve CI errors (#752) * Allow exceptions for pkg_resources usages from pyramid and cherrypy. * Move python 3.6 to ubuntu 20 GitHub action runner. Py36 isn't included with ubuntu 22 * Update rq test dependency for dropped 3.6 support. * Use a specific python 2.7 image for tests. See actions/setup-python#672 Don't use setup-python for python2.7 * Pin importlib_metadata for < py3.8 in the tests. * Handle sqlalchemy deprecations and start of v2 support. * Disable tests for SQLAlchemy v2 to allow CI to pass. * Update pre-commit repo versions. * Support flask_sqlalchemy v3 get_engine was deprecated in favor of make_engine. * Support ElasticSearch 8.7 health_report API. Update python3.6 tests to use elasticsearch 7 * Update tests to be compatible with rq v1.13+ * Switch python 3.4 GitHub action to run on a custom container. * Update changelog for CI fixes. * Fix build for python 3.11 (#748) * Fix build for python 3.11 * Skip cp311 for manylinux2010 build. * Update python and django versions. (#753) * simplify test and build * cleanup test-ubuntu-20 workflow * use text method in flask_sqlalchemy tests skip 3.12+ wheel builds * fix test sqlalchemy tests --------- Co-authored-by: Tim Schilling <[email protected]> * update pymongo collection methods * replace deprecated manylinux image with 2_28 * add xpack.security.enabled flag to elasticserach * use elasticsearch <8.0 for <=3.9 * reformat cibw_skip argument * reformat cibw_skip argument * remove manylinux1 and manylinux2010 wheel builds * remove manylinux1 and manylinux2010 wheel builds * remove i686 from manylinux_2_28 build because it doesn't exist * consolidate aarch config into main. We want aarch for all, no need for conditional anymore * fix delete aarch step * bump version to 3.0.0 * re-add django 3.2 to tests, remove erroneous django version checks * remove in-code python version checks (#771) * remove in-code python version checks that no longer apply when supporting py3.8+ only * remove usage of text_type and string_type * fix SimpleNamespace imports * fix mocked side effect error --------- Co-authored-by: Mitch Hartweg <[email protected]> * remove __future__ imports (#772) * remove in-code python version checks that no longer apply when supporting py3.8+ only * remove usage of text_type and string_type * fix SimpleNamespace imports * fix mocked side effect error * remove __future__ imports * fix expected line for error in test --------- Co-authored-by: Mitch Hartweg <[email protected]> * update changelog and set version to 3.0.0rc1 * update changelog and set version to 3.0.0rc1 * adjust formatting of changelog --------- Co-authored-by: Quinn Milionis <[email protected]> Co-authored-by: Mitch Hartweg <[email protected]> Co-authored-by: Tim Schilling <[email protected]> Co-authored-by: Quinn Milionis <[email protected]>
1 parent 86d1492 commit a9da52c

File tree

121 files changed

+406
-2228
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

121 files changed

+406
-2228
lines changed

.github/workflows/main.yml

Lines changed: 5 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,14 @@ jobs:
1919
fail-fast: false
2020
matrix:
2121
python-version:
22-
- "3.6"
23-
- "3.7"
2422
- "3.8"
2523
- "3.9"
2624
- "3.10"
25+
- "3.11"
2726

2827
services:
2928
elasticsearch:
30-
image: elasticsearch:8.2.3
29+
image: elasticsearch:8.7.0
3130
ports:
3231
- 9200:9200
3332
env:
@@ -71,55 +70,8 @@ jobs:
7170
fail-fast: false
7271
matrix:
7372
python-version:
74-
- "2.7"
75-
- "3.5"
76-
77-
services:
78-
elasticsearch:
79-
image: elasticsearch:7.10.1
80-
ports:
81-
- 9200:9200
82-
env:
83-
discovery.type: single-node
84-
85-
mongodb:
86-
image: mongo:4
87-
ports:
88-
- 27017:27017
89-
90-
redis:
91-
image: redis:6
92-
ports:
93-
- 6379:6379
94-
95-
env:
96-
ELASTICSEARCH_URL: http://localhost:9200/
97-
MONGODB_URL: mongodb://localhost:27017/
98-
REDIS_URL: redis://localhost:6379/0
99-
100-
steps:
101-
- uses: actions/checkout@v2
102-
- uses: actions/setup-python@v2
103-
with:
104-
python-version: ${{ matrix.python-version }}
105-
- name: Upgrade packaging tools
106-
run: python -m pip install --upgrade pip setuptools virtualenv
107-
- name: Install dependencies
108-
run: python -m pip install --upgrade tox
109-
- name: Run tox targets for ${{ matrix.python-version }}
110-
run: |
111-
ENV_PREFIX=$(tr -C -d "0-9" <<< "${{ matrix.python-version }}" | cut -c -3)
112-
TOXENV=$(tox --listenvs | grep "^py$ENV_PREFIX" | tr '\n' ',') python -m tox
113-
114-
tests-ubuntu-18:
115-
name: Python ${{ matrix.python-version }} Ubuntu 18
116-
runs-on: ubuntu-18.04
117-
118-
strategy:
119-
fail-fast: false
120-
matrix:
121-
python-version:
122-
- "3.4"
73+
- "3.8"
74+
- "3.9"
12375

12476
services:
12577
elasticsearch:
@@ -128,6 +80,7 @@ jobs:
12880
- 9200:9200
12981
env:
13082
discovery.type: single-node
83+
xpack.security.enabled: false
13184

13285
mongodb:
13386
image: mongo:4

.github/workflows/release.yml

Lines changed: 8 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,16 @@ on:
99
pull_request:
1010

1111
jobs:
12-
cibuildwheel_py37plus:
13-
name: Build python 3.7+ ${{ matrix.manylinux_image }} wheels
12+
cibuildwheel_py38plus:
13+
name: Build python 3.8+ ${{ matrix.manylinux_image }} wheels
1414
runs-on: ${{ matrix.os }}
1515
strategy:
1616
matrix:
1717
os: [ ubuntu-20.04 ]
18-
python: [ '3.10' ]
19-
manylinux_image: [ manylinux2010, manylinux2014, manylinux_2_24 ]
18+
python: ['3.10']
19+
manylinux_image: [ manylinux2014, manylinux_2_28 ]
2020
# Disable for platforms where pure Python wheels would be generated
21-
cibw_skip: [ "pp37-* pp38-* pp39-* pp310-*" ]
22-
include:
23-
# Exclude building 3.10 wheel for manylinux1.
24-
- os: ubuntu-20.04
25-
python: 3.9
26-
manylinux_image: manylinux1
27-
cibw_skip: "pp37-* pp38-* pp39-* pp310-* cp310-*"
21+
cibw_skip: [ "pp38-* pp39-* pp310-* pp311-* pp312-* cp312-*" ]
2822
steps:
2923
- uses: actions/checkout@v2
3024

@@ -44,53 +38,12 @@ jobs:
4438
uses: docker/setup-qemu-action@v1
4539
with:
4640
platforms: all
47-
- name: Set AArch64 env if needed
48-
if: matrix.manylinux_image != 'manylinux1' && matrix.manylinux_image != 'manylinux2010'
49-
env:
50-
CIBW_MANYLINUX_AARCH64_IMAGE: ${{ matrix.manylinux_image }}
51-
CIBW_ARCHS_LINUX: "auto aarch64"
52-
run: echo "set CIBW_MANYLINUX_AARCH64_IMAGE=${{ env.CIBW_MANYLINUX_AARCH64_IMAGE }}"
5341
- name: Build binary wheels
5442
env:
5543
CIBW_SKIP: ${{ matrix.cibw_skip }}
5644
CIBW_BUILD_VERBOSITY: 1
5745
CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.manylinux_image }}
58-
CIBW_MANYLINUX_I686_IMAGE: ${{ matrix.manylinux_image }}
59-
run: python -m cibuildwheel
60-
61-
- uses: actions/upload-artifact@v2
62-
with:
63-
path: ./wheelhouse/*.whl
64-
65-
cibuildwheel_py35py36:
66-
name: Build python 3.5, 3.6 platform wheels
67-
runs-on: ${{ matrix.os }}
68-
strategy:
69-
matrix:
70-
os: [ ubuntu-18.04 ]
71-
python: [ 3.9 ]
72-
steps:
73-
- uses: actions/checkout@v2
74-
- uses: actions/setup-python@v2
75-
name: Install Python
76-
with:
77-
python-version: ${{ matrix.python }}
78-
79-
- name: Install cibuildwheel
80-
run: |
81-
python -m pip install --upgrade pip "cibuildwheel==1.12.0"
82-
83-
- name: Set up QEMU
84-
# For cross-architecture builds
85-
# https://cibuildwheel.readthedocs.io/en/stable/faq/#emulation
86-
if: runner.os == 'Linux'
87-
uses: docker/setup-qemu-action@v1
88-
with:
89-
platforms: all
90-
- name: Build binary wheels
91-
env:
92-
CIBW_BUILD_VERBOSITY: 1
93-
CIBW_BUILD: "cp35-* cp36-*"
46+
CIBW_MANYLINUX_AARCH64_IMAGE: ${{ matrix.manylinux_image }}
9447
CIBW_ARCHS_LINUX: "auto aarch64"
9548
run: python -m cibuildwheel
9649

@@ -103,7 +56,7 @@ jobs:
10356
runs-on: ubuntu-20.04
10457
strategy:
10558
matrix:
106-
python: [3.9, 2.7]
59+
python: [3.9]
10760
steps:
10861
- uses: actions/checkout@v2
10962

@@ -143,7 +96,7 @@ jobs:
14396
path: dist/*.tar.gz
14497

14598
upload_pypi:
146-
needs: [cibuildwheel_py37plus, cibuildwheel_py35py36, build_pure_wheels, build_sdist]
99+
needs: [cibuildwheel_py38plus, build_pure_wheels, build_sdist]
147100
runs-on: ubuntu-20.04
148101
steps:
149102
- name: Download distributions for publishing.

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,5 @@ src/*.egg-info/
1717
/.pytest_cache
1818
.tox/
1919
.coverage
20+
21+
.idea/

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ ci:
44

55
repos:
66
- repo: https://github.com/pre-commit/pre-commit-hooks
7-
rev: v4.1.0
7+
rev: v4.4.0
88
hooks:
99
- id: check-added-large-files
1010
- id: check-case-conflict
@@ -17,17 +17,17 @@ repos:
1717
- id: end-of-file-fixer
1818
- id: trailing-whitespace
1919
- repo: https://github.com/psf/black
20-
rev: 21.12b0
20+
rev: 23.7.0
2121
hooks:
2222
- id: black
2323
language_version: python3
2424
additional_dependencies: ['click<8.1']
2525
- repo: https://github.com/pycqa/isort
26-
rev: 5.10.1
26+
rev: 5.12.0
2727
hooks:
2828
- id: isort
2929
- repo: https://github.com/PyCQA/flake8
30-
rev: 4.0.1
30+
rev: 6.0.0
3131
hooks:
3232
- id: flake8
3333
additional_dependencies:

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,22 @@
11
# Changelog
22

3+
## [3.0.0rc1] 2023-09-08
4+
5+
Version 3.0.0 drops support for Python 2.7 and < 3.8, as well as Django < 3.2.
6+
If you need to continue using Python < 3.8 or Django < 3.2, please continue using v2.26.1.
7+
8+
### Added
9+
- Add formal support for Python 3.11 and Django 4.2.
10+
11+
### Fixed
12+
- Fix CI for 3.8+.
13+
- Remove support for Python 2.7, 3.4, 3.5, 3.6.
14+
- Remove support for Django < 3.2.
15+
- Remove support for CherryPy, Nameko, and Pyramid.
16+
- Update ElasticSearch support for 8.7.0 (``health_check``).
17+
- Support flask_sqlalchemy v3. This requires an integration
18+
change where ``instrument_sqlalchemy`` is called before ``db.init_app()``.
19+
320
## [2.26.1] 2022-07-28
421

522
### Fixed

DEVELOPMENT.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ key in `tox.ini`, which you can list with `tox -l`. Pick one for a Python
3434
version that you have installed and run the tests, for example:
3535

3636
```
37-
tox -e py39-django31
37+
python -m tox -e py39-django31
3838
```
3939

4040
If you run `tox` with no arguments, it will test all environments. This will
@@ -70,7 +70,7 @@ by environment variables. These are:
7070

7171
* `ELASTICSEARCH_URL` - point to a running Elasticsearch instance, e.g.
7272
"http://localhost:9200/" . You can start it with:
73-
`docker run --detach --name elasticsearch --publish 9200:9200 -e "discovery.type=single-node" -e "xpack.security.enabled=false" elasticsearch:8.2.3` .
73+
`docker run --detach --name elasticsearch --publish 9200:9200 -e "discovery.type=single-node" -e "xpack.security.enabled=false" elasticsearch:8.7.0` .
7474
* `MONGODB_URL` - point to a running MongoDB instance e.g.
7575
"mongodb://localhost:27017/" . You can start it with:
7676
`docker run --detach --name mongo --publish 27017:27017 mongo:4.0` .

README.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,19 @@ Monitor the performance of Python Django apps, Flask apps, and Celery workers wi
1111

1212
## Requirements
1313

14-
Python 2.7 or 3.4+.
14+
Python 3.8+.
15+
For legacy Python versions, including 2.7 and 3.4+, pin scout-apm to <=2.26.1.
1516

1617
Scout APM has integrations for the following frameworks:
1718

1819
* Bottle 0.12+
19-
* CherryPy 18.0.0+
2020
* Celery 3.1+
21-
* Django 1.8+
21+
* Django 3.2+
2222
* Dramatiq 1.0+
2323
* Falcon 2.0+
2424
* Flask 0.10+
2525
* Huey 2.0+
2626
* Hug 2.5.1+
27-
* Nameko 2.0+
28-
* Pyramid 1.8+
2927
* RQ 1.0+
3028
* Starlette 0.12+
3129

pyproject.toml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1+
[tool.poetry]
2+
name="scout_apm_python"
3+
description = "Scout APM Python Agent"
4+
readme = "README.md"
5+
version = "0.1.0"
6+
authors = ["Developers <[email protected]>"]
7+
18
[build-system]
29
requires = ["setuptools >= 40.6.0", "wheel"]
310
build-backend = "setuptools.build_meta"
411

512
[tool.black]
6-
target-version = ["py27"]
13+
target-version = ["py311"]
714

815
[tool.isort]
916
profile = "black"
10-
add_imports = [
11-
"from __future__ import absolute_import",
12-
"from __future__ import division",
13-
"from __future__ import print_function",
14-
"from __future__ import unicode_literals",
15-
]

pytest.ini

Lines changed: 8 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,6 @@
11
[pytest]
22
addopts = --cov=scout_apm
33
--cov-report=term-missing:skip-covered
4-
# Disable Nameko's built-in Pytest plugin because it does
5-
# eventlet.monkey_patch() early on, but we want to test things in a
6-
# non-eventlet world!
7-
# It lead to this failure:
8-
# cls = <class 'eventlet.green.ssl.GreenSSLSocket'>, sock = <eventlet.greenio.base.GreenSocket object at 0x10667e588>, keyfile = None, certfile = None, server_side = False, cert_reqs = <VerifyMode.CERT_NONE: 0>
9-
# ssl_version = <_SSLMethod.PROTOCOL_TLS: 2>, ca_certs = None, do_handshake_on_connect = True, args = ()
10-
# kw = {'_context': <eventlet.green.ssl.GreenSSLContext object at 0x104d6f480>, 'server_hostname': 's3-us-west-1.amazonaws.com'}
11-
#
12-
# def __new__(cls, sock=None, keyfile=None, certfile=None,
13-
# server_side=False, cert_reqs=CERT_NONE,
14-
# ssl_version=PROTOCOL_SSLv23, ca_certs=None,
15-
# do_handshake_on_connect=True, *args, **kw):
16-
# if _is_under_py_3_7:
17-
# return super(GreenSSLSocket, cls).__new__(cls)
18-
# else:
19-
# if not isinstance(sock, GreenSocket):
20-
# sock = GreenSocket(sock)
21-
# with _original_ssl_context():
22-
# ret = _original_wrap_socket(
23-
# sock=sock.fd,
24-
# keyfile=keyfile,
25-
# certfile=certfile,
26-
# server_side=server_side,
27-
# cert_reqs=cert_reqs,
28-
# ssl_version=ssl_version,
29-
# ca_certs=ca_certs,
30-
# do_handshake_on_connect=False,
31-
# > *args, **kw
32-
# )
33-
# E TypeError: wrap_socket() got an unexpected keyword argument '_context'
34-
-p no:pytest_nameko
354
norecursedirs = src
365
filterwarnings =
376
error
@@ -77,5 +46,13 @@ filterwarnings =
7746
; Triggered by cherrypy -> jarco/text -> importlib_resources
7847
ignore:read_text is deprecated\. Use files\(\) instead\.:DeprecationWarning
7948
ignore:open_text is deprecated\. Use files\(\) instead\.:DeprecationWarning
49+
; Triggered by cherrypy -> cherrypy/__init__.py, pyramid/asset.py
50+
ignore:pkg_resources is deprecated as an API:DeprecationWarning
51+
ignore:.*pkg_resources.declare_namespace:DeprecationWarning
8052
; ElasticSearch v8 will drop support for python < 3.6
8153
ignore:Support for Python 3\.5 and earlier is deprecated and will be removed in v8\.0\.0:DeprecationWarning
54+
; Triggered by sqlalchemy -> sqlalchemy/engine/base.py
55+
ignore:.*These feature\(s\) are not compatible with SQLAlchemy 2\.0:DeprecationWarning
56+
; Triggered by rq -> rq/job.py
57+
ignore:The `push_connection` function is deprecated\. Pass the `connection` explicitly instead\.:DeprecationWarning
58+
ignore:'cgi' is deprecated and slated for removal in Python 3.13

0 commit comments

Comments
 (0)