Skip to main content

No project description provided

Project description

:rocket: This is Tidy Project

1. setuptools.setup参数含义

  • name - 项目的名称
  • version - 项目的版本。需要注意的是,PyPI上只允许一个版本存在,如果后续代码有了任何更改,再次上传需要增加版本号
  • author和author_email - 项目作者的名字和邮件
  • description - 项目的简短描述
  • long_description - 项目的详细描述,会显示在PyPI的项目描述页面。上面的例子里直接用了README.md中的内容做详细描述
  • long_description_content_type - 用于指定long_description的markup类型,上面的例子是markdown
  • url - 项目主页的URL,一般给出代码仓库的链接
  • packages - 指定最终发布的包中要包含的packages。上面的例子中find_packages() 会自动发现项目根目录下所有的packages,当然也可以手动指定package的名字
  • install_requires - 项目依赖哪些库,这些库会在pip install的时候自动安装
  • entry_points - 上面的例子中entry_points用来自动创建脚本,上面的例子在pip - install安装成功后会创建douyin_image这个命令,直接可以在命令行运行,很方便
  • classifiers - 其他信息,一般包括项目支持的Python版本,License,支持的操作系统。上面的例子中,我们指定项目只能在Python 3上运行,使用MIT License,不依赖操作系统。关于classifiers的完整列表,可参考 https://pypi.org/classifiers/。

2. 打包项目

pip install setuptools pip install wheel python setup.py sdist bdist_wheel

上面的命令会在dist/目录下生成一个tar.gz的源码包和一个.whl的Wheel包。

dist/
  douyin_image-0.1-py3-none-any.whl
  douyin_image-0.1.tar.gz

打包完之后,我们可以从本地安装库,来验证我们的项目能否被成功安装,如下

pip3 install dist/douyin_image-0.1-py3-none-any.whl

3. 创建Pypi账户

  • 上传项目到PyPI
  • 我们使用twine上传项目,先安装twine

pip3 install twine

安装完之后,运行下面的命令将库上传

twine upload dist/*

上传完成后,我们的项目就成功地发布到PyPI了

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tidy_project-0.1.tar.gz (11.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tidy_project-0.1-py3-none-any.whl (18.7 kB view details)

Uploaded Python 3

File details

Details for the file tidy_project-0.1.tar.gz.

File metadata

  • Download URL: tidy_project-0.1.tar.gz
  • Upload date:
  • Size: 11.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.7.5

File hashes

Hashes for tidy_project-0.1.tar.gz
Algorithm Hash digest
SHA256 b30ec11d4ec82bc35f4a6519d43facb313584b23a124e4b116e2a998813c14ce
MD5 bba7fdd3a0d5bdde5c035e3cbd660b36
BLAKE2b-256 0265c01365aca19eb92cd2defc902155c7832a8f0daea3289d01865ef7359288

See more details on using hashes here.

File details

Details for the file tidy_project-0.1-py3-none-any.whl.

File metadata

  • Download URL: tidy_project-0.1-py3-none-any.whl
  • Upload date:
  • Size: 18.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.7.5

File hashes

Hashes for tidy_project-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f50039fb0e055f1b71e3c18548b4fc81f2c8ea347a3aa60f02052e253c2ea950
MD5 1304283c616f59384ad3b863fe90894e
BLAKE2b-256 71d2713c16de416c246975e94c510513337117d54e4aa1d16c98f18caa617d2e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page