From 22ab9125ac7971b53aee767251bc6659831431e1 Mon Sep 17 00:00:00 2001 From: ahbensiali <112475984+ahbensiali@users.noreply.github.com> Date: Tue, 22 Nov 2022 15:24:43 +0000 Subject: [PATCH 1/9] ANPL-823 updated requirements.txt to lock in python-dotenv --- pyproject.toml | 50 ++++++++++++++++++ requirements.txt | 128 +++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 173 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index b4cf91c49..cbb874935 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,3 +17,53 @@ line_length = 88 multi_line_output = 3 no_lines_before = 'LOCALFOLDER' profile = 'black' + +[tool.poetry] +name = "analytics-platform-control-panel" +version = "v0.29.25" +description = "" +authors = ["Your Name "] +readme = "README.md" +packages = [{include = "analytics_platform_control_panel"}] + +[tool.poetry.dependencies] +python = "^3.9" +django = "3.2.15" +auth0-python = "3.13.0" +boto3 = "1.20.13" +channels = "2.4.0" +channels-redis = "3.3.1" +django-crequest = "2018.5.11" +django-extensions = "3.1.5" +django-filter = "2.4.0" +django-prometheus = "2.1.0" +django-redis = "4.12.1" +django-simple-history = "3.1.1" +djangorestframework = "3.12.4" +django-structlog = "2.2.0" +djproxy = "2.3.5" +elasticsearch-dsl = "7.2.1" +gunicorn = "20.1.0" +jinja2 = "2.11.3" +kubernetes = "11.0.0" +markupsafe = "2.0.1" +model-mommy = "2.0.0" +moto = "1.3.14" +mozilla-django-oidc = "2.0.0" +psycopg2-binary = "2.9.3" +pygithub = "1.53" +pytest = "6.0.1" +pytest-django = "3.9.0" +python-jose = "3.3.0" +rules = "3.0" +sentry-sdk = "1.5.1" +slackclient = "2.8.1" +urllib3 = "1.26.5" +pyyaml = "6.0" +uvicorn = {version = "0.17.5", extras = ["standard"]} +python-dotenv = "^0.21.0" + + +[build-system] +requires = ["poetry-core"] +build-backend = "poetry.core.masonry.api" diff --git a/requirements.txt b/requirements.txt index 96c0e46a1..c48a99850 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,35 +1,153 @@ -asgiref==3.5.0 +aiohttp==3.8.3 +aioredis==1.3.1 +aiosignal==1.3.1 +anyio==3.6.2 +asgiref==3.5.2 +async-timeout==4.0.2 +attrs==22.1.0 auth0-python==3.13.0 +autobahn==22.7.1 +Automat==22.10.0 +aws-sam-translator==1.54.0 +aws-xray-sdk==2.11.0 +boto==2.49.0 boto3==1.20.13 +botocore==1.23.54 +CacheControl==0.12.11 +cachetools==5.2.0 +cachy==0.3.0 +certifi==2022.9.24 +cffi==1.15.1 +cfn-lint==0.71.1 channels==2.4.0 channels-redis==3.3.1 +charset-normalizer==2.1.1 +cleo==1.0.0a5 +click==8.1.3 +constantly==15.1.0 +crashtest==0.3.1 +cryptography==38.0.3 +daphne==2.5.0 +Deprecated==1.2.13 +distlib==0.3.6 Django==3.2.15 django-crequest==2018.5.11 -django-dotenv==1.4.2 django-extensions==3.1.5 django-filter==2.4.0 +django-ipware==4.0.2 django-prometheus==2.1.0 django-redis==4.12.1 django-simple-history==3.1.1 -djangorestframework==3.12.4 django-structlog==2.2.0 +djangorestframework==3.12.4 djproxy==2.3.5 +docker==6.0.1 +dulwich==0.20.50 +ecdsa==0.18.0 +elasticsearch==7.17.7 elasticsearch-dsl==7.2.1 +filelock==3.8.0 +frozenlist==1.3.3 +google-auth==2.14.1 gunicorn==20.1.0 +h11==0.14.0 +hiredis==2.0.0 +html5lib==1.1 +httptools==0.3.0 +hyperlink==21.0.0 +idna==2.8 +importlib-metadata==4.13.0 +incremental==22.10.0 +iniconfig==1.1.1 +jaraco.classes==3.2.3 Jinja2==2.11.3 +jmespath==0.10.0 +josepy==1.13.0 +jschema-to-python==1.2.3 +jsondiff==1.1.2 +jsonpatch==1.32 +jsonpickle==2.2.0 +jsonpointer==2.3 +jsonschema==3.2.0 +junit-xml==1.9 +keyring==23.11.0 kubernetes==11.0.0 +lockfile==0.12.2 MarkupSafe==2.0.1 +mock==4.0.3 model-mommy==2.0.0 +more-itertools==9.0.0 moto==1.3.14 mozilla-django-oidc==2.0.0 +msgpack==1.0.4 +multidict==6.0.2 +networkx==2.8.8 +oauthlib==3.2.2 +packaging==21.3 +pbr==5.11.0 +pexpect==4.8.0 +pkginfo==1.8.3 +platformdirs==2.5.4 +pluggy==0.13.1 +poetry==1.2.2 +poetry-core==1.3.2 +poetry-plugin-export==1.2.0 +prometheus-client==0.15.0 psycopg2-binary==2.9.3 +ptyprocess==0.7.0 +py==1.11.0 +pyasn1==0.4.8 +pyasn1-modules==0.2.8 +pycparser==2.21 PyGithub==1.53 +PyJWT==2.6.0 +pylev==1.4.0 +pyOpenSSL==22.1.0 +pyparsing==3.0.9 +pyrsistent==0.19.2 pytest==6.0.1 pytest-django==3.9.0 +python-dateutil==2.8.2 +python-dotenv==0.21.0 python-jose==3.3.0 +pytz==2022.6 +PyYAML==6.0 +redis==4.3.5 +requests==2.28.1 +requests-oauthlib==1.3.1 +requests-toolbelt==0.9.1 +responses==0.22.0 +rsa==4.9 rules==3.0 +s3transfer==0.5.2 +sarif-om==1.0.4 sentry-sdk==1.5.1 +service-identity==21.1.0 +shellingham==1.5.0 +six==1.16.0 slackclient==2.8.1 +sniffio==1.3.0 +sqlparse==0.4.3 +sshpubkeys==3.3.1 +structlog==22.2.0 +toml==0.10.2 +tomlkit==0.11.6 +Twisted==22.10.0 +txaio==22.2.1 +types-toml==0.10.8.1 +typing_extensions==4.4.0 urllib3==1.26.5 -uvicorn[standard]==0.17.5 -pyyaml==6.0 +uvicorn==0.17.5 +uvloop==0.17.0 +virtualenv==20.16.7 +watchgod==0.8.2 +webencodings==0.5.1 +websocket-client==1.4.2 +websockets==10.4 +Werkzeug==2.1.2 +wrapt==1.14.1 +xattr==0.9.9 +xmltodict==0.13.0 +yarl==1.8.1 +zipp==3.10.0 +zope.interface==5.5.2 From 92d1dd5db69e44018086e3ed42fedbbf83478331 Mon Sep 17 00:00:00 2001 From: ahbensiali <112475984+ahbensiali@users.noreply.github.com> Date: Tue, 22 Nov 2022 15:36:40 +0000 Subject: [PATCH 2/9] ANPL-823 removed poetry from build --- requirements.txt | 3 --- 1 file changed, 3 deletions(-) diff --git a/requirements.txt b/requirements.txt index c48a99850..c11033506 100644 --- a/requirements.txt +++ b/requirements.txt @@ -89,9 +89,6 @@ pexpect==4.8.0 pkginfo==1.8.3 platformdirs==2.5.4 pluggy==0.13.1 -poetry==1.2.2 -poetry-core==1.3.2 -poetry-plugin-export==1.2.0 prometheus-client==0.15.0 psycopg2-binary==2.9.3 ptyprocess==0.7.0 From 83cb1d2ba845bfc0981381d673d3a920cec5e4d4 Mon Sep 17 00:00:00 2001 From: ahbensiali <112475984+ahbensiali@users.noreply.github.com> Date: Tue, 22 Nov 2022 15:45:17 +0000 Subject: [PATCH 3/9] ANPL-823 changed dockerfile to use venv used in build. dev-packages is the location where requirements.txt libs are installed --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 49d3537bb..e46997d53 100644 --- a/Dockerfile +++ b/Dockerfile @@ -73,6 +73,6 @@ COPY --from=jsdep node_modules/jquery-ui/dist/ static/jquery-ui RUN touch .env # collect static files for deployment -RUN SLACK_API_TOKEN=dummy python3 manage.py collectstatic --noinput --ignore=*.scss +RUN SLACK_API_TOKEN=dummy dev-packages/bin/python manage.py collectstatic --noinput --ignore=*.scss EXPOSE 8000 CMD ["gunicorn", "-b", "0.0.0.0:8000", "-k", "uvicorn.workers.UvicornWorker", "-w", "4", "controlpanel.asgi:application"] From 843a7f9a3ca1911a9e959ea8cca5b84eb5f87dcd Mon Sep 17 00:00:00 2001 From: ahbensiali <112475984+ahbensiali@users.noreply.github.com> Date: Tue, 22 Nov 2022 15:50:09 +0000 Subject: [PATCH 4/9] ANPL-823 test location of python used --- Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index e46997d53..de9f08ede 100644 --- a/Dockerfile +++ b/Dockerfile @@ -48,7 +48,6 @@ RUN pip install -U pip COPY requirements.txt requirements.dev.txt manage.py settings.yaml ./ RUN pip install -U --no-cache-dir pip RUN pip install -r requirements.txt -RUN pip uninstall python-dotenv -y # Re-enable dev packages RUN python3 -m venv --system-site-packages dev-packages \ @@ -72,7 +71,9 @@ COPY --from=jsdep node_modules/jquery-ui/dist/ static/jquery-ui # empty .env file to prevent warning messages RUN touch .env +RUN which python + # collect static files for deployment -RUN SLACK_API_TOKEN=dummy dev-packages/bin/python manage.py collectstatic --noinput --ignore=*.scss +RUN SLACK_API_TOKEN=dummy python manage.py collectstatic --noinput --ignore=*.scss EXPOSE 8000 CMD ["gunicorn", "-b", "0.0.0.0:8000", "-k", "uvicorn.workers.UvicornWorker", "-w", "4", "controlpanel.asgi:application"] From f82d46f213b493b50767ea1bfc8b8aeebfb4a066 Mon Sep 17 00:00:00 2001 From: ahbensiali <112475984+ahbensiali@users.noreply.github.com> Date: Tue, 22 Nov 2022 15:54:26 +0000 Subject: [PATCH 5/9] ANPL-823 changed func to use python-dotenv using load_dotenv instead of read_dotenv --- Dockerfile | 2 -- manage.py | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index de9f08ede..110a82690 100644 --- a/Dockerfile +++ b/Dockerfile @@ -71,8 +71,6 @@ COPY --from=jsdep node_modules/jquery-ui/dist/ static/jquery-ui # empty .env file to prevent warning messages RUN touch .env -RUN which python - # collect static files for deployment RUN SLACK_API_TOKEN=dummy python manage.py collectstatic --noinput --ignore=*.scss EXPOSE 8000 diff --git a/manage.py b/manage.py index e5ca5d866..1fc698fa4 100755 --- a/manage.py +++ b/manage.py @@ -7,7 +7,7 @@ from controlpanel.utils import load_app_conf_from_file if __name__ == '__main__': - dotenv.read_dotenv() + dotenv.load_dotenv() os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'controlpanel.settings') From b728162da481ff56bded52d7b7898691859c40b8 Mon Sep 17 00:00:00 2001 From: ahbensiali <112475984+ahbensiali@users.noreply.github.com> Date: Tue, 22 Nov 2022 16:50:54 +0000 Subject: [PATCH 6/9] ANPL-823 reverted back to original library requirements.txt --- Dockerfile | 2 +- requirements.txt | 125 ++--------------------------------------------- 2 files changed, 6 insertions(+), 121 deletions(-) diff --git a/Dockerfile b/Dockerfile index 110a82690..3068b5ab5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -72,6 +72,6 @@ COPY --from=jsdep node_modules/jquery-ui/dist/ static/jquery-ui RUN touch .env # collect static files for deployment -RUN SLACK_API_TOKEN=dummy python manage.py collectstatic --noinput --ignore=*.scss +RUN SLACK_API_TOKEN=dummy python3 manage.py collectstatic --noinput --ignore=*.scss EXPOSE 8000 CMD ["gunicorn", "-b", "0.0.0.0:8000", "-k", "uvicorn.workers.UvicornWorker", "-w", "4", "controlpanel.asgi:application"] diff --git a/requirements.txt b/requirements.txt index c11033506..c4e830668 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,150 +1,35 @@ -aiohttp==3.8.3 -aioredis==1.3.1 -aiosignal==1.3.1 -anyio==3.6.2 -asgiref==3.5.2 -async-timeout==4.0.2 -attrs==22.1.0 +asgiref==3.5.0 auth0-python==3.13.0 -autobahn==22.7.1 -Automat==22.10.0 -aws-sam-translator==1.54.0 -aws-xray-sdk==2.11.0 -boto==2.49.0 boto3==1.20.13 -botocore==1.23.54 -CacheControl==0.12.11 -cachetools==5.2.0 -cachy==0.3.0 -certifi==2022.9.24 -cffi==1.15.1 -cfn-lint==0.71.1 channels==2.4.0 channels-redis==3.3.1 -charset-normalizer==2.1.1 -cleo==1.0.0a5 -click==8.1.3 -constantly==15.1.0 -crashtest==0.3.1 -cryptography==38.0.3 -daphne==2.5.0 -Deprecated==1.2.13 -distlib==0.3.6 Django==3.2.15 django-crequest==2018.5.11 +python-dotenv==0.21.0 django-extensions==3.1.5 django-filter==2.4.0 -django-ipware==4.0.2 django-prometheus==2.1.0 django-redis==4.12.1 django-simple-history==3.1.1 -django-structlog==2.2.0 djangorestframework==3.12.4 +django-structlog==2.2.0 djproxy==2.3.5 -docker==6.0.1 -dulwich==0.20.50 -ecdsa==0.18.0 -elasticsearch==7.17.7 elasticsearch-dsl==7.2.1 -filelock==3.8.0 -frozenlist==1.3.3 -google-auth==2.14.1 gunicorn==20.1.0 -h11==0.14.0 -hiredis==2.0.0 -html5lib==1.1 -httptools==0.3.0 -hyperlink==21.0.0 -idna==2.8 -importlib-metadata==4.13.0 -incremental==22.10.0 -iniconfig==1.1.1 -jaraco.classes==3.2.3 Jinja2==2.11.3 -jmespath==0.10.0 -josepy==1.13.0 -jschema-to-python==1.2.3 -jsondiff==1.1.2 -jsonpatch==1.32 -jsonpickle==2.2.0 -jsonpointer==2.3 -jsonschema==3.2.0 -junit-xml==1.9 -keyring==23.11.0 kubernetes==11.0.0 -lockfile==0.12.2 MarkupSafe==2.0.1 -mock==4.0.3 model-mommy==2.0.0 -more-itertools==9.0.0 moto==1.3.14 mozilla-django-oidc==2.0.0 -msgpack==1.0.4 -multidict==6.0.2 -networkx==2.8.8 -oauthlib==3.2.2 -packaging==21.3 -pbr==5.11.0 -pexpect==4.8.0 -pkginfo==1.8.3 -platformdirs==2.5.4 -pluggy==0.13.1 -prometheus-client==0.15.0 psycopg2-binary==2.9.3 -ptyprocess==0.7.0 -py==1.11.0 -pyasn1==0.4.8 -pyasn1-modules==0.2.8 -pycparser==2.21 PyGithub==1.53 -PyJWT==2.6.0 -pylev==1.4.0 -pyOpenSSL==22.1.0 -pyparsing==3.0.9 -pyrsistent==0.19.2 pytest==6.0.1 pytest-django==3.9.0 -python-dateutil==2.8.2 -python-dotenv==0.21.0 python-jose==3.3.0 -pytz==2022.6 -PyYAML==6.0 -redis==4.3.5 -requests==2.28.1 -requests-oauthlib==1.3.1 -requests-toolbelt==0.9.1 -responses==0.22.0 -rsa==4.9 rules==3.0 -s3transfer==0.5.2 -sarif-om==1.0.4 sentry-sdk==1.5.1 -service-identity==21.1.0 -shellingham==1.5.0 -six==1.16.0 slackclient==2.8.1 -sniffio==1.3.0 -sqlparse==0.4.3 -sshpubkeys==3.3.1 -structlog==22.2.0 -toml==0.10.2 -tomlkit==0.11.6 -Twisted==22.10.0 -txaio==22.2.1 -types-toml==0.10.8.1 -typing_extensions==4.4.0 urllib3==1.26.5 -uvicorn==0.17.5 -uvloop==0.17.0 -virtualenv==20.16.7 -watchgod==0.8.2 -webencodings==0.5.1 -websocket-client==1.4.2 -websockets==10.4 -Werkzeug==2.1.2 -wrapt==1.14.1 -xattr==0.9.9 -xmltodict==0.13.0 -yarl==1.8.1 -zipp==3.10.0 -zope.interface==5.5.2 +uvicorn[standard]==0.17.5 +pyyaml==6.0 \ No newline at end of file From dcb1ddaabb659a15ceda79c36238c1fd5262e721 Mon Sep 17 00:00:00 2001 From: ahbensiali <112475984+ahbensiali@users.noreply.github.com> Date: Wed, 30 Nov 2022 19:54:12 +0100 Subject: [PATCH 7/9] ANPL-823 removed build-system section of pyproject.toml --- pyproject.toml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index cbb874935..7f47dd6af 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -62,8 +62,3 @@ urllib3 = "1.26.5" pyyaml = "6.0" uvicorn = {version = "0.17.5", extras = ["standard"]} python-dotenv = "^0.21.0" - - -[build-system] -requires = ["poetry-core"] -build-backend = "poetry.core.masonry.api" From 9330403a5c0820f324a20f7aa9e5548d9985429b Mon Sep 17 00:00:00 2001 From: ahbensiali <112475984+ahbensiali@users.noreply.github.com> Date: Fri, 2 Dec 2022 11:59:19 +0100 Subject: [PATCH 8/9] ANPL-823 removed poetry from pyproject.toml --- pyproject.toml | 45 --------------------------------------------- 1 file changed, 45 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 7f47dd6af..b4cf91c49 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,48 +17,3 @@ line_length = 88 multi_line_output = 3 no_lines_before = 'LOCALFOLDER' profile = 'black' - -[tool.poetry] -name = "analytics-platform-control-panel" -version = "v0.29.25" -description = "" -authors = ["Your Name "] -readme = "README.md" -packages = [{include = "analytics_platform_control_panel"}] - -[tool.poetry.dependencies] -python = "^3.9" -django = "3.2.15" -auth0-python = "3.13.0" -boto3 = "1.20.13" -channels = "2.4.0" -channels-redis = "3.3.1" -django-crequest = "2018.5.11" -django-extensions = "3.1.5" -django-filter = "2.4.0" -django-prometheus = "2.1.0" -django-redis = "4.12.1" -django-simple-history = "3.1.1" -djangorestframework = "3.12.4" -django-structlog = "2.2.0" -djproxy = "2.3.5" -elasticsearch-dsl = "7.2.1" -gunicorn = "20.1.0" -jinja2 = "2.11.3" -kubernetes = "11.0.0" -markupsafe = "2.0.1" -model-mommy = "2.0.0" -moto = "1.3.14" -mozilla-django-oidc = "2.0.0" -psycopg2-binary = "2.9.3" -pygithub = "1.53" -pytest = "6.0.1" -pytest-django = "3.9.0" -python-jose = "3.3.0" -rules = "3.0" -sentry-sdk = "1.5.1" -slackclient = "2.8.1" -urllib3 = "1.26.5" -pyyaml = "6.0" -uvicorn = {version = "0.17.5", extras = ["standard"]} -python-dotenv = "^0.21.0" From f52755f7b0fcc0dfba5b93d702d1619679c2b744 Mon Sep 17 00:00:00 2001 From: ahbensiali <112475984+ahbensiali@users.noreply.github.com> Date: Tue, 6 Dec 2022 13:05:40 +0000 Subject: [PATCH 9/9] ANPL-823 removed pip install from docs --- doc/running.md | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/running.md b/doc/running.md index 659810496..da8e89aeb 100644 --- a/doc/running.md +++ b/doc/running.md @@ -37,7 +37,6 @@ python3 -m venv venv source venv/bin/activate pip3 install -r requirements.txt pip3 install -r requirements.dev.txt -pip3 uninstall python-dotenv # see ANPL-823 ``` In addition, you must have: