From a0ac73a668868beb4795d656842cf36e157cd8de Mon Sep 17 00:00:00 2001 From: chrisjsimpson Date: Sun, 7 Jan 2024 15:11:56 +0000 Subject: [PATCH] #1276 remove unused packages python-dotenv, update .gitignore --- .env.example | 88 ------------------------------- .gitignore | 11 +++- Makefile | 15 ------ pyproject.toml | 4 +- requirements-dev.lock | 78 +++++++++++++++++++++++++++ requirements.lock | 2 - requirements.txt | 33 ------------ setup.py | 42 --------------- systemd/system/subscribie.service | 20 ------- 9 files changed, 89 insertions(+), 204 deletions(-) delete mode 100644 .env.example delete mode 100644 Makefile create mode 100644 requirements-dev.lock delete mode 100644 requirements.txt delete mode 100644 setup.py delete mode 100644 systemd/system/subscribie.service diff --git a/.env.example b/.env.example deleted file mode 100644 index 29f5267b4..000000000 --- a/.env.example +++ /dev/null @@ -1,88 +0,0 @@ -#Only values in uppercase are actually stored in the config object later on. So make sure to use uppercase letters for your config keys. - -# Change FLASK_ENV=live for live -FLASK_ENV=development - -# Software as a service (SAAS) -SAAS_URL=https://subscribie.co.uk/ -# SAAS_API_KEY is to allow subscribie platform to send authenticated -# api requests to subscribie shops created by the shop builder. -SAAS_API_KEY=changeme -SAAS_ACTIVATE_ACCOUNT_PATH=/activate - -# For testing this repo in isolation, SUBSCRIBIE_REPO_DIRECTORY can be './' -# for production, SUBSCRIBIE_REPO_DIRECTORY should be wherever the repo -# is cloned to -SUBSCRIBIE_REPO_DIRECTORY=./ -SQLALCHEMY_TRACK_MODIFICATIONS=False -SQLALCHEMY_DATABASE_URI="sqlite:////tmp/data.db" -SECRET_KEY="random string. e.g. echo -e 'from os import urandom\\nprint urandom(25)' | python" -DB_FULL_PATH="/tmp/data.db" -MODULES_PATH="./modules/" -TEMPLATE_BASE_DIR="./subscribie/themes/" -THEME_NAME="jesmond" -CUSTOM_PAGES_PATH="./subscribie/custom_pages/" -UPLOADED_IMAGES_DEST="./subscribie/static/" -UPLOADED_FILES_DEST="./subscribie/uploads/" -# Default 50Mb upload limit -MAX_CONTENT_LENGTH="52428800" -SUCCESS_REDIRECT_URL="http://127.0.0.1:5000/complete_mandate" -THANKYOU_URL="http://127.0.0.1:5000/thankyou" -EMAIL_LOGIN_FROM="hello@example.com" -EMAIL_QUEUE_FOLDER="/var/email-queue/" - -SERVER_NAME="127.0.0.1:5000" - -# Cookie policies -#SESSION_COOKIE_SECURE=True -#SESSION_COOKIE_HTTPONLY=True -#SESSION_COOKIE_SAMESITE=None - -PERMANENT_SESSION_LIFETIME="1800" - -MAIL_DEFAULT_SENDER="noreply@example.com" - -STRIPE_LIVE_PUBLISHABLE_KEY= -STRIPE_LIVE_SECRET_KEY= - -STRIPE_TEST_PUBLISHABLE_KEY= -STRIPE_TEST_SECRET_KEY= - -# Internal server where shop should send its stripe connect account id to. See https://github.com/Subscribie/subscribie/issues/352 -STRIPE_CONNECT_ACCOUNT_ANNOUNCER_HOST=http://127.0.0.1:8001 - -# For development: - -# Python log levels: DEBUG, INFO, WARNING, ERROR, CRITICAL -# See https://docs.python.org/3/howto/logging.html -PYTHON_LOG_LEVEL=DEBUG - -# Playwright testing -PLAYWRIGHT_HOST=http://127.0.0.1:5000/ -PLAYWRIGHT_HEADLESS=true - -#rename shop variables -PATH_TO_SITES="/path/to/sites/subscribie/" -PATH_TO_RENAME_SCRIPT="/path/to/sites/subscribie/rename-shop.sh" -SUBSCRIBIE_DOMAIN="subscriby.shop" - -PRIVATE_KEY="/tmp/private.pem" -PUBLIC_KEY="/tmp/public.pem" - -# Currencies -SUPPORTED_CURRENCIES="GBP,USD,EUR" - -# Anti spam -ANTI_SPAM_SHOP_NAMES_MODEL_FULL_PATH="/path/to/classifier.pkl" - - -# Optional -TELEGRAM_TOKEN= -TELEGRAM_CHAT_ID= -TELEGRAM_PYTHON_LOG_LEVEL=ERROR - - -# Environment Settings for tests -TEST_SHOP_OWNER_EMAIL_ISSUE_704=admin@example.com -TEST_SHOP_OWNER_LOGIN_URL=http://127.0.0.1:5000/auth/login - diff --git a/.gitignore b/.gitignore index 87413baba..e7a2b58c0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,8 @@ settings.yaml settings.yml +*.pem venv/ -*.sql +.venv *.swp *.pyc __pycache__/ @@ -18,6 +19,7 @@ subscribie.egg-info/* build/* dist/* data.db +data.db* modules/ *.db *.pub @@ -30,6 +32,7 @@ node_modules *chromium.png *webkit.png .env +.env* .env.docker *.webm public @@ -44,3 +47,9 @@ tests/browser-automated-tests-playwright/worker* tests/browser-automated-tests-playwright/e2e/*-snapshots subscribie/static/* subscribie/custom_pages/* +playwright-report +tests/browser-automated-tests-playwright +.terraform +*.pkl +emails +*.bk diff --git a/Makefile b/Makefile deleted file mode 100644 index aced0021a..000000000 --- a/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -.ONESHELL: - -default: install - -install: - virtualenv -p python3.6 venv - . venv/bin/activate - pip install . - cp .env.example .env - python -m pytest - -clean: - rm -rf venv - find -iname "*.pyc" -delete - diff --git a/pyproject.toml b/pyproject.toml index 9ed2cae4b..864255b9b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ name = "subscribie" version = "v0.1.181" description = "Collect recurring payments online - subscription payments collection automation" authors = [ - { name = "chrisjsimpson", email = "chris.j.simpson@live.co.uk" } + { name = "Karma Computing", email = "subscribie@karmacomputing.co.uk" } ] dependencies = [ "graphviz", @@ -24,13 +24,11 @@ dependencies = [ "Flask-SQLAlchemy", "Flask-Migrate", "Flask-Babel", - "python-dotenv", "pyjwt[crypto]", "py-auth-header-parser", "pydantic", "backoff", "coloredlogs", - "env-validate", "python-dateutil", "currency-symbols", "pycryptodome", diff --git a/requirements-dev.lock b/requirements-dev.lock new file mode 100644 index 000000000..0f134b890 --- /dev/null +++ b/requirements-dev.lock @@ -0,0 +1,78 @@ +# generated by rye +# use `rye lock` or `rye sync` to update this lockfile +# +# last locked with the following flags: +# pre: false +# features: [] +# all-features: false + +-e file:. +alembic==1.13.1 +annotated-types==0.6.0 +babel==2.14.0 +backoff==2.2.1 +black==23.12.1 +blinker==1.7.0 +certifi==2023.11.17 +cffi==1.16.0 +charset-normalizer==3.3.2 +click==8.1.7 +coloredlogs==15.0.1 +cryptography==41.0.7 +currency-symbols==2.0.3 +dnspython==2.4.2 +email-validator==2.1.0.post1 +flask==3.0.0 +flask-babel==4.0.0 +flask-cors==4.0.0 +flask-mail==0.9.1 +flask-migrate==4.0.5 +flask-reuploaded==1.4.0 +flask-sqlalchemy==3.1.1 +flask-wtf==1.2.1 +gitdb==4.0.11 +gitpython==3.1.40 +graphlib==0.9.5 +graphviz==0.20.1 +greenlet==3.0.3 +humanfriendly==10.0 +idna==3.6 +iniconfig==2.0.0 +itsdangerous==2.1.2 +jinja2==3.1.2 +joblib==1.3.2 +mako==1.3.0 +markupsafe==2.1.3 +mypy-extensions==1.0.0 +numpy==1.26.2 +packaging==23.2 +pandas==2.1.4 +pathlib==1.0.1 +pathspec==0.12.1 +platformdirs==4.1.0 +pluggy==1.3.0 +py-auth-header-parser==1.0.2 +pycountry==23.12.11 +pycparser==2.21 +pycryptodome==3.19.0 +pydantic==2.5.3 +pydantic-core==2.14.6 +pyjwt==2.8.0 +pytest==7.4.3 +python-dateutil==2.8.2 +pytz==2023.3.post1 +requests==2.31.0 +scikit-learn==1.3.2 +scipy==1.11.4 +six==1.16.0 +smmap==5.0.1 +sqlalchemy==2.0.23 +strictyaml==1.7.3 +stripe==7.10.0 +threadpoolctl==3.2.0 +typing-extensions==4.9.0 +tzdata==2023.3 +urllib3==2.1.0 +werkzeug==3.0.1 +wheel==0.42.0 +wtforms==3.1.1 diff --git a/requirements.lock b/requirements.lock index fd482c9da..0f134b890 100644 --- a/requirements.lock +++ b/requirements.lock @@ -22,7 +22,6 @@ cryptography==41.0.7 currency-symbols==2.0.3 dnspython==2.4.2 email-validator==2.1.0.post1 -env-validate==0.5 flask==3.0.0 flask-babel==4.0.0 flask-cors==4.0.0 @@ -61,7 +60,6 @@ pydantic-core==2.14.6 pyjwt==2.8.0 pytest==7.4.3 python-dateutil==2.8.2 -python-dotenv==1.0.0 pytz==2023.3.post1 requests==2.31.0 scikit-learn==1.3.2 diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index e9afbec06..000000000 --- a/requirements.txt +++ /dev/null @@ -1,33 +0,0 @@ -graphviz -graphlib -wheel -Flask>=2,<3 -flask_cors -Flask-Reuploaded==0.3.2 -Flask-WTF==1.0.0 -email-validator==1.1.3 -Flask-Mail>=0.9.1 -requests==2.31.0 -blinker==1.4 -stripe -GitPython -pathlib -pytest -Flask-SQLAlchemy==2.5.1 -Flask-Migrate==3.0.1 -Flask-Babel==2.0.0 -python-dotenv==0.13.0 -pyjwt[crypto] -py-auth-header-parser==1.0.2 -pydantic==1.6.2 -backoff==1.10.0 -coloredlogs==15.0 -env-validate==0.4 -python-dateutil==2.8.2 -currency-symbols==2.0.1 -pycryptodome==3.14.1 -pycountry==22.3.5 -SQLAlchemy==1.4.43 -scipy -pandas -scikit-learn diff --git a/setup.py b/setup.py deleted file mode 100644 index 62e7bc521..000000000 --- a/setup.py +++ /dev/null @@ -1,42 +0,0 @@ -import setuptools - -setuptools.setup( - name="subscribie", - version="0.0.7", - author="Karma Computing", - author_email="subscribie@karmacomputing.co.uk", - desciption="Recurring subscription management and billing", - packages=setuptools.find_packages(), - include_package_data=True, - classifiers=( - "Programming Language :: Python :: 3", - "License :: OSI Approved :: GNU Affero General Public License v3", - "Operating System :: OS Independent", - ), - install_requires=[ - "Flask>=1,<2", - "flask_cors", - "Flask-Reuploaded==0.3.2", - "flask_wtf", - "wtforms[email]", - "Flask-Mail>=0.9.1", - "requests", - "blinker", - "oauth2client", - "pyyaml", - "stripe", - "GitPython", - "pytest", - "tinycss", - "flask_sqlalchemy", - "flask_migrate", - "python-dotenv==0.13.0", - "click==7.1.2", - "pyjwt[crypto]", - "py-auth-header-parser==1.0.2", - "pydantic==1.6.2", - ], - entry_points=""" - [console_scripts] - """, -) diff --git a/systemd/system/subscribie.service b/systemd/system/subscribie.service deleted file mode 100644 index ec3c717a7..000000000 --- a/systemd/system/subscribie.service +++ /dev/null @@ -1,20 +0,0 @@ -[Unit] -Description=Subscribie uWSGI Emperor which manages vassals -After=network.target - -[Service] -# Remember to ensure enable-threads = true in your emperor config.ini -ExecStart=/path-to/venv/bin/uwsgi --ini emperor.ini -RuntimeDirectory=uwsgi -Restart=always -KillSignal=SIGQUIT -Type=notify -StandardError=syslog -NotifyAccess=all -WorkingDirectory=/path/to/subscribie/ - -[Install] -WantedBy=multi-user.target - -# See https://uwsgi-docs.readthedocs.io/en/latest/Systemd.html#systemd -