push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,84 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
django,
django-debug-toolbar,
psycopg2,
jinja2,
beautifulsoup4,
pytest-django,
pytestCheckHook,
python,
pytz,
redis,
redisTestHook,
setuptools,
stdenv,
}:
buildPythonPackage rec {
pname = "django-cachalot";
version = "2.8.0";
format = "setuptools";
src = fetchFromGitHub {
owner = "noripyt";
repo = "django-cachalot";
tag = "v${version}";
hash = "sha256-3W+9cULL3mMtAkxbqetoIj2FL/HRbzWHIDMe9O1e6BM=";
};
patches = [
# Disable tests for unsupported caching and database types which would
# require additional running backends
./disable-unsupported-tests.patch
];
build-system = [ setuptools ];
dependencies = [ django ];
nativeCheckInputs = [
beautifulsoup4
django-debug-toolbar
psycopg2
jinja2
pytest-django
pytestCheckHook
pytz
redis
redisTestHook
];
pythonImportsCheck = [ "cachalot" ];
# redisTestHook does not work on darwin
doCheck = !stdenv.hostPlatform.isDarwin;
preCheck = ''
export DJANGO_SETTINGS_MODULE=settings
'';
pytestFlags = [
"-o python_files=*.py"
"-o collect_imported_tests=false"
"cachalot/tests"
"cachalot/admin_tests"
];
disabledTests = [
# relies on specific EXPLAIN output format from sqlite, which is not stable
"test_explain"
# broken on django-debug-toolbar 6.0
"test_rendering"
];
meta = with lib; {
description = "No effort, no worry, maximum performance";
homepage = "https://github.com/noripyt/django-cachalot";
changelog = "https://github.com/noripyt/django-cachalot/blob/${src.tag}/CHANGELOG.rst";
license = licenses.bsd3;
maintainers = with maintainers; [ onny ];
};
}

View File

@@ -0,0 +1,65 @@
diff --git a/cachalot/tests/models.py b/cachalot/tests/models.py
index 8c48640..817602c 100644
--- a/cachalot/tests/models.py
+++ b/cachalot/tests/models.py
@@ -77,11 +77,6 @@ class PostgresModel(Model):
date_range = DateRangeField(null=True, blank=True)
datetime_range = DateTimeRangeField(null=True, blank=True)
- class Meta:
- # Tests schema name in table name.
- db_table = '"public"."cachalot_postgresmodel"'
-
-
class UnmanagedModel(Model):
name = CharField(max_length=50)
diff --git a/settings.py b/settings.py
index 19d7560..7095367 100644
--- a/settings.py
+++ b/settings.py
@@ -8,18 +8,9 @@ DATABASES = {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'cachalot.sqlite3',
},
- 'postgresql': {
- 'ENGINE': 'django.db.backends.postgresql',
- 'NAME': 'cachalot',
- 'USER': 'cachalot',
- 'PASSWORD': 'password',
- 'HOST': '127.0.0.1',
- },
- 'mysql': {
- 'ENGINE': 'django.db.backends.mysql',
- 'NAME': 'cachalot',
- 'USER': 'root',
- 'HOST': '127.0.0.1',
+ 'test': {
+ 'ENGINE': 'django.db.backends.sqlite3',
+ 'NAME': ':memory:',
},
}
if 'MYSQL_PASSWORD' in os.environ:
@@ -36,22 +27,6 @@ DEFAULT_AUTO_FIELD = "django.db.models.AutoField"
DATABASE_ROUTERS = ['cachalot.tests.db_router.PostgresRouter']
CACHES = {
- 'redis': {
- 'BACKEND': 'django_redis.cache.RedisCache',
- 'LOCATION': 'redis://127.0.0.1:6379/0',
- 'OPTIONS': {
- # Since we are using both Python 2 & 3 in tests, we need to use
- # a compatible pickle version to avoid unpickling errors when
- # running a Python 2 test after a Python 3 test.
- 'PICKLE_VERSION': 2,
- },
- },
- 'memcached': {
- 'BACKEND': 'django.core.cache.backends.memcached.'
- + ('PyMemcacheCache' if __DJ_V[0] > 2
- and (__DJ_V[1] > 1 or __DJ_V[0] > 3) else 'MemcachedCache'),
- 'LOCATION': '127.0.0.1:11211',
- },
'locmem': {
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
'OPTIONS': {