From 2e647a98b14ac15e1e36f8b7ca835114123cb02e Mon Sep 17 00:00:00 2001 From: Abdur-RahmaanJ Date: Thu, 26 Sep 2024 16:57:39 +0400 Subject: [PATCH 1/3] chore: Convert setup.py/.cfg to pyproject.toml --- pyproject.toml | 61 +++++++++++++++++++++++++++++--------------------- 1 file changed, 35 insertions(+), 26 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index d05d6601..b2115a00 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,31 +1,40 @@ -[tool.commitizen] -name = "cz_conventional_commits" -version = "4.1.0" -tag_format = "v$major.$minor.$patch$prerelease" -version_files = [ - "pyproject.toml:version" +[project] +name = "shopcube" +version = "4.5.0" +description = "E-commerce solution" +readme = "README.md" +license = {text = "MIT"} +authors = [ + {name = "Abdur-Rahmaan Janhangeer & contributors", email = "arj.python@gmail.com"} ] -style = [ - ["qmark", "fg:#ff9d00 bold"], - ["question", "bold"], - ["answer", "fg:#ff9d00 bold"], - ["pointer", "fg:#ff9d00 bold"], - ["highlighted", "fg:#ff9d00 bold"], - ["selected", "fg:#cc5454"], - ["separator", "fg:#cc5454"], - ["instruction", ""], - ["text", ""], - ["disabled", "fg:#858585 italic"] +keywords = ["flask", "pos", "management", "shop", "ecommerce", "cms", "erp", "e-commerce"] +classifiers = [ + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "License :: OSI Approved :: MIT License", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", ] +dynamic = ["dependencies"] +[tool.setuptools.dynamic] +dependencies = {file = ["reqs/app.txt"]} +[project.urls] +"Bug Reports" = "https://github.com/Abdur-RahmaanJ/shopcube/issues" +"Source" = "https://github.com/Abdur-RahmaanJ/shopcube/" -[tool.isort] -profile = "black" -multi_line_output = 3 -include_trailing_comma = true -force_grid_wrap = 0 -use_parentheses = true -line_length = 88 -force_single_line = true -skip = ["db-utils", "venv"] + +[options] +include_package_data = true + +[tool.setuptools.packages.find] +where = ["src"] + + +[project.scripts] +shopcube = "shopcube.__main__:main" From 463a996f2d1079c5fa9738d046980ec99eb1da3f Mon Sep 17 00:00:00 2001 From: Abdur-RahmaanJ Date: Fri, 27 Sep 2024 00:07:52 +0400 Subject: [PATCH 2/3] chore: Fix deps --- reqs/app.in | Bin 378 -> 424 bytes reqs/app.txt | 30 +++++++++++++---- setup.cfg | 11 ------- setup.py | 90 --------------------------------------------------- 4 files changed, 23 insertions(+), 108 deletions(-) delete mode 100644 setup.cfg delete mode 100644 setup.py diff --git a/reqs/app.in b/reqs/app.in index 68fc41010034c52a970bbc8e20c5e40616620cbd..80ebe502cfc409262d1aef5be6a34e79935121f1 100644 GIT binary patch delta 71 zcmeyxw1RoU4^BG^? diff --git a/reqs/app.txt b/reqs/app.txt index 0b263297..7936622a 100644 --- a/reqs/app.txt +++ b/reqs/app.txt @@ -7,11 +7,14 @@ click==8.0.1 dnspython==2.1.0 # via email-validator email-validator==1.1.3 - # via shopyo + # via + # -r reqs/app.in + # shopyo et-xmlfile==1.1.0 # via openpyxl flask==2.2.0 # via + # -r reqs/app.in # flask-admin # flask-login # flask-mailman @@ -24,7 +27,9 @@ flask==2.2.0 flask-admin==1.6.0 # via shopyo flask-login==0.6.2 - # via shopyo + # via + # -r reqs/app.in + # shopyo flask-mailman==0.3.0 # via shopyo flask-marshmallow==0.14.0 @@ -32,14 +37,18 @@ flask-marshmallow==0.14.0 flask-migrate==3.1.0 # via shopyo flask-reuploaded==1.2.0 + # via -r reqs/app.in flask-sqlalchemy==2.5.1 # via + # -r reqs/app.in # flask-migrate # shopyo flask-wtf==1.0.0 # via shopyo -greenlet==1.1.2 - # via sqlalchemy +greenlet==3.1.1 + # via + # -r reqs/app.in + # sqlalchemy idna==2.10 # via email-validator itsdangerous==2.0.1 @@ -65,15 +74,22 @@ marshmallow-sqlalchemy==0.26.1 # via shopyo mkdocs-material-extensions==1.0.3 # via flask-mailman -numpy==1.23.2 - # via pandas +numpy==2.1.1 + # via + # -r reqs/app.in + # pandas openpyxl==3.0.10 + # via -r reqs/app.in pandas==2.2.2 -pillow==9.2.0 + # via -r reqs/app.in +pillow==10.4.0 + # via -r reqs/app.in pymysql==1.0.2 + # via -r reqs/app.in python-dateutil==2.8.2 # via pandas pythoncms==1.2.1 + # via -r reqs/app.in pytz==2022.2.1 # via pandas shopyo==4.8.6 diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index d307df5c..00000000 --- a/setup.cfg +++ /dev/null @@ -1,11 +0,0 @@ -[metadata] -description-file = README.md - -[options] -packages = find: -package_dir = = src -include_package_data = True -python_requires = >= 3.7 - -[options.packages.find] -where=src diff --git a/setup.py b/setup.py deleted file mode 100644 index 6ca89c80..00000000 --- a/setup.py +++ /dev/null @@ -1,90 +0,0 @@ -"""A setuptools based setup module. -See: -https://packaging.python.org/guides/distributing-packages-using-setuptools/ -https://github.com/pypa/sampleproject - - -python setup.py publish to publish - -""" - -import glob -import os -import sys - -import setuptools - -# Always prefer setuptools over distutils -from setuptools import find_packages -from setuptools import setup - -# from setuptools import find_packages - - -here = os.path.abspath(os.path.dirname(__file__)) - - -if sys.argv[-1] == "publish": # requests - os.system("python setup.py sdist") # bdist_wheel - os.system("twine upload dist/* --skip-existing") - sys.exit() - -# Get the long description from the README file -with open(os.path.join(here, "README.md"), encoding="utf-8") as f: - long_description = f.read() -setup( - name="shopcube", # Required - version="4.5.0", # Required - description="E-commerce solution", # Optional - long_description=long_description, # Optional - long_description_content_type="text/markdown", # Optional (see note above) - url="https://github.com/Abdur-RahmaanJ/shopcube", # Optional - author="Abdur-Rahmaan Janhangeer & contributors", # Optional - author_email="arj.python@gmail.com", # Optional - # Classifiers help users find your project by categorizing it. - # - # For a list of valid classifiers, see https://pypi.org/classifiers/ - classifiers=[ # Optional - # How mature is this project? Common values are - # 3 - Alpha - # 4 - Beta - # 5 - Production/Stable - "Development Status :: 4 - Beta", - # Indicate who your project is intended for - "Intended Audience :: Developers", - # 'Topic :: Weather', - # Pick your license as you wish - "License :: OSI Approved :: MIT License", - # Specify the Python versions you support here. In particular, ensure - # that you indicate whether you support Python 2, Python 3 or both. - # These classifiers are *not* checked by 'pip install'. See instead - # 'python_requires' below. - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - ], - keywords="flask pos management shop ecommerce cms erp e-commerce", # Optional - # You can just specify package directories manually here if your project is - # simple. Or you can use find_packages(). - # - # Alternatively, if you just want to distribute a single Python file, use - # the `py_modules` argument instead as follows, which will expect a file - # called `my_module.py` to exist: - # - # py_modules=["my_module"], - # - # packages=find_packages(exclude=['contrib', 'docs', 'tests']), # Required - python_requires=">=3.4", - include_package_data=True, - install_requires=open(os.path.join(here, "reqs", "app.in"), encoding="utf-8") - .read() - .split("\n"), # Optional - project_urls={ # Optional - "Bug Reports": "https://github.com/Abdur-RahmaanJ/shopcube/issues", - "Source": "https://github.com/Abdur-RahmaanJ/shopcube/", - }, - packages=find_packages(), - entry_points={"console_scripts": ["shopcube=shopcube.__main__:main"]}, -) From 01911d6c1c112a2063fd1e3dcf3560ba7b339ed0 Mon Sep 17 00:00:00 2001 From: Abdur-RahmaanJ Date: Fri, 27 Sep 2024 00:08:19 +0400 Subject: [PATCH 3/3] chore: fix init --- src/shopcube/init.py | 34 ++++++---------------------------- 1 file changed, 6 insertions(+), 28 deletions(-) diff --git a/src/shopcube/init.py b/src/shopcube/init.py index 799aa667..ae500828 100644 --- a/src/shopcube/init.py +++ b/src/shopcube/init.py @@ -5,32 +5,7 @@ from flask_login import LoginManager from flask_mailman import Mail -from flask_migrate import Migrate -from flask_sqlalchemy import SQLAlchemy -from flask_wtf.csrf import CSRFProtect - -# from flask_marshmallow import Marshmallow, uncommented as not updated to support flask 2.x - -root_path = os.path.dirname(os.path.abspath(__file__)) # don't remove -static_path = os.path.join(root_path, "static") # don't remove -modules_path = os.path.join(root_path, "modules") # don't remove -themes_path = os.path.join(static_path, "themes") # don't remove -installed_packages = [] # don't remove - -installed_packages = [] - -db = SQLAlchemy() -# ma = Marshmallow() -login_manager = LoginManager() -migrate = Migrate() -mail = Mail() -csrf = CSRFProtect() - -import os - -from flask_login import LoginManager -from flask_mailman import Mail -from flask_marshmallow import Marshmallow +#from flask_marshmallow import Marshmallow from flask_migrate import Migrate from flask_sqlalchemy import SQLAlchemy from flask_uploads import DOCUMENTS @@ -43,13 +18,16 @@ static_path = os.path.join(root_path, "static") # don't remove modules_path = os.path.join(root_path, "modules") # don't remove themes_path = os.path.join(static_path, "themes") # don't remove +installed_packages = [] db = SQLAlchemy() -ma = Marshmallow() +# ma = Marshmallow() + +ma = None login_manager = LoginManager() migrate = Migrate() -csrf = CSRFProtect() mail = Mail() +csrf = CSRFProtect() productphotos = UploadSet("productphotos", IMAGES) categoryphotos = UploadSet("categoryphotos", IMAGES)