Skip to content

Commit

Permalink
Added support for Memcached in Windows (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nusnus authored Oct 12, 2023
1 parent 9ec6ced commit cf50961
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 4 deletions.
17 changes: 16 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ version = "1.0.0a1"

[tool.poetry.dependencies]
python = ">= 3.8,<4.0"
celery = { version = "^5.3", extras = ["redis", "memcache"] }
celery = { version = "^5.3", extras = ["redis", "memcache", "pymemcache"] }
retry = "^0.9.2"
pytest-docker-tools = "^3.1.3"

Expand Down
7 changes: 6 additions & 1 deletion src/pytest_celery/vendors/memcached/container.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
import pylibmc as memcache
import sys

if sys.platform == "win32":
import memcache
else:
import pylibmc as memcache

from pytest_celery.api.container import CeleryTestContainer
from pytest_celery.vendors.memcached.defaults import MEMCACHED_ENV
Expand Down
2 changes: 1 addition & 1 deletion src/pytest_celery/vendors/worker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ ENV PYTHONDONTWRITEBYTECODE=1

# Install Python dependencies
RUN pip install --no-cache-dir --upgrade pip \
&& pip install --no-cache-dir celery[redis,memcache]${CELERY_VERSION:+==$CELERY_VERSION}
&& pip install --no-cache-dir celery[redis,memcache,pymemcache]${CELERY_VERSION:+==$CELERY_VERSION}

# The workdir must be /app
WORKDIR /app
Expand Down

0 comments on commit cf50961

Please sign in to comment.