Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
xuanzhi33 committed Jun 3, 2022
1 parent 13b2878 commit 431e865
Show file tree
Hide file tree
Showing 2 changed files with 128 additions and 18 deletions.
80 changes: 62 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,68 @@
# SPKG by xuanzhi33

## name: SPAG = Simple Packager
# SPKG

Language: [English](https://github.com/xuanzhi33/spkg/blob/master/README.md) |
[中文文档](https://github.com/xuanzhi33/spkg/blob/master/README_cn.md)


## Introduction

SPKG (Simple Packager) - A command line tools for setuping and uploading python packages.

SPKG (Simple Packager) - 一个简单的命令行工具,用于快速的打包和上传python包到pypi。

## Install

```
pip3 install spkg
```

## Usage

spkg [COMMAND]
Make sure you are in **the directory of your package** and run the following command:

```
spkg [command]
```

### Commands

- `help`, `-h`: show this help message and exit (default)
- `upload`, `-u`: upload the package to pypi (equals to 'twine upload dist/*')
- `setup`, `-s`: setup the package (equals to 'python3 setup.py sdist')
- `clear`, `-c`: delete all .tar.gz files in 'dist' folder
- `pkg`, `-p`: clear, setup, and upload the package
- `info`, `-in`: show package info
- `setver`, `-sv`: set package version
- `install`, `-i`: install a package from pypi using 'pip3 install --upgrade [package]'

The commands below can change package version quickly and then run 'pkg' command:
(They will modify the version in 'setup.py')
- `patch`, `-pa`: Release patch update (e.g. 1.0.1 -> 1.0.2)
- `minor`, `-mi` : Release minor update (e.g. 1.0.3 -> 1.1.0)
- `major`, `-ma`: Release major update (e.g. 1.1.1 -> 2.0.0)

### Examples

- To upload all files in 'dist' folder to pypi:

```
spkg upload
```

- To setup and upload the package:

```
spkg pkg
```

- If your package's version is 1.4.2, you can run the following command to change the `version` in 'setup.py' to 1.4.3 and upload the package to pypi:

Options:
```
spkg patch
```

- help, -h: show this help message and exit (default)
- upload, -u: upload the package to pypi (equals to 'twine upload dist/*')
- setup, -s: setup the package (equals to 'python3 setup.py sdist')
- clear, -c: delete all .tar.gz files in 'dist' folder
- pkg, -p: clear, setup, and upload the package
- info, -i: show package info
- pkgver, -pv: show package version
- setver, -sv: set package version
- To install or update a package from pypi:

- The commands below can change package version quickly and then run 'pkg' command:
- (They will modify the version in 'setup.py')
- patch, -pa: Release patch update (e.g. 1.0.1 -> 1.0.2)
- minor, -mi : Release minor update (e.g. 1.0.3 -> 1.1.0)
- major, -ma: Release major update (e.g. 1.1.1 -> 2.0.0)
```
spkg install [package]
```
66 changes: 66 additions & 0 deletions README_cn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# SPKG

Language: [English](https://github.com/xuanzhi33/spkg/blob/master/README.md) |
[中文文档](https://github.com/xuanzhi33/spkg/blob/master/README_cn.md)


## 介绍

SPKG (Simple Packager) - A command line tools for setuping and uploading python packages.

SPKG (Simple Packager) - 一个简单的命令行工具,用于快速的打包和上传python包到pypi。

## 安装

```
pip3 install spkg
```

## 使用方法

cd到包的目录,执行以下命令:

```
spkg [命令]
```

### 命令说明

- `help`, `-h`: 显示帮助信息并退出
- `upload`, `-u`: 上传这个包到pypi (相当于 'twine upload dist/*')
- `setup`, `-s`: 打包 (相当于 'python3 setup.py sdist')

- `clear`, `-c`: 删除folder下所有的.tar.gz文件,用于清理dist文件夹
- `pkg`, `-p`: 相当于运行`clear``setup``upload`
- `info`, `-in`: 显示包信息
- `setver`, `-sv`: 设置包版本
- `install`, `-i`: 从pypi安装包,相当于 `pip3 install --upgrade [package]`

以下的命令可以快速的修改包版本并执行`pkg`命令:
(这会编辑setup.py文件中的`version`值)
- `patch`, `-pa`: 用于发布补丁更新 (e.g. 1.0.1 -> 1.0.2)
- `minor`, `-mi` : 用于发布小型更新 (e.g. 1.0.3 -> 1.1.0)
- `major`, `-ma`: 用于发布大型更新 (e.g. 1.1.1 -> 2.0.0)

### 举例

- 上传dist文件夹里的所有文件到pypi:


```
spkg upload
```


- 如果你的包版本为1.4.2,你可以运行下述命令将其setup.py中的版本号修改为1.4.3并打包上传至pypi。


```
spkg patch
```

- 安装一个pypi上的包

```
spkg install [package]
```

0 comments on commit 431e865

Please sign in to comment.