Skip to content

Commit

Permalink
Establish new CLI and configuration foundation (#104)
Browse files Browse the repository at this point in the history
  • Loading branch information
AzorianMatt authored Feb 2, 2024
1 parent 1e2be3e commit 09447bd
Show file tree
Hide file tree
Showing 346 changed files with 6,105 additions and 39,063 deletions.
108 changes: 0 additions & 108 deletions .env.tpl

This file was deleted.

8 changes: 1 addition & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
*.db
*.pyc
*~
.DS_Store
*.egg-info
.env
.env.dev
.env.docker
.env.local
.env.production
.env.*
.idea
conf/config.yml
docs/_build
venv
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022 Azorian Solutions LLC - legal[at]azorian.solutions
Copyright (c) 2024 Azorian Solutions

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
56 changes: 56 additions & 0 deletions config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
app:
name: pda
version: 0.1.0
cli:
entrypoint: pda
environment:
prefix: PDA
file: .env
server:
address: 0.0.0.0
port: 8080
proxy_root: /
type: django # gunicorn, uvicorn, uwsgi, django
auto_reload: true
workers: 3
threads: 5
gunicorn:
log_level: info
timeout: 30
uvicorn:
log_level: info
keep_alive_timeout: 5
graceful_shutdown_timeout: 5
uwsgi:
request_timeout: 30
db:
engine: sqlite
path: pda.db
# engine: mysql
# host: localhost
# port: 3306
# user: pda
# password: pda
# name: pda
# engine: postgresql
# host: localhost
# port: 5432
# user: pda
# password: pda
# name: pda
# schema: public
cors:
allow_credentials: true
headers: ['*']
methods: ['*']
origins: ['127.0.0.1', 'localhost']
csrf:
origins: ['http://127.0.0.1', 'http://localhost']
web:
protocol: https # http, https
host: your-domain.com
port: 443
paths:
root: $e{PWD}
security:
secret_key: $e{PDA_SECRET_KEY}
56 changes: 56 additions & 0 deletions defaults.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
app:
name: pda
version: 0.1.0
cli:
entrypoint: pda
environment:
prefix: PDA
file: .env
server:
address: 0.0.0.0
port: 8080
proxy_root: /
type: gunicorn # gunicorn, uvicorn, uwsgi, django
auto_reload: false
workers: 3
threads: 5
gunicorn:
log_level: info
timeout: 30
uvicorn:
log_level: info
keep_alive_timeout: 5
graceful_shutdown_timeout: 5
uwsgi:
request_timeout: 30
db:
engine: sqlite
path: pda.db
# engine: mysql
# host: localhost
# port: 3306
# user: pda
# password: pda
# name: pda
# engine: postgresql
# host: localhost
# port: 5432
# user: pda
# password: pda
# name: pda
# schema: public
cors:
allow_credentials: true
headers: ['*']
methods: ['*']
origins: ['127.0.0.1', 'localhost']
csrf:
origins: ['http://127.0.0.1', 'http://localhost']
web:
protocol: https # http, https
host: your-domain.com
port: 443
paths:
root: $e{PWD}
security:
secret_key: $e{PDA_SECRET_KEY}
22 changes: 22 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
celery==5.3.6
click==8.1.3
cryptography==42.0.2
django==4.2.7
django-allauth==0.60.1
django-celery-beat==2.5.0
django-celery-results==2.5.1
django-ninja==1.0.1
docker==7.0.0
gunicorn==21.2.0
jinja2==3.1.3
loguru==0.7.0
passlib[bcrypt]==1.7.4
pydantic==2.5.2
pydantic-settings==2.1.0
python-dotenv==0.21.0
python-jose[cryptography]==3.3.0
pyyaml==6.0.1
redis==5.0.1
reflective>=0.2.0
requests==2.31.0
uvicorn==0.20.0
106 changes: 40 additions & 66 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,75 +1,49 @@
import subprocess
import sys
from setuptools import setup


def install(package):
try:
return subprocess.check_call([sys.executable, "-m", "pip", "install", package])
except subprocess.CalledProcessError as e:
return False


def install_packages():
if 'yaml' not in sys.modules:
install('pyyaml')


def load_config() -> dict:
import yaml
with open('defaults.yml') as f:
return yaml.load(f, Loader=yaml.FullLoader)


def load_requirements() -> list:
with open('requirements.txt') as f:
return f.read().splitlines()


def load_readme() -> str:
with open('README.md', 'r', encoding='utf-8') as f:
return f.read()


install_packages()
config = load_config()

setup(
name='pda',
version='0.1.0',
name=config['app']['name'],
version=config['app']['version'],
package_dir={'': 'src'},
install_requires=[
'amqp==5.1.1',
'asgiref==3.6.0',
'async-timeout==4.0.2',
'attrs==22.2.0',
'bcrypt==4.0.1',
'billiard==3.6.4.0',
'celery[redis]==5.2.7',
'celery-progress==0.1.3',
'certifi==2022.12.7',
'cffi==1.15.1',
'charset-normalizer==3.0.1',
'click==8.1.3',
'click-didyoumean==0.3.0',
'click-plugins==1.1.1',
'click-repl==0.2.0',
'cryptography==39.0.1',
'defusedxml==0.7.1',
'django==4.1.7',
'django-allauth==0.52.0',
'django-allauth-2fa==0.10.0',
'django-anymail[mailgun]==9.0',
'django-environ==0.9.0',
'django-otp==1.1.4',
'django-waffle==3.0.0',
'djangorestframework==3.14.0',
'djangorestframework-api-key==2.3.0',
'dnspython==2.3.0',
'dotenv-cli==3.1.0',
'drf-spectacular==0.25.1',
'gunicorn==20.1.0',
'idna==3.4',
'inflection==0.5.1',
'jinja2==3.1.2',
'jsonschema==4.17.3',
'kombu==5.2.4',
'mysql==0.0.3',
'oauthlib==3.2.2',
'prompt-toolkit==3.0.38',
'psycopg2-binary==2.9.5',
'pycparser==2.21',
'pydantic==1.10.2',
'pyjwt[crypto]==2.6.0',
'pypng==0.20220715.0',
'pyrsistent==0.19.3',
'python3-openid==3.2.0',
'python-dotenv==0.21.0',
'pytz==2022.7.1',
'pyaml==21.10.1',
'qrcode==7.4.2',
'redis==4.5.1',
'requests==2.28.2',
'requests-oauthlib==1.3.1',
'selenium==4.8.2',
'sentry-sdk==1.15.0',
'six==1.16.0',
'sqlparse==0.4.3',
'typing-extensions==4.5.0',
'uritemplate==4.1.1',
'urllib3==1.26.14',
'vine==5.0.0',
'wcwidth==0.2.6',
],
install_requires=load_requirements(),
entry_points={
'console_scripts': [
'pda = lib.cli.app:cli',
config['app']['cli']['entrypoint'] + ' = app.cli.entry:cli',
],
},
long_description=load_readme(),
long_description_content_type='text/markdown',
)
7 changes: 0 additions & 7 deletions src/.babelrc

This file was deleted.

Loading

0 comments on commit 09447bd

Please sign in to comment.