From 59d61b8c385ead6af8c1d2af8d74a122f38d6115 Mon Sep 17 00:00:00 2001 From: shenjack <3695888@qq.com> Date: Fri, 20 Jan 2023 23:30:27 +0800 Subject: [PATCH] \pyo3/ --- configs/main.toml | 4 ++-- libs/Difficult_Rocket_rs/pyproject.toml | 15 +++++++++++++- libs/Difficult_Rocket_rs/readme.md | 8 ++++++++ libs/Difficult_Rocket_rs/src/lib.rs | 1 + nuitka3-complie.ps1 | 2 +- compile.ps1 => py_compile.ps1 | 0 pyproject.toml | 26 ++++++++++++++++++++++++- 7 files changed, 51 insertions(+), 5 deletions(-) create mode 100644 libs/Difficult_Rocket_rs/readme.md rename compile.ps1 => py_compile.ps1 (100%) diff --git a/configs/main.toml b/configs/main.toml index 001baef..d438c75 100644 --- a/configs/main.toml +++ b/configs/main.toml @@ -8,8 +8,8 @@ fonts_folder = "libs/fonts" [window] style = "None" -width = 1024 -height = 768 +width = 1515 +height = 864 visible = true gui_scale = 1 caption = "Difficult Rocket {version}" diff --git a/libs/Difficult_Rocket_rs/pyproject.toml b/libs/Difficult_Rocket_rs/pyproject.toml index 2d3b755..f3ccb79 100644 --- a/libs/Difficult_Rocket_rs/pyproject.toml +++ b/libs/Difficult_Rocket_rs/pyproject.toml @@ -1,2 +1,15 @@ [build-system] -requires = ["setuptools", "wheel", "setuptools-rust"] \ No newline at end of file +requires = ["setuptools", "wheel", "setuptools-rust"] + +[project] +name = 'Difficult_Rocket_rs' +dynamic = ['version'] +authors = [ + {name = 'shenjackyuanjie', email = '3695888@qq.com'} +] +requires-python = ">=3.8" +classifiers = [ + "Programming Language :: Rust", + "Programming Language :: Python :: Implementation :: CPython", + "Programming Language :: Python :: Implementation :: PyPy", +] \ No newline at end of file diff --git a/libs/Difficult_Rocket_rs/readme.md b/libs/Difficult_Rocket_rs/readme.md new file mode 100644 index 0000000..8e30583 --- /dev/null +++ b/libs/Difficult_Rocket_rs/readme.md @@ -0,0 +1,8 @@ +# Difficult_Rocket_rs + +DR 的 Rust 编写的扩展 +用于提升 DR 的性能 + +## 版本信息 +- 使用工具 + - pyo3 diff --git a/libs/Difficult_Rocket_rs/src/lib.rs b/libs/Difficult_Rocket_rs/src/lib.rs index 4bbc282..0091b72 100644 --- a/libs/Difficult_Rocket_rs/src/lib.rs +++ b/libs/Difficult_Rocket_rs/src/lib.rs @@ -1,3 +1,4 @@ +#[allow(non_snake_case)] use pyo3::prelude::*; /// Formats the sum of two numbers as string. diff --git a/nuitka3-complie.ps1 b/nuitka3-complie.ps1 index 6e4335a..bf530d9 100644 --- a/nuitka3-complie.ps1 +++ b/nuitka3-complie.ps1 @@ -43,7 +43,7 @@ $end_time = Get-Uptime $out = $end_time.TotalMilliseconds - $start_time.TotalMilliseconds Write-Output $end_time.TotalSeconds $start_time.TotalSeconds $out s Write-Output $start_time $end_time -Write-Output "--jobs=24 --mingw64 --lto=no and $args" +Write-Output "--jobs=24 --clang --msvc=latest --lto=no and $args" # --include-data-dir=./libs/pyglet=./pyglet # --run # --disable-ccache diff --git a/compile.ps1 b/py_compile.ps1 similarity index 100% rename from compile.ps1 rename to py_compile.ps1 diff --git a/pyproject.toml b/pyproject.toml index 9935add..430311c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,5 +22,29 @@ defusedxml = "*" [build-system] -requires = ["setuptools>=42", "wheel", "nuitka", "toml", "imageio"] +requires = ["setuptools>=61", + "wheel", + "nuitka", + "imageio", + "setuptools-rust"] build-backend = "nuitka.distutils.Build" + +[project] +name = 'Difficult_Rocket' +dynamic = ['version'] +authors = [ + {name = 'shenjackyuanjie', email = '3695888@qq.com'} +] +description = 'A rocket simlater' +readme = 'README.md' +requires-python = '>=3.8' +license = {text = 'CC BY-NC-SA 4.0'} +dependencies = [ + 'nuitka=1.3.x', + 'psutil=5.9.x', + 'defusedxml=0.7.x', + 'rtoml=0.9.x', + 'tomlkit=0.11.x', + 'Pillow', + 'pymunk' +]