Skip to content

Commit 20cb9a1

Browse files
feat: add support for 3.11 (Rd 11429) (#499)
* feat: enable 3.11 support testing Maintain a compatibility matrix instead of taking a one-size-fits-all approach * fix: supported django versions * fix: noxfile process kill method * chore: old version testing branches cleaned up
1 parent 706d66f commit 20cb9a1

File tree

67 files changed

+3320
-328
lines changed

Some content is hidden

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

67 files changed

+3320
-328
lines changed

.github/workflows/push-actions.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
- name: Set up Python
1212
uses: actions/setup-python@v4
1313
with:
14-
python-version: '3.10'
14+
python-version: '3.11'
1515
architecture: x64
1616
- name: Install jq
1717
run:
@@ -34,9 +34,9 @@ jobs:
3434
strategy:
3535
fail-fast: false # Prevent a single failure in the matrix from stopping all other jobs
3636
matrix:
37-
python-version: [ '3.7', '3.8', '3.9', '3.10' ]
37+
python-version: [ '3.7', '3.8', '3.9', '3.10', '3.11' ]
3838
integration-test-family: ${{ fromJson(needs.list-instrumentations.outputs.integration-tests) }}
39-
name: ITest ${{ matrix.integration-test-family }} / Python ${{ matrix.python-version }}
39+
name: ${{ matrix.python-version }} ${{ matrix.integration-test-family }}
4040
steps:
4141
- uses: actions/checkout@v3
4242
- name: Set up Python
@@ -52,7 +52,7 @@ jobs:
5252
strategy:
5353
fail-fast: false # Prevent a single failure in the matrix from stopping all other jobs
5454
matrix:
55-
python-version: [ '3.7', '3.8', '3.9', '3.10' ]
55+
python-version: [ '3.7', '3.8', '3.9', '3.10', '3.11' ]
5656
name: Component Test for Python ${{ matrix.python-version }}
5757
steps:
5858
- uses: actions/checkout@v3

.github/workflows/version-testing.yml

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ on:
44
schedule:
55
- cron: "0 7 * * *"
66
jobs:
7-
# If this key gets renamed, nox.py needs to be adjusted
8-
check-new-versions-of-instrumented-packages:
7+
# If this key gets renamed, noxfile.py needs to be updated accordingly
8+
test-untested-versions:
99
runs-on: ubuntu-latest
1010
strategy:
1111
matrix:
12-
# If this key gets renamed, nox.py needs to be adjusted
13-
python-version: [ '3.7', '3.8', '3.9', '3.10' ]
14-
name: check-new-versions-of-instrumented-packages
12+
# If this key gets renamed, noxfile.py needs to be updated accordingly
13+
python-version: [ '3.7', '3.8', '3.9', '3.10', '3.11' ]
14+
name: test-untested-versions
1515
steps:
1616
- uses: actions/checkout@v3
1717
- name: Set up Python
@@ -31,10 +31,10 @@ jobs:
3131
name: ${{ matrix.python-version }}
3232
path: versions_artifact
3333

34-
push-branch:
34+
create-pr-for-new-versions:
3535
runs-on: ubuntu-latest
36-
name: push-branch
37-
needs: check-new-versions-of-instrumented-packages
36+
name: create-pr-for-new-versions
37+
needs: test-untested-versions
3838
steps:
3939
- uses: actions/checkout@v3
4040
- name: Set up Python
@@ -62,6 +62,11 @@ jobs:
6262
with:
6363
name: '3.10'
6464
path: versions_artifacts/3.10
65+
- uses: actions/download-artifact@v2
66+
continue-on-error: true
67+
with:
68+
name: '3.11'
69+
path: versions_artifacts/3.11
6570
- run: python3 -m pip install -r requirements.txt
6671
- run: python3 -m scripts.gather_version_artifacts
6772
- run: git --no-pager diff
@@ -76,6 +81,7 @@ jobs:
7681
echo "$new_versions" >> $GITHUB_ENV
7782
echo "EOF" >> $GITHUB_ENV
7883
- name: Create Pull Request
84+
# WARNING: the create pull request action must be the last action in the job, it changes the current branch
7985
uses: peter-evans/create-pull-request@v4
8086
with:
8187
token: "${{ secrets.GITHUB_TOKEN }}"
@@ -85,4 +91,14 @@ jobs:
8591
body: ${{ env.new_versions }}
8692
base: main
8793
labels: version-testing, automerge
88-
reviewers: GuyMoses,saartochner,shanishiri,mmanciop
94+
reviewers: GuyMoses,saartochner,shanishiri
95+
# WARNING: the create pull request action must be the last action in the job, it changes the current branch
96+
97+
delete-old-version-testing-branches:
98+
runs-on: ubuntu-latest
99+
name: delete-old-version-testing-branches
100+
needs: create-pr-for-new-versions
101+
steps:
102+
- uses: actions/checkout@v3
103+
- run: | # remove all the version testing branches that aren't from today
104+
./scripts/delete_old_version_testing_branches.sh

CONTRIBUTING.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,33 @@ Run `./scripts/checks.sh` in the root folder.
2626
python3 -m nox
2727
# List all the tests
2828
python3 -m nox -l
29+
```
30+
31+
To run specific tests and/or specify Python versions:
32+
33+
* Use `--python PYTHON_VERSION` to specify a Python version eg.
34+
35+
`--python 3.9`
36+
* Use `-e` to specify a dependency to test eg.
37+
38+
`python3 -m nox -e integration_tests_flask`
39+
* Use `--session` to specify a dependency and version eg.
40+
41+
`--session "integration_tests_grpcio(python='3.9', grpcio_version='1.56.0')"`
42+
43+
```sh
2944
# Run a given test with the entire parameter matrix
3045
python3 -m nox -e integration_tests_flask
3146
# Run a given test for a given version of Python and all dependency versions
3247
python -m nox -e integration_tests_grpcio --python 3.9
3348
# Run a given test for a given version of Python and a given dependency version
34-
python -m nox --session "integration_tests_grpcio-3.9(grpcio_version='1.56.0')"
49+
python -m nox --session "integration_tests_grpcio(python='3.9', grpcio_version='1.56.0')"
50+
```
51+
52+
To run version testing locally, prefix the test command with `TEST_ONLY_UNTESTED_NEW_VERSIONS=true` eg.
53+
54+
```sh
55+
TEST_ONLY_UNTESTED_NEW_VERSIONS=true python3 -m nox -e integration_tests_flask`
3556
```
3657

3758
## Adding support for a new package

README.md

Lines changed: 32 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -199,34 +199,36 @@ get_current_span().add_event('<error-message>', {'lumigo.type': '<error-type>'})
199199

200200
## Supported runtimes
201201

202-
* cpython: 3.7.x, 3.8.x, 3.9.x, 3.10.x
202+
* cpython: 3.7.x, 3.8.x, 3.9.x, 3.10.x, 3.11.x
203203

204204
## Supported packages
205205

206-
| Instrumentation | Package | Supported Versions |
207-
| --- | --- | --- |
208-
| botocore | [boto3](https://pypi.org/project/boto3) | 1.17.22~1.28.40 |
209-
| fastapi | [fastapi](https://pypi.org/project/fastapi) | 0.56.1~0.100.0 |
210-
| | | 0.100.0b2~0.103.1 |
211-
| | [uvicorn](https://pypi.org/project/uvicorn) | 0.11.3~0.22.0 |
212-
| flask | [flask](https://pypi.org/project/flask) | 2.0.0~2.2.5 |
213-
| grpcio | [grpcio](https://pypi.org/project/grpcio) | 1.45.0~1.58.0rc1 |
214-
| kafka_python | [kafka_python](https://pypi.org/project/kafka_python) | 2.0.0~2.0.2 |
215-
| pika | [pika](https://pypi.org/project/pika) | 1.0.0 |
216-
| | | 1.0.1~1.3.0 |
217-
| | | 1.3.0rc5~1.3.2 |
218-
| pymongo | [pymongo](https://pypi.org/project/pymongo) | 3.1.1~3.3.1 |
219-
| | | 3.5.0~3.13.0 |
220-
| | | 4.0.1~4.5.0 |
221-
| | | 3.1 |
222-
| | | 3.2 |
223-
| | | 4.0 |
224-
| pymysql | [pymysql](https://pypi.org/project/pymysql) | 0.9.0~0.10.1 |
225-
| | | 1.0.0~1.0.3 |
226-
| | | 1.1.0~1.1.0rc2 |
227-
| redis | [redis](https://pypi.org/project/redis) | 4.1.1~4.2.0 |
228-
| | | 4.2.1~4.6.0 |
229-
| | | 5.0.0~5.0.0rc2 |
206+
| Instrumentation | Package | Supported Versions | | | | |
207+
| --- | --- | :---: | :---: | :---: | :---: | :---: |
208+
| | | 3.7 | 3.8 | 3.9 | 3.10 | 3.11 |
209+
| botocore | [boto3](https://pypi.org/project/boto3) | 1.17.22~1.28.40|1.17.22~1.28.40|1.17.22~1.28.40|1.17.22~1.28.40| |
210+
| django | [django](https://pypi.org/project/django) | |4.2.5|4.2.5|4.2.5|4.2.5|
211+
| fastapi | [fastapi](https://pypi.org/project/fastapi) | 0.56.1~0.100.0|0.56.1~0.100.0|0.56.1~0.100.0|0.56.1~0.100.0|0.56.1~0.100.0|
212+
| | | 0.100.0b2~0.103.1| 0.100.0b2~0.103.1| 0.100.0b2~0.103.1| 0.100.0b2~0.103.1| 0.100.0b2~0.103.1|
213+
| | [uvicorn](https://pypi.org/project/uvicorn) | 0.11.3~0.22.0|0.11.3~0.22.0|0.11.3~0.22.0|0.11.3~0.22.0|0.12.0~0.22.0|
214+
| flask | [flask](https://pypi.org/project/flask) | 2.0.0~2.2.5|2.0.0~2.2.5|2.0.0~2.2.5|2.0.0~2.2.5|2.0.0~2.2.5|
215+
| grpcio | [grpcio](https://pypi.org/project/grpcio) | 1.45.0~1.58.0rc1|1.45.0~1.58.0rc1|1.45.0~1.58.0rc1|1.45.0~1.58.0rc1|1.49.0~1.58.0rc1|
216+
| kafka_python | [kafka_python](https://pypi.org/project/kafka_python) | 2.0.0~2.0.2|2.0.0~2.0.2|2.0.0~2.0.2|2.0.0~2.0.2| |
217+
| pika | [pika](https://pypi.org/project/pika) | 1.0.0|1.0.0|1.0.0|1.0.0| |
218+
| | | 1.0.1~1.3.0| 1.0.1~1.3.0| 1.0.1~1.3.0| 1.0.1~1.3.0| |
219+
| | | 1.3.0rc5~1.3.2| 1.3.0rc5~1.3.2| 1.3.0rc5~1.3.2| 1.3.0rc5~1.3.2| |
220+
| pymongo | [pymongo](https://pypi.org/project/pymongo) | 3.1.1~3.3.1|3.1.1~3.3.1|3.1.1~3.3.1|3.1.1~3.3.1|3.1.1~3.3.1|
221+
| | | 3.5.0~3.13.0| 3.5.0~3.13.0| 3.5.0~3.13.0| 3.5.0~3.13.0| 3.5.0~3.9.0|
222+
| | | 4.0.1~4.5.0| 4.0.1~4.5.0| 4.0.1~4.5.0| 4.0.1~4.5.0| 3.1|
223+
| | | 3.1| 3.1| 3.1| 3.1| 3.2|
224+
| | | 3.2| 3.2| 3.2| 3.2| |
225+
| | | 4.0| 4.0| 4.0| 4.0| |
226+
| pymysql | [pymysql](https://pypi.org/project/pymysql) | 0.9.0~0.10.1|0.9.0~0.10.1|0.9.0~0.10.1|0.9.0~0.10.1| |
227+
| | | 1.0.0~1.0.3| 1.0.0~1.0.3| 1.0.0~1.0.3| 1.0.0~1.0.3| |
228+
| | | 1.1.0~1.1.0rc2| 1.1.0~1.1.0rc2| 1.1.0~1.1.0rc2| 1.1.0~1.1.0rc2| |
229+
| redis | [redis](https://pypi.org/project/redis) | 4.1.1~4.2.0|4.1.1~4.2.0|4.1.1~4.2.0|4.1.1~4.2.0|4.1.1~4.2.0|
230+
| | | 4.2.1~4.6.0| 4.2.1~4.6.0| 4.2.1~4.6.0| 4.2.1~4.6.0| 4.2.1~4.6.0|
231+
| | | 5.0.0~5.0.0rc2| 5.0.0~5.0.0rc2| 5.0.0~5.0.0rc2| 5.0.0~5.0.0rc2| 5.0.0~5.0.0rc2|
230232

231233
## Automated dependency reporting
232234

@@ -343,22 +345,18 @@ Without the scope provided by the iterator over `response["Messages"]`, `span_1`
343345

344346
### Filtering out empty SQS messages
345347

346-
A common pattern in SQS-based applications is to continuously poll an SQS queue for messages,
348+
A common pattern in SQS-based applications is to continuously poll an SQS queue for messages,
347349
and to process them as they arrive.
348-
In order not to clutter the Lumigo platform with empty SQS polling messages, the default behavior is to filter them
350+
In order not to clutter the Lumigo platform with empty SQS polling messages, the default behavior is to filter them
349351
out from being sent to Lumigo.
350352

351353
You can change this behavior by setting the boolean environment variable `LUMIGO_AUTO_FILTER_EMPTY_SQS` to `false`.
352354
The possible variations are:
355+
353356
* `LUMIGO_AUTO_FILTER_EMPTY_SQS=true` filter out empty SQS polling messages
354357
* `LUMIGO_AUTO_FILTER_EMPTY_SQS=false` do not filter out empty SQS polling messages
355358
* No environment variable set (default): filter out empty SQS polling messages
356359

357-
## Testing
358-
359-
We use [nox](https://pypi.org/project/nox/) for setting up and running our tests.
360+
## Contributing
360361

361-
```sh
362-
python3 -m nox
363-
python3 -m nox -e integration_tests_flask
364-
```
362+
For guidelines on contributing, please see [CONTRIBUTING.md](./CONTRIBUTING.md).

0 commit comments

Comments
 (0)