Skip to content

Commit c9edd02

Browse files
committed
Merge remote-tracking branch 'origin/main' into types
2 parents 3c672b3 + 03320e6 commit c9edd02

File tree

11 files changed

+82
-20
lines changed

11 files changed

+82
-20
lines changed

.github/ISSUE_TEMPLATE.md renamed to .github/ISSUE_TEMPLATE/1-bug.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1-
Thanks for wanting to report an issue you've found in valkey-py. Please delete this text and fill in the template below.
2-
It is of course not always possible to reduce your code to a small test case, but it's highly appreciated to have as much data as possible. Thank you!
1+
<!--
2+
Thanks for reporting an issue you've found in valkey-py.
3+
Please delete this text and fill in the template below.
4+
It is of course not always possible to reduce your code to a
5+
small test case, but it's highly appreciated to have as much
6+
data as possible. Thank you!
7+
-->
38

49
**Version**: What valkey-py and what valkey version is the issue happening on?
510

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<!--
2+
Thanks for opening a feature request!
3+
-->
4+
5+
**Description**: Description of your feature request
6+
7+
**Example use cases**: List some possible use cases for this feature

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
blank_issues_enabled: true
2+
contact_links:
3+
- name: Security Issues
4+
url: mailto:[email protected]
5+
about: Please report security vulnerabilities here.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
### Pull Request check-list
22

3-
_Please make sure to review and check all of these items:_
3+
<!-- Please make sure to review and check all of these items: -->
44

55
- [ ] Do tests and lints pass with this change?
66
- [ ] 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)?
99
- [ ] Is there an example added to the examples folder (if applicable)?
1010

11-
_NOTE: these things are not required to open a PR and can be done
12-
afterwards / while the PR is open._
11+
<!-- NOTE: these things are not required to open a PR and can be done
12+
afterwards / while the PR is open. -->
1313

1414
### Description of change
1515

16-
_Please provide a description of the change here._
16+
<!-- Please provide a description of the change here. -->

.github/workflows/integration.yaml

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,29 @@ jobs:
5050
pip install -r dev_requirements.txt
5151
invoke linters
5252
53+
populate-cache:
54+
runs-on: ubuntu-latest
55+
timeout-minutes: 60
56+
name: Update docker cache
57+
steps:
58+
- uses: actions/checkout@v4
59+
- name: Cache docker images
60+
id: custom-cache
61+
uses: actions/cache@v3
62+
with:
63+
path: ./custom-cache/
64+
key: custom-cache
65+
- if: ${{ steps.custom-cache.outputs.cache-hit != 'true' || github.event_name == 'schedule' }}
66+
name: Update Cache
67+
run: |
68+
mkdir -p ./custom-cache/
69+
docker compose --profile all build
70+
docker pull valkey/valkey:latest
71+
docker save valkey-py-stunnel:latest valkey-py-cluster:latest valkey/valkey:latest -o ./custom-cache/all.tar
72+
5373
run-tests:
5474
runs-on: ubuntu-latest
75+
needs: [populate-cache]
5576
timeout-minutes: 60
5677
strategy:
5778
max-parallel: 15
@@ -70,6 +91,17 @@ jobs:
7091
with:
7192
python-version: ${{ matrix.python-version }}
7293
cache: 'pip'
94+
95+
- name: Cache docker images
96+
id: custom-cache
97+
uses: actions/cache@v3
98+
with:
99+
path: ./custom-cache/
100+
fail-on-cache-miss: true
101+
key: custom-cache
102+
- name: Use Cache
103+
run: docker image load -i ./custom-cache/all.tar
104+
73105
- name: run tests
74106
run: |
75107
pip install -U setuptools wheel
@@ -79,7 +111,11 @@ jobs:
79111
pip install "libvalkey>=4.0.0"
80112
fi
81113
invoke devenv
82-
sleep 10 # time to settle
114+
if [[ "${{matrix.test-type}}" == "standalone" ]]; then
115+
./util/wait-for-it.sh localhost:6379
116+
else
117+
./util/wait-for-it.sh localhost:16379
118+
fi
83119
invoke ${{matrix.test-type}}-tests --protocol=${{ matrix.protocol-version }}
84120
if [[ "${{matrix.python-version}}" != pypy-* ]]; then
85121
invoke ${{matrix.test-type}}-tests --uvloop --protocol=${{ matrix.protocol-version }}
@@ -111,6 +147,17 @@ jobs:
111147
- uses: actions/setup-python@v5
112148
with:
113149
python-version: 3.9
150+
151+
- name: Cache docker images
152+
id: custom-cache
153+
uses: actions/cache@v3
154+
with:
155+
path: ./custom-cache/
156+
fail-on-cache-miss: true
157+
key: custom-cache
158+
- name: Use Cache
159+
run: docker image load -i ./custom-cache/all.tar
160+
114161
- name: Run installed unit tests
115162
run: |
116163
bash .github/workflows/install_and_test.sh ${{ matrix.extension }}

