Skip to content

Commit

Permalink
Release 0.3 (upgrade to python 3.9 / django 4.0)
Browse files Browse the repository at this point in the history
  • Loading branch information
open-risk committed Mar 1, 2022
1 parent 8466fda commit 784e066
Show file tree
Hide file tree
Showing 10 changed files with 120 additions and 86 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.7-slim
FROM python:3.9-slim
MAINTAINER Open Risk <www.openriskmanagement.com>
LABEL maintainer="[email protected]"
EXPOSE 8080
Expand Down
21 changes: 9 additions & 12 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,29 @@
#
import sys
import os
sys.path.insert(0, os.path.abspath('../../'))

os.environ['DJANGO_SETTINGS_MODULE'] = 'equinox.settings'
sys.path.append(os.path.abspath('../../'))

# os.environ['DJANGO_SETTINGS_MODULE'] = 'equinox.settings'
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'equinox.settings')

import django

django.setup()

__version__ = '0.2'
__version__ = '0.3'

# -- Project information -----------------------------------------------------

project = 'equinox'
copyright = '2021, Open Risk'
copyright = '2021 - 2022, Open Risk'
author = 'Open Risk'

# The short X.Y version
version = ''
# The full version, including alpha/beta/rc tags
release = __version__


# -- General configuration ---------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
Expand Down Expand Up @@ -81,7 +84,6 @@
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'


# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
Expand Down Expand Up @@ -111,7 +113,6 @@
'titles_only': False
}


# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
Expand All @@ -134,7 +135,6 @@
# Output file base name for HTML help builder.
htmlhelp_basename = 'equinoxdoc'


# -- Options for LaTeX output ------------------------------------------------

latex_elements = {
Expand Down Expand Up @@ -163,7 +163,6 @@
'Open Risk', 'manual'),
]


# -- Options for manual page output ------------------------------------------

# One entry per manual page. List of tuples
Expand All @@ -173,7 +172,6 @@
[author], 1)
]


# -- Options for Texinfo output ----------------------------------------------

# Grouping the document tree into Texinfo files. List of tuples
Expand All @@ -185,11 +183,10 @@
'Miscellaneous'),
]


# -- Extension configuration -------------------------------------------------

extensions.append('sphinx.ext.todo')
todo_include_todos=True
todo_include_todos = True

# extensions.append('sphinx_automodapi.automodapi')
# numpydoc_show_class_members = False
2 changes: 1 addition & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Overview
* Author: `Open Risk <http://www.openriskmanagement.com>`_
* License: MIT
* Development Website: `Github <https://github.com/open-risk/equinox>`_
* Online Code Documentation: `Read The Docs <https://equinox.readthedocs.io/en/latest/>`_
* Online Code Documentation: `Read The Docs <https://equinox-server.readthedocs.io/en/latest/>`_
* Project Discussion: `Open Risk Commons <https://www.openriskcommons.org/c/sustainable-finance>`_
* Docker Image: Coming
* Training: Coming: `Open Risk Academy <https://www.openriskacademy.com/>`_
Expand Down
1 change: 1 addition & 0 deletions equinox/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent
# BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/3.1/howto/deployment/checklist/
Expand Down
17 changes: 2 additions & 15 deletions requirements-docs.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,2 @@
Sphinx==3.5.4
sphinx-rtd-theme==0.5.2
sphinxcontrib-applehelp==1.0.2
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-htmlhelp==1.0.3
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.4
Django==3.2.9
django-jazzmin==2.4.8
django-json-widget==1.1.1
djangorestframework==3.12.4
drf-yasg==1.20.0
django-treebeard==4.5.1
django-geojson==3.2.0
Sphinx>=4.4.0
sphinx-rtd-theme>=1.0.0
66 changes: 15 additions & 51 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,51 +1,15 @@
alabaster==0.7.12
asgiref==3.5.0
Babel==2.9.1
backports.zoneinfo==0.2.1
bleach==4.1.0
certifi==2021.10.8
chardet==4.0.0
charset-normalizer==2.0.10
coreapi==2.3.3
coreschema==0.0.4
Django==4.0.1
django-debug-toolbar==3.2.4
django-geojson==3.2.0
django-jazzmin==2.4.9
django-json-widget==1.1.1
django-leaflet==0.28.2
django-markdownfield==0.10.0
django-treebeard==4.5.1
djangorestframework==3.13.1
docutils==0.18.1
drf-yasg==1.20.0
future==0.18.2
idna==3.3
imagesize==1.3.0
importlib-metadata==4.10.1
inflection==0.5.1
itypes==1.2.0
Jinja2==3.0.3
jsonfield==3.1.0
Markdown==3.3.6
MarkupSafe==2.0.1
numpy==1.21.5
packaging==21.3
pandas==1.3.5
Pillow==9.0.0
Pygments==2.11.2
pyparsing==3.0.7
python-dateutil==2.8.2
pytz==2021.3
requests==2.27.1
ruamel.yaml==0.17.20
ruamel.yaml.clib==0.2.6
shortuuid==1.0.8
six==1.16.0
snowballstemmer==2.2.0
sqlparse==0.4.2
typing_extensions==4.0.1
uritemplate==4.1.1
urllib3==1.26.8
webencodings==0.5.1
zipp==3.7.0
Django
django-debug-toolbar
django-geojson
django-jazzmin
django-json-widget
django-leaflet
django-markdownfield
django-treebeard
djangorestframework
drf-yasg
jsonfield
Markdown
numpy
pandas
Pillow
9 changes: 4 additions & 5 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,20 @@ license = Apache
classifiers =
Environment :: Web Environment
Framework :: Django
Framework :: Django :: 3.2
Framework :: Django :: 4.0
Intended Audience :: Developers
License :: OSI Approved :: BSD License
Operating System :: OS Independent
Programming Language :: Python
Programming Language :: Python :: 3
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Topic :: Internet :: WWW/HTTP
Topic :: Internet :: WWW/HTTP :: Dynamic Content

