Skip to content

Commit 9ddbd87

Browse files
committed
Merge remote-tracking branch 'origin/master' into ck_py312
2 parents e6487ed + 57af285 commit 9ddbd87

File tree

117 files changed

+8258
-1806
lines changed

Some content is hidden

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

117 files changed

+8258
-1806
lines changed

.flake8

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ exclude =
1616
ignore =
1717
E126
1818
E203
19+
E701
20+
E704
1921
F405
2022
N801
2123
N802

.github/wordlist.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ bysource
7474
charset
7575
del
7676
dev
77+
docstring
78+
docstrings
7779
eg
7880
exc
7981
firsttimersonly

.github/workflows/docs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ on:
1313
- cron: '0 1 * * *' # nightly build
1414

1515
concurrency:
16-
group: ${{ github.event.pull_request.number || github.ref }}
16+
group: ${{ github.event.pull_request.number || github.ref }}-docs
1717
cancel-in-progress: true
1818

1919
permissions:

.github/workflows/integration.yaml

Lines changed: 119 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -17,105 +17,111 @@ on:
1717
- cron: '0 1 * * *' # nightly build
1818

1919
concurrency:
20-
group: ${{ github.event.pull_request.number || github.ref }}
20+
group: ${{ github.event.pull_request.number || github.ref }}-integration
2121
cancel-in-progress: true
2222

2323
permissions:
2424
contents: read # to fetch code (actions/checkout)
2525

26+
env:
27+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
28+
REDIS_IMAGE: redis/redis-stack-server:7.4.0-rc1
29+
REDIS_STACK_IMAGE: redis/redis-stack-server:7.4.0-rc1
30+
2631
jobs:
32+
dependency-audit:
33+
name: Dependency audit
34+
runs-on: ubuntu-latest
35+
steps:
36+
- uses: actions/checkout@v4
37+
- uses: pypa/[email protected]
38+
with:
39+
inputs: requirements.txt dev_requirements.txt
40+
ignore-vulns: |
41+
GHSA-w596-4wvx-j9j6 # subversion related git pull, dependency for pytest. There is no impact here.
2742
28-
dependency-audit:
29-
name: Dependency audit
30-
runs-on: ubuntu-latest
31-
steps:
32-
- uses: actions/checkout@v4
33-
- uses: pypa/[email protected]
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', '3.12', '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@v3
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:
43+
lint:
44+
name: Code linters
45+
runs-on: ubuntu-latest
46+
steps:
47+
- uses: actions/checkout@v4
48+
- uses: actions/setup-python@v5
49+
with:
50+
python-version: 3.9
51+
cache: 'pip'
52+
- name: run code linters
53+
run: |
54+
pip install -r dev_requirements.txt
55+
invoke linters
56+
57+
run-tests:
58+
runs-on: ubuntu-latest
59+
timeout-minutes: 60
60+
strategy:
61+
max-parallel: 15
62+
fail-fast: false
63+
matrix:
64+
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', 'pypy-3.8', 'pypy-3.9']
65+
test-type: ['standalone', 'cluster']
66+
connection-type: ['hiredis', 'plain']
67+
env:
68+
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
69+
name: Python ${{ matrix.python-version }} ${{matrix.test-type}}-${{matrix.connection-type}} tests
70+
steps:
71+
- uses: actions/checkout@v4
72+
- uses: actions/setup-python@v5
73+
with:
74+
python-version: ${{ matrix.python-version }}
75+
cache: 'pip'
76+
- name: run tests
77+
run: |
78+
pip install -U setuptools wheel
79+
pip install -r requirements.txt
80+
pip install -r dev_requirements.txt
81+
if [ "${{matrix.connection-type}}" == "hiredis" ]; then
82+
pip install hiredis
83+
fi
84+
invoke devenv
85+
sleep 10 # time to settle
86+
invoke ${{matrix.test-type}}-tests
87+
88+
- uses: actions/upload-artifact@v4
89+
if: success() || failure()
90+
with:
91+
name: pytest-results-${{matrix.test-type}}-${{matrix.connection-type}}-${{matrix.python-version}}
92+
path: '${{matrix.test-type}}*results.xml'
93+
94+
- name: Upload codecov coverage
95+
uses: codecov/codecov-action@v4
96+
with:
97+
fail_ci_if_error: false
98+
99+
- name: View Test Results
100+
uses: dorny/test-reporter@v1
101+
if: success() || failure()
102+
continue-on-error: true
103+
with:
104+
name: Test Results ${{matrix.python-version}} ${{matrix.test-type}}-${{matrix.connection-type}}
105+
path: '*.xml'
106+
reporter: java-junit
107+
list-suites: all
108+
list-tests: all
109+
max-annotations: 10
110+
fail-on-error: 'false'
111+
112+
resp3_tests:
109113
runs-on: ubuntu-latest
110114
strategy:
111115
fail-fast: false
112116
matrix:
113117
python-version: ['3.8', '3.12']
114118
test-type: ['standalone', 'cluster']
115119
connection-type: ['hiredis', 'plain']
116-
protocol: ['3']
120+
exclude:
121+
- test-type: 'cluster'
122+
connection-type: 'hiredis'
117123
env:
118-
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
124+
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
119125
name: RESP3 [${{ matrix.python-version }} ${{matrix.test-type}}-${{matrix.connection-type}}]
120126
steps:
121127
- uses: actions/checkout@v4
@@ -132,11 +138,35 @@ jobs:
132138
pip install hiredis
133139
fi
134140
invoke devenv
135-
sleep 5 # time to settle
136-
invoke ${{matrix.test-type}}-tests
137-
invoke ${{matrix.test-type}}-tests --uvloop
141+
sleep 10 # time to settle
142+
invoke ${{matrix.test-type}}-tests --protocol=3
143+
invoke ${{matrix.test-type}}-tests --uvloop --protocol=3
144+
145+
- uses: actions/upload-artifact@v4
146+
if: success() || failure()
147+
with:
148+
name: pytest-results-${{matrix.test-type}}-${{matrix.connection-type}}-${{matrix.python-version}}-resp3
149+
path: '${{matrix.test-type}}*results.xml'
150+
151+
- name: Upload codecov coverage
152+
uses: codecov/codecov-action@v4
153+
with:
154+
fail_ci_if_error: false
155+
156+
- name: View Test Results
157+
uses: dorny/test-reporter@v1
158+
if: success() || failure()
159+
continue-on-error: true
160+
with:
161+
name: Test Results ${{matrix.python-version}} ${{matrix.test-type}}-${{matrix.connection-type}}-resp3
162+
path: '*.xml'
163+
reporter: java-junit
164+
list-suites: all
165+
list-tests: all
166+
max-annotations: 10
167+
fail-on-error: 'false'
138168

