Skip to content

Commit

Permalink
Merge pull request #20 from whg517/main
Browse files Browse the repository at this point in the history
bump: change version to 0.3.0 2d222e2
  • Loading branch information
whg517 authored Oct 20, 2021
2 parents 22adbe7 + 2d222e2 commit c2e63c5
Show file tree
Hide file tree
Showing 5 changed files with 215 additions and 68 deletions.
59 changes: 50 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@

- 跨平台支持使用
- 支持自定义配置选项

- 默认使用 SRC 项目结构
- 初始化 PEP517 规范打包配置
- 可选初始化通用项目骨架

**注意:** 项目支持 `Python >= 3.7` , 并且已经启用 `Python 3.10` 相关功能和稳定性测试。对于小于 `Python 3.9` 的 Python 版本使用时,
建议开启新特性支持。
建议开启新特性支持。如果在小于 `Python 3.7` 环境下使用,可能出现未知异常,强烈建议升级到 `Python 3.7+`

### 直接使用

```shell
```bash
# 升级最新 pip
pip install -U pip

Expand All @@ -39,6 +39,8 @@ cookiecutter /~https://github.com/pyloong/cookiecutter-pythonic-project

### 详细说明

#### 创建项目

```text
❯ cookiecutter /~https://github.com/pyloong/cookiecutter-pythonic-project
project_name [My Project]:
Expand All @@ -51,14 +53,15 @@ Select python_version:
1 - 3.7
2 - 3.8
3 - 3.9
Choose from 1, 2, 3 [1]:
use_src_layout [y]:
use_pipenv [y]:
4 - 3.10
Choose from 1, 2, 3, 4 [1]:
use_src_layout [y]:
use_pipenv [y]:
Select index_server:
1 - none
2 - aliyun
Choose from 1, 2 [1]:
use_docker [n]:
Choose from 1, 2 [1]:
use_docker [n]:
Select ci_tools:
1 - none
2 - Gitlab
Expand Down Expand Up @@ -106,7 +109,45 @@ init_skeleton [n]:

目录中包含了一个完整项目所需要的内容。有项目打包用到的描述文件,记录项目依赖文件和一个简单的测试用例。

项目使用 SRC 目录结构,项目模块在 SRC 下。请尽量测试你的代码,尽早在项目发布之前发现更多可能出现的异常。
项目使用 SRC 目录结构,项目模块在 SRC 下。强烈建议开发前测试你的代码,可以避免因项目生成项目模板导致后期开发异常。

#### 使用项目

进入项目目录:

```bash
## 进入到项目中
cd my_project

## 初始化项目环境
## 如果使用了 pipenv 则执行 pipenv install
pipenv install

## 如果不使用 pipenv 则执行 pip install -r requirements.txt
## 强烈建议使用 virtualenv 虚拟环境管理项目环境
## 安装 virtualenv 虚拟环境管理工具
# pip install virtualenv
## 使用 virtualenv 创建虚拟环境
# virtualenv .venv
## 进入虚拟环境中
# source .venv/bin/activate
## 安装项目必要依赖
# pip install -r requirements.txt
## 后续安装依赖直接使用 pip install aiohttp 即可
## 可以使用 pip freeze 生成当前依赖版本,并更新依赖
# pip freeze > requirements.txt

## 进入虚拟环境
pipenv shell

## 自动化测试项目
tox