[options]
include_package_data = true
packages = find:
python_requires = >=3.6
python_requires = >=3.9
install_requires =
Django >= 3.2
Django >= 4.0
61 changes: 60 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,62 @@
# Copyright (c) 2020 - 2022 Open Risk (https://www.openriskmanagement.com)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.


from codecs import open

from setuptools import setup

setup()
__version__ = '0.3'

ver = __version__

long_descr = open('docs/source/description.rst', 'r', encoding='utf8').read()

setup(name='equinox-server',
version=ver,
description='An open source platform for sustainable finance',
long_description=long_descr,
long_description_content_type='text/x-rst',
author='Open Risk',
author_email='[email protected]',
packages=['equinox'],
include_package_data=True,
url='https://github.com/open-risk/equinox',
install_requires=[
'Django'
],
zip_safe=False,
provides=['equinox'],
keywords=['sustainable finance', 'ghg emissions', 'pcaf', 'eeio', 'portfolio', 'loan', 'database'],
classifiers=[
'Environment :: Web Environment',
'Intended Audience :: Developers',
'Intended Audience :: Science/Research',
'Intended Audience :: Financial and Insurance Industry',
'Development Status :: 3 - Alpha',
'License :: OSI Approved :: Apache Software License',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3 :: Only',
'Programming Language :: Python :: 3.9',
'Topic :: Scientific/Engineering',
'Topic :: Scientific/Engineering :: Information Analysis'
]

)
Empty file added tests/__init__.py
Empty file.
27 changes: 27 additions & 0 deletions tests/test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
from django.http import HttpRequest
from django.test import SimpleTestCase
from django.urls import reverse

from equinox import views


# ATTN internationalization strings are not captured

class HomePageTests(SimpleTestCase):

def test_home_page_status_code(self):
response = self.client.get('/')
self.assertEquals(response.status_code, 200)

def test_view_url_by_name(self):
response = self.client.get(reverse('start:Front'))
self.assertEquals(response.status_code, 200)

def test_view_uses_correct_template(self):
response = self.client.get(reverse('start:Front'))
self.assertEquals(response.status_code, 200)
self.assertTemplateUsed(response, 'start/front.html')

def test_home_page_contains_correct_html(self):
response = self.client.get('/')
self.assertContains(response, '<h4>How does it work?</h4>')

0 comments on commit 784e066

Please sign in to comment.