diff --git a/documentation/conf.py b/documentation/conf.py index ef945899a..d8cd08d20 100644 --- a/documentation/conf.py +++ b/documentation/conf.py @@ -221,7 +221,7 @@ # -- Options for intersphinx extension --------------------------------------- # Example configuration for intersphinx: refer to the Python standard library. -intersphinx_mapping = {"https://docs.python.org/3/": None} +intersphinx_mapping = {"python": ("https://docs.python.org/3", None)} # -- Options for copybytton extension --------------------------------------- copybutton_prompt_is_regexp = True diff --git a/flexmeasures/app.py b/flexmeasures/app.py index 051600508..b26c0aad3 100644 --- a/flexmeasures/app.py +++ b/flexmeasures/app.py @@ -73,7 +73,9 @@ def create( # noqa C901 if app.testing: from fakeredis import FakeStrictRedis - redis_conn = FakeStrictRedis() + redis_conn = FakeStrictRedis( + host="redis", port="1234" + ) # dummy connection details else: redis_conn = Redis( app.config["FLEXMEASURES_REDIS_URL"], diff --git a/flexmeasures/data/services/users.py b/flexmeasures/data/services/users.py index 3a331a3d8..ed786d0e4 100644 --- a/flexmeasures/data/services/users.py +++ b/flexmeasures/data/services/users.py @@ -8,10 +8,10 @@ from flask_security.recoverable import update_password from email_validator import ( validate_email, - validate_email_deliverability, EmailNotValidError, EmailUndeliverableError, ) +from email_validator.deliverability import validate_email_deliverability from flask_security.utils import hash_password from werkzeug.exceptions import NotFound diff --git a/requirements/app.in b/requirements/app.in index 684b2bafe..2809f4ec9 100644 --- a/requirements/app.in +++ b/requirements/app.in @@ -9,7 +9,9 @@ iso8601 xlrd workalendar inflection -inflect +# <6.0.2 and pydantic due to https://github.com/jaraco/inflect/issues/187 +inflect<=6.0.2 +pydantic<2 humanize psycopg2-binary bcrypt @@ -21,6 +23,7 @@ click click-default-group email_validator rq +# rq-dashboard-compatible # use this if compatibility with Flask 2.3 is not done rq-dashboard # the following uses environment markers (see PEP 496) rq-win; os_name == 'nt' or os_name == 'win' @@ -37,15 +40,20 @@ importlib_metadata # see GH#607 for issue on this pin sqlalchemy>=1.4.0, <2 Flask-SSLify +# use <0.4 if not compatible with Flask2.2 yet Flask_JSON Flask-Migrate Flask-WTF Flask-Mail -Flask-Security-Too>=5.0 -# This pin is tough to debug, but logging in (in API) stops working at 0.6.2. Maybe Flask 2.2 will help resolve this. -Flask-Login <= 0.6.1 -Flask-Classful -Flask-Marshmallow +# <5.2: https://github.com/Parallels/rq-dashboard/issues/417 as 5.2 requires Flask 2.3 +Flask-Security-Too>=5.0, <5.2 +# This pin is tough to debug, but logging in (in API) stops working at 0.6.2. +# On repeated call to API with auth token, user is anonymous. +# See test_get_one_user or test_api_task_run_post_unauthorized_wrong_role for a good example +Flask-Login<0.6.2 +Flask-Classful @ git+https://github.com/superseed/flask-classful@werkzeug-2.2 +# <0.15: https://github.com/marshmallow-code/flask-marshmallow/issues/262 +Flask-Marshmallow<0.15 Flask-Cors sentry-sdk[flask] marshmallow>=3 @@ -57,5 +65,6 @@ uniplot>=0.7.0 # Maximum constraints here due to Flask-Classful not supporting Werkzeug 2.2.0 yet, see GH#595 and https://github.com/teracyhq/flask-classful/pull/145 Flask-SQLAlchemy>=2.4.3,<3 # flask should be after all the flask plugins, because setup might find they ARE flask -flask>=1.0,<=2.1.2 -werkzeug <2.1 +# <2.3: https://github.com/Parallels/rq-dashboard/issues/417 and https://github.com/FlexMeasures/flexmeasures/issues/754 and flask-login 0.6.1 not compatible +flask>=1.0, <=2.1.2 +werkzeug<=2.1 diff --git a/requirements/app.txt b/requirements/app.txt index 3b4170198..340a23f4d 100644 --- a/requirements/app.txt +++ b/requirements/app.txt @@ -1,30 +1,30 @@ # -# This file is autogenerated by pip-compile with Python 3.9 +# This file is autogenerated by pip-compile with Python 3.10 # by the following command: # # pip-compile --output-file=requirements/app.txt requirements/app.in # -alembic==1.10.2 +alembic==1.11.1 # via flask-migrate -altair==4.2.2 +altair==5.0.1 # via -r requirements/app.in arrow==1.2.3 # via rq-dashboard async-timeout==4.0.2 # via redis -attrs==22.2.0 +attrs==23.1.0 # via jsonschema babel==2.12.1 # via py-moneyed bcrypt==4.0.1 # via -r requirements/app.in -blinker==1.5 +blinker==1.6.2 # via # flask-mail # flask-principal # flask-security-too # sentry-sdk -certifi==2022.12.7 +certifi==2023.5.7 # via # requests # sentry-sdk @@ -40,25 +40,23 @@ click-default-group==1.2.2 # via -r requirements/app.in colour==0.1.5 # via -r requirements/app.in -contourpy==1.0.7 +contourpy==1.1.0 # via matplotlib convertdate==2.4.0 # via workalendar cycler==0.11.0 # via matplotlib -deprecated==1.2.13 +deprecated==1.2.14 # via sktime dill==0.3.6 # via openturns dnspython==2.3.0 # via email-validator -email-validator==1.3.1 +email-validator==2.0.0.post2 # via # -r requirements/app.in # flask-security-too -entrypoints==0.4 - # via altair -filelock==3.10.7 +filelock==3.12.2 # via tldextract flask==2.1.2 # via @@ -77,9 +75,9 @@ flask==2.1.2 # flask-wtf # rq-dashboard # sentry-sdk -flask-classful==0.14.2 +flask-classful @ git+https://github.com/superseed/flask-classful@werkzeug-2.2 # via -r requirements/app.in -flask-cors==3.0.10 +flask-cors==4.0.0 # via -r requirements/app.in flask-json==0.3.5 # via -r requirements/app.in @@ -107,29 +105,26 @@ flask-wtf==1.1.1 # via # -r requirements/app.in # flask-security-too -fonttools==4.39.3 +fonttools==4.40.0 # via matplotlib greenlet==2.0.2 # via sqlalchemy -humanize==4.6.0 +humanize==4.7.0 # via -r requirements/app.in idna==3.4 # via # email-validator # requests # tldextract -importlib-metadata==6.1.0 +importlib-metadata==6.7.0 # via # -r requirements/app.in - # flask # timely-beliefs -importlib-resources==5.12.0 - # via matplotlib inflect==6.0.2 # via -r requirements/app.in inflection==0.5.1 # via -r requirements/app.in -iso8601==1.1.0 +iso8601==2.0.0 # via -r requirements/app.in isodate==0.6.1 # via @@ -144,22 +139,21 @@ jinja2==3.1.2 # via # altair # flask -joblib==1.2.0 +joblib==1.3.1 # via scikit-learn jsonschema==4.17.3 # via altair kiwisolver==1.4.4 # via matplotlib -llvmlite==0.39.1 - # via numba lunardate==0.2.0 # via workalendar mako==1.2.4 # via alembic -markupsafe==2.1.2 +markupsafe==2.1.3 # via # jinja2 # mako + # sentry-sdk # wtforms marshmallow==3.19.0 # via @@ -174,15 +168,12 @@ marshmallow-sqlalchemy==0.29.0 # via -r requirements/app.in matplotlib==3.7.1 # via timetomodel -numba==0.56.4 - # via sktime numpy==1.23.5 # via # -r requirements/app.in # altair # contourpy # matplotlib - # numba # pandas # patsy # properscoring @@ -193,16 +184,17 @@ numpy==1.23.5 # timely-beliefs # timetomodel # uniplot -openturns==1.20.post3 +openturns==1.21 # via timely-beliefs -packaging==23.0 +packaging==23.1 # via # marshmallow # marshmallow-sqlalchemy # matplotlib + # sktime # statsmodels # webargs -pandas==1.5.3 +pandas==2.0.3 # via # -r requirements/app.in # altair @@ -214,9 +206,9 @@ passlib==1.7.4 # via flask-security-too patsy==0.5.3 # via statsmodels -pillow==9.4.0 +pillow==9.5.0 # via matplotlib -pint==0.20.1 +pint==0.22 # via -r requirements/app.in ply==3.11 # via pyomo @@ -224,23 +216,25 @@ properscoring==0.1 # via timely-beliefs pscript==0.7.7 # via -r requirements/app.in -psutil==5.9.4 +psutil==5.9.5 # via openturns -psycopg2-binary==2.9.5 +psycopg2-binary==2.9.6 # via # -r requirements/app.in # timely-beliefs py-moneyed==3.0 # via -r requirements/app.in -pydantic==1.10.7 - # via inflect +pydantic==1.10.10 + # via + # -r requirements/app.in + # inflect pyluach==2.2.0 # via workalendar pymeeus==0.5.12 # via convertdate -pyomo==6.5.0 +pyomo==6.6.1 # via -r requirements/app.in -pyparsing==3.0.9 +pyparsing==3.1.0 # via matplotlib pyrsistent==0.19.3 # via jsonschema @@ -259,28 +253,30 @@ pytz==2023.3 # pandas # timely-beliefs # timetomodel -redis==4.5.4 +redis==4.6.0 # via # -r requirements/app.in # rq # rq-dashboard -requests==2.28.2 +requests==2.31.0 # via # requests-file # tldextract requests-file==1.5.1 # via tldextract -rq==1.13.0 +rq==1.15.1 # via # -r requirements/app.in # rq-dashboard rq-dashboard==0.6.1 # via -r requirements/app.in +scikit-base==0.5.0 + # via sktime scikit-learn==1.2.2 # via # sktime # timetomodel -scipy==1.10.1 +scipy==1.11.1 # via # properscoring # scikit-learn @@ -288,19 +284,18 @@ scipy==1.10.1 # statsmodels # timely-beliefs # timetomodel -sentry-sdk[flask]==1.18.0 +sentry-sdk[flask]==1.26.0 # via -r requirements/app.in six==1.16.0 # via - # flask-cors # flask-marshmallow # isodate # patsy # python-dateutil # requests-file -sktime==0.16.1 +sktime==0.20.0 # via timely-beliefs -sqlalchemy==1.4.47 +sqlalchemy==1.4.48 # via # -r requirements/app.in # alembic @@ -308,34 +303,38 @@ sqlalchemy==1.4.47 # marshmallow-sqlalchemy # timely-beliefs # timetomodel -statsmodels==0.13.5 +statsmodels==0.14.0 # via timetomodel tabulate==0.9.0 # via -r requirements/app.in threadpoolctl==3.1.0 # via scikit-learn -timely-beliefs[forecast]==1.20.1 +timely-beliefs[forecast]==1.21.0 # via -r requirements/app.in timetomodel==0.7.3 # via -r requirements/app.in -tldextract==3.4.0 +tldextract==3.4.4 # via -r requirements/app.in toolz==0.12.0 # via altair -typing-extensions==4.5.0 +typing-extensions==4.7.0 # via # alembic + # altair + # pint # py-moneyed # pydantic +tzdata==2023.3 + # via pandas uniplot==0.10.0 # via -r requirements/app.in -urllib3==1.26.15 +urllib3==2.0.3 # via # requests # sentry-sdk webargs==8.2.0 # via -r requirements/app.in -werkzeug==2.0.3 +werkzeug==2.1.0 # via # -r requirements/app.in # flask @@ -351,9 +350,7 @@ wtforms==3.0.1 xlrd==2.0.1 # via -r requirements/app.in zipp==3.15.0 - # via - # importlib-metadata - # importlib-resources + # via importlib-metadata # The following packages are considered to be unsafe in a requirements file: # setuptools diff --git a/requirements/dev.txt b/requirements/dev.txt index 625d3f8a8..332320639 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile with Python 3.9 +# This file is autogenerated by pip-compile with Python 3.10 # by the following command: # # pip-compile --output-file=requirements/dev.txt requirements/dev.in @@ -15,7 +15,7 @@ click==8.1.3 # black distlib==0.3.6 # via virtualenv -filelock==3.10.7 +filelock==3.12.2 # via # -c requirements/app.txt # virtualenv @@ -23,30 +23,30 @@ flake8==4.0.1 # via -r requirements/dev.in flake8-blind-except==0.2.1 # via -r requirements/dev.in -identify==2.5.22 +identify==2.5.24 # via pre-commit mccabe==0.6.1 # via flake8 -mypy==1.1.1 +mypy==1.4.1 # via -r requirements/dev.in mypy-extensions==1.0.0 # via # black # mypy -nodeenv==1.7.0 +nodeenv==1.8.0 # via pre-commit -packaging==23.0 +packaging==23.1 # via # -c requirements/app.txt # -c requirements/test.txt # setuptools-scm pathspec==0.11.1 # via black -platformdirs==3.2.0 +platformdirs==3.8.0 # via # black # virtualenv -pre-commit==3.2.1 +pre-commit==3.3.3 # via -r requirements/dev.in pycodestyle==2.8.0 # via flake8 @@ -66,13 +66,12 @@ tomli==2.0.1 # black # mypy # setuptools-scm -typing-extensions==4.5.0 +typing-extensions==4.7.0 # via # -c requirements/app.txt - # black # mypy # setuptools-scm -virtualenv==20.21.0 +virtualenv==20.23.1 # via pre-commit watchdog==3.0.0 # via -r requirements/dev.in diff --git a/requirements/docs.txt b/requirements/docs.txt index baa53083b..722bf528c 100644 --- a/requirements/docs.txt +++ b/requirements/docs.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile with Python 3.9 +# This file is autogenerated by pip-compile with Python 3.10 # by the following command: # # pip-compile --output-file=requirements/docs.txt requirements/docs.in @@ -10,7 +10,7 @@ babel==2.12.1 # via # -c requirements/app.txt # sphinx -certifi==2022.12.7 +certifi==2023.5.7 # via # -c requirements/app.txt # requests @@ -29,27 +29,23 @@ idna==3.4 # requests imagesize==1.4.1 # via sphinx -importlib-metadata==6.1.0 - # via - # -c requirements/app.txt - # sphinx jinja2==3.1.2 # via # -c requirements/app.txt # sphinx -markupsafe==2.1.2 +markupsafe==2.1.3 # via # -c requirements/app.txt # jinja2 -packaging==23.0 +packaging==23.1 # via # -c requirements/app.txt # sphinx -pygments==2.14.0 +pygments==2.15.1 # via # sphinx # sphinx-tabs -requests==2.28.2 +requests==2.31.0 # via # -c requirements/app.txt # sphinx @@ -59,7 +55,7 @@ six==1.16.0 # sphinxcontrib-httpdomain snowballstemmer==2.2.0 # via sphinx -sphinx==6.1.3 +sphinx==6.2.1 # via # -r requirements/docs.in # sphinx-copybutton @@ -68,11 +64,11 @@ sphinx==6.1.3 # sphinx-tabs # sphinxcontrib-httpdomain # sphinxcontrib-jquery -sphinx-copybutton==0.5.1 +sphinx-copybutton==0.5.2 # via -r requirements/docs.in sphinx-fontawesome==0.0.6 # via -r requirements/docs.in -sphinx-rtd-theme==1.2.0 +sphinx-rtd-theme==1.2.2 # via -r requirements/docs.in sphinx-tabs==3.4.1 # via -r requirements/docs.in @@ -92,11 +88,7 @@ sphinxcontrib-qthelp==1.0.3 # via sphinx sphinxcontrib-serializinghtml==1.1.5 # via sphinx -urllib3==1.26.15 +urllib3==2.0.3 # via # -c requirements/app.txt # requests -zipp==3.15.0 - # via - # -c requirements/app.txt - # importlib-metadata diff --git a/requirements/test.txt b/requirements/test.txt index edd5791ca..3dc640eaa 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile with Python 3.9 +# This file is autogenerated by pip-compile with Python 3.10 # by the following command: # # pip-compile --output-file=requirements/test.txt requirements/test.in @@ -8,11 +8,7 @@ async-timeout==4.0.2 # via # -c requirements/app.txt # redis -attrs==22.2.0 - # via - # -c requirements/app.txt - # pytest -certifi==2022.12.7 +certifi==2023.5.7 # via # -c requirements/app.txt # requests @@ -24,11 +20,11 @@ click==8.1.3 # via # -c requirements/app.txt # flask -coverage[toml]==7.2.2 +coverage[toml]==7.2.7 # via pytest-cov exceptiongroup==1.1.1 # via pytest -fakeredis==2.10.2 +fakeredis==2.15.0 # via -r requirements/test.in flask==2.1.2 # via @@ -38,10 +34,6 @@ idna==3.4 # via # -c requirements/app.txt # requests -importlib-metadata==6.1.0 - # via - # -c requirements/app.txt - # flask iniconfig==2.0.0 # via pytest itsdangerous==2.1.2 @@ -52,41 +44,41 @@ jinja2==3.1.2 # via # -c requirements/app.txt # flask -lupa==1.14.1 +lupa==2.0 # via -r requirements/test.in -markupsafe==2.1.2 +markupsafe==2.1.3 # via # -c requirements/app.txt # jinja2 -packaging==23.0 +packaging==23.1 # via # -c requirements/app.txt # pytest # pytest-sugar -pluggy==1.0.0 +pluggy==1.2.0 # via pytest -pytest==7.2.2 +pytest==7.4.0 # via # -r requirements/test.in # pytest-cov # pytest-flask # pytest-sugar -pytest-cov==4.0.0 +pytest-cov==4.1.0 # via -r requirements/test.in pytest-flask==1.2.0 # via -r requirements/test.in -pytest-sugar==0.9.6 +pytest-sugar==0.9.7 # via -r requirements/test.in -redis==4.5.4 +redis==4.6.0 # via # -c requirements/app.txt # fakeredis -requests==2.28.2 +requests==2.31.0 # via # -c requirements/app.txt # -r requirements/test.in # requests-mock -requests-mock==1.10.0 +requests-mock==1.11.0 # via -r requirements/test.in six==1.16.0 # via @@ -94,22 +86,18 @@ six==1.16.0 # requests-mock sortedcontainers==2.4.0 # via fakeredis -termcolor==2.2.0 +termcolor==2.3.0 # via pytest-sugar tomli==2.0.1 # via # coverage # pytest -urllib3==1.26.15 +urllib3==2.0.3 # via # -c requirements/app.txt # requests -werkzeug==2.0.3 +werkzeug==2.1.0 # via # -c requirements/app.txt # flask # pytest-flask -zipp==3.15.0 - # via - # -c requirements/app.txt - # importlib-metadata