Skip to content

Commit

Permalink
Hotfix/1.6.4 (#505)
Browse files Browse the repository at this point in the history
* add vscode to gitignore

* add API_TIMEOUT to CYCLOPS settings

* update documentation with CYCLOPS setting

* add settings update to CHANGELOG

* modify dockerfile to include newest version of pip

* change docker image number to 3.6.4-alpine

* change docker image number to 3.5.4-alpine

* change docker image number to 3.6-alpine

* add upgrade pip script to travis

* add setuptools upgrade to travis

* add _internal to pip imports

* update CHANGELOG
  • Loading branch information
Chase Brewer authored May 1, 2018
1 parent b2893f7 commit 7620810
Show file tree
Hide file tree
Showing 10 changed files with 48 additions and 8 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,4 @@ keys/
kibana/
logs/
media/
.vscode/
13 changes: 12 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,20 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/). This project adheres to [Semantic Versioning](http://semver.org/).

<a name="Unreleased"></a>
<a name=""></a>
## [Unreleased]

<a name="1.6.4"></a>
## [1.6.4](https://github.com/dunbarcyber/cyphon/compare/1.6.3...1.6.4) (2018-04-03)

### Added

- **cyphon.settings.conf**: added CYCLOPS.API_TIMEOUT to settings file ([249c0ef](https://github.com/dunbarcyber/cyphon/commit/249c0ef))

### Fixed

- **setup.py**: fixed failing CI build due to pip 10 update moving all it's internal API to `._internal` ([92417d1](https://github.com/dunbarcyber/cyphon/commit/92417d1))

<a name="1.6.3"></a>
## [1.6.3](https://github.com/dunbarcyber/cyphon/compare/1.6.2...1.6.3) (2018-03-30)

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ RUN apk add -U --repository http://dl-5.alpinelinux.org/alpine/edge/testing/ \
python3-dev \
jpeg-dev \
zlib-dev \
tiff-dev \
tiff-dev
&& pip install -r $CYPHON_HOME/requirements.txt \
&& apk del build-deps \
&& python -m nltk.downloader -d /usr/local/share/nltk_data punkt wordnet
Expand Down
2 changes: 1 addition & 1 deletion cyphon/cyclops/templates/cyclops/app.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
API_URL: '/api/v1',
ADMIN_URL: '/admin/',
CYPHON_LOGO_URL: '{% static 'images/cyphon-logo.svg' %}',
API_TIMEOUT: 30000,
API_TIMEOUT: {{ api_timeout }},
NOTIFICATIONS_SERVICE_WORKER_URL: '/sw.js',
NOTIFICATIONS_ENABLED: {{ notifications_enabled | lower }},
MAPBOX_ACCESS_TOKEN: '{{ mapbox_access_token }}',
Expand Down
20 changes: 20 additions & 0 deletions cyphon/cyclops/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,26 @@ def test_cyphon_version(self):

self.assertEqual(response.context['cyphon_version'], VERSION)

def test_api_timeout(self):
"""
Tests that the correct api_timeout is passed to the template.
"""
self.authenticate()

response = self.get_application()

self.assertEqual(response.context['api_timeout'], 30000)
self.assertContains(response, 'API_TIMEOUT: 30000,')

cyclops_settings = deepcopy(settings.CYCLOPS)
cyclops_settings['API_TIMEOUT'] = 60000

with self.settings(CYCLOPS=cyclops_settings):
response = self.get_application()

self.assertEqual(response.context['api_timeout'], 60000)
self.assertContains(response, 'API_TIMEOUT: 60000,')


class ManifestTest(CyclopsViewsTestCase):
"""
Expand Down
9 changes: 7 additions & 2 deletions cyphon/cyclops/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@
from .conf import CYCLOPS_JS_URL, CYCLOPS_CSS_URL, CYCLOPS_VERSION

DEVELOPMENT_ENABLED = settings.CYCLOPS.get('DEVELOPMENT_ENABLED', False)
DEVELOPMENT_URL = settings.CYCLOPS.get('DEVELOPMENT_URL',
'http://localhost:8080/')
DEVELOPMENT_URL = settings.CYCLOPS.get(
'DEVELOPMENT_URL', 'http://localhost:8080/')
API_TIMEOUT = settings.CYCLOPS.get('API_TIMEOUT', 30000)

CSS_URL = (
'{}cyclops.css'.format(DEVELOPMENT_URL)
if DEVELOPMENT_ENABLED
Expand Down Expand Up @@ -59,13 +61,16 @@ def application(request):
:class:`~django.http.HttpResponse`
"""
api_timeout = settings.CYCLOPS.get('API_TIMEOUT', 30000)

return render(request, 'cyclops/app.html', {
'notifications_enabled': config.PUSH_NOTIFICATIONS_ENABLED,
'mapbox_access_token': settings.CYCLOPS['MAPBOX_ACCESS_TOKEN'],
'cyclops_version': CYCLOPS_VERSION,
'cyphon_version': request.cyphon_version,
'css_url': CSS_URL,
'js_url': JS_URL,
'api_timeout': api_timeout,
})


Expand Down
1 change: 1 addition & 0 deletions cyphon/cyphon/settings/conf.example.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
'MAPBOX_ACCESS_TOKEN': '',
'DEVELOPMENT_ENABLED': False,
'DEVELOPMENT_URL': 'http://localhost:8080/',
'API_TIMEOUT': 30000,
}

DATASIFTER = {
Expand Down
3 changes: 2 additions & 1 deletion cyphon/cyphon/settings/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@

APPUSERS = {
'CUSTOM_FILTER_BACKENDS': [],
'ONLY_SHOW_STAFF': False
'ONLY_SHOW_STAFF': False,
}

CODEBOOKS = {
Expand All @@ -82,6 +82,7 @@
'ENABLED': True,
'MAPBOX_ACCESS_TOKEN': '',
'DEVELOPMENT_ENABLED': False,
'API_TIMEOUT': 30000,
'DEVELOPMENT_URL': 'http://localhost:8080/',
}

Expand Down
1 change: 1 addition & 0 deletions docs/source/getting-started/configure-project.txt
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ Cyclops is configured with the ``conf.py`` file in the Cyphon settings::

CYCLOPS = {
'ENABLED': True,
'API_TIMEOUT': 30000,
'MAPBOX_ACCESS_TOKEN': '',
'DEVELOPMENT_ENABLED': False,
'DEVELOPMENT_URL': 'http://localhost:8080/',
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
"""
import os
from pip.download import PipSession
from pip.req import parse_requirements
from pip._internal.download import PipSession
from pip._internal.req import parse_requirements
from setuptools import find_packages, setup

# parse_requirements() returns generator of pip.req.InstallRequirement objects
Expand Down

0 comments on commit 7620810

Please sign in to comment.