django-ratelimit
django-ratelimit copied to clipboard
Reopening https://github.com/jsocol/django-ratelimit/issues/252 with reproducible steps
Closed issue: https://github.com/jsocol/django-ratelimit/issues/252
I tried to reproduce this behaviour in a python:3.7 docker instance. (for platform independence)
- Run python 3.7 docker image with shell access:
sudo docker run -it --entrypoint /bin/bash python:3.7 - create a virtualenv in it:
python -m venv venv - activate env:
source venv/bin/activate - install django-ratelimit:
venv/bin/python -m pip install django-ratelimit==3.0.1 - Now browse to the ratelimit package in env:
cd /venv/lib/python3.7/site-packages/ratelimit/
Here you will find the list of files which are: __init__.py __pycache__ core.py decorators.py exceptions.py middleware.py mixins.py models.py tests.py utils.py
I hope it may help to reproduce.
Thanks for making a reproducible report.
Unlike #252 I see VERSION = (3, 0, 1) in __init__.py. But I do see a models.py and a utils.py file, which indeed do not match what's in the repo for the 3.0.1 tag: https://github.com/jsocol/django-ratelimit/tree/v3.0.1/ratelimit
@jsocol is the owner and releaser - he will need to check the release process as to how this happened. I suspect he has old build files sitting around. They should be cleared between releases.
Thanks for running this down @anveshagarwal! I can take a look at this later this week. I suspect there was a dirty build folder the last time I published and some old files got tarred up with the new one. I'll look at scripting/automating that so it's not subject to me remembering to remove the old ones.
FYI @jsocol here's my package release script: https://github.com/adamchainz/scripts/blob/main/package-release.py
It does a bunch of stuff, but I'd say the important steps here are rm -rf build dist and then python -m build. build is the recommended futuristic way to build packages now.
v4 is out and was built automatically with the new(ish, at this point) tooling inside Actions, with a pre-build clean step even though it should be in a clean environment each time. I don't have docker installed on this computer and it's a bit late, but hopefully this version shouldn't have issues with the packaging!
OK, I ran through the STR (thank you for that!) for v4: the utils file is gone, and the VERSION is correct. There is still an empty models file which is intentional—though since there's also an app.py now it's probably no longer necessary