## 安装项目开发时需要的依赖。安装完成后,会自动更新 Pipenv.lock 文件,锁定当前版本。
pipenv install aiohttp
```

更多使用细节请查看 [使用说明](./docs/usage.md)

## 开发与协作

Expand Down
3 changes: 3 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@

Not release

## V0.3.0

### 2021-10-20

- 特性 py39 py310 支持
- 特性 [PEP 585](https://www.python.org/dev/peps/pep-0585/) 支持。对于版本小于 3.9 的代码增加 `from __future__ import annotations` 导入
- 特性 增加 pytest-xdist ,并启用并行化测试。
- 文档 更新 README 和使用文档。

### 2021-08-31

Expand Down
53 changes: 49 additions & 4 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
![GitHub Workflow Status (branch)](https://img.shields.io/github/workflow/status/pyloong/cookiecutter-pythonic-project/main/main?style=flat-square)
![GitHub release (latest by date)](https://img.shields.io/github/v/release/pyloong/cookiecutter-pythonic-project?style=flat-square)
![License](https://img.shields.io/github/license/pyloong/cookiecutter-pythonic-project?style=flat-square)
![support python version](https://img.shields.io/badge/python-3.7%20%7C%203.8%20%7C%203.9%20%7C%203.10-blue)

一个使用 [Cookiecutter](/~https://github.com/cookiecutter/cookiecutter) 工具生成 Python 工程化项目的模板。

Expand All @@ -13,14 +14,17 @@

- 跨平台支持使用
- 支持自定义配置选项

- 默认使用 SRC 项目结构
- 初始化 PEP517 规范打包配置
- 可选初始化通用项目骨架

**注意:** 项目支持 `Python >= 3.7` , 并且已经启用 `Python 3.10` 相关功能和稳定性测试。对于小于 `Python 3.9` 的 Python 版本使用时,
建议开启新特性支持。如果在小于 `Python 3.7` 环境下使用,可能出现未知异常,强烈建议升级到 `Python 3.7+`

### 直接使用

```shell
```bash
# 升级最新 pip
pip install -U pip

Expand All @@ -35,6 +39,8 @@ cookiecutter /~https://github.com/pyloong/cookiecutter-pythonic-project

### 详细说明

#### 创建项目

```text
❯ cookiecutter /~https://github.com/pyloong/cookiecutter-pythonic-project
project_name [My Project]:
Expand All @@ -47,7 +53,8 @@ Select python_version:
1 - 3.7
2 - 3.8
3 - 3.9
Choose from 1, 2, 3 [1]:
4 - 3.10
Choose from 1, 2, 3, 4 [1]:
use_src_layout [y]:
use_pipenv [y]:
Select index_server:
Expand Down Expand Up @@ -102,7 +109,45 @@ init_skeleton [n]:

目录中包含了一个完整项目所需要的内容。有项目打包用到的描述文件,记录项目依赖文件和一个简单的测试用例。

项目使用 SRC 目录结构,项目模块在 SRC 下。请尽量测试你的代码,尽早在项目发布之前发现更多可能出现的异常。
项目使用 SRC 目录结构,项目模块在 SRC 下。强烈建议开发前测试你的代码,可以避免因项目生成项目模板导致后期开发异常。

#### 使用项目

进入项目目录:

```bash
# 进入到项目中
cd my_project

## 初始化项目环境
## 如果使用了 pipenv 则执行 pipenv install
pipenv install -d

## 如果不使用 pipenv 则执行 pip install -r requirements.txt
## 强烈建议使用 virtualenv 虚拟环境管理项目环境
## 安装 virtualenv 虚拟环境管理工具
# pip install virtualenv
## 使用 virtualenv 创建虚拟环境
# virtualenv .venv
## 进入虚拟环境中
# source .venv/bin/activate
## 安装项目必要依赖
# pip install -r requirements.txt
## 后续安装依赖直接使用 pip install aiohttp 即可
## 可以使用 pip freeze 生成当前依赖版本,并更新依赖
# pip freeze > requirements.txt

## 进入虚拟环境
pipenv shell

## 自动化测试项目
tox

## 安装项目开发时需要的依赖。安装完成后,会自动更新 Pipenv.lock 文件,锁定当前版本。
pipenv install aiohttp
```

更多使用细节请查看 [使用说明](https://pyloong.github.io/cookiecutter-pythonic-project/usage/)

## 开发与协作

Expand Down
Loading

0 comments on commit c2e63c5

Please sign in to comment.