Build Version 1.2.0.0 + typing

This commit is contained in:
shenjack 2023-03-02 13:15:29 +08:00
parent 2f178f5907
commit 1062ca87f7
14 changed files with 90 additions and 17 deletions

View File

@ -7,6 +7,7 @@
import os import os
import sys import sys
import zipfile import zipfile
import shutil
if sys.platform == "win32": if sys.platform == "win32":
os.system('') os.system('')
@ -21,13 +22,40 @@ def make_zip():
dist_zip.write(file_path) dist_zip.write(file_path)
def remove_dev_usage(): def remove_un_use():
un_use_fonts = [ un_use_file = [
'./' './libs/fonts/Fira_Code',
'./libs/fonts/scientifica'
'./libs/fonts/Monocraft.otf',
'./libs/fonts/SmileySans-Oblique.ttf'
'./libs/fonts/HarmonyOS_Sans/HarmonyOS_Sans_Condensed',
'./libs/fonts/HarmonyOS_Sans/HarmonyOS_Sans'
] ]
... # 删除不必要的文件
# 如果忽略不存在或无法删除的文件
os.chdir('./build/Difficult-Rocket')
for file in un_use_file:
try:
os.remove(file)
except FileNotFoundError:
pass
except PermissionError:
pass
os.chdir('../../')
def copy_data_file():
files = {
'./libs/pyglet': './build/pyglet',
'./libs/Difficult_Rocket_rs/lib': './build/libs/Difficult_Rocket_rs/lib',
}
# 使用 shutil 复制文件
for src, dist in files.items():
shutil.copytree(src, dist)
if __name__ == '__main__': if __name__ == '__main__':
print(os.listdir('./build')) print(os.listdir('./build'))
remove_un_use()
copy_data_file()
make_zip() make_zip()

View File

@ -23,7 +23,7 @@ from Difficult_Rocket.api.types import Options
from libs.MCDR.version import Version from libs.MCDR.version import Version
game_version = Version("0.7.1.4") # 游戏版本 game_version = Version("0.7.1.4") # 游戏版本
build_version = Version("1.1.0.0") # 编译文件版本(与游戏本体无关) build_version = Version("1.2.0.0") # 编译文件版本(与游戏本体无关)
DR_rust_version = Version("0.2.5.5") # DR 的 Rust 编写部分的版本 DR_rust_version = Version("0.2.5.5") # DR 的 Rust 编写部分的版本
Api_version = Version("0.0.0.1") # API 版本 Api_version = Version("0.0.0.1") # API 版本
__version__ = game_version __version__ = game_version

View File

