Skip to content

Commit ca6ae7d

Browse files
author
Andrew Brookins
committed
Merge branch 'main' into asyncio
2 parents b2c2dd9 + 1e369e3 commit ca6ae7d

Some content is hidden

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

47 files changed

+3288
-763
lines changed

.github/workflows/ci.yml

+136-122
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ on:
1212
- '[0-9].[0-9]+'
1313
- 'update/pre-commit-autoupdate'
1414
schedule:
15-
- cron: '0 6 * * *' # Daily 6AM UTC build
15+
- cron: '0 6 * * *' # Daily 6AM UTC build
1616

1717

1818
jobs:
@@ -22,63 +22,57 @@ jobs:
2222
runs-on: ubuntu-latest
2323
timeout-minutes: 5
2424
steps:
25-
- name: Checkout
26-
uses: actions/[email protected]
27-
- name: Setup Python 3.9
28-
uses: actions/setup-python@v2
29-
with:
30-
python-version: 3.9
31-
#----------------------------------------------
32-
# ----- install & configure poetry -----
33-
#----------------------------------------------
34-
- name: Install Poetry
35-
uses: snok/install-poetry@v1
36-
with:
37-
virtualenvs-create: true
38-
virtualenvs-in-project: true
39-
installer-parallel: true
40-
#----------------------------------------------
41-
# load cached venv if cache exists
42-
#----------------------------------------------
43-
- name: Load cached venv
44-
id: cached-poetry-dependencies
45-
uses: actions/cache@v2
46-
with:
47-
path: .venv
48-
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
49-
#----------------------------------------------
50-
# install dependencies if cache does not exist
51-
#----------------------------------------------
52-
- name: Install dependencies
53-
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
54-
run: poetry install --no-interaction --no-root
55-
#----------------------------------------------
56-
# install your root project, if required
57-
#----------------------------------------------
58-
- name: Install library
59-
run: poetry install --no-interaction
60-
#----------------------------------------------
61-
# run test suite
62-
#----------------------------------------------
63-
- name: Run linter
64-
run: |
65-
make lint
66-
# - name: Prepare twine checker
67-
# run: |
68-
# pip install -U twine wheel
69-
# python setup.py sdist bdist_wheel
70-
# - name: Run twine checker
71-
# run: |
72-
# twine check dist/*
25+
- name: Checkout
26+
uses: actions/[email protected]
27+
- name: Setup Python 3.9
28+
uses: actions/setup-python@v2
29+
with:
30+
python-version: 3.9
31+
#----------------------------------------------
32+
# ----- install & configure poetry -----
33+
#----------------------------------------------
34+
- name: Install Poetry
35+
uses: snok/install-poetry@v1
36+
with:
37+
virtualenvs-create: true
38+
virtualenvs-in-project: true
39+
installer-parallel: true
40+
#----------------------------------------------
41+
# load cached venv if cache exists
42+
#----------------------------------------------
43+
- name: Load cached venv
44+
id: cached-poetry-dependencies
45+
uses: actions/cache@v2
46+
with:
47+
path: .venv
48+
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
49+
#----------------------------------------------
50+
# install dependencies if cache does not exist
51+
#----------------------------------------------
52+
- name: Install dependencies
53+
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
54+
run: poetry install --no-interaction --no-root
55+
#----------------------------------------------
56+
# install your root project, if required
57+
#----------------------------------------------
58+
- name: Install library
59+
run: poetry install --no-interaction
60+
#----------------------------------------------
61+
# run test suite
62+
#----------------------------------------------
63+
- name: Run linter
64+
run: |
65+
make dist
66+
make lint
7367
7468
test-unix:
7569
name: Test Unix
7670
needs: lint
7771
strategy:
7872
matrix:
79-
os: [ubuntu-latest]
80-
pyver: [3.6, 3.7, 3.8, 3.9, pypy3]
81-
redismod: ["edge", "preview"]
73+
os: [ ubuntu-latest ]
74+
pyver: [ 3.6, 3.7, 3.8, 3.9, pypy3 ]
75+
redismod: [ "preview" ]
8276
fail-fast: false
8377
services:
8478
redis:
@@ -98,75 +92,95 @@ jobs:
9892
OS: ${{ matrix.os }}
9993
INSTALL_DIR: ${{ github.workspace }}/redis
10094
steps:
101-
- name: Checkout
102-
uses: actions/[email protected].4
103-
- name: Setup Python ${{ matrix.pyver }}
104-
uses: actions/setup-python@v2
105-
with:
106-
python-version: ${{ matrix.pyver }}
107-
#----------------------------------------------
108-
# ----- install & configure poetry -----
109-
#----------------------------------------------
110-
- name: Install Poetry
111-
uses: snok/install-poetry@v1
112-
with:
113-
virtualenvs-create: true
114-
virtualenvs-in-project: true
115-
installer-parallel: true
116-
#----------------------------------------------
117-
# load cached venv if cache exists
118-
#----------------------------------------------
119-
- name: Load cached venv
120-
id: cached-poetry-dependencies
121-
uses: actions/cache@v2
122-
with:
123-
path: .venv
124-
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
125-
#----------------------------------------------
126-
# install dependencies if cache does not exist
127-
#----------------------------------------------
128-
- name: Install dependencies
129-
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
130-
run: poetry install --no-interaction --no-root
131-
#----------------------------------------------
132-
# install your root project, if required
133-
#----------------------------------------------
134-
- name: Install library
135-
run: poetry install --no-interaction
136-
- name: Run unittests (redismod:${{ matrix.redismod }}, ${{ matrix.os }})
137-
run: |
138-
make test
139-
poetry run coverage xml
140-
- name: Upload coverage
141-
uses: codecov/[email protected]
142-
with:
143-
file: ./coverage.xml
144-
flags: unit
145-
env_vars: OS
146-
fail_ci_if_error: false
95+
- name: Checkout
96+
uses: actions/[email protected].5
97+
- name: Setup Python ${{ matrix.pyver }}
98+
uses: actions/setup-python@v2
99+
with:
100+
python-version: ${{ matrix.pyver }}
101+
#----------------------------------------------
102+
# ----- install & configure poetry -----
103+
#----------------------------------------------
104+
- name: Install Poetry
105+
uses: snok/install-poetry@v1
106+
with:
107+
virtualenvs-create: true
108+
virtualenvs-in-project: true
109+
installer-parallel: true
110+
#----------------------------------------------
111+
# load cached venv if cache exists
112+
#----------------------------------------------
113+
- name: Load cached venv
114+
id: cached-poetry-dependencies
115+
uses: actions/cache@v2
116+
with:
117+
path: .venv
118+
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
119+
#----------------------------------------------
120+
# install dependencies if cache does not exist
121+
#----------------------------------------------
122+
- name: Install dependencies
123+
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
124+
run: poetry install --no-interaction --no-root
125+
#----------------------------------------------
126+
# install your root project, if required
127+
#----------------------------------------------
128+
- name: Install library
129+
run: poetry install --no-interaction
130+
- name: Run unittests (redismod:${{ matrix.redismod }}, ${{ matrix.os }})
131+
run: |
132+
make test
133+
poetry run coverage xml
134+
- name: Upload coverage
135+
uses: codecov/[email protected]
136+
with:
137+
file: ./coverage.xml
138+
flags: unit
139+
env_vars: OS
140+
fail_ci_if_error: false
147141

