From be4ddcc895f1424cdc92ba8bd8d315b69ae75c70 Mon Sep 17 00:00:00 2001 From: Open Risk Date: Thu, 21 Sep 2023 18:13:41 +0200 Subject: [PATCH] v0.6.2 (bump to Python 3.10) --- CHANGELOG.rst | 4 ++++ Dockerfile | 4 ++-- README.md | 2 +- createadmin.py | 22 +++++++++++++++++++++- dashboard.py | 20 ++++++++++++++++++++ docs/source/description.rst | 16 +++++++++++++++- docs/source/installation.rst | 2 +- manage.py | 21 ++++++++++++++++++++- npl_portfolio/apps.py | 20 ++++++++++++++++++++ openNPL/settings.py | 21 --------------------- openNPL/urls.py | 9 ++++----- setup.cfg | 6 +++--- setup.py | 4 ++-- sflp_portfolio/apps.py | 20 ++++++++++++++++++++ 14 files changed, 133 insertions(+), 38 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 8e7dec2..e0684b4 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -2,6 +2,10 @@ ChangeLog =========================== PLEASE NOTE THIS IS ONLY A BETA RELEASE. THE OPENNPL API IS STILL UNSTABLE +v0.6.2 (21-09-2023) +------------------- +* Dependencies: Upgrade to Python 3.10 + v0.6.1 (03-04-2023) ------------------- * Functionality: Complete SFLP Template Loading diff --git a/Dockerfile b/Dockerfile index ea7b61f..929cbd9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ -FROM python:3.9-slim -LABEL version="0.6" +FROM python:3.10-slim +LABEL version="0.6.1" LABEL author="Open Risk " LABEL description="openNPL: Open Source Credit Portfolio Management" LABEL maintainer="info@openrisk.eu" diff --git a/README.md b/README.md index b40396f..ceec144 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,7 @@ Manual installation from the repository source files requires some familiarity w ### Prerequisites - openNPL requires a working Python 3 installation (including pip) -- Python >= 3.9 +- Python >= 3.10 - Django >= 4.0 - The precise python library dependencies are listed in the :doc:`requirements`.txt file. - Note: The current User Interface (UI) is desktop oriented and might not work properly in smaller mobile screens diff --git a/createadmin.py b/createadmin.py index 2f065eb..490b069 100644 --- a/createadmin.py +++ b/createadmin.py @@ -1,6 +1,26 @@ #!/usr/bin/env python -"""Create a standard admin user for testing purposes""" +# Copyright (c) 2020 - 2023 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. + import os + import django os.environ['DJANGO_SETTINGS_MODULE'] = 'openNPL.settings' diff --git a/dashboard.py b/dashboard.py index 57b6cc3..91658a7 100644 --- a/dashboard.py +++ b/dashboard.py @@ -1,3 +1,23 @@ +# Copyright (c) 2020 - 2023 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. + """ ATTN: Deprecated diff --git a/docs/source/description.rst b/docs/source/description.rst index 938ebaf..6d39644 100644 --- a/docs/source/description.rst +++ b/docs/source/description.rst @@ -51,7 +51,7 @@ The openNPL distribution has the following structure: +=========+===============+====================+=======================================+ | openNPL | | | The root directory | +---------+---------------+--------------------+---------------------------------------+ -| | npl_portfolio | | DIR: The core python files | +| | npl_portfolio | | DIR: EBA NPL portfolio app | +---------+---------------+--------------------+---------------------------------------+ | | | models.py | Portfolio level models | +---------+---------------+--------------------+---------------------------------------+ @@ -63,6 +63,12 @@ The openNPL distribution has the following structure: +---------+---------------+--------------------+---------------------------------------+ | | | fixtures | DIR: Sample data in JSON format | +---------+---------------+--------------------+---------------------------------------+ +| | sflp_portfolio| | DIR: US Single Family loan app | ++---------+---------------+--------------------+---------------------------------------+ +| | | models | DIR: model files | ++---------+---------------+--------------------+---------------------------------------+ +| | | fixtures | DIR: Sample data in JSON format | ++---------+---------------+--------------------+---------------------------------------+ | | start | | DIR: Templates for the front end | +---------+---------------+--------------------+---------------------------------------+ | | openNPL | | DIR: Application configuration files | @@ -81,11 +87,19 @@ Core Data Models ---------------- The core data models currently implemented are: +EBA NPL Portfolio +~~~~~~~~~~~~~~~~~~ + - **Portfolio** (Segments the loan level data into distinct portfolios) - **Portfolio_Snapshot** (Segments the loan level data into temporal snapshots / cutoff dates) - **8 NPL Tables** (Implementing the core European Banking Authority NPL template specification) - **User** (Inheriting from Django User model) +US Single Family Portfolio +~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. TODO:: + Installation Options -------------------- The :doc:`/installation` page provides guidance with the current installation options diff --git a/docs/source/installation.rst b/docs/source/installation.rst index 024314a..784e2a2 100644 --- a/docs/source/installation.rst +++ b/docs/source/installation.rst @@ -65,7 +65,7 @@ Dependencies / Requirements .. note:: A Linux based system is recommended but with minor tweaks it is in principle also possible to deploy in Windows systems - openNPL requires a working Python 3 installation (including pip) -- Python >= 3.9 +- Python >= 3.10 - Django >= 4.0 - The precise python library dependencies are listed in the :doc:`requirements`.txt file. - openNPL may work with earlier versions of these packages but this has not been tested diff --git a/manage.py b/manage.py index dfeb7f4..f2ddeb1 100755 --- a/manage.py +++ b/manage.py @@ -1,5 +1,24 @@ #!/usr/bin/env python -"""openNPL / Django's command-line utility for administrative tasks.""" +# Copyright (c) 2020 - 2023 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. + import os import sys diff --git a/npl_portfolio/apps.py b/npl_portfolio/apps.py index 9177ac8..2c0b945 100755 --- a/npl_portfolio/apps.py +++ b/npl_portfolio/apps.py @@ -1,3 +1,23 @@ +# Copyright (c) 2020 - 2023 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 django.apps import AppConfig diff --git a/openNPL/settings.py b/openNPL/settings.py index 33e27cd..f03e9da 100644 --- a/openNPL/settings.py +++ b/openNPL/settings.py @@ -25,25 +25,16 @@ """ import os -# import grappelli from django.utils.translation import gettext_lazy as _ BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) - -# Quick-start development settings - unsuitable for production - -# SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = '@e=)h@ikk@p6an)s-e_wpt57p6%h%g$*ra#*g+xg2xr+9xd9tg' - -# SECURITY WARNING: don't run with debug turned on in production! DEBUG = True ALLOWED_HOSTS = ['localhost', '0.0.0.0', '127.0.0.1', 'www.equinoxpoint.org'] INSTALLED_APPS = [ 'jazzmin', - # 'grappelli', - # 'grappelli.dashboard', 'django.contrib.admin', 'django.contrib.admindocs', 'django.contrib.auth', @@ -83,20 +74,15 @@ ] ROOT_URLCONF = 'openNPL.urls' - ROOT_VIEW = "http://localhost:8001" - SITE_ID = 1 SITE_URL = "http://127.0.0.1:8001/" - MEDIA_ROOT = os.path.join(BASE_DIR, 'uploads/') MEDIA_URL = '/uploads/' TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', - # 'DIRS': [os.path.join(BASE_DIR, 'templates'), os.path.join(BASE_DIR, 'templates/admin'), - # os.path.dirname(grappelli.__file__)], 'DIRS': [os.path.join(BASE_DIR, 'templates'), os.path.join(BASE_DIR, 'templates/admin')], 'APP_DIRS': True, 'OPTIONS': { @@ -159,16 +145,11 @@ ) DATA_UPLOAD_MAX_NUMBER_FIELDS = 10000 - TIME_ZONE = 'UTC' - USE_I18N = True - USE_L10N = True - USE_TZ = True -# Debug-Toolbar INTERNAL_IPS = [ '127.0.0.1', ] @@ -176,8 +157,6 @@ STATIC_URL = '/static/' STATIC_ROOT = os.path.join(BASE_DIR, 'static') -# GRAPPELLI_ADMIN_TITLE = 'openNPL' - JAZZMIN_SETTINGS = { # Whether to show the UI customizer on the sidebar # "show_ui_builder": False, diff --git a/openNPL/urls.py b/openNPL/urls.py index 483c0f8..6bed17c 100644 --- a/openNPL/urls.py +++ b/openNPL/urls.py @@ -37,12 +37,11 @@ from django.conf.urls.static import static from django.contrib import admin from django.urls import path, include, re_path - -from . import npl_views, sflp_views, settings - -from rest_framework import permissions -from drf_yasg.views import get_schema_view from drf_yasg import openapi +from drf_yasg.views import get_schema_view +from rest_framework import permissions + +from . import npl_views, settings schema_view = get_schema_view( openapi.Info( diff --git a/setup.cfg b/setup.cfg index 4b52a45..288b8cd 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,7 +1,7 @@ [metadata] license_file = LICENSE name = openNPL -version = 0.5 +version = 0.6.2 description = Open source platform for the management of non-performing loans long_description = file:description_short.rst url = https://github.com/open-risk/openNPL @@ -13,7 +13,7 @@ classifiers = License :: OSI Approved :: MIT License Operating System :: OS Independent Programming Language :: Python :: 3 :: Only - Programming Language :: Python :: 3.9 + Programming Language :: Python :: 3.10 Programming Language :: Python :: Implementation :: CPython Topic :: Scientific/Engineering Topic :: Scientific/Engineering :: Information Analysis @@ -36,7 +36,7 @@ max-complexity = 10 [options] include_package_data = true -python_requires = >=3.9 +python_requires = >=3.10 setup_requires = setuptools >= 38.3.0 install_requires = diff --git a/setup.py b/setup.py index 7ecb6b6..b01320e 100644 --- a/setup.py +++ b/setup.py @@ -23,7 +23,7 @@ from setuptools import setup -__version__ = '0.5' +__version__ = '0.6.2' ver = __version__ @@ -54,7 +54,7 @@ 'License :: OSI Approved :: Apache Software License', 'Operating System :: OS Independent', 'Programming Language :: Python :: 3 :: Only', - 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', 'Topic :: Scientific/Engineering', 'Topic :: Scientific/Engineering :: Information Analysis' ] diff --git a/sflp_portfolio/apps.py b/sflp_portfolio/apps.py index e961f5c..87bdf7d 100755 --- a/sflp_portfolio/apps.py +++ b/sflp_portfolio/apps.py @@ -1,3 +1,23 @@ +# Copyright (c) 2020 - 2023 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 django.apps import AppConfig