-
-
Notifications
You must be signed in to change notification settings - Fork 321
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
90e75e0
commit 4ad80a0
Showing
14 changed files
with
116 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# This file is part of the django-environ. | ||
# | ||
# Copyright (c) 2021, Serghei Iakovlev <[email protected]> | ||
# Copyright (c) 2021-2022, Serghei Iakovlev <[email protected]> | ||
# Copyright (c) 2013-2021, Daniele Faraglia <[email protected]> | ||
# | ||
# For the full copyright and license information, please view | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
============= | ||
API Reference | ||
============= | ||
|
||
.. currentmodule:: environ | ||
|
||
|
||
The ``__init__`` module | ||
======================= | ||
|
||
.. automodule:: environ | ||
:members: | ||
:no-undoc-members: | ||
|
||
|
||
The ``compat`` module | ||
====================== | ||
|
||
.. automodule:: environ.compat | ||
:members: | ||
:no-undoc-members: | ||
|
||
|
||
The ``environ`` module | ||
====================== | ||
|
||
.. autoclass:: environ.Env | ||
:members: | ||
:no-undoc-members: | ||
|
||
.. autoclass:: environ.FileAwareEnv | ||
:members: | ||
:no-undoc-members: | ||
|
||
.. autoclass:: environ.Path | ||
:members: | ||
:no-undoc-members: | ||
|
||
|
||
The ``fileaware_mapping`` module | ||
================================ | ||
|
||
.. autoclass:: environ.fileaware_mapping.FileAwareMapping | ||
:members: | ||
:no-undoc-members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# This file is part of the django-environ. | ||
# | ||
# Copyright (c) 2021, Serghei Iakovlev <[email protected]> | ||
# Copyright (c) 2021-2022, Serghei Iakovlev <[email protected]> | ||
# Copyright (c) 2013-2021, Daniele Faraglia <[email protected]> | ||
# | ||
# For the full copyright and license information, please view | ||
|
@@ -12,9 +12,14 @@ | |
|
||
import codecs | ||
import os | ||
import sys | ||
import re | ||
|
||
|
||
PROJECT_DIR = os.path.abspath('..') | ||
sys.path.insert(0, PROJECT_DIR) | ||
|
||
|
||
def read_file(filepath): | ||
"""Read content from a UTF-8 encoded text file.""" | ||
with codecs.open(filepath, 'rb', 'utf-8') as file_handle: | ||
|
@@ -23,9 +28,7 @@ def read_file(filepath): | |
|
||
def find_version(meta_file): | ||
"""Extract ``__version__`` from meta_file.""" | ||
here = os.path.abspath(os.path.dirname(__file__)) | ||
contents = read_file(os.path.join(here, meta_file)) | ||
|
||
contents = read_file(os.path.join(PROJECT_DIR, meta_file)) | ||
meta_match = re.search( | ||
r"^__version__\s+=\s+['\"]([^'\"]*)['\"]", | ||
contents, | ||
|
@@ -56,6 +59,7 @@ def find_version(meta_file): | |
"sphinx.ext.doctest", | ||
"sphinx.ext.intersphinx", | ||
"sphinx.ext.todo", | ||
"sphinx.ext.viewcode", | ||
"notfound.extension", | ||
] | ||
|
||
|
@@ -75,7 +79,7 @@ def find_version(meta_file): | |
|
||
# The version info | ||
# The short X.Y version. | ||
release = find_version('../environ/__init__.py') | ||
release = find_version('environ/__init__.py') | ||
version = release.rsplit(u".", 1)[0] | ||
# The full version, including alpha/beta/rc tags. | ||
|
||
|
@@ -85,11 +89,33 @@ def find_version(meta_file): | |
|
||
# The reST default role (used for this markup: `text`) to use for all | ||
# documents. | ||
default_role = "any" | ||
# default_role = None | ||
|
||
# If true, '()' will be appended to :func: etc. cross-reference text. | ||
add_function_parentheses = True | ||
|
||
# | ||
# -- Options for linkcheck ---------------------------------------------------- | ||
# | ||
|
||
linkcheck_ignore = [ | ||
# We run into GitHub's rate limits. | ||
r"https://github.com/.*/(issues|pull)/\d+", | ||
] | ||
|
||
# | ||
# -- Options for nitpick ---------------------------------------------------- | ||
# | ||
|
||
nitpicky = True | ||
|
||
# In nitpick mode (-n), still ignore any of the following "broken" references | ||
# to non-types. | ||
nitpick_ignore = [ | ||
('py:class', 'file'), | ||
('py:class', 'urlparse.ParseResult'), | ||
] | ||
|
||
# | ||
# -- Options for extlinks ---------------------------------------------------- | ||
# | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
============ | ||
Deprecations | ||
============ | ||
|
||
Features deprecated in 0.9.0 | ||
============================ | ||
|
||
Methods | ||
------- | ||
|
||
* The :meth:`.environ.Env.unicode` method is deprecated as it was used | ||
for Python 2.x only. Use :meth:`.environ.Env.str` instead. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# This file is part of the django-environ. | ||
# | ||
# Copyright (c) 2021, Serghei Iakovlev <[email protected]> | ||
# Copyright (c) 2021-2022, Serghei Iakovlev <[email protected]> | ||
# Copyright (c) 2013-2021, Daniele Faraglia <[email protected]> | ||
# | ||
# For the full copyright and license information, please view | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# This file is part of the django-environ. | ||
# | ||
# Copyright (c) 2021, Serghei Iakovlev <[email protected]> | ||
# Copyright (c) 2021-2022, Serghei Iakovlev <[email protected]> | ||
# Copyright (c) 2013-2021, Daniele Faraglia <[email protected]> | ||
# | ||
# For the full copyright and license information, please view | ||
|
@@ -23,9 +23,9 @@ | |
__url__ | ||
__description__ | ||
Refer to the `documentation <https://django-environ.readthedocs.org/>`_ | ||
Refer to the `documentation <https://django-environ.readthedocs.io/en/latest/>`_ | ||
for details on the use of this package. | ||
""" | ||
""" # noqa: E501 | ||
|
||
from .environ import * | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# This file is part of the django-environ. | ||
# | ||
# Copyright (c) 2021, Serghei Iakovlev <[email protected]> | ||
# Copyright (c) 2021-2022, Serghei Iakovlev <[email protected]> | ||
# Copyright (c) 2013-2021, Daniele Faraglia <[email protected]> | ||
# | ||
# For the full copyright and license information, please view | ||
|
@@ -39,8 +39,8 @@ class ImproperlyConfigured(Exception): | |
REDIS_DRIVER = 'django_redis.cache.RedisCache' | ||
|
||
|
||
# back compatibility for pymemcache | ||
def choose_pymemcache_driver(): | ||
"""Backward compatibility for pymemcache.""" | ||
old_django = DJANGO_VERSION is not None and DJANGO_VERSION < (3, 2) | ||
if old_django or not find_loader('pymemcache'): | ||
# The original backend choice for the 'pymemcache' scheme is | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# This file is part of the django-environ. | ||
# | ||
# Copyright (c) 2021, Serghei Iakovlev <[email protected]> | ||
# Copyright (c) 2021-2022, Serghei Iakovlev <[email protected]> | ||
# Copyright (c) 2013-2021, Daniele Faraglia <[email protected]> | ||
# | ||
# For the full copyright and license information, please view | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# This file is part of the django-environ. | ||
# | ||
# Copyright (c) 2021, Serghei Iakovlev <[email protected]> | ||
# Copyright (c) 2021-2022, Serghei Iakovlev <[email protected]> | ||
# Copyright (c) 2013-2021, Daniele Faraglia <[email protected]> | ||
# | ||
# For the full copyright and license information, please view | ||
|
@@ -14,14 +14,14 @@ | |
|
||
class FileAwareMapping(MutableMapping): | ||
""" | ||
A mapping that wraps os.environ, first checking for the existance of a key | ||
A mapping that wraps os.environ, first checking for the existence of a key | ||
appended with ``_FILE`` whenever reading a value. If a matching file key is | ||
found then the value is instead read from the file system at this location. | ||
By default, values read from the file system are cached so future lookups | ||
do not hit the disk again. | ||
A ``_FILE`` key has higher precidence than a value is set directly in the | ||
A ``_FILE`` key has higher precedence than a value is set directly in the | ||
environment, and an exception is raised if the file can not be found. | ||
""" | ||
|
||
|