mirror of
https://github.com/jazzband/django-configurations.git
synced 2026-03-16 22:20:27 +00:00
Merge pull request #219 from jazzband/feature/add-extras-require
Add extras for optional requirements
This commit is contained in:
commit
efea2224da
7 changed files with 35 additions and 22 deletions
3
AUTHORS
3
AUTHORS
|
|
@ -3,4 +3,5 @@ Gilles Fabio
|
|||
Jannis Leidel
|
||||
Marc Abramowitz
|
||||
Michael van Tellingen
|
||||
Mike Fogel
|
||||
Mike Fogel
|
||||
Peter Bittner
|
||||
|
|
|
|||
|
|
@ -32,6 +32,12 @@ Install django-configurations:
|
|||
|
||||
pip install django-configurations
|
||||
|
||||
or, alternatively, if you want to use URL-based values:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
pip install django-configurations[cache,database,email,search]
|
||||
|
||||
Then subclass the included ``configurations.Configuration`` class in your
|
||||
project's **settings.py** or any other module you're using to store the
|
||||
settings constants, e.g.:
|
||||
|
|
|
|||
|
|
@ -124,8 +124,8 @@ class ConfigurationImporter(object):
|
|||
def stylize(text):
|
||||
return colorize(text, fg='green')
|
||||
|
||||
if (self.argv[1] == 'runserver' and
|
||||
os.environ.get('RUN_MAIN') == 'true'):
|
||||
if self.argv[1] == 'runserver' \
|
||||
and os.environ.get('RUN_MAIN') == 'true':
|
||||
|
||||
message = ("django-configurations version {0}, using "
|
||||
"configuration '{1}'".format(__version__,
|
||||
|
|
|
|||
|
|
@ -52,8 +52,8 @@ class Value(object):
|
|||
instance.late_binding = kwargs.get('late_binding')
|
||||
if not instance.late_binding:
|
||||
instance.__init__(*args, **kwargs)
|
||||
if ((instance.environ and instance.environ_name) or
|
||||
(not instance.environ and instance.default)):
|
||||
if (instance.environ and instance.environ_name) \
|
||||
or (not instance.environ and instance.default):
|
||||
instance = instance.setup(instance.environ_name)
|
||||
return instance
|
||||
|
||||
|
|
|
|||
19
setup.py
19
setup.py
|
|
@ -41,6 +41,22 @@ setup(
|
|||
'django-cadmin = configurations.management:execute_from_command_line',
|
||||
],
|
||||
},
|
||||
extras_require={
|
||||
'cache': ['django-cache-url'],
|
||||
'database': ['dj-database-url'],
|
||||
'email': ['dj-email-url'],
|
||||
'search': ['dj-search-url'],
|
||||
'testing': [
|
||||
'django-discover-runner',
|
||||
'mock',
|
||||
'django-cache-url>=1.0.0',
|
||||
'dj-database-url',
|
||||
'dj-email-url',
|
||||
'dj-search-url',
|
||||
'six',
|
||||
'Sphinx>=1.4',
|
||||
],
|
||||
},
|
||||
classifiers=[
|
||||
'Development Status :: 5 - Production/Stable',
|
||||
'Framework :: Django',
|
||||
|
|
@ -49,10 +65,9 @@ setup(
|
|||
'Operating System :: OS Independent',
|
||||
'Programming Language :: Python',
|
||||
'Programming Language :: Python :: 2.7',
|
||||
'Programming Language :: Python :: 3.2',
|
||||
'Programming Language :: Python :: 3.4',
|
||||
'Programming Language :: Python :: 3.5',
|
||||
'Programming Language :: Python :: 3.6',
|
||||
'Programming Language :: Python :: 3.7',
|
||||
'Topic :: Utilities',
|
||||
],
|
||||
zip_safe=False,
|
||||
|
|
|
|||
|
|
@ -1,8 +0,0 @@
|
|||
django-discover-runner
|
||||
mock
|
||||
dj-database-url
|
||||
dj-email-url
|
||||
dj-search-url
|
||||
django-cache-url>=1.0.0
|
||||
six
|
||||
Sphinx>=1.4
|
||||
13
tox.ini
13
tox.ini
|
|
@ -1,8 +1,8 @@
|
|||
[tox]
|
||||
skipsdist = True
|
||||
usedevelop = True
|
||||
skipsdist = true
|
||||
usedevelop = true
|
||||
minversion = 1.8
|
||||
whitelist_externals=sphinx-build
|
||||
whitelist_externals = sphinx-build
|
||||
envlist =
|
||||
flake8-py27,
|
||||
flake8-py36,
|
||||
|
|
@ -19,7 +19,6 @@ setenv =
|
|||
coverage: COVERAGE_PROCESS_START = {toxinidir}/setup.cfg
|
||||
coverage: _TEST_RUN_PREFIX=coverage run
|
||||
deps =
|
||||
-rtests/requirements.txt
|
||||
dj18: django>=1.8,<1.9
|
||||
dj110: django>=1.10,<1.11
|
||||
dj111: django>=1.11,<2.0
|
||||
|
|
@ -29,7 +28,7 @@ deps =
|
|||
py27,pypy: mock
|
||||
coverage: coverage
|
||||
coverage: coverage_enable_subprocess
|
||||
|
||||
extras = testing
|
||||
commands =
|
||||
python --version
|
||||
{env:_TEST_RUN_PREFIX:} {envbindir}/django-cadmin test -v2 {posargs:tests}
|
||||
|
|
@ -49,5 +48,5 @@ commands = flake8 configurations tests
|
|||
deps = flake8
|
||||
|
||||
[flake8]
|
||||
exclude=.tox
|
||||
ignore=E501,E127,E128,E124
|
||||
exclude = .tox
|
||||
ignore = E501,E127,E128,E124
|
||||
|
|
|
|||
Loading…
Reference in a new issue