Skip to content
This repository has been archived by the owner on Oct 11, 2023. It is now read-only.

Commit

Permalink
Merge pull request #90 from Ljzd-PRO/v2.0.0-temp
Browse files Browse the repository at this point in the history
更新至 v2.0.0
  • Loading branch information
ERZATZ Type AK9 authored May 4, 2023
2 parents 4ea0631 + 4a20a64 commit 8ef7aeb
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-v1.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and pack (v1)
name: Build (v1)

on:
workflow_dispatch:
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/build-v2-i386_alpine.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Build (i386 Alpine, v2)

on:
workflow_dispatch:

permissions:
contents: read

env:
# Initialize vars context by reading it from env context
_: ${{ vars._ }}
spec-file-path: Mys_Goods_Tool.spec
container-id:

jobs:
build:

runs-on: ubuntu-latest
container: balenalib/qemux86-alpine-python
steps:
- name: Install dependencies
run : |
qemu-i386 curl -sSL https://install.python-poetry.org | python3 -
qemu-i386 poetry install --with pyinstaller
- name: Build
run: |
poetry run pyinstaller ${{ env.spec-file-path }}
- name: Upload build
uses: actions/upload-artifact@v3
with:
name: Mys_Goods_Tool_v2-Alpine-i386
path: |
dist/${{ env.executable-file-name }}*
README.md
6 changes: 3 additions & 3 deletions .github/workflows/build-v2.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
name: Build and pack (v2)
name: Build (v2)

on:
workflow_dispatch:
push:
path:
paths:
- 'mys_goods_tool/**'
- '.github/workflows/build-v2.yml'
- '__init__.py'
- 'Mys_Goods_Tool.spec'
- 'pyproject.toml'

pull_request:
path:
paths:
- 'mys_goods_tool/**'
- '.github/workflows/build-v2.yml'
- '__init__.py'
Expand Down
13 changes: 6 additions & 7 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@ name: Multiple Python Versions Test
on:
workflow_dispatch:
push:
path:
path:
- 'mys_goods_tool/**'
- '.github/workflows/python-package.yml'
- '__init__.py'
- 'pyproject.toml'
paths:
- 'mys_goods_tool/**'
- '.github/workflows/python-package.yml'
- '__init__.py'
- 'pyproject.toml'

pull_request:
path:
paths:
- 'mys_goods_tool/**'
- '.github/workflows/python-package.yml'
- '__init__.py'
Expand Down
12 changes: 9 additions & 3 deletions mys_goods_tool/user_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
CONFIG_PATH = ROOT_PATH / "user_data.json"
"""用户数据文件默认路径"""

VERSION = "2.0.0-beta.1"
VERSION = "2.0.0"
"""程序当前版本"""

if TYPE_CHECKING:
Expand Down Expand Up @@ -306,7 +306,13 @@ class Preference(BaseSettings):
@validator("log_path")
def _(cls, v: Optional[Path]):
absolute_path = v.absolute()
if not os.access(absolute_path, os.W_OK):
if not os.path.exists(absolute_path) or not os.path.isfile(absolute_path):
absolute_parent = absolute_path.parent
try:
os.makedirs(absolute_parent, exist_ok=True)
except PermissionError:
logger.warning(f"程序没有创建日志目录 {absolute_parent} 的权限")
elif not os.access(absolute_path, os.W_OK):
logger.warning(f"程序没有写入日志文件 {absolute_path} 的权限")
return v

Expand Down Expand Up @@ -473,7 +479,7 @@ def load_config():
"""
加载用户数据文件
"""
if os.path.isfile(CONFIG_PATH):
if os.path.exists(CONFIG_PATH) and os.path.isfile(CONFIG_PATH):
try:
return UserData.parse_file(CONFIG_PATH)
except (ValidationError, JSONDecodeError):
Expand Down
5 changes: 2 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "mys-goods-tool"
version = "2.0.0-beta.1"
version = "2.0.0"
description = "米游社商品兑换工具|短信验证登录|终端TUI界面"
authors = ["Ljzd-PRO <[email protected]>"]
readme = "README.md"
Expand All @@ -26,12 +26,11 @@ tenacity = "^8.2.2"
requests = "^2.29.0"
ping3 = "^4.0.4"
ntplib = "^0.4.0"
pyperclip = "^1.8.2"
pydantic = "^1.10.6"
loguru = "^0.7.0"
httpx = "^0.24.0"
rich = "^13.3.5"
textual = "^0.22.3"
textual = "^0.23.0"
socksio = "^1.0.0"
apscheduler = "^3.10.1"

Expand Down
3 changes: 1 addition & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@ tenacity~=8.2.2
requests~=2.29.0
ping3~=4.0.4
ntplib~=0.4.0
pyperclip~=1.8.2
pydantic~=1.10.6
loguru~=0.7.0
httpx~=0.24.0
rich~=13.3.5
textual~=0.22.3
textual~=0.23.0
socksio~=1.0.0
apscheduler~=3.10.1

Expand Down

0 comments on commit 8ef7aeb

Please sign in to comment.