Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into ck_py312
Browse files Browse the repository at this point in the history
  • Loading branch information
gerzse committed Jul 3, 2024
2 parents e6487ed + 57af285 commit 9ddbd87
Show file tree
Hide file tree
Showing 117 changed files with 8,258 additions and 1,806 deletions.
2 changes: 2 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ exclude =
ignore =
E126
E203
E701
E704
F405
N801
N802
Expand Down
2 changes: 2 additions & 0 deletions .github/wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ bysource
charset
del
dev
docstring
docstrings
eg
exc
firsttimersonly
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
- cron: '0 1 * * *' # nightly build

concurrency:
group: ${{ github.event.pull_request.number || github.ref }}
group: ${{ github.event.pull_request.number || github.ref }}-docs
cancel-in-progress: true

permissions:
Expand Down
208 changes: 119 additions & 89 deletions .github/workflows/integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,105 +17,111 @@ on:
- cron: '0 1 * * *' # nightly build

concurrency:
group: ${{ github.event.pull_request.number || github.ref }}
group: ${{ github.event.pull_request.number || github.ref }}-integration
cancel-in-progress: true

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

env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
REDIS_IMAGE: redis/redis-stack-server:7.4.0-rc1
REDIS_STACK_IMAGE: redis/redis-stack-server:7.4.0-rc1

jobs:
dependency-audit:
name: Dependency audit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pypa/[email protected]
with:
inputs: requirements.txt dev_requirements.txt
ignore-vulns: |
GHSA-w596-4wvx-j9j6 # subversion related git pull, dependency for pytest. There is no impact here.
dependency-audit:
name: Dependency audit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pypa/[email protected]
with:
inputs: requirements.txt dev_requirements.txt
ignore-vulns: |
GHSA-w596-4wvx-j9j6 # subversion related git pull, dependency for pytest. There is no impact here.
lint:
name: Code linters
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.9
cache: 'pip'
- name: run code linters
run: |
pip install -r dev_requirements.txt
invoke linters
run-tests:
runs-on: ubuntu-latest
timeout-minutes: 60
strategy:
max-parallel: 15
fail-fast: false
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', 'pypy-3.8', 'pypy-3.9']
test-type: ['standalone', 'cluster']
connection-type: ['hiredis', 'plain']
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
name: Python ${{ matrix.python-version }} ${{matrix.test-type}}-${{matrix.connection-type}} tests
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: run tests
run: |
pip install -U setuptools wheel
pip install -r requirements.txt
pip install -r dev_requirements.txt
if [ "${{matrix.connection-type}}" == "hiredis" ]; then
pip install hiredis
fi
invoke devenv
sleep 10 # time to settle
invoke ${{matrix.test-type}}-tests
- uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: pytest-results-${{matrix.test-type}}-${{matrix.connection-type}}-${{matrix.python-version}}
path: '${{matrix.test-type}}*results.xml'

- name: Upload codecov coverage
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: false

- name: View Test Results
uses: dorny/test-reporter@v1
if: success() || failure()
continue-on-error: true
with:
name: Test Results ${{matrix.python-version}} ${{matrix.test-type}}-${{matrix.connection-type}}
path: '*.xml'
reporter: java-junit
list-suites: all
list-tests: all
max-annotations: 10
fail-on-error: 'false'

resp3_tests:
lint:
name: Code linters
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.9
cache: 'pip'
- name: run code linters
run: |
pip install -r dev_requirements.txt
invoke linters
run-tests:
runs-on: ubuntu-latest
timeout-minutes: 60
strategy:
max-parallel: 15
fail-fast: false
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', 'pypy-3.8', 'pypy-3.9']
test-type: ['standalone', 'cluster']
connection-type: ['hiredis', 'plain']
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
name: Python ${{ matrix.python-version }} ${{matrix.test-type}}-${{matrix.connection-type}} tests
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: run tests
run: |
pip install -U setuptools wheel
pip install -r requirements.txt
pip install -r dev_requirements.txt
if [ "${{matrix.connection-type}}" == "hiredis" ]; then
pip install hiredis
fi
invoke devenv
sleep 10 # time to settle
invoke ${{matrix.test-type}}-tests
- uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: pytest-results-${{matrix.test-type}}-${{matrix.connection-type}}-${{matrix.python-version}}
path: '${{matrix.test-type}}*results.xml'

- name: Upload codecov coverage
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: false

- name: View Test Results
uses: dorny/test-reporter@v1
if: success() || failure()
continue-on-error: true
with:
name: Test Results ${{matrix.python-version}} ${{matrix.test-type}}-${{matrix.connection-type}}
path: '*.xml'
reporter: java-junit
list-suites: all
list-tests: all
max-annotations: 10
fail-on-error: 'false'