139-
build_and_test_package:
169+
build_and_test_package:
140170
name: Validate building and installing the package
141171
runs-on: ubuntu-latest
142172
needs: [run-tests]
@@ -153,7 +183,7 @@ jobs:
153183
run: |
154184
bash .github/workflows/install_and_test.sh ${{ matrix.extension }}
155185
156-
install_package_from_commit:
186+
install_package_from_commit:
157187
name: Install package from commit hash
158188
runs-on: ubuntu-latest
159189
strategy:

.github/workflows/pypi-publish.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ jobs:
2727
python setup.py build
2828
python setup.py sdist bdist_wheel
2929
30+
- name: Basic package test prior to upload
31+
run: |
32+
twine check dist/*
33+
3034
- name: Publish to Pypi
3135
uses: pypa/gh-action-pypi-publish@release/v1
3236
with:

.github/workflows/release-drafter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
runs-on: ubuntu-latest
1717
steps:
1818
# Drafts your next Release notes as Pull Requests are merged into "master"
19-
- uses: release-drafter/release-drafter@v5
19+
- uses: release-drafter/release-drafter@v6
2020
with:
2121
# (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml
2222
config-name: release-drafter-config.yml

.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.35.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.'

CHANGES

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
* Move doctests (doc code examples) to main branch
2+
* Update `ResponseT` type hint
3+
* Allow to control the minimum SSL version
14
* Add an optional lock_name attribute to LockError.
25
* Fix return types for `get`, `set_path` and `strappend` in JSONCommands
36
* Connection.register_connect_callback() is made public.

CONTRIBUTING.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,19 @@ using `invoke standalone-tests`; similarly, RedisCluster tests can be run by usi
8181
Each run of tests starts and stops the various dockers required. Sometimes
8282
things get stuck, an `invoke clean` can help.
8383

84+
## Documentation
85+
86+
If relevant, update the code documentation, via docstrings, or in `/docs`.
87+
88+
You can check how the documentation looks locally by running `invoke build-docs`
89+
and loading the generated HTML files in a browser.
90+
91+
Historically there is a mix of styles in the docstrings, but the preferred way
92+
of documenting code is by applying the
93+
[Google style](https://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html).
94+
Type hints should be added according to PEP484, and should not be repeated in
95+
the docstrings.
96+
8497
### Docker Tips
8598

8699
Following are a few tips that can help you work with the Docker-based

0 commit comments

Comments
 (0)