forked from City-of-Helsinki/parkkihubi
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request City-of-Helsinki#39 from suutari-ai/req-update
Update requirements and switch to Prequ
- Loading branch information
Showing
11 changed files
with
91 additions
and
47 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
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import contextlib | ||
from functools import lru_cache | ||
|
||
from django.conf import settings | ||
from django.urls import reverse | ||
from django.utils import timezone | ||
|
||
# No-op context manager | ||
# | ||
# Usable like the one coming in Python 3.7, see | ||
# https://github.com/python/cpython/commit/0784a2e5b174d2dbf7b144d480559e650c5cf64c | ||
nullcontext = contextlib.ExitStack | ||
|
||
|
||
class AdminTimezoneMiddleware: | ||
def __init__(self, get_response): | ||
self.get_response = get_response | ||
|
||
def __call__(self, request): | ||
tz_overrider = nullcontext() | ||
if request.path.startswith(get_admin_url_path_prefix()): | ||
admin_tz = getattr(settings, 'ADMIN_TIME_ZONE', None) | ||
if admin_tz: | ||
tz_overrider = timezone.override(admin_tz) | ||
with tz_overrider: | ||
return self.get_response(request) | ||
|
||
|
||
@lru_cache() | ||
def get_admin_url_path_prefix(): | ||
return reverse('admin:index') |
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,42 +1,44 @@ | ||
# This file is autogenerated by Prequ. To update, run: | ||
# | ||
# This file is autogenerated by pip-compile | ||
# To update, run: | ||
# prequ update | ||
# | ||
# pip-compile --output-file requirements-dev.txt requirements-dev.in | ||
# | ||
appnope==0.1.0 # via ipython | ||
autoflake==0.7 | ||
autopep8==1.3.2 | ||
coverage==4.4.1 # via pytest-cov | ||
attrs==17.3.0 # via pytest | ||
autoflake==1.0 | ||
autopep8==1.3.3 | ||
coverage==4.4.2 # via pytest-cov | ||
decorator==4.1.2 # via ipython, traitlets | ||
django-extensions==1.9.0 | ||
factory-boy==2.8.1 # via pytest-factoryboy | ||
faker==0.7.18 # via factory-boy | ||
flake8==3.4.1 | ||
django-extensions==1.9.8 | ||
factory-boy==2.8.1 | ||
faker==0.8.7 # via factory-boy | ||
flake8==3.5.0 | ||
freezegun==0.3.9 | ||
inflection==0.3.1 # via pytest-factoryboy | ||
ipython==6.2.1 | ||
ipython-genutils==0.2.0 # via traitlets | ||
ipython==6.1.0 | ||
isort==4.2.15 | ||
jedi==0.10.2 # via ipython | ||
jedi==0.11.0 # via ipython | ||
mccabe==0.6.1 # via flake8 | ||
pexpect==4.2.1 # via ipython | ||
parso==0.1.0 # via jedi | ||
pexpect==4.3.0 # via ipython | ||
pickleshare==0.7.4 # via ipython | ||
pluggy==0.6.0 # via pytest | ||
prompt-toolkit==1.0.15 # via ipython | ||
ptyprocess==0.5.2 # via pexpect | ||
py==1.4.34 # via pytest | ||
py==1.5.2 # via pytest | ||
pycodestyle==2.3.1 # via autopep8, flake8 | ||
pydocstyle==2.0.0 | ||
pyflakes==1.5.0 # via autoflake, flake8 | ||
pydocstyle==2.1.1 | ||
pyflakes==1.6.0 # via autoflake, flake8 | ||
pygments==2.2.0 # via ipython | ||
pytest==3.3.1 | ||
pytest-cov==2.5.1 | ||
pytest-django==3.1.2 | ||
pytest-factoryboy==1.3.1 | ||
pytest==3.2.1 | ||
python-dateutil==2.6.1 # via faker, freezegun | ||
simplegeneric==0.8.1 # via ipython | ||
six==1.10.0 # via django-extensions, faker, freezegun, prompt-toolkit, pydocstyle, python-dateutil, traitlets | ||
six==1.11.0 # via django-extensions, faker, freezegun, prompt-toolkit, pydocstyle, pytest, python-dateutil, traitlets | ||
snowballstemmer==1.2.1 # via pydocstyle | ||
text-unidecode==1.1 # via faker | ||
traitlets==4.3.2 # via ipython | ||
typing==3.6.2 # via django-extensions, ipython | ||
wcwidth==0.1.7 # via prompt-toolkit | ||
werkzeug==0.12.2 | ||
werkzeug==0.13 |
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,5 +1,5 @@ | ||
# Django | ||
Django | ||
Django~=1.11 | ||
|
||
# Settings | ||
django-environ | ||
|
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,25 +1,22 @@ | ||
# This file is autogenerated by Prequ. To update, run: | ||
# | ||
# This file is autogenerated by pip-compile | ||
# To update, run: | ||
# prequ update | ||
# | ||
# pip-compile --output-file requirements.txt requirements.in | ||
# | ||
certifi==2017.7.27.1 # via requests | ||
certifi==2017.11.5 # via requests | ||
chardet==3.0.4 # via requests | ||
contextlib2==0.5.5 # via raven | ||
django==1.11.8 | ||
django-environ==0.4.4 | ||
django-filter==1.0.4 | ||
django==1.11.4 # via django-environ | ||
djangorestframework-gis==0.11.2 | ||
djangorestframework==3.6.4 | ||
django-filter==1.1.0 | ||
djangorestframework==3.7.3 | ||
djangorestframework-gis==0.12 | ||
idna==2.6 # via requests | ||
lxml==3.8.0 | ||
owslib==0.14.0 | ||
psycopg2==2.7.3.1 | ||
lxml==4.1.1 | ||
owslib==0.15.0 | ||
psycopg2==2.7.3.2 | ||
pyproj==1.9.5.1 # via owslib | ||
python-dateutil==2.6.1 # via owslib | ||
pytz==2017.2 | ||
raven==6.1.0 | ||
pytz==2017.3 | ||
raven==6.3.0 | ||
requests==2.18.4 # via owslib | ||
six==1.10.0 # via django-environ, python-dateutil | ||
six==1.11.0 # via django-environ, djangorestframework-gis, python-dateutil | ||
urllib3==1.22 # via requests |
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,3 +1,6 @@ | ||
[prequ] | ||
annotate = yes | ||
|
||
[pep8] | ||
max-line-length = 120 | ||
exclude = *migrations* | ||
|