Skip to content

Commit 8fab22d

Browse files
authored
Merge branch 'master' into issue/3139
2 parents 0dcc41a + fb74aa2 commit 8fab22d

Some content is hidden

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

93 files changed

+6667
-1300
lines changed

.flake8

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ exclude =
1616
ignore =
1717
E126
1818
E203
19+
E231
1920
E701
2021
E704
2122
F405

.github/wordlist.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,3 +141,4 @@ unicode
141141
url
142142
virtualenv
143143
www
144+
yaml

.github/workflows/integration.yaml

Lines changed: 118 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -23,123 +23,148 @@ concurrency:
2323
permissions:
2424
contents: read # to fetch code (actions/checkout)
2525

26+
env:
27+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
28+
# this speeds up coverage with Python 3.12: https://github.com/nedbat/coveragepy/issues/1665
29+
COVERAGE_CORE: sysmon
30+
REDIS_IMAGE: redis:7.4-rc2
31+
REDIS_STACK_IMAGE: redis/redis-stack-server:latest
32+
2633
jobs:
34+
dependency-audit:
35+
name: Dependency audit
36+
runs-on: ubuntu-latest
37+
steps:
38+
- uses: actions/checkout@v4
39+
- uses: pypa/gh-action-pip-audit@v1.0.8
40+
with:
41+
inputs: requirements.txt dev_requirements.txt
42+
ignore-vulns: |
43+
GHSA-w596-4wvx-j9j6 # subversion related git pull, dependency for pytest. There is no impact here.
2744
28-
dependency-audit:
29-
name: Dependency audit
30-
runs-on: ubuntu-latest
31-
steps:
32-
- uses: actions/checkout@v4
33-
- uses: pypa/gh-action-pip-audit@v1.0.8
34-
with:
35-
inputs: requirements.txt dev_requirements.txt
36-
ignore-vulns: |
37-
GHSA-w596-4wvx-j9j6 # subversion related git pull, dependency for pytest. There is no impact here.
38-
39-
lint:
40-
name: Code linters
41-
runs-on: ubuntu-latest
42-
steps:
43-
- uses: actions/checkout@v4
44-
- uses: actions/setup-python@v5
45-
with:
46-
python-version: 3.9
47-
cache: 'pip'
48-
- name: run code linters
49-
run: |
50-
pip install -r dev_requirements.txt
51-
invoke linters
52-
53-
run-tests:
54-
runs-on: ubuntu-latest
55-
timeout-minutes: 60
56-
strategy:
57-
max-parallel: 15
58-
fail-fast: false
59-
matrix:
60-
python-version: ['3.8', '3.9', '3.10', '3.11', 'pypy-3.8', 'pypy-3.9']
61-
test-type: ['standalone', 'cluster']
62-
connection-type: ['hiredis', 'plain']
63-
env:
64-
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
65-
name: Python ${{ matrix.python-version }} ${{matrix.test-type}}-${{matrix.connection-type}} tests
66-
steps:
67-
- uses: actions/checkout@v4
68-
- uses: actions/setup-python@v5
69-
with:
70-
python-version: ${{ matrix.python-version }}
71-
cache: 'pip'
72-
- name: run tests
73-
run: |
74-
pip install -U setuptools wheel
75-
pip install -r requirements.txt
76-
pip install -r dev_requirements.txt
77-
if [ "${{matrix.connection-type}}" == "hiredis" ]; then
78-
pip install hiredis
79-
fi
80-
invoke devenv
81-
sleep 10 # time to settle
82-
invoke ${{matrix.test-type}}-tests
83-
84-
- uses: actions/upload-artifact@v4
85-
if: success() || failure()
86-
with:
87-
name: pytest-results-${{matrix.test-type}}-${{matrix.connection-type}}-${{matrix.python-version}}
88-
path: '${{matrix.test-type}}*results.xml'
89-
90-
- name: Upload codecov coverage
91-
uses: codecov/codecov-action@v4
92-
with:
93-
fail_ci_if_error: false
94-
95-
- name: View Test Results
96-
uses: dorny/test-reporter@v1
97-
if: success() || failure()
98-
continue-on-error: true
99-
with:
100-
name: Test Results ${{matrix.python-version}} ${{matrix.test-type}}-${{matrix.connection-type}}
101-
path: '*.xml'
102-
reporter: java-junit
103-
list-suites: all
104-
list-tests: all
105-
max-annotations: 10
106-
fail-on-error: 'false'
107-
108-
resp3_tests:
45+
lint:
46+
name: Code linters
47+
runs-on: ubuntu-latest
48+
steps:
49+
- uses: actions/checkout@v4
50+
- uses: actions/setup-python@v5
51+
with:
52+
python-version: 3.9
53+
cache: 'pip'
54+
- name: run code linters
55+
run: |
56+
pip install -r dev_requirements.txt
57+
invoke linters
58+
59+
resp2-tests:
10960
runs-on: ubuntu-latest
61+
timeout-minutes: 60
11062
strategy:
63+
max-parallel: 15
11164
fail-fast: false
11265
matrix:
113-
python-version: ['3.8', '3.11']
66+
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', 'pypy-3.8', 'pypy-3.9']
11467
test-type: ['standalone', 'cluster']
11568
connection-type: ['hiredis', 'plain']
116-
protocol: ['3']
11769
env:
118-
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
119-
name: RESP3 [${{ matrix.python-version }} ${{matrix.test-type}}-${{matrix.connection-type}}]
70+
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
71+
name: RESP2 ${{ matrix.python-version }} ${{matrix.test-type}}-${{matrix.connection-type}}
12072
steps:
12173
- uses: actions/checkout@v4
74+
12275
- uses: actions/setup-python@v5
12376
with:
12477
python-version: ${{ matrix.python-version }}
12578
cache: 'pip'
126-
- name: run tests
79+
80+
- name: Run tests
12781
run: |
12882
pip install -U setuptools wheel
12983
pip install -r requirements.txt
13084
pip install -r dev_requirements.txt
13185
if [ "${{matrix.connection-type}}" == "hiredis" ]; then
132-
pip install hiredis
86+
pip install hiredis
13387
fi
13488
invoke devenv
135-
sleep 5 # time to settle
89+
sleep 10 # time to settle
13690
invoke ${{matrix.test-type}}-tests
137-
invoke ${{matrix.test-type}}-tests --uvloop
91+
ls -1
92+
93+
- name: Upload test results and profiling data
94+
uses: actions/upload-artifact@v4
95+
with:
96+
name: pytest-results-${{matrix.test-type}}-${{matrix.connection-type}}-${{matrix.python-version}}
97+
path: |
98+
${{matrix.test-type}}*-results.xml
99+
prof/**
100+
profile_output*
101+
if-no-files-found: error
102+
retention-days: 10
103+
104+
- name: Upload codecov coverage
105+
uses: codecov/codecov-action@v4
106+
with:
107+
fail_ci_if_error: false
108+
109+
resp3-tests:
110+
runs-on: ubuntu-latest
111+
strategy:
112+
fail-fast: false
113+
matrix:
114+
python-version: ['3.8', '3.12']
115+
test-type: ['standalone', 'cluster']
116+
connection-type: ['hiredis', 'plain']
117+
event-loop: ['asyncio', 'uvloop']
118+
exclude:
119+
- test-type: 'cluster'
120+
connection-type: 'hiredis'
121+
env:
122+
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
123+
name: RESP3 ${{ matrix.python-version }} ${{matrix.test-type}}-${{matrix.connection-type}}-${{matrix.event-loop}}
124+
steps:
125+
- uses: actions/checkout@v4
126+
127+
- uses: actions/setup-python@v5
128+
with:
129+
python-version: ${{ matrix.python-version }}
130+
cache: 'pip'
131+
132+
- name: Run tests
133+
run: |
134+
pip install -U setuptools wheel
135+
pip install -r requirements.txt
136+
pip install -r dev_requirements.txt
137+
if [ "${{matrix.connection-type}}" == "hiredis" ]; then
138+
pip install hiredis
139+
fi
140+
invoke devenv
141+
sleep 10 # time to settle
142+
if [ "${{matrix.event-loop}}" == "uvloop" ]; then
143+
invoke ${{matrix.test-type}}-tests --uvloop --protocol=3
144+
else
145+
invoke ${{matrix.test-type}}-tests --protocol=3
146+
fi
147+
148+
- name: Upload test results and profiling data
149+
uses: actions/upload-artifact@v4
150+
with:
151+
name: pytest-results-${{matrix.test-type}}-${{matrix.connection-type}}-${{matrix.python-version}}-${{matrix.event-loop}}-resp3
152+
path: |
153+
${{matrix.test-type}}*-results.xml
154+
prof/**
155+
profile_output*
156+
if-no-files-found: error
157+
retention-days: 10
158+
159+
- name: Upload codecov coverage
160+
uses: codecov/codecov-action@v4
161+
with:
162+
fail_ci_if_error: false
138163

139-
build_and_test_package:
164+
build-and-test-package:
140165
name: Validate building and installing the package
141166
runs-on: ubuntu-latest
142-
needs: [run-tests]
167+
needs: [resp2-tests, resp3-tests]
143168
strategy:
144169
fail-fast: false
145170
matrix:
@@ -153,13 +178,13 @@ jobs:
153178
run: |
154179
bash .github/workflows/install_and_test.sh ${{ matrix.extension }}
155180
156-
install_package_from_commit:
181+
install-package-from-commit:
157182
name: Install package from commit hash
158183
runs-on: ubuntu-latest
159184
strategy:
160185
fail-fast: false
161186
matrix:
162-
python-version: ['3.8', '3.9', '3.10', '3.11', 'pypy-3.8', 'pypy-3.9']
187+
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', 'pypy-3.8', 'pypy-3.9']
163188
steps:
164189
- uses: actions/checkout@v4
165190
- uses: actions/setup-python@v5

.github/workflows/spellcheck.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
- name: Checkout
99
uses: actions/checkout@v4
1010
- name: Check Spelling
11-
uses: rojopolis/spellcheck-github-actions@0.36.0
11+
uses: rojopolis/spellcheck-github-actions@0.38.0
1212
with:
1313
config_path: .github/spellcheck-settings.yml
1414
task_name: Markdown

.github/workflows/stale-issues.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212

1313
runs-on: ubuntu-latest
1414
steps:
15-
- uses: actions/stale@v3
15+
- uses: actions/stale@v9
1616
with:
1717
repo-token: ${{ secrets.GITHUB_TOKEN }}
1818
stale-issue-message: 'This issue is marked stale. It will be closed in 30 days if it is not updated.'

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,6 @@ coverage.xml
1616
.venv*
1717
*.xml
1818
.coverage*
19+
prof
20+
profile_output*
1921
docker/stunnel/keys

CHANGES

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
* Fixed sentinel execute command response
2+
* Move doctests (doc code examples) to main branch
23
* Update `ResponseT` type hint
34
* Allow to control the minimum SSL version
45
* Add an optional lock_name attribute to LockError.
@@ -64,6 +65,8 @@
6465
* Make `ClusterCommandsProtocol` an actual Protocol
6566
* Add `sum` to DUPLICATE_POLICY documentation of `TS.CREATE`, `TS.ADD` and `TS.ALTER`
6667
* Prevent async ClusterPipeline instances from becoming "false-y" in case of empty command stack (#3061)
68+
* Close Unix sockets if the connection attempt fails. This prevents `ResourceWarning`s. (#3314)
69+
* Close SSL sockets if the connection attempt fails, or if validations fail. (#3317)
6770

6871
* 4.1.3 (Feb 8, 2022)
6972
* Fix flushdb and flushall (#1926)

dev_requirements.txt

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
1-
click==8.0.4
21
black==24.3.0
32
cachetools
4-
flake8==5.0.4
5-
flake8-isort==6.0.0
3+
click==8.0.4
4+
flake8-isort
5+
flake8
66
flynt~=0.69.0
7-
mock==4.0.3
7+
invoke==2.2.0
8+
mock
89
packaging>=20.4
9-
pytest==7.2.0
10-
pytest-timeout==2.1.0
11-
pytest-asyncio>=0.20.2
12-
invoke==1.7.3
13-
pytest-cov>=4.0.0
14-
vulture>=2.3.0
10+
pytest
11+
pytest-asyncio
12+
pytest-cov
13+
pytest-profiling
14+
pytest-timeout
1515
ujson>=4.2.0
16-
wheel>=0.30.0
17-
urllib3<2
1816
uvloop
17+
vulture>=2.3.0
18+
wheel>=0.30.0
19+
numpy>=1.24.0

0 commit comments

Comments
 (0)