lol

python3Packages.django-cachalot: init at 2.5.3

authored by

Raito Bezarius and committed by
Jonas Heinrich
8fb44a49 9950021c

+121
+54
pkgs/development/python-modules/django-cachalot/default.nix
··· 1 + { lib 2 + , buildPythonPackage 3 + , fetchFromGitHub 4 + , django 5 + , django-debug-toolbar 6 + , psycopg2 7 + , beautifulsoup4 8 + , python 9 + }: 10 + 11 + buildPythonPackage rec { 12 + pname = "django-cachalot"; 13 + version = "2.5.3"; 14 + format = "setuptools"; 15 + 16 + src = fetchFromGitHub { 17 + owner = "noripyt"; 18 + repo = "django-cachalot"; 19 + rev = "v${version}"; 20 + hash = "sha256-ayAN+PgK3aIpt4R8aeC6c6mRGTnfObycmkoXPTjx4WI="; 21 + }; 22 + 23 + patches = [ 24 + # Disable tests for unsupported caching and database types which would 25 + # require additional running backends 26 + ./disable-unsupported-tests.patch 27 + ]; 28 + 29 + propagatedBuildInputs = [ 30 + django 31 + ]; 32 + 33 + checkInputs = [ 34 + beautifulsoup4 35 + django-debug-toolbar 36 + psycopg2 37 + ]; 38 + 39 + pythonImportsCheck = [ "cachalot" ]; 40 + 41 + checkPhase = '' 42 + runHook preCheck 43 + ${python.interpreter} runtests.py 44 + runHook postCheck 45 + ''; 46 + 47 + meta = with lib; { 48 + description = "No effort, no worry, maximum performance"; 49 + homepage = "https://github.com/noripyt/django-cachalot"; 50 + changelog = "https://github.com/noripyt/django-cachalot/blob/${src.rev}/CHANGELOG.rst"; 51 + license = licenses.bsd3; 52 + maintainers = with maintainers; [ onny ]; 53 + }; 54 + }
+65
pkgs/development/python-modules/django-cachalot/disable-unsupported-tests.patch
··· 1 + diff --git a/cachalot/tests/models.py b/cachalot/tests/models.py 2 + index 8c48640..817602c 100644 3 + --- a/cachalot/tests/models.py 4 + +++ b/cachalot/tests/models.py 5 + @@ -77,11 +77,6 @@ class PostgresModel(Model): 6 + date_range = DateRangeField(null=True, blank=True) 7 + datetime_range = DateTimeRangeField(null=True, blank=True) 8 + 9 + - class Meta: 10 + - # Tests schema name in table name. 11 + - db_table = '"public"."cachalot_postgresmodel"' 12 + - 13 + - 14 + class UnmanagedModel(Model): 15 + name = CharField(max_length=50) 16 + 17 + diff --git a/settings.py b/settings.py 18 + index 19d7560..7095367 100644 19 + --- a/settings.py 20 + +++ b/settings.py 21 + @@ -8,18 +8,9 @@ DATABASES = { 22 + 'ENGINE': 'django.db.backends.sqlite3', 23 + 'NAME': 'cachalot.sqlite3', 24 + }, 25 + - 'postgresql': { 26 + - 'ENGINE': 'django.db.backends.postgresql', 27 + - 'NAME': 'cachalot', 28 + - 'USER': 'cachalot', 29 + - 'PASSWORD': 'password', 30 + - 'HOST': '127.0.0.1', 31 + - }, 32 + - 'mysql': { 33 + - 'ENGINE': 'django.db.backends.mysql', 34 + - 'NAME': 'cachalot', 35 + - 'USER': 'root', 36 + - 'HOST': '127.0.0.1', 37 + + 'test': { 38 + + 'ENGINE': 'django.db.backends.sqlite3', 39 + + 'NAME': ':memory:', 40 + }, 41 + } 42 + if 'MYSQL_PASSWORD' in os.environ: 43 + @@ -36,22 +27,6 @@ DEFAULT_AUTO_FIELD = "django.db.models.AutoField" 44 + DATABASE_ROUTERS = ['cachalot.tests.db_router.PostgresRouter'] 45 + 46 + CACHES = { 47 + - 'redis': { 48 + - 'BACKEND': 'django_redis.cache.RedisCache', 49 + - 'LOCATION': 'redis://127.0.0.1:6379/0', 50 + - 'OPTIONS': { 51 + - # Since we are using both Python 2 & 3 in tests, we need to use 52 + - # a compatible pickle version to avoid unpickling errors when 53 + - # running a Python 2 test after a Python 3 test. 54 + - 'PICKLE_VERSION': 2, 55 + - }, 56 + - }, 57 + - 'memcached': { 58 + - 'BACKEND': 'django.core.cache.backends.memcached.' 59 + - + ('PyMemcacheCache' if __DJ_V[0] > 2 60 + - and (__DJ_V[1] > 1 or __DJ_V[0] > 3) else 'MemcachedCache'), 61 + - 'LOCATION': '127.0.0.1:11211', 62 + - }, 63 + 'locmem': { 64 + 'BACKEND': 'django.core.cache.backends.locmem.LocMemCache', 65 + 'OPTIONS': {
+2
pkgs/top-level/python-packages.nix
··· 2699 2699 2700 2700 django-bootstrap4 = callPackage ../development/python-modules/django-bootstrap4 { }; 2701 2701 2702 + django-cachalot = callPackage ../development/python-modules/django-cachalot { }; 2703 + 2702 2704 django-cache-url = callPackage ../development/python-modules/django-cache-url { }; 2703 2705 2704 2706 django-cacheops = callPackage ../development/python-modules/django-cacheops { };