django-ratelimit icon indicating copy to clipboard operation
django-ratelimit copied to clipboard

Reopening https://github.com/jsocol/django-ratelimit/issues/252 with reproducible steps

Open anveshagarwal opened this issue 4 years ago • 3 comments
trafficstars

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)

  1. Run python 3.7 docker image with shell access: sudo docker run -it --entrypoint /bin/bash python:3.7
  2. create a virtualenv in it: python -m venv venv
  3. activate env: source venv/bin/activate
  4. install django-ratelimit: venv/bin/python -m pip install django-ratelimit==3.0.1
  5. 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.

anveshagarwal avatar Nov 14 '21 15:11 anveshagarwal

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.

adamchainz avatar Nov 15 '21 10:11 adamchainz

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.

jsocol avatar Nov 15 '21 16:11 jsocol

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.

adamchainz avatar Nov 15 '21 17:11 adamchainz

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!

jsocol avatar Dec 04 '22 03:12 jsocol

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

jsocol avatar Dec 04 '22 16:12 jsocol