INSTALL

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
Please use
33
python setup.py install
44

5-
and report errors to Salvatore Mesoraca ([email protected])
5+
and report errors to via https://github.com/valkey-io/valkey-py/issues/new
66

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
async-timeout>=4.0.3
1+
async-timeout>=4.0.3; python_version<"3.11"

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
long_description_content_type="text/markdown",
99
keywords=["Valkey", "key-value store", "database"],
1010
license="MIT",
11-
version="6.0.0",
11+
version="6.0.1",
1212
packages=find_packages(
1313
include=[
1414
"valkey",
@@ -36,7 +36,7 @@
3636
author_email="[email protected]",
3737
python_requires=">=3.8",
3838
install_requires=[
39-
'async-timeout>=4.0.3; python_version<="3.12"',
39+
'async-timeout>=4.0.3; python_version<"3.11"',
4040
],
4141
classifiers=[
4242
"Development Status :: 5 - Production/Stable",

tests/test_asyncio/test_lock.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,7 @@ async def test_blocking_timeout(self, r):
112112
lock2 = self.get_lock(r, "foo", sleep=sleep, blocking_timeout=bt)
113113
start = asyncio.get_running_loop().time()
114114
assert not await lock2.acquire()
115-
# The elapsed duration should be less than the total blocking_timeout
116-
assert bt >= (asyncio.get_running_loop().time() - start) > bt - sleep
115+
assert (asyncio.get_running_loop().time() - start) > (bt - sleep)
117116
await lock1.release()
118117

119118
async def test_context_manager(self, r):

tests/test_lock.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,10 @@ def test_blocking_timeout(self, r):
101101
assert lock1.acquire(blocking=False)
102102
bt = 0.4
103103
sleep = 0.05
104-
fudge_factor = 0.1
105104
lock2 = self.get_lock(r, "foo", sleep=sleep, blocking_timeout=bt)
106105
start = time.monotonic()
107106
assert not lock2.acquire()
108-
# The elapsed duration should be less than the total blocking_timeout
109-
assert (bt + fudge_factor) > (time.monotonic() - start) > bt - sleep
107+
assert (time.monotonic() - start) > (bt - sleep)
110108
lock1.release()
111109

112110
def test_context_manager(self, r):
@@ -120,12 +118,10 @@ def test_context_manager_blocking_timeout(self, r):
120118
with self.get_lock(r, "foo", blocking=False):
121119
bt = 0.4
122120
sleep = 0.05
123-
fudge_factor = 0.05
124121
lock2 = self.get_lock(r, "foo", sleep=sleep, blocking_timeout=bt)
125122
start = time.monotonic()
126123
assert not lock2.acquire()
127-
# The elapsed duration should be less than the total blocking_timeout
128-
assert (bt + fudge_factor) > (time.monotonic() - start) > bt - sleep
124+
assert (time.monotonic() - start) > (bt - sleep)
129125

130126
def test_context_manager_raises_when_locked_not_acquired(self, r):
131127
r.set("foo", "bar")

0 commit comments

Comments
 (0)