How to release python whl to pypi

Edit setup.pu setup.cfg version id

# Copyright 2018 Deep Learning Service of Huawei Cloud. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import io
import re

import setuptools
from setuptools import setup

PACKAGE_NAME = 'huaweicloud-sdk-python-modelarts-dataset'

with open('README.md') as f:
    long_description = f.read()

with io.open('modelarts/__init__.py', 'rt', encoding='utf8') as f:
    version = re.search(r'__version__ = \'(.*?)\'', f.read()).group(1)
    if version is None:
        raise ImportError('Could not find __version__ in modelarts/__init__.py')

REQUIRED_PACKAGES = [
    'esdk-obs-python>=3.0.5'
]

EXTRA_REQUIRE = {
    # `docs` versions are to facilitate local generation of documentation.
    # Sphinx 1.3 would be desirable, but is incompatible with current ATG setup.
    # Thus the pinning of both sphinx and alabaster versions.
    'docs': [
        'sphinx==1.2.2',
        'alabaster==0.7.11'
    ],
    'opencv': ['opencv-python>=3.2.0.6'],
    'tf': ['tensorflow>=1.4.0'],
    'tf_gpu': ['tensorflow-gpu>=1.4.0'],
    'test': [
        'Pillow>=3.0',
        'codecov>=2.0.15',
        'mock>=2.0.0',
        'opencv-python>=3.2.0.6',
        'flake8',
        'pylint>=1.9',
        'pytest>=3.0.0',
        'pytest-cov>=2.5.1',
        'pytest-forked>=0.2',
        'pytest-logger>=0.4.0',
        'pytest-timeout>=1.3.3',
        'pytest-xdist',
        's3fs>=0.0.1',
    ],
    'torch': ['torchvision>=0.2.1'],
}

packages = setuptools.find_packages()

setup(
    name=PACKAGE_NAME,
    version=version,
    install_requires=REQUIRED_PACKAGES,
    packages=packages,
    description='huaweicloud-sdk-python-modelarts-dataset.',
    long_description=long_description,
    long_description_content_type="text/markdown",
    license='Apache License, Version 2.0',
    extras_require=EXTRA_REQUIRE,
    entry_points={
    },
    url='https://github.com/huawei-clouds/modelarts-dataset-sdk',
    author='Huawei Technologies, Inc.',
    classifiers=[
        'Environment :: Console',
        'Environment :: Web Environment',
        'Intended Audience :: Developers',
        'Intended Audience :: Science/Research',
        'License :: OSI Approved :: Apache Software License',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3.4',
        'Programming Language :: Python :: 3.5',
        'Programming Language :: Python :: 3.6',
        'Programming Language :: Python :: 3.7',
    ],
)

install

python3.7 setup.py install
python3.7 setup.py bdist_wheel --plat-name any
twine upload dist/*

Release to pypi

localhost:huaweicloud-sdk-python-modelarts-dataset xubo$ twine upload dist/*
Enter your username: xubo245
Enter your password: 
Uploading distributions to https://upload.pypi.org/legacy/
Uploading huaweicloud_sdk_python_modelarts_dataset-0.1.1-py2.py3-none-any.whl
100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 44.2k/44.2k [00:05<00:00, 8.78kB/s]
Uploading huaweicloud_sdk_python_modelarts_dataset-0.1.1-py2.py3-none-win_amd64.whl
100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 44.3k/44.3k [00:03<00:00, 11.7kB/s]
Uploading huaweicloud_sdk_python_modelarts_dataset-0.1.1-py2.7.egg
100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 73.0k/73.0k [00:02<00:00, 32.7kB/s]
Uploading huaweicloud_sdk_python_modelarts_dataset-0.1.1-py3.6.egg
100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 72.5k/72.5k [00:02<00:00, 31.4kB/s]
Uploading huaweicloud_sdk_python_modelarts_dataset-0.1.1-py3.7.egg
100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 72.7k/72.7k [00:03<00:00, 20.8kB/s]
localhost:huaweicloud-sdk-python-modelarts-dataset xubo$ 

validate

https://pypi.org/project/huaweicloud-sdk-python-modelarts-dataset/#history
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值