mirror of
https://github.com/jazzband/django-axes.git
synced 2026-03-16 22:30:23 +00:00
Migrate to setuptools_scm
This commit is contained in:
parent
43b0a45ca9
commit
c30b2366cf
5 changed files with 15 additions and 17 deletions
|
|
@ -1,7 +1,5 @@
|
|||
__version__ = '5.0.12'
|
||||
from pkg_resources import get_distribution
|
||||
|
||||
default_app_config = 'axes.apps.AppConfig'
|
||||
|
||||
|
||||
def get_version():
|
||||
return __version__
|
||||
__version__ = get_distribution('django-axes').version
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
from logging import getLogger
|
||||
from pkg_resources import get_distribution
|
||||
|
||||
from django import apps
|
||||
|
||||
from axes import get_version
|
||||
from axes.conf import settings
|
||||
|
||||
log = getLogger(settings.AXES_LOGGER)
|
||||
|
|
@ -32,7 +32,7 @@ class AppConfig(apps.AppConfig):
|
|||
cls.logging_initialized = True
|
||||
|
||||
log.info('AXES: BEGIN LOG')
|
||||
log.info('AXES: Using django-axes %s', get_version())
|
||||
log.info('AXES: Using django-axes version %s', get_distribution('django-axes').version)
|
||||
|
||||
if settings.AXES_ONLY_USER_FAILURES:
|
||||
log.info('AXES: blocking by username only.')
|
||||
|
|
|
|||
15
docs/conf.py
15
docs/conf.py
|
|
@ -6,16 +6,15 @@ More information on the configuration options is available at:
|
|||
http://www.sphinx-doc.org/en/master/usage/configuration.html
|
||||
"""
|
||||
|
||||
import os
|
||||
from os import environ
|
||||
from pkg_resources import get_distribution
|
||||
|
||||
import axes
|
||||
import django
|
||||
import sphinx_rtd_theme
|
||||
|
||||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'axes.tests.settings')
|
||||
environ.setdefault('DJANGO_SETTINGS_MODULE', 'axes.tests.settings')
|
||||
django.setup()
|
||||
|
||||
|
||||
# -- Extra custom configuration ------------------------------------------
|
||||
|
||||
title = 'Django Axes Documentation'
|
||||
|
|
@ -44,11 +43,11 @@ project = 'Django Axes'
|
|||
copyright = '2016, Jazzband'
|
||||
author = 'Jazzband'
|
||||
|
||||
# The short X.Y version.
|
||||
version = axes.get_version()
|
||||
|
||||
# The full version, including alpha/beta/rc tags.
|
||||
release = axes.get_version()
|
||||
release = get_distribution('django-axes').version
|
||||
|
||||
# The short X.Y version.
|
||||
version = '.'.join(release.split('.')[:2])
|
||||
|
||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||
# for a list of supported languages.
|
||||
|
|
|
|||
2
pyproject.toml
Normal file
2
pyproject.toml
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
[build-system]
|
||||
requires = ["setuptools>=30.3.0", "wheel", "setuptools_scm"]
|
||||
5
setup.py
5
setup.py
|
|
@ -2,11 +2,8 @@
|
|||
|
||||
from setuptools import setup, find_packages
|
||||
|
||||
from axes import get_version
|
||||
|
||||
setup(
|
||||
name='django-axes',
|
||||
version=get_version(),
|
||||
description='Keep track of failed login attempts in Django-powered sites.',
|
||||
long_description='\n'.join([
|
||||
open('README.rst', encoding='utf-8').read(),
|
||||
|
|
@ -32,6 +29,8 @@ setup(
|
|||
},
|
||||
license='MIT',
|
||||
package_dir={'axes': 'axes'},
|
||||
use_scm_version=True,
|
||||
setup_requires=['setuptools_scm'],
|
||||
python_requires='~=3.6',
|
||||
install_requires=[
|
||||
'django>=1.11',
|
||||
|
|
|
|||
Loading…
Reference in a new issue