diff --git a/django_ratelimit/__init__.py b/django_ratelimit/__init__.py index 2a2e71e..8069e33 100644 --- a/django_ratelimit/__init__.py +++ b/django_ratelimit/__init__.py @@ -1,4 +1,4 @@ -VERSION = (3, 0, 1) +VERSION = (4, 0, 0) __version__ = '.'.join(map(str, VERSION)) ALL = (None,) # Sentinel value for all HTTP methods. diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..2a15259 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,38 @@ +[build-system] +requires = ["setuptools>=61.2"] +build-backend = "setuptools.build_meta" + +[project] +name = "django-ratelimit" +version = "4.0.0" +authors = [{name = "James Socol", email = "me@jamessocol.com"}] +requires-python = ">= 3.7" +license = {file = "LICENSE"} +description = "Cache-based rate-limiting for Django." +readme = "README.rst" +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Web Environment", + "Intended Audience :: Developers", + "License :: OSI Approved :: Apache Software License", + "Operating System :: OS Independent", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Framework :: Django", + "Topic :: Software Development :: Libraries :: Python Modules", +] +urls = {Homepage = "https://github.com/jsocol/pystatsd"} + +[tool.distutils.bdist_wheel] +universal = 1 + +[tool.setuptools] +include-package-data = true + +[tool.setuptools.packages] +find = {namespaces = false} diff --git a/run.sh b/run.sh index cb54e0e..7850414 100755 --- a/run.sh +++ b/run.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh export PYTHONPATH=".:$PYTHONPATH" export DJANGO_SETTINGS_MODULE="test_settings" @@ -10,20 +10,32 @@ shift usage() { echo "USAGE: $PROG [command]" echo " test - run the ratelimit tests" - echo " flake8 - run flake8" + echo " lint - run flake8 (alias: flake8)" echo " shell - open the Django shell" + echo " build - build a package for release" + echo " check - run twine check on build artifacts" exit 1 } case "$CMD" in "test" ) echo "Django version: $(python -m django --version)" - python -m django test django_ratelimit "$@";; - "flake8" ) + python -m django test django_ratelimit "$@" + ;; + "lint"|"flake8" ) echo "Flake8 version: $(flake8 --version)" - flake8 "$@" django_ratelimit/;; + flake8 "$@" django_ratelimit/ + ;; "shell" ) - python -m django shell ;; + python -m django shell + ;; + "build" ) + rm -rf dist/* + python -m build + ;; + "check" ) + twine check dist/* + ;; * ) usage ;; esac diff --git a/setup.py b/setup.py deleted file mode 100644 index 26d8966..0000000 --- a/setup.py +++ /dev/null @@ -1,41 +0,0 @@ -from setuptools import setup, find_packages - -from django_ratelimit import __version__ - - -setup( - name='django-ratelimit', - version=__version__, - description='Cache-based rate-limiting for Django.', - long_description=open('README.rst').read(), - author='James Socol', - author_email='me@jamessocol.com', - url='https://github.com/jsocol/django-ratelimit', - license='Apache Software License', - packages=find_packages(exclude=['test_settings']), - python_requires='>=3.4', - include_package_data=True, - package_data={'': ['README.rst']}, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Web Environment', - 'Framework :: Django', - 'Framework :: Django :: 2.0', - 'Framework :: Django :: 2.1', - 'Framework :: Django :: 2.2', - 'Framework :: Django :: 3.0', - 'Intended Audience :: Developers', - 'License :: OSI Approved :: Apache Software License', - 'Operating System :: OS Independent', - 'Programming Language :: Python', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.4', - 'Programming Language :: Python :: 3.5', - 'Programming Language :: Python :: 3.6', - 'Programming Language :: Python :: 3.7', - 'Programming Language :: Python :: 3.8', - 'Programming Language :: Python :: Implementation :: CPython', - 'Programming Language :: Python :: Implementation :: PyPy', - 'Topic :: Software Development :: Libraries :: Python Modules', - ] -)