更新PyPI上的python包
Posted _less is more
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了更新PyPI上的python包相关的知识,希望对你有一定的参考价值。
1、修改代码,组织成如下结构
miniml是源码
README.rst
# MLplayground
A mini Machine Learning Algorithm library written as personal side project.
setup.py修改版本信息
from setuptools import setup
from setuptools import find_packages
with open("README.rst", "r") as f:
long_description = f.read()
setup(
name='MLplayground', # package name
version='1.0.1', # package version
description='A mini Machine Learning Algorithm Library',
long_description=long_description,
author='LujiaZhong',
url='https://lujiazho.github.io/',
install_requires=[
"numpy==1.21.1",
"matplotlib==3.5.1"
],
license='MIT License',
packages=find_packages(),
platforms=["Windows 10"],
classifiers=[
'Intended Audience :: Developers',
'Operating System :: OS Independent',
'Natural Language :: English',
'Programming Language :: Python :: 3.7',
'Topic :: Software Development :: Libraries'
],
)
2、打包成tar.gz
python setup.py sdist build
3、打包wheel格式
python setup.py bdist_wheel --universal
4、上传
twine upload dist/*
5、查看PyPI
https://pypi.org/project/MLplayground
6、更新本地包
pip install --upgrade MLplayground
以上是关于更新PyPI上的python包的主要内容,如果未能解决你的问题,请参考以下文章
是否可以只更新 pypi 索引中的详细信息,而不重新创建包?