-
Notifications
You must be signed in to change notification settings - Fork 190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test on PyMemcacheCache on Django 3.2 #241
Comments
OK I made a couple of clean-up changes to get to 3.2 first: #248 and #249. Basically I think there are three ways we can go about this:
I don't have a strong opinion between 1 and 2, but I am slightly leaning toward number 2, "parametrize". I don't like 3: it's the easiest but would likely mean that pylibmc was broken and we wouldn't know it. Some initial thoughts about what 2 might look like
# in test_settings.py
cache_type = os.getenv('CACHE')
if cache_type == 'python-memcached':
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
'LOCATION': 'service-container:11211',
},
'default-connection-error': {
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
'LOCATION': 'invalid-host:1234',
},
}
elif cache_type == 'pymemcached':
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.memcached.PyMemcachedCache',
# ... etc ...
}
elif cache_type == 'pylibmc':
# ...
elif cache_type == 'redis':
# ...
elif cache_type == 'locmem':
# ...
else:
raise ImproperlyConfigured('unknown cache backend specified for tests') and so on. I'm not 100% sure how to handle "connection error" tests for LocMem, but if we're going to special case anything in tests, I'd rather it be LocMem—which is primarily a development tool, because it can't fail to connect—than one of the real ones. This is also an eventual look at |
Hi @jsocol,
|
I like point 2, Why drop tox? Check out the configuration at django-cachalot so we can keep tox and still use GitHub actions. I agree with not needing to test pylibmc for now (though the errors generated there are the exact same as pymemcache). I think we should just skip locmem tests for conn errors since it's just a Python dictionary. Also please don't feel pressured to release soon. If someone needs to use this software, they should vendor it and manage it themselves. |
I don’t really care about dropping tox specifically, I just want one way to manage the tests. But I am worried about the lack of ability to define things like memcached and redis dependencies, if we go that way. I’ll check out the cachalot test config! As for releasing soon, it’s probably ok to say 3.2 is supported and that while pylibmc are pymemcache are considered experimental, issues with them are bugs that we’ll work to fix. Maybe 4.0 is just the current set of changes and they can come in 4.1 or 4.2. However I can’t make promises about my time and availability. I try to make progress here but also need to spend time away from coding outside of work. If your on a deadline @mahyard , I’d recommend either vendoring the current snapshot, or another known-working commit, or installing directly from git with a specific commit tagged. |
FYI on tox + github actions, you can check my projects, e.g. https://github.com/adamchainz/django-htmx or https://github.com/adamchainz/django-mysql/ . I run one github actions container per python version and then use a little tox plugin I wrote to run all tox environments matching that python version. |
Indeed I didn't mean to ask for a major release. what I was looking for is a minor version containing just the current changes under the assumption that the latest commit on the master branch doesn't break anything on v3.0.1. it could be named v3.0.2 for example. |
@adamchainz good to know, will take a look! @mahyard the current main branch contains significant breaking changes, including a rename of the module from Also, regardless of how far away mid-Oct is, I cannot guarantee my free time between now and then. This is a project I care about but not one that I am paid to work on. Please be understanding of that. |
absolutely there is no rush, no guarantee asked, and I didn't want you to do something more than what you are trying to do. I'm thankful for your efforts and what you and other contributors here provided for the IT world is really precious. I don't know maybe my bad English caused you to think that I want to force you to do more. |
django-ratelimit/test_settings.py
Lines 14 to 17 in 651c730
In ref to #239, I added Django 3.2 but Django at that version added a new class: PyMemcacheCache that uses a different version of memcached called pymemcached which is maintained by Pinterest.
The text was updated successfully, but these errors were encountered: