1 Star 0 Fork 0

work-ji-python/yagmail

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
deploy.py 953 Bytes
一键复制 编辑 原始数据 按行查看 历史
pascal 提交于 2022-07-01 13:07 . update deploy script
""" File unrelated to the package, except for convenience in deploying """
import re
import sh
import os
commit_count = sh.git("rev-list", ["--all"]).count("\n")
with open("setup.py") as f:
setup = f.read()
setup = re.sub("MICRO_VERSION = '[0-9]+'", "MICRO_VERSION = '{}'".format(commit_count), setup)
major = re.search("MAJOR_VERSION = '([0-9]+)'", setup).groups()[0]
minor = re.search("MINOR_VERSION = '([0-9]+)'", setup).groups()[0]
micro = re.search("MICRO_VERSION = '([0-9]+)'", setup).groups()[0]
version = "{}.{}.{}".format(major, minor, micro)
with open("setup.py", "w") as f:
f.write(setup)
with open("yagmail/__init__.py") as f:
init = f.read()
with open("yagmail/__init__.py", "w") as f:
f.write(re.sub('__version__ = "[0-9.]+"', '__version__ = "{}"'.format(version), init))
py_version = "python"
os.system("rm -rf dist/")
os.system("{} setup.py sdist bdist_wheel".format(py_version))
os.system("twine upload dist/*")
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/work-ji-python/yagmail.git
[email protected]:work-ji-python/yagmail.git
work-ji-python
yagmail
yagmail
master

搜索帮助