首页 > 编程语言 >python setup.py sdist bdist_wheel

python setup.py sdist bdist_wheel

时间:2023-07-11 13:33:06浏览次数:42  
标签:wheel __ py description python setup bdist os self

# python setup.py sdist bdist_wheel
# twine upload dist/*
import io
import os
import sys
from shutil import rmtree
from setuptools import find_packages, setup, Command

NAME = 'xgo-pythonlib'
DESCRIPTION = 'PythonLib for XGO2-DOG'
URL = 'https://github.com/Xgorobot/XGO-PythonLib'
EMAIL = '[email protected]'
AUTHOR = 'luwudynamics'
REQUIRES_PYTHON = '>=3.6.0'
VERSION = '0.2.3'

# What packages are required for this module to be executed?
REQUIRED = [
# 'requests', 'maya', 'records',
]

# What packages are optional?
EXTRAS = {
# 'fancy feature': ['django'],
}

# The rest you shouldn't have to touch too much :)
# ------------------------------------------------
# Except, perhaps the License and Trove Classifiers!
# If you do change the License, remember to change the Trove Classifier for that!

here = os.path.abspath(os.path.dirname(__file__))

# Import the README and use it as the long-description.
# Note: this will only work if 'README.md' is present in your MANIFEST.in file!
try:
with io.open(os.path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = '\n' + f.read()
except FileNotFoundError:
long_description = DESCRIPTION

# Load the package's __version__.py module as a dictionary.
about = {}
if not VERSION:
project_slug = NAME.lower().replace("-", "_").replace(" ", "_")
with open(os.path.join(here, project_slug, '__version__.py')) as f:
exec(f.read(), about)
else:
about['__version__'] = VERSION


class UploadCommand(Command):
"""Support setup.py upload."""

description = 'Build and publish the package.'
user_options = []

@staticmethod
def status(s):
"""Prints things in bold."""
print('\033[1m{0}\033[0m'.format(s))

def initialize_options(self):
pass

def finalize_options(self):
pass

def run(self):
try:
self.status('Removing previous builds…')
rmtree(os.path.join(here, 'dist'))
except OSError:
pass

self.status('Building Source and Wheel (universal) distribution…')
os.system('{0} setup.py sdist bdist_wheel --universal'.format(sys.executable))

self.status('Uploading the package to PyPI via Twine…')
os.system('twine upload dist/*')

self.status('Pushing git tags…')
os.system('git tag v{0}'.format(about['__version__']))
os.system('git push --tags')

sys.exit()


# Where the magic happens:
setup(
name=NAME,
version=about['__version__'],
description=DESCRIPTION,
long_description=long_description,
long_description_content_type='text/markdown',
author=AUTHOR,
author_email=EMAIL,
python_requires=REQUIRES_PYTHON,
url=URL,
packages=find_packages(),
# If your package is a single module, use this instead of 'packages':
# py_modules=['mypackage'],

# entry_points={
# 'console_scripts': ['mycli=mymodule:cli'],
# },
install_requires=REQUIRED,
extras_require=EXTRAS,
include_package_data=True,
license='MIT',
classifiers=[
# Trove classifiers
# Full list: https://pypi.python.org/pypi?%3Aaction=list_classifiers
'License :: OSI Approved :: MIT License',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy'
],
# $ setup.py publish support.
cmdclass={
'upload': UploadCommand,
},
)

标签:wheel,__,py,description,python,setup,bdist,os,self
From: https://www.cnblogs.com/flyingsir/p/17544406.html

相关文章

  • Python核对批量下载多个文件时的下载情况
      本文介绍批量下载遥感影像时,利用Python实现已下载影像文件的核对,并自动生成未下载影像的下载链接列表的方法。  批量下载大量遥感影像数据对于GIS学生与从业人员可谓十分常见。然而,对于动辄成千上万景的遥感影像文件,下载过程中可能会出现各类失败问题,且或许在下载软件或工具......
  • python pandas链接mysql数据库报错
    1. ModuleNotFoundError:Nomodulenamed'mysql'需要安装链接驱动,比如 pipinstallmysqlclient#或pipinstallpymysql#或pipinstallmysql-connector-python2.pandas的 pd.read_sql(ad_first_query,conn)报错: executereturnself.connectable.executio......
  • Windows版python安装教程
    Windows版python安装教程第一步:下载Python最新版本Python官网:http://www.python.org进入官网之后,根据电脑系统选择合适的版本下载安装。截止到目前为止,python-3.10.2是Python最新版本(此版本Windows7系统及更早系统无法使用,Windows7系统的小伙伴可以选择下载python-3.8.10)。第......
  • Python - 打断点以及如何查看
    1、鼠标左键单击代码跟行号中间的地方会出现一个红点,这个就是断点。2、点击Debug按钮,进入调试模式。 3、当代码运行到断点之前,所有关于变量的代码,都会出现运行的结果。 4、点击StepIntoMyCode按钮,代码一步一步查看断点之后的内容。 5、最后:如果不想要继续查看断点......
  • 解决Python 画图 默认字体大小的具体操作步骤
    Python画图默认字体大小概述在Python中画图时,默认使用的字体大小可能不符合我们的需求,因此需要对字体大小进行调整。本文将介绍如何使用Python来实现画图时的默认字体大小,并提供详细的代码示例和解释。步骤下面是实现“Python画图默认字体大小”的步骤:步骤操作......
  • 如何实现Python 函数的参数的具体操作步骤
    Python函数的参数在Python中,函数是一种可重复使用的代码块,用于执行特定的任务。函数可以接受参数,参数是函数中用于接受输入值的变量。Python中的函数参数非常灵活,可以有多种形式。本文将介绍Python函数参数的不同类型以及它们的使用方法。位置参数位置参数是指根据参数的......
  • 解决Python 轨迹纠偏算法的具体操作步骤
    Python轨迹纠偏算法实现指南简介在实际应用中,我们经常需要处理采集到的轨迹数据,例如GPS定位数据。由于各种原因,采集到的轨迹数据可能存在噪声、漂移或其他异常情况,因此需要进行轨迹纠偏算法的处理。本文将介绍如何使用Python实现轨迹纠偏算法。整体流程下面是实现Python轨迹纠......
  • 如何实现Python 定时结束程序的具体操作步骤
    Python定时结束程序介绍在编写程序时,有时我们希望程序在经过一段时间后自动结束,而不是一直运行下去。Python提供了一种简单的方法来实现定时结束程序的功能。本文将介绍如何使用Python中的time模块和signal模块来实现定时结束程序的功能,并提供相应的代码示例。使用time......
  • 如何实现Python 的 tsfresh的具体操作步骤
    使用tsfresh库进行Python特征提取介绍在数据处理和机器学习中,特征提取是一个重要的步骤。它涉及从原始数据中提取有用信息并转换为可用于训练模型的特征。Python的tsfresh库是一个功能强大的工具,用于自动化时间序列数据的特征提取。本文将向你介绍如何使用tsfresh库来实现Python......
  • IDApython练习1-脚本去花
    IDApython练习1-脚本去花这里主要是练习IDApython脚本去花1这里jz跳转条件是zf=1,jnz跳转条件是zf=0,但是zf就2种可能,所以无论如何都会跳转到loc_411DDF+3的位置,等于jmploc_411DDF+3.这里可以等长度的nop,我们可以手动nop,这里是脚本练习,需要我们自己写importidcdefcle......