加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
setup.py 1.99 KB
一键复制 编辑 原始数据 按行查看 历史
猫神战之京 提交于 2020-08-04 11:08 . update the wechaty plugin repo
"""
setup
"""
import os
from typing import List
import semver
import setuptools
def versioning(version: str) -> str:
"""
version to specification
Author: Huan <zixia@zixia.net> (https://github.com/huan)
X.Y.Z -> X.Y.devZ
"""
sem_ver = semver.parse(version)
major = sem_ver['major']
minor = sem_ver['minor']
patch = str(sem_ver['patch'])
if minor % 2:
patch = 'dev' + patch
fin_ver = '%d.%d.%s' % (
major,
minor,
patch,
)
return fin_ver
def get_version() -> str:
"""
read version from VERSION file
"""
version = '0.0.0'
with open(
os.path.join(
os.path.dirname(__file__),
'VERSION'
)
) as version_fh:
# Get X.Y.Z
version = version_fh.read().strip()
# versioning from X.Y.Z to X.Y.devZ
version = versioning(version)
return version
def get_long_description() -> str:
"""get long_description"""
with open('README.md', 'r') as readme_fh:
return readme_fh.read()
def get_install_requires() -> List[str]:
"""get install_requires"""
with open('requirements.txt', 'r') as requirements_fh:
return requirements_fh.read().splitlines()
setuptools.setup(
name='wechaty-plugin-contrib',
version=get_version(),
author='wj-Mcat (吴京京)',
author_email='1435130236@qq.com',
description='Python Wechaty Plugin Contrib is a repo which store the '
'pupular wechaty contrib',
long_description=get_long_description(),
long_description_content_type='text/markdown',
license='Apache-2.0',
url='https://github.com/wechaty/python-wechaty-plugin-contrib',
packages=setuptools.find_packages('src'),
package_dir={'': 'src'},
install_requires=get_install_requires(),
classifiers=[
'Programming Language :: Python :: 3.7',
'License :: OSI Approved :: Apache Software License',
'Operating System :: OS Independent',
],
)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化