Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

version: 2
updates:
- package-ecosystem: "pip" # See documentation for possible values
- package-ecosystem: "uv" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "daily"
48 changes: 16 additions & 32 deletions .github/workflows/compatibility.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,18 @@ jobs:
python-version: ["3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v3
- name: Cache dependencies
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements/**') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
- name: Install uv and Python
uses: astral-sh/setup-uv@v6
with:
enable-cache: true
python-version: ${{ matrix.python-version }}
- name: Install dependencies
- name: Setup uv venv
run: |
python -m pip install --upgrade pip setuptools wheel
pip install -r requirements/dev.txt
python setup.py build
uv sync --locked --all-extras --group dev
- name: Lint with ruff
run: |
ruff check --select I coredis tests
ruff check coredis tests
uv run ruff check --select I coredis tests
uv run ruff check coredis tests
- name: Check types
run: |
mypy coredis
Expand Down Expand Up @@ -123,33 +115,25 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: Cache dependencies
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-${{ matrix.python-version }}-pip-${{ hashFiles('requirements/**') }}
restore-keys: |
${{ runner.os }}-${{ matrix.python-version }}-pip-
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
- name: Install uv and Python
uses: astral-sh/setup-uv@v6
with:
enable-cache: true
python-version: ${{ matrix.python-version }}
- name: Install dependencies
- name: Setup uv venv
run: |
python -m pip install --upgrade pip setuptools wheel
pip install -r requirements/ci.txt
python setup.py build
uv sync --locked --all-extras --group ci
- name: Compile extensions
if: ${{ matrix.extensions == 'True' }}
run: python setup.py build_ext --inplace --use-mypyc
run: uv run mypyc coredis/constants.py coredis/parser.py coredis/_packer.py
- name: Install uvloop
if: ${{ matrix.uvloop == 'True' }}
run:
pip install uvloop
uv pip install uvloop
- name: Install orjson
if: ${{ matrix.orjson == 'True' }}
run:
pip install orjson
uv pip install orjson
- name: Tests with coverage
env:
COREDIS_UVLOOP: ${{ matrix.uvloop }}
Expand All @@ -163,7 +147,7 @@ jobs:
echo "Runtime checks: $COREDIS_RUNTIME_CHECKS"
echo "UVLoop: $COREDIS_UVLOOP"
echo "CI: $CI"
pytest --reverse --reruns 2 --cov=coredis --cov-report=xml ${{ matrix.test_params }}
uv run pytest --reverse --reruns 2 --cov=coredis --cov-report=xml ${{ matrix.test_params }}
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4.2.0
env:
Expand Down
76 changes: 37 additions & 39 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,21 @@ jobs:
python-version: ["3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v3
- name: Cache dependencies
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements/**') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
- name: Install uv and Python
uses: astral-sh/setup-uv@v6
with:
enable-cache: true
python-version: ${{ matrix.python-version }}
- name: Install dependencies
- name: Setup uv venv
run: |
python -m pip install --upgrade pip setuptools wheel
pip install -r requirements/dev.txt
python setup.py build
uv sync --locked --all-extras --group dev
- name: Lint with ruff
run: |
ruff check --select I coredis tests
ruff check coredis tests
uv run ruff check --select I coredis tests
uv run ruff check coredis tests
- name: Check types
run: |
mypy coredis
uv run mypy coredis
- name: Check auto generated sources
run: |
make templated-sources
Expand Down Expand Up @@ -99,33 +91,25 @@ jobs:
label: ""
steps:
- uses: actions/checkout@v3
- name: Cache dependencies
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-${{ matrix.python-version }}-pip-${{ hashFiles('requirements/**') }}
restore-keys: |
${{ runner.os }}-${{ matrix.python-version }}-pip-
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
- name: Install uv and Python
uses: astral-sh/setup-uv@v6
with:
enable-cache: true
python-version: ${{ matrix.python-version }}
- name: Install dependencies
- name: Setup uv venv
run: |
python -m pip install --upgrade pip setuptools wheel
pip install -r requirements/ci.txt
python setup.py build
uv sync --locked --all-extras --group ci
- name: Compile extensions
if: ${{ matrix.extensions == 'True' }}
run: python setup.py build_ext --inplace --use-mypyc
run: uv run mypyc coredis/constants.py coredis/parser.py coredis/_packer.py
- name: Install uvloop
if: ${{ matrix.uvloop == 'True' }}
run:
pip install uvloop
uv pip install uvloop
- name: Install orjson
if: ${{ matrix.orjson == 'True' }}
run:
pip install orjson
uv pip install orjson
- name: Tests
env:
COREDIS_UVLOOP: ${{ matrix.uvloop }}
Expand All @@ -139,7 +123,7 @@ jobs:
echo "Runtime checks: $COREDIS_RUNTIME_CHECKS"
echo "UVLoop: $COREDIS_UVLOOP"
echo "CI: $CI"
pytest --reverse --reruns 2 --cov=coredis --cov-report=xml ${{ matrix.test_params }}
uv run pytest --reverse --reruns 2 --cov=coredis --cov-report=xml ${{ matrix.test_params }}
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4.2.0
env:
Expand Down Expand Up @@ -185,6 +169,13 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install uv and Python
uses: astral-sh/setup-uv@v6
with:
enable-cache: true
- name: Setup uv venv
run: |
uv sync --locked --all-extras --group dev
- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v2
Expand All @@ -194,9 +185,9 @@ jobs:
only: ${{ matrix.only }}
env:
CIBW_BUILD_VERBOSITY: 3
CIBW_BUILD_FRONTEND: "build"
CIBW_CONFIG_SETTINGS: "--build-option=--use-mypyc"
CIBW_TEST_COMMAND: "python -c 'import coredis'"
CIBW_BUILD_FRONTEND: "build[uv]"
CIBW_TEST_COMMAND: "uv run python -c 'import coredis'"
USE_MYPYC: true
- uses: actions/upload-artifact@v4
with:
name: wheels-${{matrix.only}}
Expand All @@ -209,10 +200,13 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install uv and Python
uses: astral-sh/setup-uv@v6
with:
enable-cache: true
- name: Build wheels
run: |
python -m pip install build
PURE_PYTHON=1 python -m build --wheel
PURE_PYTHON=1 uv build
- uses: actions/upload-artifact@v4
with:
name: pure_wheels
Expand All @@ -224,9 +218,13 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install uv and Python
uses: astral-sh/setup-uv@v6
with:
enable-cache: true
- name: Build sdist
run: |
pipx run build --sdist
uv build --sdist
- uses: actions/upload-artifact@v4
with:
name: src_dist
Expand Down
13 changes: 4 additions & 9 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,10 @@ build:
os: ubuntu-20.04
tools:
python: "3.13"
# You can also specify other tool versions:
# nodejs: "16"
# rust: "1.55"
# golang: "1.17"

# Build documentation in the docs/ directory with Sphinx
commands:
- pip install uv
- cd docs
- uv run --group docs python -m sphinx docs/source $READTHEDOCS_OUTPUT/html -b html
sphinx:
configuration: docs/source/conf.py

python:
install:
- requirements: requirements/docs.txt
1 change: 0 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ include README.md
include HISTORY.rst
exclude __pycache__
recursive-exclude tests *
recursive-include requirements *.txt
recursive-include coredis *.pyi
recursive-include coredis *.lua
include versioneer.py
Expand Down
24 changes: 12 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
lint:
ruff check --select I coredis tests
ruff check coredis tests
ruff format --check coredis tests
mypy coredis
uv run ruff check --select I coredis tests
uv run ruff check coredis tests
uv run ruff format --check coredis tests
uv run mypy coredis

lint-fix:
ruff check --select I --fix coredis tests
ruff check --fix coredis tests
ruff format coredis tests
mypy coredis
uv run ruff check --select I --fix coredis tests
uv run ruff check --fix coredis tests
uv run ruff format coredis tests
uv run mypy coredis

DEBUG := False

coverage-docs:
rm -rf docs/source/compatibility.rst
PYTHONPATH=${CURDIR} python -m scripts.code_gen --debug=${DEBUG} coverage-doc
PYTHONPATH=${CURDIR} uv run python -m scripts.code_gen --debug=${DEBUG} coverage-doc

templated-sources:
PYTHONPATH=${CURDIR} python -m scripts.code_gen token-enum
PYTHONPATH=${CURDIR} python -m scripts.code_gen command-constants
PYTHONPATH=${CURDIR} python -m scripts.code_gen cluster-key-extraction
PYTHONPATH=${CURDIR} uv run python -m scripts.code_gen token-enum
PYTHONPATH=${CURDIR} uv run python -m scripts.code_gen command-constants
PYTHONPATH=${CURDIR} uv run python -m scripts.code_gen cluster-key-extraction

benchmark:
./scripts/benchmark.sh
Expand Down
3 changes: 1 addition & 2 deletions docs/source/handbook/development.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ The unit tests will lazily initialize the containers required per test using the

.. code-block:: bash

$ pip install -r requirements/test.txt
$ pytest tests/
$ uv run pytest tests


To reduce unnecessary setup and tear down the containers are left running after the tests complete. To cleanup::
Expand Down
Loading
Loading