Skip to content

Commit

Permalink
Fix deps and tests (#138)
Browse files Browse the repository at this point in the history
* update dependencies for python 3.10

* fix tests
  • Loading branch information
markdboyd authored Nov 1, 2024
1 parent 722ec25 commit 914071c
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 35 deletions.
75 changes: 44 additions & 31 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,109 +1,115 @@
#
# This file is autogenerated by pip-compile with Python 3.11
# This file is autogenerated by pip-compile with Python 3.10
# by the following command:
#
# pip-compile --output-file=dev-requirements.txt pip-tools/dev-requirements.in
#
async-timeout==5.0.0
# via
# -r /Users/markdboyd/development/opensearch-dashboards-cf-auth-proxy/requirements.txt
# redis
bandit==1.7.9
# via -r pip-tools/dev-requirements.in
black==24.4.2
# via -r pip-tools/dev-requirements.in
blinker==1.8.2
# via
# -r pip-tools/../requirements.txt
# -r /Users/markdboyd/development/opensearch-dashboards-cf-auth-proxy/requirements.txt
# flask
build==1.2.1
# via pip-tools
cachelib==0.13.0
# via
# -r pip-tools/../requirements.txt
# -r /Users/markdboyd/development/opensearch-dashboards-cf-auth-proxy/requirements.txt
# flask-session
certifi==2024.7.4
# via
# -r pip-tools/../requirements.txt
# -r /Users/markdboyd/development/opensearch-dashboards-cf-auth-proxy/requirements.txt
# requests
cffi==1.16.0
# via
# -r pip-tools/../requirements.txt
# -r /Users/markdboyd/development/opensearch-dashboards-cf-auth-proxy/requirements.txt
# cryptography
charset-normalizer==3.3.2
# via
# -r pip-tools/../requirements.txt
# -r /Users/markdboyd/development/opensearch-dashboards-cf-auth-proxy/requirements.txt
# requests
click==8.1.7
# via
# -r pip-tools/../requirements.txt
# -r /Users/markdboyd/development/opensearch-dashboards-cf-auth-proxy/requirements.txt
# black
# flask
# pip-tools
colorama==0.4.6
# via pytest-watch
cryptography==42.0.8
# via
# -r pip-tools/../requirements.txt
# -r /Users/markdboyd/development/opensearch-dashboards-cf-auth-proxy/requirements.txt
# jwcrypto
# pyjwt
dnspython==2.6.1
# via
# -r pip-tools/../requirements.txt
# -r /Users/markdboyd/development/opensearch-dashboards-cf-auth-proxy/requirements.txt
# eventlet
docopt==0.6.2
# via pytest-watch
environs==11.0.0
# via -r pip-tools/../requirements.txt
# via -r /Users/markdboyd/development/opensearch-dashboards-cf-auth-proxy/requirements.txt
eventlet==0.36.1
# via -r pip-tools/../requirements.txt
# via -r /Users/markdboyd/development/opensearch-dashboards-cf-auth-proxy/requirements.txt
exceptiongroup==1.2.2
# via pytest
flask==3.0.3
# via
# -r pip-tools/../requirements.txt
# -r /Users/markdboyd/development/opensearch-dashboards-cf-auth-proxy/requirements.txt
# flask-session
flask-session[redis]==0.8.0
# via -r pip-tools/../requirements.txt
# via -r /Users/markdboyd/development/opensearch-dashboards-cf-auth-proxy/requirements.txt
greenlet==3.0.3
# via
# -r pip-tools/../requirements.txt
# -r /Users/markdboyd/development/opensearch-dashboards-cf-auth-proxy/requirements.txt
# eventlet
# playwright
gunicorn==22.0.0
# via -r pip-tools/../requirements.txt
# via -r /Users/markdboyd/development/opensearch-dashboards-cf-auth-proxy/requirements.txt
idna==3.7
# via
# -r pip-tools/../requirements.txt
# -r /Users/markdboyd/development/opensearch-dashboards-cf-auth-proxy/requirements.txt
# requests
iniconfig==2.0.0
# via pytest
itsdangerous==2.2.0
# via
# -r pip-tools/../requirements.txt
# -r /Users/markdboyd/development/opensearch-dashboards-cf-auth-proxy/requirements.txt
# flask
jinja2==3.1.4
# via
# -r pip-tools/../requirements.txt
# -r /Users/markdboyd/development/opensearch-dashboards-cf-auth-proxy/requirements.txt
# flask
jwcrypto==1.5.6
# via -r pip-tools/../requirements.txt
# via -r /Users/markdboyd/development/opensearch-dashboards-cf-auth-proxy/requirements.txt
markdown-it-py==3.0.0
# via rich
markupsafe==2.1.5
# via
# -r pip-tools/../requirements.txt
# -r /Users/markdboyd/development/opensearch-dashboards-cf-auth-proxy/requirements.txt
# jinja2
# werkzeug
marshmallow==3.21.3
# via
# -r pip-tools/../requirements.txt
# -r /Users/markdboyd/development/opensearch-dashboards-cf-auth-proxy/requirements.txt
# environs
mdurl==0.1.2
# via markdown-it-py
msgspec==0.18.6
# via
# -r pip-tools/../requirements.txt
# -r /Users/markdboyd/development/opensearch-dashboards-cf-auth-proxy/requirements.txt
# flask-session
mypy-extensions==1.0.0
# via black
packaging==24.1
# via
# -r pip-tools/../requirements.txt
# -r /Users/markdboyd/development/opensearch-dashboards-cf-auth-proxy/requirements.txt
# black
# build
# gunicorn
Expand All @@ -125,14 +131,14 @@ pluggy==1.5.0
# via pytest
pycparser==2.22
# via
# -r pip-tools/../requirements.txt
# -r /Users/markdboyd/development/opensearch-dashboards-cf-auth-proxy/requirements.txt
# cffi
pyee==11.1.0
# via playwright
pygments==2.18.0
# via rich
pyjwt[crypto]==2.8.0
# via -r pip-tools/../requirements.txt
# via -r /Users/markdboyd/development/opensearch-dashboards-cf-auth-proxy/requirements.txt
pyotp==2.9.0
# via -r pip-tools/dev-requirements.in
pyproject-hooks==1.1.0
Expand All @@ -153,19 +159,19 @@ pytest-watch==4.2.0
# via -r pip-tools/dev-requirements.in
python-dotenv==1.0.1
# via
# -r pip-tools/../requirements.txt
# -r /Users/markdboyd/development/opensearch-dashboards-cf-auth-proxy/requirements.txt
# environs
python-slugify==8.0.4
# via pytest-playwright
pyyaml==6.0.1
# via bandit
redis==5.0.7
# via
# -r pip-tools/../requirements.txt
# -r /Users/markdboyd/development/opensearch-dashboards-cf-auth-proxy/requirements.txt
# flask-session
requests==2.32.3
# via
# -r pip-tools/../requirements.txt
# -r /Users/markdboyd/development/opensearch-dashboards-cf-auth-proxy/requirements.txt
# pytest-base-url
# requests-mock
requests-mock==1.12.1
Expand All @@ -176,20 +182,27 @@ stevedore==5.2.0
# via bandit
text-unidecode==1.3
# via python-slugify
tomli==2.0.2
# via
# black
# build
# pip-tools
# pytest
typing-extensions==4.12.2
# via
# -r pip-tools/../requirements.txt
# -r /Users/markdboyd/development/opensearch-dashboards-cf-auth-proxy/requirements.txt
# black
# jwcrypto
# pyee
urllib3==2.2.2
# via
# -r pip-tools/../requirements.txt
# -r /Users/markdboyd/development/opensearch-dashboards-cf-auth-proxy/requirements.txt
# requests
watchdog==4.0.1
# via pytest-watch
werkzeug==3.0.3
# via
# -r pip-tools/../requirements.txt
# -r /Users/markdboyd/development/opensearch-dashboards-cf-auth-proxy/requirements.txt
# flask
wheel==0.43.0
# via pip-tools
Expand Down
4 changes: 3 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
#
# This file is autogenerated by pip-compile with Python 3.11
# This file is autogenerated by pip-compile with Python 3.10
# by the following command:
#
# pip-compile --output-file=requirements.txt pip-tools/requirements.in
#
async-timeout==5.0.0
# via redis
blinker==1.8.2
# via flask
cachelib==0.13.0
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ def base_local_config(monkeypatch, token_keys):
monkeypatch.setenv("CF_ADMIN_GROUP_NAME", "wrong-value")
monkeypatch.setenv("DASHBOARD_URL", "https://wrong-value.example.com/")
monkeypatch.setenv("FLASK_ENV", "local")
monkeypatch.setenv("REDIS_HOST", "fake-redis-host")


@pytest.fixture
Expand Down Expand Up @@ -104,16 +105,15 @@ def test_prod_has_secure_settings(monkeypatch, base_local_config):
monkeypatch.setenv("FLASK_ENV", "production")
config = config_from_env()

# TODO: double-check this - is it temporary until we figure out shared sessions?
assert config.SESSION_TYPE == "null"
assert config.SESSION_TYPE == "redis"
assert config.SESSION_COOKIE_SECURE
assert config.SESSION_REDIS


def test_local_has_test_friendly_settings(monkeypatch, base_local_config):
monkeypatch.setenv("FLASK_ENV", "local")
config = config_from_env()

assert config.SESSION_TYPE == "filesystem"
assert not config.SESSION_COOKIE_SECURE


Expand Down

0 comments on commit 914071c

Please sign in to comment.