diff --git a/barker/.env b/.env similarity index 100% rename from barker/.env rename to .env diff --git a/CHANGES.txt b/CHANGES.md similarity index 100% rename from CHANGES.txt rename to CHANGES.md diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index 0e9ddc7..0000000 --- a/MANIFEST.in +++ /dev/null @@ -1,3 +0,0 @@ -include *.txt *.ini *.cfg *.rst -recursive-include barker/static *.ico *.png *.css *.gif *.jpg *.txt *.js *.html *.map *.eot *.svg *.ttf *.woff - diff --git a/README.txt b/README.md similarity index 100% rename from README.txt rename to README.md diff --git a/alembic.ini b/barker/alembic.ini similarity index 100% rename from alembic.ini rename to barker/alembic.ini diff --git a/alembic/README b/barker/alembic/README similarity index 100% rename from alembic/README rename to barker/alembic/README diff --git a/alembic/env.py b/barker/alembic/env.py similarity index 100% rename from alembic/env.py rename to barker/alembic/env.py diff --git a/alembic/script.py.mako b/barker/alembic/script.py.mako similarity index 100% rename from alembic/script.py.mako rename to barker/alembic/script.py.mako diff --git a/alembic/versions/8c06ac60d125_initial_commit.py b/barker/alembic/versions/8c06ac60d125_initial_commit.py similarity index 100% rename from alembic/versions/8c06ac60d125_initial_commit.py rename to barker/alembic/versions/8c06ac60d125_initial_commit.py diff --git a/barker/__init__.py b/barker/barker/__init__.py similarity index 100% rename from barker/__init__.py rename to barker/barker/__init__.py diff --git a/barker/__main__.py b/barker/barker/__main__.py similarity index 100% rename from barker/__main__.py rename to barker/barker/__main__.py diff --git a/barker/core/__init__.py b/barker/barker/core/__init__.py similarity index 100% rename from barker/core/__init__.py rename to barker/barker/core/__init__.py diff --git a/barker/core/config.py b/barker/barker/core/config.py similarity index 100% rename from barker/core/config.py rename to barker/barker/core/config.py diff --git a/barker/core/security.py b/barker/barker/core/security.py similarity index 100% rename from barker/core/security.py rename to barker/barker/core/security.py diff --git a/barker/core/session.py b/barker/barker/core/session.py similarity index 100% rename from barker/core/session.py rename to barker/barker/core/session.py diff --git a/barker/db/__init__.py b/barker/barker/db/__init__.py similarity index 100% rename from barker/db/__init__.py rename to barker/barker/db/__init__.py diff --git a/barker/db/base.py b/barker/barker/db/base.py similarity index 100% rename from barker/db/base.py rename to barker/barker/db/base.py diff --git a/barker/db/base_class.py b/barker/barker/db/base_class.py similarity index 100% rename from barker/db/base_class.py rename to barker/barker/db/base_class.py diff --git a/barker/db/init_db.py b/barker/barker/db/init_db.py similarity index 100% rename from barker/db/init_db.py rename to barker/barker/db/init_db.py diff --git a/barker/db/session.py b/barker/barker/db/session.py similarity index 100% rename from barker/db/session.py rename to barker/barker/db/session.py diff --git a/barker/main.py b/barker/barker/main.py similarity index 100% rename from barker/main.py rename to barker/barker/main.py diff --git a/barker/models/__init__.py b/barker/barker/models/__init__.py similarity index 100% rename from barker/models/__init__.py rename to barker/barker/models/__init__.py diff --git a/barker/models/auth.py b/barker/barker/models/auth.py similarity index 100% rename from barker/models/auth.py rename to barker/barker/models/auth.py diff --git a/barker/models/master.py b/barker/barker/models/master.py similarity index 100% rename from barker/models/master.py rename to barker/barker/models/master.py diff --git a/barker/models/meta.py b/barker/barker/models/meta.py similarity index 100% rename from barker/models/meta.py rename to barker/barker/models/meta.py diff --git a/barker/models/tzinfoutc.py b/barker/barker/models/tzinfoutc.py similarity index 100% rename from barker/models/tzinfoutc.py rename to barker/barker/models/tzinfoutc.py diff --git a/barker/models/voucher.py b/barker/barker/models/voucher.py similarity index 100% rename from barker/models/voucher.py rename to barker/barker/models/voucher.py diff --git a/barker/printing/__init__.py b/barker/barker/printing/__init__.py similarity index 100% rename from barker/printing/__init__.py rename to barker/barker/printing/__init__.py diff --git a/barker/printing/bill.py b/barker/barker/printing/bill.py similarity index 100% rename from barker/printing/bill.py rename to barker/barker/printing/bill.py diff --git a/barker/printing/kot.py b/barker/barker/printing/kot.py similarity index 100% rename from barker/printing/kot.py rename to barker/barker/printing/kot.py diff --git a/barker/routers/__init__.py b/barker/barker/routers/__init__.py similarity index 100% rename from barker/routers/__init__.py rename to barker/barker/routers/__init__.py diff --git a/barker/routers/auth/__init__.py b/barker/barker/routers/auth/__init__.py similarity index 100% rename from barker/routers/auth/__init__.py rename to barker/barker/routers/auth/__init__.py diff --git a/barker/routers/auth/client.py b/barker/barker/routers/auth/client.py similarity index 100% rename from barker/routers/auth/client.py rename to barker/barker/routers/auth/client.py diff --git a/barker/routers/auth/role.py b/barker/barker/routers/auth/role.py similarity index 100% rename from barker/routers/auth/role.py rename to barker/barker/routers/auth/role.py diff --git a/barker/routers/auth/user.py b/barker/barker/routers/auth/user.py similarity index 100% rename from barker/routers/auth/user.py rename to barker/barker/routers/auth/user.py diff --git a/barker/routers/customer.py b/barker/barker/routers/customer.py similarity index 100% rename from barker/routers/customer.py rename to barker/barker/routers/customer.py diff --git a/barker/routers/device.py b/barker/barker/routers/device.py similarity index 100% rename from barker/routers/device.py rename to barker/barker/routers/device.py diff --git a/barker/routers/guest_book.py b/barker/barker/routers/guest_book.py similarity index 100% rename from barker/routers/guest_book.py rename to barker/barker/routers/guest_book.py diff --git a/barker/routers/login.py b/barker/barker/routers/login.py similarity index 100% rename from barker/routers/login.py rename to barker/barker/routers/login.py diff --git a/barker/routers/menu_category.py b/barker/barker/routers/menu_category.py similarity index 100% rename from barker/routers/menu_category.py rename to barker/barker/routers/menu_category.py diff --git a/barker/routers/modifier.py b/barker/barker/routers/modifier.py similarity index 100% rename from barker/routers/modifier.py rename to barker/barker/routers/modifier.py diff --git a/barker/routers/modifier_category.py b/barker/barker/routers/modifier_category.py similarity index 100% rename from barker/routers/modifier_category.py rename to barker/barker/routers/modifier_category.py diff --git a/barker/routers/printer.py b/barker/barker/routers/printer.py similarity index 100% rename from barker/routers/printer.py rename to barker/barker/routers/printer.py diff --git a/barker/routers/product.py b/barker/barker/routers/product.py similarity index 100% rename from barker/routers/product.py rename to barker/barker/routers/product.py diff --git a/barker/routers/reports/__init__.py b/barker/barker/routers/reports/__init__.py similarity index 100% rename from barker/routers/reports/__init__.py rename to barker/barker/routers/reports/__init__.py diff --git a/barker/routers/reports/beer_consumption_report.py b/barker/barker/routers/reports/beer_consumption_report.py similarity index 100% rename from barker/routers/reports/beer_consumption_report.py rename to barker/barker/routers/reports/beer_consumption_report.py diff --git a/barker/routers/reports/bill_settlement_report.py b/barker/barker/routers/reports/bill_settlement_report.py similarity index 100% rename from barker/routers/reports/bill_settlement_report.py rename to barker/barker/routers/reports/bill_settlement_report.py diff --git a/barker/routers/reports/cashier_report.py b/barker/barker/routers/reports/cashier_report.py similarity index 100% rename from barker/routers/reports/cashier_report.py rename to barker/barker/routers/reports/cashier_report.py diff --git a/barker/routers/reports/discount_report.py b/barker/barker/routers/reports/discount_report.py similarity index 100% rename from barker/routers/reports/discount_report.py rename to barker/barker/routers/reports/discount_report.py diff --git a/barker/routers/reports/product_sale_report.py b/barker/barker/routers/reports/product_sale_report.py similarity index 100% rename from barker/routers/reports/product_sale_report.py rename to barker/barker/routers/reports/product_sale_report.py diff --git a/barker/routers/reports/sale_report.py b/barker/barker/routers/reports/sale_report.py similarity index 100% rename from barker/routers/reports/sale_report.py rename to barker/barker/routers/reports/sale_report.py diff --git a/barker/routers/reports/tax_report.py b/barker/barker/routers/reports/tax_report.py similarity index 100% rename from barker/routers/reports/tax_report.py rename to barker/barker/routers/reports/tax_report.py diff --git a/barker/routers/reprint.py b/barker/barker/routers/reprint.py similarity index 100% rename from barker/routers/reprint.py rename to barker/barker/routers/reprint.py diff --git a/barker/routers/role.py b/barker/barker/routers/role.py similarity index 100% rename from barker/routers/role.py rename to barker/barker/routers/role.py diff --git a/barker/routers/sale_category.py b/barker/barker/routers/sale_category.py similarity index 100% rename from barker/routers/sale_category.py rename to barker/barker/routers/sale_category.py diff --git a/barker/routers/section.py b/barker/barker/routers/section.py similarity index 100% rename from barker/routers/section.py rename to barker/barker/routers/section.py diff --git a/barker/routers/section_printer.py b/barker/barker/routers/section_printer.py similarity index 100% rename from barker/routers/section_printer.py rename to barker/barker/routers/section_printer.py diff --git a/barker/routers/setting.py b/barker/barker/routers/setting.py similarity index 100% rename from barker/routers/setting.py rename to barker/barker/routers/setting.py diff --git a/barker/routers/table.py b/barker/barker/routers/table.py similarity index 100% rename from barker/routers/table.py rename to barker/barker/routers/table.py diff --git a/barker/routers/tax.py b/barker/barker/routers/tax.py similarity index 100% rename from barker/routers/tax.py rename to barker/barker/routers/tax.py diff --git a/barker/routers/voucher/__init__.py b/barker/barker/routers/voucher/__init__.py similarity index 100% rename from barker/routers/voucher/__init__.py rename to barker/barker/routers/voucher/__init__.py diff --git a/barker/routers/voucher/change.py b/barker/barker/routers/voucher/change.py similarity index 100% rename from barker/routers/voucher/change.py rename to barker/barker/routers/voucher/change.py diff --git a/barker/routers/voucher/merge_move.py b/barker/barker/routers/voucher/merge_move.py similarity index 100% rename from barker/routers/voucher/merge_move.py rename to barker/barker/routers/voucher/merge_move.py diff --git a/barker/routers/voucher/receive_payment.py b/barker/barker/routers/voucher/receive_payment.py similarity index 100% rename from barker/routers/voucher/receive_payment.py rename to barker/barker/routers/voucher/receive_payment.py diff --git a/barker/routers/voucher/save.py b/barker/barker/routers/voucher/save.py similarity index 100% rename from barker/routers/voucher/save.py rename to barker/barker/routers/voucher/save.py diff --git a/barker/routers/voucher/show.py b/barker/barker/routers/voucher/show.py similarity index 100% rename from barker/routers/voucher/show.py rename to barker/barker/routers/voucher/show.py diff --git a/barker/routers/voucher/split.py b/barker/barker/routers/voucher/split.py similarity index 100% rename from barker/routers/voucher/split.py rename to barker/barker/routers/voucher/split.py diff --git a/barker/routers/voucher/update.py b/barker/barker/routers/voucher/update.py similarity index 100% rename from barker/routers/voucher/update.py rename to barker/barker/routers/voucher/update.py diff --git a/barker/routers/voucher/void.py b/barker/barker/routers/voucher/void.py similarity index 100% rename from barker/routers/voucher/void.py rename to barker/barker/routers/voucher/void.py diff --git a/barker/routes.py b/barker/barker/routes.py similarity index 100% rename from barker/routes.py rename to barker/barker/routes.py diff --git a/barker/schemas/__init__.py b/barker/barker/schemas/__init__.py similarity index 100% rename from barker/schemas/__init__.py rename to barker/barker/schemas/__init__.py diff --git a/barker/schemas/auth.py b/barker/barker/schemas/auth.py similarity index 100% rename from barker/schemas/auth.py rename to barker/barker/schemas/auth.py diff --git a/barker/schemas/customer.py b/barker/barker/schemas/customer.py similarity index 100% rename from barker/schemas/customer.py rename to barker/barker/schemas/customer.py diff --git a/barker/schemas/device.py b/barker/barker/schemas/device.py similarity index 100% rename from barker/schemas/device.py rename to barker/barker/schemas/device.py diff --git a/barker/schemas/guest_book.py b/barker/barker/schemas/guest_book.py similarity index 100% rename from barker/schemas/guest_book.py rename to barker/barker/schemas/guest_book.py diff --git a/barker/schemas/master.py b/barker/barker/schemas/master.py similarity index 100% rename from barker/schemas/master.py rename to barker/barker/schemas/master.py diff --git a/barker/schemas/menu_category.py b/barker/barker/schemas/menu_category.py similarity index 100% rename from barker/schemas/menu_category.py rename to barker/barker/schemas/menu_category.py diff --git a/barker/schemas/merge_move.py b/barker/barker/schemas/merge_move.py similarity index 100% rename from barker/schemas/merge_move.py rename to barker/barker/schemas/merge_move.py diff --git a/barker/schemas/modifier.py b/barker/barker/schemas/modifier.py similarity index 100% rename from barker/schemas/modifier.py rename to barker/barker/schemas/modifier.py diff --git a/barker/schemas/modifier_category.py b/barker/barker/schemas/modifier_category.py similarity index 100% rename from barker/schemas/modifier_category.py rename to barker/barker/schemas/modifier_category.py diff --git a/barker/schemas/printer.py b/barker/barker/schemas/printer.py similarity index 100% rename from barker/schemas/printer.py rename to barker/barker/schemas/printer.py diff --git a/barker/schemas/product.py b/barker/barker/schemas/product.py similarity index 100% rename from barker/schemas/product.py rename to barker/barker/schemas/product.py diff --git a/barker/schemas/receive_payment.py b/barker/barker/schemas/receive_payment.py similarity index 100% rename from barker/schemas/receive_payment.py rename to barker/barker/schemas/receive_payment.py diff --git a/barker/schemas/sale_category.py b/barker/barker/schemas/sale_category.py similarity index 100% rename from barker/schemas/sale_category.py rename to barker/barker/schemas/sale_category.py diff --git a/barker/schemas/section.py b/barker/barker/schemas/section.py similarity index 100% rename from barker/schemas/section.py rename to barker/barker/schemas/section.py diff --git a/barker/schemas/section_printer.py b/barker/barker/schemas/section_printer.py similarity index 100% rename from barker/schemas/section_printer.py rename to barker/barker/schemas/section_printer.py diff --git a/barker/schemas/split.py b/barker/barker/schemas/split.py similarity index 100% rename from barker/schemas/split.py rename to barker/barker/schemas/split.py diff --git a/barker/schemas/table.py b/barker/barker/schemas/table.py similarity index 100% rename from barker/schemas/table.py rename to barker/barker/schemas/table.py diff --git a/barker/schemas/tax.py b/barker/barker/schemas/tax.py similarity index 100% rename from barker/schemas/tax.py rename to barker/barker/schemas/tax.py diff --git a/barker/schemas/voucher.py b/barker/barker/schemas/voucher.py similarity index 100% rename from barker/schemas/voucher.py rename to barker/barker/schemas/voucher.py diff --git a/barker/scripts/__init__.py b/barker/barker/scripts/__init__.py similarity index 100% rename from barker/scripts/__init__.py rename to barker/barker/scripts/__init__.py diff --git a/barker/scripts/fixtures.py b/barker/barker/scripts/fixtures.py similarity index 100% rename from barker/scripts/fixtures.py rename to barker/barker/scripts/fixtures.py diff --git a/barker/scripts/initializedb.py b/barker/barker/scripts/initializedb.py similarity index 100% rename from barker/scripts/initializedb.py rename to barker/barker/scripts/initializedb.py diff --git a/barker/subscribers.py b/barker/barker/subscribers.py similarity index 100% rename from barker/subscribers.py rename to barker/barker/subscribers.py diff --git a/barker/worker.py b/barker/barker/worker.py similarity index 100% rename from barker/worker.py rename to barker/barker/worker.py diff --git a/barker/pyproject.toml b/barker/pyproject.toml new file mode 100644 index 0000000..c285326 --- /dev/null +++ b/barker/pyproject.toml @@ -0,0 +1,61 @@ +[tool.poetry] +name = "barker" +version = "0.1.0" +description = "Point of Sale for a restaurant" +authors = ["tanshu "] + +[tool.poetry.dependencies] +python = "^3.8" +uvicorn = "^0.12.1" +fastapi = "^0.61.1" +python-jose = {extras = ["cryptography"], version = "^3.2.0"} +passlib = {extras = ["bcrypt"], version = "^1.7.3"} +psycopg2-binary = "^2.8.6" +SQLAlchemy = "^1.3.19" +python-multipart = "^0.0.5" +PyJWT = "^1.7.1" +alembic = "^1.4.3" +itsdangerous = "^1.1.0" +python-dotenv = "^0.14.0" +pydantic = {extras = ["dotenv"], version = "^1.6.1"} +starlette = "^0.13.6" + +[tool.poetry.dev-dependencies] +flake8 = "^3.8.4" +black = "^20.8b1" +isort = "^5.6.2" + +[build-system] +requires = ["poetry-core>=1.0.0"] +build-backend = "poetry.core.masonry.api" + +[tool.isort] +profile = "black" +atomic = true +include_trailing_comma = true +lines_after_imports = 2 +lines_between_types = 1 +use_parentheses = true +src_paths = ["poetry", "tests"] +skip_glob = ["*/setup.py"] +filter_files = true +known_first_party = "poetry" + +[tool.black] +line-length = 88 +include = '\.pyi?$' +exclude = ''' +/( + \.eggs + | \.git + | \.hg + | \.mypy_cache + | \.tox + | \.venv + | _build + | buck-out + | build + | dist + | tests/.*/setup.py +)/ +''' \ No newline at end of file diff --git a/container.ini b/container.ini deleted file mode 100644 index 1e098b9..0000000 --- a/container.ini +++ /dev/null @@ -1,50 +0,0 @@ -[app:main] -use = egg:barker - -pyramid.reload_templates = false -pyramid.debug_authorization = false -pyramid.debug_notfound = false -pyramid.debug_routematch = false -pyramid.default_locale_name = en -secret_key = secret - -[server:main] -use = egg:waitress#main -host = 0.0.0.0 -port = 80 - -# Begin logging configuration - -[loggers] -keys = root, barker, sqlalchemy.engine.base - -[handlers] -keys = console - -[formatters] -keys = generic - -[logger_root] -level = WARNING -handlers = console - -[logger_barker] -level = WARNING -handlers = -qualname = barker - -[logger_sqlalchemy.engine.base] -level = DEBUG -handlers = -qualname = sqlalchemy.engine.base - -[handler_console] -class = StreamHandler -args = (sys.stderr,) -level = NOTSET -formatter = generic - -[formatter_generic] -format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s - -# End logging configuration diff --git a/development.ini b/development.ini deleted file mode 100644 index 7bbd806..0000000 --- a/development.ini +++ /dev/null @@ -1,51 +0,0 @@ -[app:main] -use = egg:barker - -pyramid.reload_templates = false -pyramid.debug_authorization = false -pyramid.debug_notfound = false -pyramid.debug_routematch = false -pyramid.default_locale_name = en -# sqlalchemy.url = postgresql://hops:123456@localhost:8765/hops -sqlalchemy.url = postgresql://postgres:123456@localhost:5432/petty - -[server:main] -use = egg:waitress#main -host = 0.0.0.0 -port = 6543 - -# Begin logging configuration - -[loggers] -keys = root, barker, sqlalchemy.engine.base - -[handlers] -keys = console - -[formatters] -keys = generic - -[logger_root] -level = WARNING -handlers = console - -[logger_barker] -level = WARNING -handlers = -qualname = barker - -[logger_sqlalchemy.engine.base] -level = DEBUG -handlers = -qualname = sqlalchemy.engine.base - -[handler_console] -class = StreamHandler -args = (sys.stderr,) -level = NOTSET -formatter = generic - -[formatter_generic] -format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s - -# End logging configuration diff --git a/production.ini b/production.ini deleted file mode 100644 index e069d67..0000000 --- a/production.ini +++ /dev/null @@ -1,44 +0,0 @@ -[app:main] -use = egg:barker - -pyramid.reload_templates = false -pyramid.debug_authorization = false -pyramid.debug_notfound = false -pyramid.debug_routematch = false -pyramid.default_locale_name = en - -[server:main] -use = egg:waitress#main -host = 0.0.0.0 -port = 6543 - -# Begin logging configuration - -[loggers] -keys = root, barker - -[handlers] -keys = console - -[formatters] -keys = generic - -[logger_root] -level = WARN -handlers = console - -[logger_barker] -level = WARN -handlers = -qualname = barker - -[handler_console] -class = StreamHandler -args = (sys.stderr,) -level = NOTSET -formatter = generic - -[formatter_generic] -format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s - -# End logging configuration diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index fe22da0..0000000 --- a/requirements.txt +++ /dev/null @@ -1,15 +0,0 @@ -setuptools -wheel -uvicorn -fastapi -python-jose[cryptography] -passlib[bcrypt] -psycopg2-binary -sqlalchemy -python-multipart -pyjwt -alembic -itsdangerous -python-dotenv -pydantic[dotenv] -starlette diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 384a5d5..0000000 --- a/setup.cfg +++ /dev/null @@ -1,27 +0,0 @@ -[nosetests] -match = ^test -nocapture = 1 -cover-package = barker -with-coverage = 1 -cover-erase = 1 - -[compile_catalog] -directory = barker/locale -domain = barker -statistics = true - -[extract_messages] -add_comments = TRANSLATORS: -output_file = barker/locale/barker.pot -width = 80 - -[init_catalog] -domain = barker -input_file = barker/locale/barker.pot -output_dir = barker/locale - -[update_catalog] -domain = barker -input_file = barker/locale/barker.pot -output_dir = barker/locale -previous = true diff --git a/setup.py b/setup.py deleted file mode 100644 index 32f120b..0000000 --- a/setup.py +++ /dev/null @@ -1,50 +0,0 @@ -import os - -from setuptools import setup, find_packages - -here = os.path.abspath(os.path.dirname(__file__)) -with open(os.path.join(here, 'README.txt')) as f: - README = f.read() -with open(os.path.join(here, 'CHANGES.txt')) as f: - CHANGES = f.read() - -requires = [ - 'pyramid', - 'waitress', - 'pyramid_tm', - 'transaction', - 'zope.sqlalchemy', - 'SQLAlchemy', - 'psycopg2-binary', -] - -setup(name='barker', - version='1.0.0-beta.1', - description='barker', - long_description=README + '\n\n' + CHANGES, - classifiers=[ - "Programming Language :: Python", - "Framework :: Pyramid", - "Topic :: Internet :: WWW/HTTP", - "Topic :: Internet :: WWW/HTTP :: WSGI :: Application", - ], - author='Tanshu', - author_email='barker@tanshu.com', - url='http://tanshu.com', - keywords='web pyramid pylons', - packages=find_packages(), - include_package_data=True, - zip_safe=False, - install_requires=requires, - tests_require=requires, - test_suite="barker", - entry_points={ - 'paste.app_factory': [ - 'main = barker:main', - ], - 'console_scripts': [ - 'initdb = barker.scripts.initializedb:main', - 'fixtures = barker.scripts.fixtures:main', - ], - } - )