resp3_tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.8', '3.12']
test-type: ['standalone', 'cluster']
connection-type: ['hiredis', 'plain']
protocol: ['3']
exclude:
- test-type: 'cluster'
connection-type: 'hiredis'
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
name: RESP3 [${{ matrix.python-version }} ${{matrix.test-type}}-${{matrix.connection-type}}]
steps:
- uses: actions/checkout@v4
Expand All @@ -132,11 +138,35 @@ jobs:
pip install hiredis
fi
invoke devenv
sleep 5 # time to settle
invoke ${{matrix.test-type}}-tests
invoke ${{matrix.test-type}}-tests --uvloop
sleep 10 # time to settle
invoke ${{matrix.test-type}}-tests --protocol=3
invoke ${{matrix.test-type}}-tests --uvloop --protocol=3
- uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: pytest-results-${{matrix.test-type}}-${{matrix.connection-type}}-${{matrix.python-version}}-resp3
path: '${{matrix.test-type}}*results.xml'

- name: Upload codecov coverage
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: false

- name: View Test Results
uses: dorny/test-reporter@v1
if: success() || failure()
continue-on-error: true
with:
name: Test Results ${{matrix.python-version}} ${{matrix.test-type}}-${{matrix.connection-type}}-resp3
path: '*.xml'
reporter: java-junit
list-suites: all
list-tests: all
max-annotations: 10
fail-on-error: 'false'

build_and_test_package:
build_and_test_package:
name: Validate building and installing the package
runs-on: ubuntu-latest
needs: [run-tests]
Expand All @@ -153,7 +183,7 @@ jobs:
run: |
bash .github/workflows/install_and_test.sh ${{ matrix.extension }}
install_package_from_commit:
install_package_from_commit:
name: Install package from commit hash
runs-on: ubuntu-latest
strategy:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/pypi-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ jobs:
python setup.py build
python setup.py sdist bdist_wheel
- name: Basic package test prior to upload
run: |
twine check dist/*
- name: Publish to Pypi
uses: pypa/gh-action-pypi-publish@release/v1
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest
steps:
# Drafts your next Release notes as Pull Requests are merged into "master"
- uses: release-drafter/release-drafter@v5
- uses: release-drafter/release-drafter@v6
with:
# (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml
config-name: release-drafter-config.yml
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/spellcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Check Spelling
uses: rojopolis/spellcheck-github-actions@0.35.0
uses: rojopolis/spellcheck-github-actions@0.38.0
with:
config_path: .github/spellcheck-settings.yml
task_name: Markdown
2 changes: 1 addition & 1 deletion .github/workflows/stale-issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:

runs-on: ubuntu-latest
steps:
- uses: actions/stale@v3
- uses: actions/stale@v9
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'This issue is marked stale. It will be closed in 30 days if it is not updated.'
Expand Down
3 changes: 3 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
* Move doctests (doc code examples) to main branch
* Update `ResponseT` type hint
* Allow to control the minimum SSL version
* Add an optional lock_name attribute to LockError.
* Fix return types for `get`, `set_path` and `strappend` in JSONCommands
* Connection.register_connect_callback() is made public.
Expand Down
13 changes: 13 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,19 @@ using `invoke standalone-tests`; similarly, RedisCluster tests can be run by usi
Each run of tests starts and stops the various dockers required. Sometimes
things get stuck, an `invoke clean` can help.

## Documentation

If relevant, update the code documentation, via docstrings, or in `/docs`.

You can check how the documentation looks locally by running `invoke build-docs`
and loading the generated HTML files in a browser.

Historically there is a mix of styles in the docstrings, but the preferred way
of documenting code is by applying the
[Google style](https://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html).
Type hints should be added according to PEP484, and should not be repeated in
the docstrings.

### Docker Tips

Following are a few tips that can help you work with the Docker-based
Expand Down
16 changes: 7 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,15 @@ The Python interface to the Redis key-value store.

## How do I Redis?

[Learn for free at Redis University](https://university.redis.com/)
[Learn for free at Redis University](https://redis.io/university/)

[Build faster with the Redis Launchpad](https://launchpad.redis.com/)
[Try the Redis Cloud](https://redis.io/try-free/)

[Try the Redis Cloud](https://redis.com/try-free/)
[Dive in developer tutorials](https://redis.io/learn)

[Dive in developer tutorials](https://developer.redis.com/)
[Join the Redis community](https://redis.io/community/)

[Join the Redis community](https://redis.com/community/)

[Work at Redis](https://redis.com/company/careers/jobs/)
[Work at Redis](https://redis.io/careers/)

## Installation

Expand Down Expand Up @@ -159,7 +157,7 @@ The following example shows how to utilize [Redis Pub/Sub](https://redis.io/docs

### Author

redis-py is developed and maintained by [Redis Inc](https://redis.com). It can be found [here](
redis-py is developed and maintained by [Redis Inc](https://redis.io). It can be found [here](
https://github.com/redis/redis-py), or downloaded from [pypi](https://pypi.org/project/redis/).

Special thanks to:
Expand All @@ -171,4 +169,4 @@ Special thanks to:
system.
- Paul Hubbard for initial packaging support.

[![Redis](./docs/logo-redis.png)](https://www.redis.com)
[![Redis](./docs/_static/logo-redis.svg)](https://redis.io)
Loading

0 comments on commit 9ddbd87

Please sign in to comment.