From e9e5f2499b29ebfbe4952cec824c2e7a79d5c7a6 Mon Sep 17 00:00:00 2001 From: "Vincent (Leirof)" Date: Fri, 3 Feb 2023 10:14:03 +0100 Subject: [PATCH] Update 0.1.0 --- docs/conf.py | 1 + pyproject.toml | 2 +- setup.py | 2 +- src/examples.ipynb | 39 ++++++++++++++++++++++----------------- upload_on_pypi.py | 3 ++- 5 files changed, 27 insertions(+), 20 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index c35da2a..add9e76 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -58,6 +58,7 @@ "path_to_docs": "docs", "use_repository_button": True, "use_edit_page_button": True, + "announcement": "⚠️ 0.1.0 version is in active development and might be unstable, use it at your own risks ⚠️" } html_logo = "logo.png" diff --git a/pyproject.toml b/pyproject.toml index 5f3173b..bb5ff1d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,7 +8,7 @@ build-backend = "setuptools.build_meta" [project] name = "LRFutils" -version = "0.0.15" +version = "0.1.0" authors = [ { name="Leirof", email="vince.lrf@gmail.com" }, ] diff --git a/setup.py b/setup.py index 51b2b92..a184145 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ setup( name="LRFutils", - version = "0.0.10", + version = "0.1.0", description = 'Just a custom library to share with some colleagues. Use it at your own risks.', author = 'Leirof', author_email = 'vince.lrf@gmail.com', diff --git a/src/examples.ipynb b/src/examples.ipynb index 7fbbc45..779a14d 100644 --- a/src/examples.ipynb +++ b/src/examples.ipynb @@ -14,7 +14,15 @@ "cell_type": "code", "execution_count": 1, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Archive created at ./archives/2023-02-03_875a360/4_Simu-L=2,z=3.14,state=solid\n" + ] + } + ], "source": [ "from LRFutils import archive\n", "\n", @@ -36,7 +44,7 @@ "source": [ "---\n", "\n", - "# Color" + "# 🎨 Color" ] }, { @@ -69,7 +77,7 @@ "source": [ "---\n", "\n", - "# Logs" + "# 📜 Logs" ] }, { @@ -81,10 +89,10 @@ "name": "stdout", "output_type": "stream", "text": [ - "\u001b[34m03/02/2023\u001b[0m at \u001b[35m09:56:39\u001b[0m | \u001b[32m[INFO] \u001b[0mHello world!\n", - "\u001b[34m03/02/2023\u001b[0m at \u001b[35m09:56:39\u001b[0m | \u001b[93m[WARNING] Hello world!\u001b[0m\n", - "\u001b[34m03/02/2023\u001b[0m at \u001b[35m09:56:39\u001b[0m | \u001b[41m[ERROR]\u001b[0m\u001b[31m Hello world!\u001b[0m\n", - " -> Look at \u001b[32mlogs/2023-02-03_09.56.39.797538.log\u001b[0m for more information.\n", + "\u001b[34m03/02/2023\u001b[0m at \u001b[35m10:00:47\u001b[0m | \u001b[32m[INFO] \u001b[0mHello world!\n", + "\u001b[34m03/02/2023\u001b[0m at \u001b[35m10:00:47\u001b[0m | \u001b[93m[WARNING] Hello world!\u001b[0m\n", + "\u001b[34m03/02/2023\u001b[0m at \u001b[35m10:00:47\u001b[0m | \u001b[41m[ERROR]\u001b[0m\u001b[31m Hello world!\u001b[0m\n", + " -> Look at \u001b[32mlogs/2023-02-03_10.00.47.123940.log\u001b[0m for more information.\n", "\n" ] } @@ -104,7 +112,7 @@ "source": [ "---\n", "\n", - "# Progress" + "# ⌛ Progress" ] }, { @@ -113,15 +121,12 @@ "metadata": {}, "outputs": [ { - "ename": "AttributeError", - "evalue": "module 'LRFutils.color' has no attribute 'LightGreen'", - "output_type": "error", - "traceback": [ - "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[1;31mAttributeError\u001b[0m Traceback (most recent call last)", - "Cell \u001b[1;32mIn[4], line 9\u001b[0m\n\u001b[0;32m 6\u001b[0m a \u001b[39m=\u001b[39m progress\u001b[39m.\u001b[39mBar(\u001b[39mmax\u001b[39m \u001b[39m=\u001b[39m N)\n\u001b[0;32m 8\u001b[0m \u001b[39mfor\u001b[39;00m i \u001b[39min\u001b[39;00m \u001b[39mrange\u001b[39m(N):\n\u001b[1;32m----> 9\u001b[0m a(i\u001b[39m+\u001b[39;49m\u001b[39m1\u001b[39;49m)\n\u001b[0;32m 10\u001b[0m time\u001b[39m.\u001b[39msleep(\u001b[39m0.01\u001b[39m)\n\u001b[0;32m 12\u001b[0m a \u001b[39m=\u001b[39m progress\u001b[39m.\u001b[39mBar(prefix \u001b[39m=\u001b[39m \u001b[39m\"\u001b[39m\u001b[39mThe best bar\u001b[39m\u001b[39m\"\u001b[39m, \u001b[39mmax\u001b[39m \u001b[39m=\u001b[39m N)\n", - "File \u001b[1;32mc:\\Users\\vince\\Documents\\Dev\\Perso\\LRFutils\\src\\LRFutils\\progress.py:83\u001b[0m, in \u001b[0;36mBar.__call__\u001b[1;34m(self, progress, prefix, stop)\u001b[0m\n\u001b[0;32m 81\u001b[0m progress_normed \u001b[39m=\u001b[39m progress \u001b[39m/\u001b[39m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mmax\n\u001b[0;32m 82\u001b[0m \u001b[39mif\u001b[39;00m progress \u001b[39m==\u001b[39m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mmax : stop \u001b[39m=\u001b[39m \u001b[39mTrue\u001b[39;00m\n\u001b[1;32m---> 83\u001b[0m color_bar \u001b[39m=\u001b[39m color\u001b[39m.\u001b[39mYellow \u001b[39mif\u001b[39;00m stop \u001b[39mand\u001b[39;00m progress_normed \u001b[39m!=\u001b[39m \u001b[39m1\u001b[39m \u001b[39melse\u001b[39;00m color\u001b[39m.\u001b[39;49mLightGreen \n\u001b[0;32m 85\u001b[0m \u001b[39mif\u001b[39;00m stop: end \u001b[39m=\u001b[39m \u001b[39m\"\u001b[39m\u001b[39m\\n\u001b[39;00m\u001b[39m\"\u001b[39m\n\u001b[0;32m 86\u001b[0m \u001b[39melse\u001b[39;00m: end \u001b[39m=\u001b[39m \u001b[39m\"\u001b[39m\u001b[39m\\r\u001b[39;00m\u001b[39m\"\u001b[39m\n", - "\u001b[1;31mAttributeError\u001b[0m: module 'LRFutils.color' has no attribute 'LightGreen'" + "name": "stdout", + "output_type": "stream", + "text": [ + "\u001b[92m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ \u001b[92m100% \u001b[91m1000/1000 \u001b[35m0:00:15\u001b[0mta \u001b[34m0:00:00\u001b[0m\n", + "\u001b[0mThe best bar \u001b[93m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[93m╸\u001b[37m━━━━━━━━━━━━━━━━ \u001b[93m64% \u001b[91m642/1000 \u001b[35m0:00:11\u001b[0m00:05\u001b[0m\n", + "\u001b[0mWaw, another incredible bar \u001b[92m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ \u001b[92m100% \u001b[91m1000/1000 \u001b[35m0:00:15\u001b[0mta \u001b[34m0:00:00\u001b[0m\n" ] } ], diff --git a/upload_on_pypi.py b/upload_on_pypi.py index 93e2a88..a7b6470 100644 --- a/upload_on_pypi.py +++ b/upload_on_pypi.py @@ -1,4 +1,5 @@ import os +from LRFutils import color # Remove old versions if os.path.isdir("dist"): @@ -17,7 +18,7 @@ accept = ["", "yes", "y", "ye", "yeah", "yep", "oui", "ouai", "ouaip"] for command in script: - select = input(f"Do you want to execute the following command? [Y/n]\n{command}\n") + select = input(color.blue("\nDo you want to execute the following command? [Y/n]\n ") + color.yellow(command) + "\n") if select.lower() in accept: os.system(command) else: