Skip to main content

快速打包上传到项目到 pypi.org

Project description

## 说明

快速打包上传到项目到 pypi.org。
模块在WIN系统pyCharm中测试,不做其他环境使用。

## 设置 .pypi
在你的/~user/里面创建 .pypi,用记事本编辑以下内容并保存
```text
[pypi]
username = your pypi username
password = pypi-(Your pypi key)
```

## 步骤
1. 目录结构格式:
```text
/source_root
-- /myProject
-- /myProject/__init__.py
-- /myProject/constants.py
-- /myProject/core.py
-- pypi.py
-- README.MD
-- requirements.txt
```
2. 在constants.py中设定常量
```python
VERSION = '1.0.0'
NAME = 'myProject'
DESCRIPTION = 'Project Description'
LONG_DESCRIPTION = 'README.MD'
LONG_DESCRIPTION_TYPE = 'text/markdown'
URL = 'http://www.project.url/'
AUTHOR = 'Your Name'
AUTHOR_EMAIL = 'email@project.url'
AUTHOR_URL = 'http://www.project.url/'
```

3. 在__init__.py中加载
```python
from .core import MyModule
from .constants import *
```
4. 编写 pypi.py 内容
```python
from hebill_pypi import Pypi
import myProject

pypi = Pypi(myProject, r'D:\SDK\Environments\myProject\Scripts\python.exe')
pypi.pack()
```

5. 运行 pypi.py

Project details


Download files

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

Source Distribution

hebill_pypi-1.0.4.tar.gz (4.2 kB view hashes)

Uploaded Source

Built Distribution

hebill_pypi-1.0.4-py3-none-any.whl (5.6 kB view hashes)

Uploaded Python 3

Supported by

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