diff --git a/.gitignore b/.gitignore index 4d09e33..43ac8f4 100644 --- a/.gitignore +++ b/.gitignore @@ -25,6 +25,7 @@ share/python-wheels/ .installed.cfg *.egg MANIFEST +MANIFEST.in # PyInstaller # Usually these files are written by a python script from a template diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..2d16a1a --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,7 @@ +include packages/create_myte/utils/info.json + +recursive-include packages/create_myte/templates * + +recursive-exclude packages/create_myte/templates/*/env * +recursive-exclude packages/create_myte/templates *.env +recursive-exclude tests * \ No newline at end of file diff --git a/Pipfile.lock b/Pipfile.lock index ab81928..f180de3 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -47,31 +47,39 @@ ], "version": "==0.4.6" }, + "editor": { + "hashes": [ + "sha256:53c26dd78333b50b8cdcf67748956afa75fabcb5bb25e96a00515504f58e49a8", + "sha256:5a8ad611d2a05de34994df3781605e26e63492f82f04c2e93abdd330eed6fa8d" + ], + "markers": "python_version >= '3.8'", + "version": "==1.6.5" + }, "flake8": { "hashes": [ - "sha256:d5b3857f07c030bdb5bf41c7f53799571d75c4491748a3adcd47de929e34cd23", - "sha256:ffdfce58ea94c6580c77888a86506937f9a1a227dfcd15f245d694ae20a6b6e5" + "sha256:33f96621059e65eec474169085dc92bf26e7b2d47366b70be2f67ab80dc25132", + "sha256:a6dfbb75e03252917f2473ea9653f7cd799c3064e54d4c8140044c5c065f53c3" ], "index": "pypi", "markers": "python_full_version >= '3.8.1'", - "version": "==6.1.0" + "version": "==7.0.0" }, "inquirer": { "hashes": [ - "sha256:a7441fd74d06fcac4385218a1f5e8703f7a113f7944e01af47b8c58e84f95ce5", - "sha256:aac309406f5b49d4b8ab7c6872117f43bf082a552dc256aa16bc95e16bb58bec" + "sha256:d5ff9bb8cd07bd3f076eabad8ae338280886e93998ff10461975b768e3854fbc", + "sha256:e1a0a001b499633ca69d2ea64da712b449939e8fad8fa47caebc92b0ee212df4" ], "index": "pypi", - "markers": "python_version >= '3.8'", - "version": "==3.1.3" + "markers": "python_full_version >= '3.8.1'", + "version": "==3.2.1" }, "jinxed": { "hashes": [ - "sha256:032acda92d5c57cd216033cbbd53de731e6ed50deb63eb4781336ca55f72cda5", - "sha256:cfc2b2e4e3b4326954d546ba6d6b9a7a796ddcb0aef8d03161d005177eb0d48b" + "sha256:30c3f861b73279fea1ed928cfd4dfb1f273e16cd62c8a32acfac362da0f78f3f", + "sha256:37422659c4925969c66148c5e64979f553386a4226b9484d910d3094ced37d30" ], "markers": "platform_system == 'Windows'", - "version": "==1.2.0" + "version": "==1.2.1" }, "markdown-it-py": { "hashes": [ @@ -99,38 +107,28 @@ }, "pycodestyle": { "hashes": [ - "sha256:259bcc17857d8a8b3b4a2327324b79e5f020a13c16074670f9c8c8f872ea76d0", - "sha256:5d1013ba8dc7895b548be5afb05740ca82454fd899971563d2ef625d090326f8" + "sha256:41ba0e7afc9752dfb53ced5489e89f8186be00e599e712660695b7a75ff2663f", + "sha256:44fe31000b2d866f2e41841b18528a505fbd7fef9017b04eff4e2648a0fadc67" ], "index": "pypi", "markers": "python_version >= '3.8'", - "version": "==2.11.0" + "version": "==2.11.1" }, "pyflakes": { "hashes": [ - "sha256:4132f6d49cb4dae6819e5379898f2b8cce3c5f23994194c24b77d5da2e36f774", - "sha256:a0aae034c444db0071aa077972ba4768d40c830d9539fd45bf4cd3f8f6992efc" + "sha256:1c61603ff154621fb2a9172037d84dca3500def8c8b630657d1701f026f8af3f", + "sha256:84b5be138a2dfbb40689ca07e2152deb896a65c3a3e24c251c5c62489568074a" ], "markers": "python_version >= '3.8'", - "version": "==3.1.0" + "version": "==3.2.0" }, "pygments": { "hashes": [ - "sha256:13fc09fa63bc8d8671a6d247e1eb303c4b343eaee81d861f3404db2935653692", - "sha256:1daff0494820c69bc8941e407aa20f577374ee88364ee10a98fdbe0aece96e29" + "sha256:b27c2826c47d0f3219f29554824c30c5e8945175d888647acd804ddd04af846c", + "sha256:da46cec9fd2de5be3a8a784f434e4c4ab670b4ff54d605c4c2717e9d49c4c367" ], "markers": "python_version >= '3.7'", - "version": "==2.16.1" - }, - "python-editor": { - "hashes": [ - "sha256:1bf6e860a8ad52a14c3ee1252d5dc25b2030618ed80c022598f00176adc8367d", - "sha256:51fda6bcc5ddbbb7063b2af7509e43bd84bfc32a4ff71349ec7847713882327b", - "sha256:5f98b069316ea1c2ed3f67e7f5df6c0d8f10b689964a4a811ff64f0106819ec8", - "sha256:c3da2053dbab6b29c94e43c486ff67206eafbe7eb52dbec7390b5e2fb05aac77", - "sha256:ea87e17f6ec459e780e4221f295411462e0d0810858e055fc514684350a2f522" - ], - "version": "==1.0.4" + "version": "==2.17.2" }, "readchar": { "hashes": [ @@ -142,25 +140,33 @@ }, "rich": { "hashes": [ - "sha256:2b38e2fe9ca72c9a00170a1a2d20c63c790d0e10ef1fe35eba76e1e7b1d7d245", - "sha256:5c14d22737e6d5084ef4771b62d5d4363165b403455a30a1c8ca39dc7b644bef" + "sha256:5cb5123b5cf9ee70584244246816e9114227e0b98ad9176eede6ad54bf5403fa", + "sha256:6da14c108c4866ee9520bbffa71f6fe3962e193b7da68720583850cd4548e235" ], - "version": "==13.6.0" + "version": "==13.7.0" + }, + "runs": { + "hashes": [ + "sha256:8804271011b7a2eeb0d77c3e3f556e5ce5f602fa0dd2a31ed0c1222893be69b7", + "sha256:ec6fe3b24dfa20c5c4e5c4806d3b35bb880aad0e787a8610913c665c5a7cc07c" + ], + "markers": "python_version >= '3.8'", + "version": "==1.2.0" }, "setuptools": { "hashes": [ - "sha256:4ac1475276d2f1c48684874089fefcd83bd7162ddaafb81fac866ba0db282a87", - "sha256:b454a35605876da60632df1a60f736524eb73cc47bbc9f3f1ef1b644de74fd2a" + "sha256:385eb4edd9c9d5c17540511303e39a147ce2fc04bc55289c322b9e5904fe2c05", + "sha256:be1af57fc409f93647f2e8e4573a142ed38724b8cdd389706a867bb4efcf1e78" ], "markers": "python_version >= '3.8'", - "version": "==68.2.2" + "version": "==69.0.3" }, "shellingham": { "hashes": [ - "sha256:419c6a164770c9c7cfcaeddfacb3d31ac7a8db0b0f3e9c1287679359734107e9", - "sha256:cb4a6fec583535bc6da17b647dd2330cf7ef30239e05d547d99ae3705fd0f7f8" + "sha256:7ecfff8f2fd72616f7481040475a65b2bf8af90a56c89140852d1120324e8686", + "sha256:8dbca0739d487e5bd35ab3ca4b36e11c4078f3a234bfce294b0a0291363404de" ], - "version": "==1.5.3" + "version": "==1.5.4" }, "six": { "hashes": [ @@ -183,18 +189,26 @@ }, "typing-extensions": { "hashes": [ - "sha256:8f92fc8806f9a6b641eaa5318da32b44d401efaac0f6678c9bc448ba3605faa0", - "sha256:df8e4339e9cb77357558cbdbceca33c303714cf861d1eef15e1070055ae8b7ef" + "sha256:23478f88c37f27d76ac8aee6c905017a143b0b1b886c3c9f66bc2fd94f9f5783", + "sha256:af72aea155e91adfc61c3ae9e0e342dbc0cba726d6cba4b6c72c1f34e47291cd" ], "markers": "python_version >= '3.8'", - "version": "==4.8.0" + "version": "==4.9.0" }, "wcwidth": { "hashes": [ - "sha256:77f719e01648ed600dfa5402c347481c0992263b81a027344f3e1ba25493a704", - "sha256:8705c569999ffbb4f6a87c6d1b80f324bd6db952f5eb0b95bc07517f4c1813d4" + "sha256:3da69048e4540d84af32131829ff948f1e022c1c6bdb8d6102117aac784f6859", + "sha256:72ea0c06399eb286d978fdedb6923a9eb47e1c486ce63e9b4e64fc18303972b5" ], - "version": "==0.2.8" + "version": "==0.2.13" + }, + "xmod": { + "hashes": [ + "sha256:38c76486b9d672c546d57d8035df0beb7f4a9b088bc3fb2de5431ae821444377", + "sha256:a24e9458a4853489042522bdca9e50ee2eac5ab75c809a91150a8a7f40670d48" + ], + "markers": "python_version >= '3.8'", + "version": "==1.8.1" } }, "develop": {} diff --git a/packages/create_myte/resources/create_project.py b/packages/create_myte/resources/create_project.py index 1ac2bb1..1e34ba6 100644 --- a/packages/create_myte/resources/create_project.py +++ b/packages/create_myte/resources/create_project.py @@ -11,8 +11,8 @@ from rich.console import Console from rich.text import Text -from ..utils.secret_key_generator import GenerateSecretKey from ..utils.constants import current_dir, messages, system_os, template_folder +from ..utils.secret_key_generator import GenerateSecretKey class CreateProject: diff --git a/packages/create_myte/resources/setup_project.py b/packages/create_myte/resources/setup_project.py index cd44b4f..995e727 100644 --- a/packages/create_myte/resources/setup_project.py +++ b/packages/create_myte/resources/setup_project.py @@ -9,9 +9,9 @@ from rich import print as mprint from rich.prompt import Prompt -from ..utils.errors import UKeyboardInterrupt from .create_project import CreateProject from .delete_project import DeleteProject +from ..utils.errors import UKeyboardInterrupt class SetupProject: @@ -26,12 +26,22 @@ def project_setup(): "Project Name", default="myte-project") mprint("\n") - if project_name == ".": - DeleteProject.delete_files() - else: - DeleteProject.delete_dir(project_name) - mprint(f"[green] ✅ Project name: {project_name} [/green]") - mprint("\n") + try: + if project_name == ".": + DeleteProject.delete_files() + else: + DeleteProject.delete_dir(project_name) + mprint(f"[green] ✅ Project name: {project_name} [/green]") + mprint("\n") + except UKeyboardInterrupt as e: + mprint(f"{e.message}") # noqa + raise typer.Abort() + except KeyboardInterrupt as e: + mprint(f"The Programme was terminated due to {e} Error") # noqa + raise typer.Abort() + except TypeError as e: + mprint(f"The Programme was terminated due to {e} Error") # noqa + raise typer.Abort() # get framework choice try: diff --git a/packages/create_myte/templates/template-flask-restful-api-robust/example.env b/packages/create_myte/templates/template-flask-restful-api-robust/example.envi similarity index 100% rename from packages/create_myte/templates/template-flask-restful-api-robust/example.env rename to packages/create_myte/templates/template-flask-restful-api-robust/example.envi diff --git a/packages/create_myte/templates/template-flask-restful-api-simple/example.env b/packages/create_myte/templates/template-flask-restful-api-simple/example.envi similarity index 100% rename from packages/create_myte/templates/template-flask-restful-api-simple/example.env rename to packages/create_myte/templates/template-flask-restful-api-simple/example.envi diff --git a/packages/create_myte/templates/template-flask-robust/example.env b/packages/create_myte/templates/template-flask-robust/example.envi similarity index 100% rename from packages/create_myte/templates/template-flask-robust/example.env rename to packages/create_myte/templates/template-flask-robust/example.envi diff --git a/packages/create_myte/templates/template-flask-simple/example.env b/packages/create_myte/templates/template-flask-simple/example.envi similarity index 100% rename from packages/create_myte/templates/template-flask-simple/example.env rename to packages/create_myte/templates/template-flask-simple/example.envi diff --git a/packages/create_myte/utils/info.json b/packages/create_myte/utils/info.json index b3d4bc5..bd80ad8 100644 --- a/packages/create_myte/utils/info.json +++ b/packages/create_myte/utils/info.json @@ -32,7 +32,7 @@ "environment_variable": "[cyan] - Rename example.env to .env [/cyan]", "database_configuration": " - Go to config.py, decide the database you want to use, uncomment it and run the pip instructions there ", - "secret_key_configuration": "[cyan] - Go to .env, replace 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' in SECRETKEY with[/cyan]" + "secret_key_configuration": "[cyan] - Rename example.envi to .env, Go to .env, replace 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' in SECRETKEY with[/cyan]" }, "os":{ diff --git a/pyproject.toml b/pyproject.toml index 2c051a1..9b7a3cb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,10 +4,11 @@ build-backend = "setuptools.build_meta" [project] name = "myte" -version = "1.0.0a1" +version = "1.0.0b1" dependencies = [ "typer", "inquirer", + "rich" ] authors = [ { name="Samuel Doghor", email="talkto@samdoghor.com" }, diff --git a/setup.cfg b/setup.cfg index 725a733..33c1dbc 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = myte -version = 1.0.0a1 +version = 1.0.0b1 author = Samuel Doghor author_email = talkto@samdoghor.com description = Myte allows users to choose from popular web frameworks like Flask, FastAPI, and Tornado etc when initializing a new project. After entering a project name, the user selects their preferred framework which then generates the basic directory structure and boilerplate code to get started. @@ -23,6 +23,7 @@ include_package_data = True install_requires = typer inquirer + rich [options.entry_points] console_scripts =