From 021d42c2fd48d40345dbb2e6898b5084c4dd6ce6 Mon Sep 17 00:00:00 2001 From: Dandaedre Date: Fri, 24 Feb 2023 19:31:50 +0100 Subject: [PATCH] Release (Makefile) - Deletes .whl and adds them to the .gitignore, now uses cargo-make --- .gitignore | 7 +- Cargo.toml | 2 +- Makefile.toml | 78 ++++++++++++++++--- pyproject.toml | 2 +- python/ffcraft_solver-0.0.4-py3-none-any.whl | Bin 5148 -> 0 bytes python/pyinstaller_log.txt | 58 -------------- python/pyproject.toml | 2 +- python/requirements_dev.txt | 6 +- 8 files changed, 73 insertions(+), 82 deletions(-) delete mode 100644 python/ffcraft_solver-0.0.4-py3-none-any.whl delete mode 100644 python/pyinstaller_log.txt diff --git a/.gitignore b/.gitignore index a8c96d3..8634d9d 100644 --- a/.gitignore +++ b/.gitignore @@ -4,10 +4,9 @@ /bin.py python/dontlook.py expected_values.md -/bin.py -python/dontlook.py -expected_values.md releases/* +.whl +pyinstaller_log.txt # Byte-compiled / optimized / DLL files __pycache__/ @@ -161,4 +160,4 @@ dmypy.json .pytype/ # Cython debug symbols -cython_debug/ \ No newline at end of file +cython_debug/ diff --git a/Cargo.toml b/Cargo.toml index 2fabe8c..321b3c5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "xiv_craft_solver" -version = "0.1.3" +version = "0.1.4" edition = "2021" authors = ["谭俊健","Dandaedre","Vkyfox"] description = "Small XIV solver library in rust, with python and rust bindings" diff --git a/Makefile.toml b/Makefile.toml index 8fbda65..ce63504 100644 --- a/Makefile.toml +++ b/Makefile.toml @@ -1,3 +1,23 @@ +[tasks.release] +dependencies = [ + "format", + "clean", + "build", + "maturin", + "maturin_build", + "pip", + "pyinstaller", + "zip", +] + +[tasks.upload] +script_runner="@shell" +ignore_errors = true +script = [ +"twine upload releases/ffcraft_solver*.whl --repository gitea", +"twine upload releases/xiv_craft_solver*.whl --repository gitea", +] + [tasks.format] install_crate = "rustfmt" command = "cargo" @@ -6,6 +26,7 @@ args = ["fmt", "--", "--emit=files"] [tasks.clean] command = "cargo" args = ["clean"] +dependencies = ["remove_tmp"] [tasks.remove_tmp] script_runner = "@shell" @@ -15,23 +36,56 @@ script = ''' rm -rf python/dist ''' +[tasks.zip] +script_runner = "@shell" +script = ''' + mkdir -p releases # Add version as an arg and things + cp target/wheels/*.whl releases/ + zip releases/ffcraft_solver_cli.zip -q -j target/release/ffcraft_solver_cli craft.toml -j target/release/libxiv_craft_solver.so + cd python/dist/ && zip -q ../../releases/ffcraft_solver_gui.zip -r ffcraft_solver_gui/ +''' + +[tasks.pip] +script_runner = "@shell" +script = ''' + cd python + rm -rf build dist + pip install -q -r requirements_dev.txt + pip install -q -e . + python -m pip wheel . --wheel-dir=../releases/ +''' + +[tasks.pyinstaller] +windows_alias = "windows_pyinstaller" +linux_alias = "linux_pyinstaller" + +[tasks.linux_pyinstaller] +script_runner = "@shell" +script = ''' + cd python + pyinstaller src/ffcraft_solver/__main__.py -i "src/ffcraft_solver/ressources/ffcraft_solver.ico" --add-data "src/ffcraft_solver/configs/:ffcraft_solver/configs" --add-data "src/ffcraft_solver/ressources/:ffcraft_solver/ressources" --name ffcraft_solver_gui -y > /dev/null +''' + +[tasks.windows_pyinstaller] +script_runner = "@shell" +script = ''' + cd python + pyinstaller src/ffcraft_solver/__main__.py -i "src/ffcraft_solver/ressources/ffcraft_solver.ico" --add-data "src/ffcraft_solver/configs/;ffcraft_solver/configs" --add-data "src/ffcraft_solver/ressources/;ffcraft_solver/ressources" --name ffcraft_solver_gui -y > /dev/null 2>pyinstaller_log.txt +''' + [tasks.build] command = "cargo" -args = ["build","--release","-q"] +args = ["build","--release"] dependencies = ["clean"] [tasks.maturin] command = "maturin" -args = ["develop", "--release", "-q"] +args = ["develop", "--release"] + +[tasks.maturin_build] +command = "maturin" +args = ["build", "--release"] + [tasks.rust] -dependencies = ["build","maturin"] - - -[tasks.my-flow] -dependencies = [ - "format", - "build", - "test" -] - +dependencies = ["build","maturin"] \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index e26bb76..73e2fc6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "maturin" [project] # The rust bindings name = "xiv_craft_solver" requires-python = ">=3.7" -version = "0.0.4" +version = "0.1.4" classifiers = [ "Programming Language :: Rust", "Programming Language :: Python :: Implementation :: CPython", diff --git a/python/ffcraft_solver-0.0.4-py3-none-any.whl b/python/ffcraft_solver-0.0.4-py3-none-any.whl deleted file mode 100644 index 05f46622e0f22d039329989096ff641ffb8a43d8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5148 zcmai&cTiK?7RE!9E}=vakzN8MR4G!VLm<@9LFqw4?@dvPf=H7h9i&PC%Yy(CG&Vpw zAqWCW3(}FIfJlG2_sv}24n)^V@5!toio0mnocrk_`X=&;W|gTU%w`l9kmV zed&`HCuzC6y9PSD2RjD&d50ncB^@16zNlbFM+yH3a|B{0&;l$5l`sQ?yGc*$TR9IH898$sZ#TdMF%wD%6Z9p zb#vOP9Woh(m-m*QXCQ46UoMkNsec(>i@dpS;+3~%@J`5pc786voREmqv?*yAXYl9? zFxd%s8zAiZ=9?1$*p|2&I%$ae^J1C2CYeJT=V`Te#i;`NRv{VQ@L^ zS=Va*p)jG$)fBM4W`ObSGTb{XZ@wYDShb8DRy(@g1rDFi-K&kx#~fr$)`yDIP^Cn_ zG}ez->{4X@#G$FkB8cbTYNf9zw4@k{r#Q=n6BqX{xMxG>e*=S75xbMTqxiHFO^%O# z{9Nwbh)cIdRByL6H->*pI!;{Gp;^s~vP&id)}nAGjZhy?R6>obznAb_>$a@TWwrgP zxnCZVw@$Zm0W|gjCCr>H4o^QAmGH_I!@IUtJza4t_68*KCn;9a3hoUmU7hPv)9smi zFP-04B_2&(U2}6mEro#D?Y>%h7U7T=Eb=Mrv1rc{-BFo{hkQ{P`=zL+Z>xSz#wA;@ z^i=ZsPFLZ3>kI7{Yp0J_`jX2wO^wK!2Ql3DFkb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peeji=1pTDCwG8E}85gZ;2hr|E4QYK20u9QU-Zf!MY(?gDuYXf)Ngmck^hu>Hn;xRsTfwF@a; zS%IVfDQn$UzEvT}_0~CrHJ_{N<6>)Qlv7RfnAXnV9mfIS#9Edddw+-{1w_V+iOp>r>eas->NVdie=YGHjX?<_Vk-~6z zzfHBwGUh=W$DQlt)fJy7_NGlV@pZx?6Q@dqOS`^Aozd8LattlXpv@OO2E3&#Z)rh7 zBg&p3R3C63q-*cDVF{~~93?Kxsf|H8KKcEj@gryEog$E4M8Bi^485L2lqFdM2#QdFvfthcm8K%*i~&*iy<76G%48U}N_q4BXf4kXf!c zVwnLL-pkrva4}3k{b37dh5EhW^eu9xwo*ll1X|RO=q%A|j&@|Z(Eyd}xV37ol&441 zw5;F8B+$eHW8u?*vUW+eU-KpQx7PGPF0p0kS6@qAZIcq9jscBX-58~>mMV|Ghk&Wx zAVIR9jEYotcnN6EYqz-bHdf#HUAPK@_$MUst?!nXeHtusi+>hTThJZFss}Ev66}~H zDD618d(=3rmF4!B3&TG8fzGYG|71u>TxBwalaaGg{Ce6!>X<*DhL}Hoem(m*$vHW= z_#XuTXo!jWH_l&UjFX&`w(%!NkNO|+{4|j#F(+NqPfQxkuP}e}P$z*WP0LT9Gs!!g zsMEh#n3KGd&f_QV%ddHV`H=so{hQYRq;)c!jP94pe-e69LVrTvG5!|%r=XrBo|L_x tM7PtwCH_qWPm)in-d|+0SHCC!PXkTiRHVTh06<52IZ5LA1^CC;e*uLgdW!%6 diff --git a/python/pyinstaller_log.txt b/python/pyinstaller_log.txt deleted file mode 100644 index 0d5d164..0000000 --- a/python/pyinstaller_log.txt +++ /dev/null @@ -1,58 +0,0 @@ -71 INFO: PyInstaller: 5.8.0 -71 INFO: Python: 3.10.6 -72 INFO: Platform: Linux-6.1.11-76060111-generic-x86_64-with-glibc2.35 -72 INFO: wrote /home/dandaedre/Documents/Git/ffcraft_solver/python/ffcraft_solver_gui.spec -74 INFO: UPX is available. -74 INFO: Extending PYTHONPATH with paths -['/home/dandaedre/Documents/Git/ffcraft_solver/python/src'] -166 INFO: checking Analysis -166 INFO: Building Analysis because Analysis-00.toc is non existent -166 INFO: Initializing module dependency graph... -167 INFO: Caching module graph hooks... -176 INFO: Analyzing base_library.zip ... -581 INFO: Loading module hook 'hook-heapq.py' from '/home/dandaedre/Documents/Git/ffcraft_solver/.venv/lib/python3.10/site-packages/PyInstaller/hooks'... -625 INFO: Loading module hook 'hook-encodings.py' from '/home/dandaedre/Documents/Git/ffcraft_solver/.venv/lib/python3.10/site-packages/PyInstaller/hooks'... -1292 INFO: Loading module hook 'hook-pickle.py' from '/home/dandaedre/Documents/Git/ffcraft_solver/.venv/lib/python3.10/site-packages/PyInstaller/hooks'... -2161 INFO: Caching module dependency graph... -2221 INFO: running Analysis Analysis-00.toc -2236 INFO: Analyzing /home/dandaedre/Documents/Git/ffcraft_solver/python/src/ffcraft_solver/__main__.py -2508 INFO: Loading module hook 'hook-platform.py' from '/home/dandaedre/Documents/Git/ffcraft_solver/.venv/lib/python3.10/site-packages/PyInstaller/hooks'... -2672 INFO: Loading module hook 'hook-pygments.py' from '/home/dandaedre/Documents/Git/ffcraft_solver/.venv/lib/python3.10/site-packages/PyInstaller/hooks'... -3097 INFO: Loading module hook 'hook-pkg_resources.py' from '/home/dandaedre/Documents/Git/ffcraft_solver/.venv/lib/python3.10/site-packages/PyInstaller/hooks'... -3438 INFO: Loading module hook 'hook-xml.py' from '/home/dandaedre/Documents/Git/ffcraft_solver/.venv/lib/python3.10/site-packages/PyInstaller/hooks'... -3457 INFO: Loading module hook 'hook-sysconfig.py' from '/home/dandaedre/Documents/Git/ffcraft_solver/.venv/lib/python3.10/site-packages/PyInstaller/hooks'... -4100 INFO: Processing module hooks... -5030 INFO: Processing pre-safe import module hook win32com from '/home/dandaedre/Documents/Git/ffcraft_solver/.venv/lib/python3.10/site-packages/_pyinstaller_hooks_contrib/hooks/pre_safe_import_module/hook-win32com.py'. -5209 INFO: Loading module hook 'hook-packaging.py' from '/home/dandaedre/Documents/Git/ffcraft_solver/.venv/lib/python3.10/site-packages/PyInstaller/hooks'... -5271 INFO: Looking for ctypes DLLs -5276 INFO: Analyzing run-time hooks ... -5278 INFO: Including run-time hook '/home/dandaedre/Documents/Git/ffcraft_solver/.venv/lib/python3.10/site-packages/PyInstaller/hooks/rthooks/pyi_rth_inspect.py' -5279 INFO: Including run-time hook '/home/dandaedre/Documents/Git/ffcraft_solver/.venv/lib/python3.10/site-packages/PyInstaller/hooks/rthooks/pyi_rth_pkgres.py' -5281 INFO: Including run-time hook '/home/dandaedre/Documents/Git/ffcraft_solver/.venv/lib/python3.10/site-packages/PyInstaller/hooks/rthooks/pyi_rth_pkgutil.py' -5288 INFO: Looking for dynamic libraries -5630 INFO: Looking for eggs -5630 INFO: Python library not among binary dependencies. Performing additional search... -5642 INFO: Using Python library /lib/x86_64-linux-gnu/libpython3.10.so.1.0 -5644 INFO: Warnings written to /home/dandaedre/Documents/Git/ffcraft_solver/python/build/ffcraft_solver_gui/warn-ffcraft_solver_gui.txt -5669 INFO: Graph cross-reference written to /home/dandaedre/Documents/Git/ffcraft_solver/python/build/ffcraft_solver_gui/xref-ffcraft_solver_gui.html -5679 INFO: Appending 'datas' from .spec -5684 INFO: checking PYZ -5684 INFO: Building PYZ because PYZ-00.toc is non existent -5684 INFO: Building PYZ (ZlibArchive) /home/dandaedre/Documents/Git/ffcraft_solver/python/build/ffcraft_solver_gui/PYZ-00.pyz -6064 INFO: Building PYZ (ZlibArchive) /home/dandaedre/Documents/Git/ffcraft_solver/python/build/ffcraft_solver_gui/PYZ-00.pyz completed successfully. -6073 WARNING: Ignoring icon; supported only on Windows and macOS! -6073 INFO: checking PKG -6073 INFO: Building PKG because PKG-00.toc is non existent -6073 INFO: Building PKG (CArchive) ffcraft_solver_gui.pkg -6087 INFO: Building PKG (CArchive) ffcraft_solver_gui.pkg completed successfully. -6087 INFO: Bootloader /home/dandaedre/Documents/Git/ffcraft_solver/.venv/lib/python3.10/site-packages/PyInstaller/bootloader/Linux-64bit-intel/run -6087 INFO: checking EXE -6087 INFO: Building EXE because EXE-00.toc is non existent -6087 INFO: Building EXE from EXE-00.toc -6087 INFO: Copying bootloader EXE to /home/dandaedre/Documents/Git/ffcraft_solver/python/build/ffcraft_solver_gui/ffcraft_solver_gui -6088 INFO: Appending PKG archive to custom ELF section in EXE -6096 INFO: Building EXE from EXE-00.toc completed successfully. -6096 INFO: checking COLLECT -6096 INFO: Building COLLECT because COLLECT-00.toc is non existent -6096 INFO: Building COLLECT COLLECT-00.toc -6236 INFO: Building COLLECT COLLECT-00.toc completed successfully. diff --git a/python/pyproject.toml b/python/pyproject.toml index 0e3f93e..5990991 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -9,7 +9,7 @@ authors = [ {name="Dandaedre"}, ] requires-python = ">=3.7" -version = "0.0.4" +version = "0.1.4" license = {text="Mozilla Public License Version 2.0"} classifiers = [ "Programming Language :: Rust", diff --git a/python/requirements_dev.txt b/python/requirements_dev.txt index 96c3071..48f786b 100644 --- a/python/requirements_dev.txt +++ b/python/requirements_dev.txt @@ -5,9 +5,5 @@ pytest-cov==3.0.0 mypy==0.941 dearpygui==1.8.0 PyYAML==6.0 -<<<<<<< HEAD rich==13.3.1 -pyinstaller==5.8.0 -======= -rich==13.3.1 ->>>>>>> develop +pyinstaller==5.8.0 \ No newline at end of file