Skip to content

Commit

Permalink
Merge branch 'release-1.2' into node/tjz-example
Browse files Browse the repository at this point in the history
  • Loading branch information
cyip10 authored Nov 29, 2024
2 parents 370e2f3 + 031dfe5 commit 383252f
Show file tree
Hide file tree
Showing 10 changed files with 63 additions and 41 deletions.
2 changes: 1 addition & 1 deletion .github/DEVELOPER.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ We use dynamic matrices for our CI/CD workflows, which are created using the `cr
4. It generates three matrices:
- Engine matrix: Defines the types and versions of the engine to test against, for example Valkey 7.2.5.
- Host matrix: Defines the host platforms to run the tests on, for example Ubuntu on ARM64.
- Language-version matrix: Defines the supported versions of languages, for example python 3.8.
- Language-version matrix: Defines the supported versions of languages, for example python 3.9.

#### Outputs

Expand Down
4 changes: 2 additions & 2 deletions .github/json_matrices/supported-languages-versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
},
{
"language": "python",
"versions": ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"],
"always-run-versions": ["3.8", "3.13"]
"versions": ["3.9", "3.10", "3.11", "3.12", "3.13"],
"always-run-versions": ["3.9", "3.13"]
},
{
"language": "node",
Expand Down
57 changes: 44 additions & 13 deletions .github/workflows/pypi-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ jobs:
if: ${{ !contains(matrix.build.RUNNER, 'self-hosted') }}
uses: actions/setup-python@v5
with:
python-version: "3.12"
python-version: "3.13"

- name: Update package version in config.toml
uses: ./.github/workflows/update-glide-version
Expand Down Expand Up @@ -146,22 +146,25 @@ jobs:
with:
working-directory: ./python
target: ${{ matrix.build.TARGET }}
args: --release --strip --out wheels -i ${{ github.event_name != 'pull_request' && 'python3.8 python3.9 python3.10 python3.11 python3.12 python3.13' || 'python3.12' }}
args: --release --strip --out wheels -i ${{ github.event_name != 'pull_request' && 'python3.9 python3.10 python3.11 python3.12 python3.13' || 'python3.12' }}
manylinux: auto
container: ${{ matrix.build.CONTAINER != '' && matrix.build.CONTAINER || '2014' }}
before-script-linux: |
# Install protobuf compiler
if [[ $(`which apt`) != '' ]]
then
echo "installing unzip and curl"
apt install unzip curl -y
apt-get update
apt install unzip curl python3.13 -y
fi
PB_REL="https://github.com/protocolbuffers/protobuf/releases"
ARCH=`uname -p`
if [[ $ARCH == 'x86_64' ]]; then
PROTOC_ARCH="x86_64"
elif [[ $ARCH == 'aarch64' ]]; then
PROTOC_ARCH="aarch_64"
export CC_aarch64_unknown_linux_gnu=aarch64-linux-gnu-gcc
export CFLAGS_aarch64_unknown_linux_gnu="-march=armv8-a"
else
echo "Running on unsupported architecture: $ARCH. Expected one of: ['x86_64', 'aarch64']"
exit 1
Expand All @@ -174,10 +177,10 @@ jobs:
if: startsWith(matrix.build.NAMED_OS, 'darwin')
uses: PyO3/maturin-action@v1
with:
maturin-version: latest
maturin-version: 0.14.17
working-directory: ./python
target: ${{ matrix.build.TARGET }}
args: --release --strip --out wheels -i ${{ github.event_name != 'pull_request' && 'python3.8 python3.9 python3.10 python3.11 python3.12 python3.13' || 'python3.12' }}
args: --release --strip --out wheels -i ${{ github.event_name != 'pull_request' && 'python3.9 python3.10 python3.11 python3.12 python3.13' || 'python3.12' }}

- name: Upload Python wheels
if: github.event_name != 'pull_request'
Expand Down Expand Up @@ -217,6 +220,10 @@ jobs:
matrix:
build: ${{ fromJson(needs.load-platform-matrix.outputs.PLATFORM_MATRIX) }}
steps:
- name: Setup self-hosted runner access
if: ${{ matrix.build.TARGET == 'aarch64-unknown-linux-gnu' }}
run: sudo chown -R $USER:$USER /home/ubuntu/actions-runner/_work/valkey-glide

- name: checkout
uses: actions/checkout@v4

Expand All @@ -225,23 +232,43 @@ jobs:
with:
python-version: 3.12

- name: Install engine
uses: ./.github/workflows/install-engine
with:
version: "8.0"
- name: Install engine Ubuntu ARM
if: ${{ matrix.build.TARGET == 'aarch64-unknown-linux-gnu' }}
shell: bash
# in self hosted runner we first want to check that engine is not already installed
run: |
if [[ $(`which redis-server`) == '' ]]
then
sudo apt-get update
sudo apt-get install -y redis-server
else
echo "Redis is already installed"
fi
- name: Install engine Ubuntu x86
if: ${{ matrix.build.TARGET == 'x86_64-unknown-linux-gnu' }}
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y redis-server
- name: Install engine MacOS
if: ${{ matrix.build.OS == 'macos' }}
shell: bash
run: |
brew install redis
- name: Check if RC and set a distribution tag for the package
shell: bash
run: |
if [[ "${GITHUB_REF:11}" == *"rc"* ]]
then
echo "This is a release candidate"
export pip_pre="--pre"
echo "PIP_PRE=true" >> $GITHUB_ENV
else
echo "This is a stable release"
export pip_pre=""
echo "PIP_PRE=false" >> $GITHUB_ENV
fi
echo "PIP_PRE=${pip_pre}" >> $GITHUB_ENV
- name: Run the tests
shell: bash
Expand All @@ -250,7 +277,11 @@ jobs:
python -m venv venv
source venv/bin/activate
pip install -U pip
pip install ${PIP_PRE} valkey-glide
if [[ "${{ env.PIP_PRE }}" == "true" ]]; then
pip install --pre valkey-glide
else
pip install valkey-glide
fi
python rc_test.py
# Reset the repository to make sure we get the clean checkout of the action later in other actions.
Expand Down
14 changes: 4 additions & 10 deletions node/npm/glide/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ function initialize() {
const {
AggregationType,
BaseScanOptions,
ScanOptions,
ZScanOptions,
HScanOptions,
BitEncoding,
Expand Down Expand Up @@ -119,6 +120,7 @@ function initialize() {
GlideClientConfiguration,
GlideJson,
GlideFt,
Field,
TextField,
TagField,
NumericField,
Expand All @@ -138,7 +140,6 @@ function initialize() {
FtAggregateApply,
FtAggregateReturnType,
FtSearchReturnType,
FtProfileOtions,
GlideRecord,
GlideString,
JsonGetOptions,
Expand Down Expand Up @@ -175,16 +176,13 @@ function initialize() {
InfBoundary,
KeyWeight,
Boundary,
UpdateOptions,
ProtocolVersion,
RangeByIndex,
RangeByScore,
RangeByLex,
ReadFrom,
ServerCredentials,
SortClusterOptions,
SortOptions,
SortedSetRange,
StreamGroupOptions,
StreamTrimOptions,
StreamAddOptions,
Expand Down Expand Up @@ -215,7 +213,6 @@ function initialize() {
createLeakedDouble,
createLeakedMap,
createLeakedString,
parseInfoResponse,
Script,
ObjectType,
ClusterScanCursor,
Expand All @@ -233,6 +230,7 @@ function initialize() {
module.exports = {
AggregationType,
BaseScanOptions,
ScanOptions,
HScanOptions,
ZScanOptions,
BitEncoding,
Expand All @@ -253,6 +251,7 @@ function initialize() {
DecoderOption,
GeoAddOptions,
GlideFt,
Field,
TextField,
TagField,
NumericField,
Expand All @@ -272,7 +271,6 @@ function initialize() {
FtAggregateApply,
FtAggregateReturnType,
FtSearchReturnType,
FtProfileOtions,
GlideRecord,
GlideJson,
GlideString,
Expand Down Expand Up @@ -326,16 +324,13 @@ function initialize() {
InfBoundary,
KeyWeight,
Boundary,
UpdateOptions,
ProtocolVersion,
RangeByIndex,
RangeByScore,
RangeByLex,
ReadFrom,
ServerCredentials,
SortClusterOptions,
SortOptions,
SortedSetRange,
StreamGroupOptions,
StreamTrimOptions,
StreamAddOptions,
Expand Down Expand Up @@ -364,7 +359,6 @@ function initialize() {
createLeakedDouble,
createLeakedMap,
createLeakedString,
parseInfoResponse,
Script,
ObjectType,
ClusterScanCursor,
Expand Down
2 changes: 1 addition & 1 deletion python/Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ name = "pypi"
[dev-packages]

[requires]
python_version = "3.8"
python_version = "3.9"
2 changes: 1 addition & 1 deletion python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ macOS:

| Python Version |
|----------------|
| 3.8 |
| 3.9 |
| 3.10 |
| 3.11 |
| 3.12 |
| 3.13 |

## Installation and Setup

Expand Down
10 changes: 5 additions & 5 deletions python/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[build-system]
requires = ["maturin>=0.13,<0.14"]
requires = ["maturin==0.14.17"]
build-backend = "maturin"

[project]
name = "valkey-glide"
requires-python = ">=3.8"
requires-python = ">=3.9"
dependencies = [
"async-timeout>=4.0.2; python_version < '3.11'",
"typing-extensions>=4.8.0; python_version < '3.11'",
"protobuf>=3.20"
"protobuf>=3.20",
]
classifiers = [
"Topic :: Database",
Expand All @@ -30,7 +30,7 @@ max-line-length = 127
extend-ignore = ['E203']

[tool.black]
target-version = ['py38', 'py39', 'py310', 'py311', 'py312']
target-version = ['py39', 'py310', 'py311', 'py312', 'py313']

[tool.mypy]
exclude = [ 'submodules', 'utils/release-candidate-testing' ]
exclude = ['submodules', 'utils/release-candidate-testing']
8 changes: 3 additions & 5 deletions python/python/glide/async_commands/standalone_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,17 @@

from __future__ import annotations

from typing import Any, Dict, List, Mapping, Optional, Set, Union, cast
from typing import Dict, List, Mapping, Optional, Union, cast

from glide.async_commands.command_args import Limit, ObjectType, OrderBy
from glide.async_commands.command_args import ObjectType
from glide.async_commands.core import (
CoreCommands,
FlushMode,
FunctionRestorePolicy,
InfoSection,
_build_sort_args,
)
from glide.async_commands.transaction import Transaction
from glide.constants import (
OK,
TOK,
TEncodable,
TFunctionListResponse,
Expand All @@ -23,7 +21,7 @@
)
from glide.protobuf.command_request_pb2 import RequestType

from ..glide import ClusterScanCursor, Script
from ..glide import Script


class StandaloneCommands(CoreCommands):
Expand Down
2 changes: 1 addition & 1 deletion python/python/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
ReadFrom,
ServerCredentials,
)
from glide.exceptions import ClosingError, RequestError
from glide.exceptions import ClosingError
from glide.glide_client import GlideClient, GlideClusterClient, TGlideClient
from glide.logger import Level as logLevel
from glide.logger import Logger
Expand Down
3 changes: 1 addition & 2 deletions python/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
async-timeout==4.0.2;python_version<"3.11"
maturin==0.13.0
maturin==0.14.17 # higher version break the needs structure changes, the name of the project is not the same as the package name, and the naming both glide create a circular dependency - TODO: fix this
protobuf==3.20.*
pytest
pytest-asyncio
typing_extensions==4.8.0;python_version<"3.11"
pytest-html
pyrsistent

0 comments on commit 383252f

Please sign in to comment.