Skip to content

Commit a7fb844

Browse files
committed
Merge remote-tracking branch 'upstream/master' into connection-pool-fix
2 parents 59ab61f + 9167a0e commit a7fb844

File tree

233 files changed

+65952
-8355
lines changed

Some content is hidden

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

233 files changed

+65952
-8355
lines changed

.coveragerc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[run]
2+
source = redis

.dockerignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
**/__pycache__
2+
**/*.pyc
3+
.tox
4+
.coverage
5+
.coverage.*

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@
33
_Please make sure to review and check all of these items:_
44

55
- [ ] Does `$ tox` pass with this change (including linting)?
6-
- [ ] Does travis tests pass with this change (enable it first in your forked repo and wait for the travis build to finish)?
6+
- [ ] Do the CI tests pass with this change (enable it first in your forked repo and wait for the github action build to finish)?
77
- [ ] Is the new or changed code fully tested?
88
- [ ] Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?
9+
- [ ] Is there an example added to the examples folder (if applicable)?
10+
- [ ] Was the change added to CHANGES file?
911

1012
_NOTE: these things are not required to open a PR and can be done
1113
afterwards / while the PR is open._

.github/release-drafter-config.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name-template: 'Version $NEXT_PATCH_VERSION'
2+
tag-template: 'v$NEXT_PATCH_VERSION'
3+
autolabeler:
4+
- label: 'maintenance'
5+
files:
6+
- '*.md'
7+
- '.github/*'
8+
- label: 'bug'
9+
branch:
10+
- '/bug-.+'
11+
- label: 'maintenance'
12+
branch:
13+
- '/maintenance-.+'
14+
- label: 'feature'
15+
branch:
16+
- '/feature-.+'
17+
categories:
18+
- title: '🔥 Breaking Changes'
19+
labels:
20+
- 'breakingchange'
21+
- title: '🚀 New Features'
22+
labels:
23+
- 'feature'
24+
- 'enhancement'
25+
- title: '🐛 Bug Fixes'
26+
labels:
27+
- 'fix'
28+
- 'bugfix'
29+
- 'bug'
30+
- title: '🧰 Maintenance'
31+
label: 'maintenance'
32+
change-template: '- $TITLE (#$NUMBER)'
33+
exclude-labels:
34+
- 'skip-changelog'
35+
template: |
36+
## Changes
37+
38+
$CHANGES
39+
40+
## Contributors
41+
We'd like to thank all the contributors who worked on this release!
42+
43+
$CONTRIBUTORS
44+

.github/workflows/codeql-analysis.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL"
13+
14+
on:
15+
push:
16+
branches: [ master ]
17+
pull_request:
18+
# The branches below must be a subset of the branches above
19+
branches: [ master ]
20+
21+
jobs:
22+
analyze:
23+
name: Analyze
24+
runs-on: ubuntu-latest
25+
permissions:
26+
actions: read
27+
contents: read
28+
security-events: write
29+
30+
strategy:
31+
fail-fast: false
32+
matrix:
33+
language: [ 'python' ]
34+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
35+
# Learn more about CodeQL language support at https://git.io/codeql-language-support
36+
37+
steps:
38+
- name: Checkout repository
39+
uses: actions/checkout@v2
40+
41+
# Initializes the CodeQL tools for scanning.
42+
- name: Initialize CodeQL
43+
uses: github/codeql-action/init@v1
44+
with:
45+
languages: ${{ matrix.language }}
46+
# If you wish to specify custom queries, you can do so here or in a config file.
47+
# By default, queries listed here will override any specified in a config file.
48+
# Prefix the list here with "+" to use these queries and those in the config file.
49+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
50+
51+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
52+
# If this step fails, then you should remove it and run the build manually (see below)
53+
- name: Autobuild
54+
uses: github/codeql-action/autobuild@v1
55+
56+
# ℹ️ Command-line programs to run using the OS shell.
57+
# 📚 https://git.io/JvXDl
58+
59+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
60+
# and modify them (or add more) to build your code if your project
61+
# uses a compiled language
62+
63+
#- run: |
64+
# make bootstrap
65+
# make release
66+
67+
- name: Perform CodeQL Analysis
68+
uses: github/codeql-action/analyze@v1

.github/workflows/install_and_test.sh

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
SUFFIX=$1
6+
if [ -z ${SUFFIX} ]; then
7+
echo "Supply valid python package extension such as whl or tar.gz. Exiting."
8+
exit 3
9+
fi
10+
11+
script=`pwd`/${BASH_SOURCE[0]}
12+
HERE=`dirname ${script}`
13+
ROOT=`realpath ${HERE}/../..`
14+
15+
cd ${ROOT}
16+
DESTENV=${ROOT}/.venvforinstall
17+
if [ -d ${DESTENV} ]; then
18+
rm -rf ${DESTENV}
19+
fi
20+
python -m venv ${DESTENV}
21+
source ${DESTENV}/bin/activate
22+
pip install --upgrade --quiet pip
23+
pip install --quiet -r dev_requirements.txt
24+
invoke devenv
25+
invoke package
26+
27+
# find packages
28+
PKG=`ls ${ROOT}/dist/*.${SUFFIX}`
29+
ls -l ${PKG}
30+
31+
TESTDIR=${ROOT}/STAGETESTS
32+
if [ -d ${TESTDIR} ]; then
33+
rm -rf ${TESTDIR}
34+
fi
35+
mkdir ${TESTDIR}
36+
cp -R ${ROOT}/tests ${TESTDIR}/tests
37+
cd ${TESTDIR}
38+
39+
# install, run tests
40+
pip install ${PKG}
41+
# Redis tests
42+
pytest -m 'not onlycluster'
43+
# RedisCluster tests
44+
CLUSTER_URL="redis://localhost:16379/0"
45+
pytest -m 'not onlynoncluster and not redismod and not ssl' --redis-url=${CLUSTER_URL}

.github/workflows/integration.yaml

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
paths-ignore:
6+
- 'docs/**'
7+
- '**/*.rst'
8+
- '**/*.md'
9+
branches:
10+
- master
11+
- '[0-9].[0-9]'
12+
pull_request:
13+
branches:
14+
- master
15+
- '[0-9].[0-9]'
16+
17+
jobs:
18+
19+
lint:
20+
name: Code linters
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v2
24+
- name: install python
25+
uses: actions/setup-python@v3
26+
with:
27+
python-version: 3.9
28+
cache: 'pip'
29+
- name: run code linters
30+
run: |
31+
pip install -r dev_requirements.txt
32+
invoke linters
33+
34+
run-tests:
35+
runs-on: ubuntu-latest
36+
timeout-minutes: 30
37+
strategy:
38+
max-parallel: 15
39+
matrix:
40+
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10', 'pypy-3.7']
41+
test-type: ['standalone', 'cluster']
42+
connection-type: ['hiredis', 'plain']
43+
env:
44+
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
45+
name: Python ${{ matrix.python-version }} ${{matrix.test-type}}-${{matrix.connection-type}} tests
46+
steps:
47+
- uses: actions/checkout@v2
48+
- name: install python
49+
uses: actions/setup-python@v3
50+
with:
51+
python-version: ${{ matrix.python-version }}
52+
cache: 'pip'
53+
- name: run tests
54+
run: |
55+
pip install -U setuptools wheel
56+
pip install -r dev_requirements.txt
57+
tox -e ${{matrix.test-type}}-${{matrix.connection-type}}
58+
- name: Upload codecov coverage
59+
uses: codecov/codecov-action@v2
60+
with:
61+
fail_ci_if_error: false
62+
token: ${{ secrets.CODECOV_TOKEN }}
63+
64+
build_and_test_package:
65+
name: Validate building and installing the package
66+
runs-on: ubuntu-latest
67+
strategy:
68+
matrix:
69+
extension: ['tar.gz', 'whl']
70+
steps:
71+
- uses: actions/checkout@v2
72+
- name: install python
73+
uses: actions/setup-python@v3
74+
with:
75+
python-version: 3.9
76+
- name: Run installed unit tests
77+
run: |
78+
bash .github/workflows/install_and_test.sh ${{ matrix.extension }}
79+
80+
install_package_from_commit:
81+
name: Install package from commit hash
82+
runs-on: ubuntu-latest
83+
strategy:
84+
matrix:
85+
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10', 'pypy-3.7']
86+
steps:
87+
- uses: actions/checkout@v2
88+
- name: install python ${{ matrix.python-version }}
89+
uses: actions/setup-python@v3
90+
with:
91+
python-version: ${{ matrix.python-version }}
92+
cache: 'pip'
93+
- name: install from pip
94+
run: |
95+
pip install --quiet git+${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git@${GITHUB_SHA}

.github/workflows/pypi-publish.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Publish tag to Pypi
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
9+
build_and_package:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
- name: install python
14+
uses: actions/setup-python@v3
15+
with:
16+
python-version: 3.9
17+
- name: Install dev tools
18+
run: |
19+
pip install -r dev_requirements.txt
20+
pip install twine wheel
21+
22+
- name: Build package
23+
run: |
24+
python setup.py build
25+
python setup.py sdist bdist_wheel
26+
27+
- name: Publish to Pypi
28+
uses: pypa/gh-action-pypi-publish@release/v1
29+
with:
30+
user: __token__
31+
password: ${{ secrets.PYPI_API_TOKEN }}

.github/workflows/release-drafter.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Release Drafter
2+
3+
on:
4+
push:
5+
# branches to consider in the event; optional, defaults to all
6+
branches:
7+
- master
8+
9+
jobs:
10+
update_release_draft:
11+
runs-on: ubuntu-latest
12+
steps:
13+
# Drafts your next Release notes as Pull Requests are merged into "master"
14+
- uses: release-drafter/release-drafter@v5
15+
with:
16+
# (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml
17+
config-name: release-drafter-config.yml
18+
env:
19+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/stale-issues.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: "Close stale issues"
2+
on:
3+
schedule:
4+
- cron: "0 0 * * *"
5+
6+
jobs:
7+
stale:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/stale@v3
11+
with:
12+
repo-token: ${{ secrets.GITHUB_TOKEN }}
13+
stale-issue-message: 'This issue is marked stale. It will be closed in 30 days if it is not updated.'
14+
stale-pr-message: 'This pull request is marked stale. It will be closed in 30 days if it is not updated.'
15+
days-before-stale: 365
16+
days-before-close: 30
17+
stale-issue-label: "Stale"
18+
stale-pr-label: "Stale"
19+
operations-per-run: 10
20+
remove-stale-when-updated: true

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,10 @@ vagrant/.vagrant
1111
.eggs
1212
.idea
1313
.coverage
14+
env
15+
venv
16+
coverage.xml
17+
.venv*
18+
*.xml
19+
.coverage*
20+
docker/stunnel/keys

.mypy.ini

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
[mypy]
2+
#, docs/examples, tests
3+
files = redis
4+
check_untyped_defs = True
5+
follow_imports_for_stubs asyncio.= True
6+
#disallow_any_decorated = True
7+
disallow_subclassing_any = True
8+
#disallow_untyped_calls = True
9+
disallow_untyped_decorators = True
10+
#disallow_untyped_defs = True
11+
implicit_reexport = False
12+
no_implicit_optional = True
13+
show_error_codes = True
14+
strict_equality = True
15+
warn_incomplete_stub = True
16+
warn_redundant_casts = True
17+
warn_unreachable = True
18+
warn_unused_ignores = True
19+
disallow_any_unimported = True
20+
#warn_return_any = True
21+
22+
[mypy-redis.asyncio.lock]
23+
# TODO: Remove once locks has been rewritten
24+
ignore_errors = True

0 commit comments

Comments
 (0)