@ -11,7 +11,15 @@ github: @shenjackyuanjie
gitee: @shenjackyuanjie gitee: @shenjackyuanjie
""" """
from Difficult_Rocket.exception.command import * from Difficult_Rocket.exception.command import (
CommandError,
CommandParseError,
CommandQMarkPosError,
CommandQMarkConflict,
CommandQMarkMissing,
CommandQMarkPreMissing,
CommandQMarkSufMissing
)
__all__ = [ __all__ = [
"CommandError", "CommandError",

View File

@ -4,7 +4,9 @@
# All rights reserved # All rights reserved
# ------------------------------- # -------------------------------
from Difficult_Rocket.exception.logger import * from Difficult_Rocket.exception.logger import (
LogFileLockTimeOutError
)
__all__ = [ __all__ = [
"LogFileLockTimeOutError" "LogFileLockTimeOutError"

View File

@ -4,7 +4,9 @@
# All rights reserved # All rights reserved
# ------------------------------- # -------------------------------
from Difficult_Rocket.exception.threading import * from Difficult_Rocket.exception.threading import (
LockTimeOutError
)
__all__ = [ __all__ = [
"LockTimeOutError" "LockTimeOutError"

View File

@ -11,7 +11,14 @@ github: @shenjackyuanjie
gitee: @shenjackyuanjie gitee: @shenjackyuanjie
""" """
from Difficult_Rocket.exception.unsupport import * from Difficult_Rocket.exception.unsupport import (
NoMoreJson5,
Nope418ImATeapot,
ThinkError,
BrainError,
BigBrainError,
GrammarError
)
__all__ = [ __all__ = [
'NoMoreJson5', 'NoMoreJson5',

View File

@ -1,3 +1,4 @@
# ------------------------------- # -------------------------------
# Difficult Rocket # Difficult Rocket
# Copyright © 2020-2023 by shenjackyuanjie 3695888@qq.com # Copyright © 2020-2023 by shenjackyuanjie 3695888@qq.com

View File

@ -4,7 +4,7 @@
# All rights reserved # All rights reserved
# ------------------------------- # -------------------------------
from Difficult_Rocket.exception import BaseError, BaseRuntimeError from Difficult_Rocket.exception import BaseError
__all__ = ['LanguageNotFound', __all__ = ['LanguageNotFound',
'TranslateError', 'TranslateError',

View File

@ -36,7 +36,7 @@ file configs
file_error = {FileNotFoundError: 'no {filetype} file was founded!:\n file name: {filename}\n file_type: {filetype}\n stack: {stack}', file_error = {FileNotFoundError: 'no {filetype} file was founded!:\n file name: {filename}\n file_type: {filetype}\n stack: {stack}',
KeyError: 'no stack in {filetype} file {filename} was found! \n file type: {} \n file name: {} \n stack: {stack}', KeyError: 'no stack in {filetype} file {filename} was found! \n file type: {} \n file name: {} \n stack: {stack}',
Exception: 'get some {error_type} error when read {filetype} file {filename}! \n file type: {} \n file name: {} \n stack: {stack}'} Exception: 'get some {error_type} when read {filetype} file {filename}! \n file type: {} \n file name: {} \n stack: {stack}'}
def load_file(file_name: str, def load_file(file_name: str,

View File

@ -14,7 +14,7 @@ gitee: @shenjackyuanjie
import inspect import inspect
from dataclasses import dataclass from dataclasses import dataclass
from typing import Union, Tuple, Any, Type, List, Dict, Hashable, Optional from typing import Union, Tuple, Any, List, Dict, Hashable, Optional
from Difficult_Rocket import DR_runtime, DR_option from Difficult_Rocket import DR_runtime, DR_option
from Difficult_Rocket.utils import tools from Difficult_Rocket.utils import tools

View File

@ -1,4 +1,4 @@
<PartTypes xmlns="http://jundroo.com/simplerockets/partlist.xsd"> <PartTypes xmlns="https://raw.githubusercontent.com/wengh/SRxsd/master/SR/partlist.xsd">
<PartType id="pod-1" name="Command Pod Mk1" description="This is your ship's brain. Be careful with it." sprite="Pod.png" type="pod" mass="1.0" width="4" height="3" hidden="true"> <PartType id="pod-1" name="Command Pod Mk1" description="This is your ship's brain. Be careful with it." sprite="Pod.png" type="pod" mass="1.0" width="4" height="3" hidden="true">
<Damage disconnect="1500" explode="1500" explosionPower="5" explosionSize="10" /> <Damage disconnect="1500" explode="1500" explosionPower="5" explosionSize="10" />
<Shape> <Shape>

View File

@ -22,6 +22,33 @@
- [![Readme-gitee](https://img.shields.io/badge/Readme-中文(点我!)-blue.svg?style=flat-square)](../../README.md) - [![Readme-gitee](https://img.shields.io/badge/Readme-中文(点我!)-blue.svg?style=flat-square)](../../README.md)
- Using [SemVer 2.0.0](https://semver.org/) to manage version - Using [SemVer 2.0.0](https://semver.org/) to manage version
## 20230302 DR `0.7.1.5` + Build `1.2.0.0`
### Build V 1.2.0.0
- 现在打包之前会移除无用文件
- Now useless files will be removed before packaging
### typing
- 移除了以下文件的 `from x import *`
- Remove `from x import *` in the following files
- `Difficult_Rocket.api.exception.command`
- `Difficult_Rocket.api.exception.logger`
- `Difficult_Rocket.api.exception.threading`
- `Difficult_Rocket.api.exception.unsupport`
- 移除了以下文件的多余引用
- Remove unnecessary imports in the following files
- `Difficult_Rocket.client.__init__`
- `Difficult_Rocket.exception.language`
- `Difficult_Rocket.utils.translate`
- `libs.utils.logger`
### 移除
- 移除了 `pyproject.toml``tool.ruff` 的不必要规则忽略
- Remove unnecessary rule ignore in `tool.ruff` of `pyproject.toml`
## 20230301 DR `0.7.1.4` + DR_rs `0.2.5.4/5` ## 20230301 DR `0.7.1.4` + DR_rs `0.2.5.4/5`
### 修复了上个版本没有步进版本号的毛病 ### 修复了上个版本没有步进版本号的毛病

View File

@ -21,7 +21,7 @@ import threading
from types import FrameType from types import FrameType
from dataclasses import dataclass from dataclasses import dataclass
from logging import NOTSET, DEBUG from logging import NOTSET, DEBUG
from typing import NamedTuple, Optional, Type, Union, Dict, Iterable, Any, List from typing import NamedTuple, Optional, Type, Union, Dict, Iterable, List
Version = '1.1.0' Version = '1.1.0'

View File

@ -48,11 +48,9 @@ src = [
exclude = [ exclude = [
'libs/pyglet', 'libs/pyglet',
'libs/pyperclicp', 'libs/pyperclip',
'libs/MCDR/serializer.py' 'libs/MCDR/serializer.py'
] ]
format = "grouped" format = "grouped"
[tool.ruff.per-file-ignores]
"Difficult_Rocket/api/exception/*.py" = [ "F405", "F403" ]