148142
deploy:
149-
name: Deploy
150-
runs-on: ubuntu-latest
151-
needs: test-unix
152-
# Run only on pushing a tag
153-
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
154-
steps:
155-
- name: Checkout
156-
uses: actions/[email protected]
157-
- name: Setup Python 3.9
158-
uses: actions/setup-python@v2
159-
with:
160-
python-version: 3.9
161-
- name: Install dependencies
162-
run:
163-
python -m pip install -U pip wheel twine
164-
- name: Make dists
165-
run:
166-
python setup.py sdist bdist_wheel
167-
- name: PyPI upload
168-
env:
169-
TWINE_USERNAME: __token__
170-
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
171-
run: |
172-
twine upload dist/*
143+
name: Deploy
144+
runs-on: ubuntu-latest
145+
needs: test-unix
146+
# Run only on pushing a tag
147+
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
148+
steps:
149+
- name: Checkout
150+
uses: actions/[email protected]
151+
- name: Setup Python 3.9
152+
uses: actions/setup-python@v2
153+
with:
154+
python-version: 3.9
155+
- name: Install Poetry
156+
uses: snok/install-poetry@v1
157+
with:
158+
virtualenvs-create: true
159+
virtualenvs-in-project: true
160+
installer-parallel: true
161+
#----------------------------------------------
162+
# load cached venv if cache exists
163+
#----------------------------------------------
164+
- name: Load cached venv
165+
id: cached-poetry-dependencies
166+
uses: actions/cache@v2
167+
with:
168+
path: .venv
169+
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
170+
#----------------------------------------------
171+
# install dependencies if cache does not exist
172+
#----------------------------------------------
173+
- name: Install dependencies
174+
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
175+
run: poetry install --no-interaction --no-root
176+
#----------------------------------------------
177+
# install your root project, if required
178+
#----------------------------------------------
179+
- name: Install library
180+
run: poetry install --no-interaction
181+
- name: PyPI upload
182+
env:
183+
TWINE_USERNAME: __token__
184+
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
185+
run: |
186+
make upload

.gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -128,3 +128,9 @@ dmypy.json
128128
# Pyre type checker
129129
.pyre/
130130
data
131+
132+
# Makefile install checker
133+
.install.stamp
134+
135+
# Sync version of the library, via Unasync
136+
redis_om/

.install.stamp

Whitespace-only changes.

LICENSE

+22-17
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,26 @@
1-
The MIT License (MIT)
1+
Copyright 2021 Redis, Inc.
22

3-
Copyright (c) 2021-present Redis, Inc.
3+
Redistribution and use in source and binary forms, with or without modification,
4+
are permitted provided that the following conditions are met:
45

5-
Permission is hereby granted, free of charge, to any person obtaining a copy
6-
of this software and associated documentation files (the "Software"), to deal
7-
in the Software without restriction, including without limitation the rights
8-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9-
copies of the Software, and to permit persons to whom the Software is
10-
furnished to do so, subject to the following conditions:
6+
1. Redistributions of source code must retain the above copyright notice, this
7+
list of conditions and the following disclaimer.
118

12-
The above copyright notice and this permission notice shall be included in all
13-
copies or substantial portions of the Software.
9+
2. Redistributions in binary form must reproduce the above copyright notice,
10+
this list of conditions and the following disclaimer in the documentation and/or
11+
other materials provided with the distribution.
1412

15-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21-
SOFTWARE.
13+
3. Neither the name of the copyright holder nor the names of its contributors
14+
may be used to endorse or promote products derived from this software without
15+
specific prior written permission.
16+
17+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
21+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
24+
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

0 commit comments

Comments
 (0)