Skip to content

Commit

Permalink
Repair the first legacy*.json
Browse files Browse the repository at this point in the history
+ Repair the creation of the brand-new legacy*.json
  • Loading branch information
huangwb8 committed Nov 15, 2023
1 parent 3dd67f4 commit 3eba145
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ You can also directly download `m2w` from this repotory. The usage is exactly t
You can specify version or resource when installing `m2w`:

```bash
pip install -i https://pypi.org/simple m2w==2.5.11
pip install -i https://pypi.org/simple m2w==2.5.12
```

Generally, the latest version of `m2w` is recommended.
Expand Down
2 changes: 1 addition & 1 deletion README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ pip install m2w
在安装 `m2w` 时,您可以指定版本或资源:

```bash
pip install -i https://pypi.org/simple m2w==2.5.11
pip install -i https://pypi.org/simple m2w==2.5.12
```

通常建议使用最新版本的 `m2w`
Expand Down
6 changes: 5 additions & 1 deletion m2w/up.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ async def up(
"""

# Backup old legacy*.json
shutil.copyfile(path_legacy_json, path_legacy_json + "_temporary_old")
is_first_legacy_exist = os.path.exists(path_legacy_json)
if is_first_legacy_exist:
shutil.copyfile(path_legacy_json, path_legacy_json + "_temporary_old")

# Mode
if rest_api:
Expand All @@ -56,6 +58,8 @@ async def up(

# Backup the latest legacy*.json
shutil.copyfile(path_legacy_json, path_legacy_json + "_temporary_latest")
if not is_first_legacy_exist:
shutil.copyfile(path_legacy_json, path_legacy_json + "_temporary_old")

# Upload & Update
if len(md_upload) > 0 or len(md_update) > 0:
Expand Down
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
+ 输入"pip install twine"来安装twine工具。 必要时可更新工具包:pip install --upgrade twine setuptools wheel
+ 使用"python setup.py sdist"命令来生成项目的源代码包。 如果要测试该包,可运行类似命令: python setup.py sdist; pip install .\dist\m2w-2.5.11.tar.gz
+ 使用"python setup.py sdist"命令来生成项目的源代码包。 如果要测试该包,可运行类似命令: python setup.py sdist; pip install .\dist\m2w-2.5.12.tar.gz
+ 使用"python setup.py bdist_wheel"命令来生成项目的长描述。
+ 先完成Github仓库的更新和加tag。最后再上传至PyPi。输入"twine upload dist/*2.5.11* --verbose"来上传项目的源代码包。
+ 先完成Github仓库的更新和加tag。最后再上传至PyPi。输入"twine upload dist/*2.5.12* --verbose"来上传项目的源代码包。
+ 在上传过程中,你需要输入你在PyPi上注册的用户名和密码。
Expand All @@ -45,7 +45,7 @@
"""

VERSION = "2.5.11"
VERSION = "2.5.12"

with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
Expand Down

0 comments on commit 3eba145

Please sign in to comment.