Skip to content

Commit

Permalink
Merge pull request #76 from Alinvor/kernel
Browse files Browse the repository at this point in the history
[DONE]合并分支
  • Loading branch information
DovSnier authored Jul 7, 2021
2 parents 2e4695e + 43602d3 commit e1edd65
Show file tree
Hide file tree
Showing 5 changed files with 141 additions and 37 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,9 @@ tox-quickstart

```bash
tox

# the recommend
tox --result-json ./Temp/tox/tox_result.json
```

### 4.5 twine version
Expand Down
2 changes: 2 additions & 0 deletions Temp/bash/bash_or_ps1.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
- [1.2.3. dist](#123-dist)
- [1.2.4. log](#124-log)

> 平常工作和生活当中, 需要跨系统, 跨语言, 跨环境, 好多都需要笔录的方式记忆下来(已超出个体记忆能力), 好记性不如烂笔头, 故整理后续参考;
## 一. 删除缓存

### 1.1. pyc and pycache
Expand Down
130 changes: 105 additions & 25 deletions Temp/bash/python_command.md
Original file line number Diff line number Diff line change
@@ -1,65 +1,145 @@
# 常用命令

- [一. pip](#一-pip)
- [1.1. pip --editable](#11-pip---editable)
- [1.2. pip list or freeze](#12-pip-list-or-freeze)
- [1.3. pip install](#13-pip-install)
- [1.3.1. pip install -r requirements.txt](#131-pip-install--r-requirementstxt)
- [1.3.2. pip install xxx](#132-pip-install-xxx)
- [二. flake8](#二-flake8)
- [一. 规则](#一-规则)
- [二. pip](#二-pip)
- [2.1. pip --editable](#21-pip---editable)
- [2.2. pip list or freeze](#22-pip-list-or-freeze)
- [2.3. pip install](#23-pip-install)
- [2.3.1. pip install -r requirements.txt](#231-pip-install--r-requirementstxt)
- [2.3.2. pip install xxx](#232-pip-install-xxx)
- [三. flake8](#三-flake8)
- [四. tox](#四-tox)
- [4.1. tox --version](#41-tox---version)
- [4.2. tox --help](#42-tox---help)
- [4.3. tox --help-ini](#43-tox---help-ini)
- [4.4. tox --showconfig](#44-tox---showconfig)
- [4.4. tox --result-json](#44-tox---result-json)

## 一. pip
> 平常工作和生活当中, 需要跨系统, 跨语言, 跨环境, 好多都需要笔录的方式记忆下来(已超出个体记忆能力), 好记性不如烂笔头, 故整理后续参考;
### 1.1. pip --editable
## 一. 规则

1. `./Temp/archives/record/*` 目录下的帮助文档统一格式命名为: `yyyy_MMdd_xyz.txt`;
2. `./Temp/*/*` 目录下的帮助文档统一格式命名为: `python[2|3]_xyz.txt`, 如若`定版``定稿`需求, 帮助文档统一格式命名为: `yyyy_python[2|3]_xyz.txt``yyyy_MMdd_python[2|3]_xyz.txt`;

此规则适用于如下`目录`:

- `./Temp/help/*`
- `./Temp/txt/*`

## 二. pip

### 2.1. pip --editable

```bash
pip2 install -e .
pip3 install -e .
```

### 1.2. pip list or freeze
### 2.2. pip list or freeze

```bash
# pip list
pip2 list > ./Temp/txt/pip2_list.txt
pip3 list > ./Temp/txt/pip3_list.txt
pip2 list > ./Temp/txt/2021_pip2_list.txt
pip3 list > ./Temp/txt/2021_pip3_list.txt
pip2 list > ./Temp/txt/python2_pip2_list.txt
pip3 list > ./Temp/txt/python3_pip3_list.txt
python2 -m pip2 list > ./Temp/txt/2021_python2_pip2_list.txt
python3 -m pip3 list > ./Temp/txt/2021_python3_pip3_list.txt
# pip freeze
pip2 freeze > ./Temp/txt/pip2_freeze.txt
pip3 freeze > ./Temp/txt/pip3_freeze.txt
pip2 freeze > ./Temp/txt/2021_pip2_freeze.txt
pip3 freeze > ./Temp/txt/2021_pip3_freeze.txt
pip2 freeze > ./Temp/txt/python2_pip2_freeze.txt
pip3 freeze > ./Temp/txt/python3_pip3_freeze.txt
python2 -m pip2 freeze > ./Temp/txt/2021_python2_pip2_freeze.txt
python3 -m pip3 freeze > ./Temp/txt/2021_python3_pip3_freeze.txt
```

### 1.3. pip install
### 2.3. pip install

#### 1.3.1. pip install -r requirements.txt
#### 2.3.1. pip install -r requirements.txt

```bash
# the base component requirements
pip2 install -r ./requirements.txt
pip3 install -r ./requirements.txt

python2 -m pip2 install -r ./requirements.txt
python3 -m pip3 install -r ./requirements.txt

# the base chain component requirements
pip2 install -r ./Temp/archives/material/requirements.txt
pip3 install -r ./Temp/archives/material/requirements.txt

python2 -m pip2 install -r ./Temp/archives/material/requirements.txt
python3 -m pip3 install -r ./Temp/archives/material/requirements.txt
```

#### 1.3.2. pip install xxx
#### 2.3.2. pip install xxx

```bash
pip2 install xxx
pip3 install xxx
```

## . flake8
## . flake8

```bash

flake8 ./src/ > ./Temp/flake8_recorder.txt
flake8 ./src/ > ./Temp/flake8/python2_flake8_recorder.txt
flake8 ./src/ > ./Temp/flake8/python3_flake8_recorder.txt

flake8 --exclude [*.pyc] ./src/
flake8 --exclude [*.pyc] ./src/ > ./Temp/flake8_recorder.txt
flake8 --help > ./Temp/flake8_help.txt
flake8 --exclude [*.pyc] ./src/ > ./Temp/flake8/python2_flake8_recorder.txt
flake8 --exclude [*.pyc] ./src/ > ./Temp/flake8/python3_flake8_recorder.txt

flake8 --help > ./Temp/help/python2_flake8_help.txt
flake8 --help > ./Temp/help/python3_flake8_help.txt
```

## 四. tox

```bash
tox --verbose

python2 -m tox --verbose > ./Temp/help/python2_tox_verbose.txt
python3 -m tox --verbose > ./Temp/help/python3_tox_verbose.txt
```

### 4.1. tox --version

```bash
tox --version
```

### 4.2. tox --help

```bash
tox --help

python2 -m tox --help > ./Temp/help/python2_tox_help.txt
python3 -m tox --help > ./Temp/help/python3_tox_help.txt
```

### 4.3. tox --help-ini

```bash
tox --help-ini

python2 -m tox --help-ini > ./Temp/help/python2_tox_help_ini.txt
python3 -m tox --help-ini > ./Temp/help/python3_tox_help_ini.txt
```

### 4.4. tox --showconfig

```bash
tox --showconfig

python2 -m tox --showconfig > ./Temp/help/python2_tox_show_config.txt
python3 -m tox --showconfig > ./Temp/help/python3_tox_show_config.txt
```

### 4.4. tox --result-json

```bash
tox --result-json

python2 -m tox --result-json > ./Temp/help/python2_tox_result_json.txt
python3 -m tox --result-json > ./Temp/help/python3_tox_result_json.txt
```
38 changes: 26 additions & 12 deletions doc/project_help/the_global_rules.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,39 @@
# 规则

- [一. 说明](#一-说明)
- [二. 源码](#二-源码)
- [三. 调试](#三-调试)
- [3.1. System 环境变量](#31-system-环境变量)
- [3.2. VSCode PYTHONPATH](#32-vscode-pythonpath)
- [3.3. inline import](#33-inline-import)
- [四. 测试](#四-测试)
- [二. 文档](#二-文档)
- [2.1. 规则文档](#21-规则文档)
- [2.2. 命令文档](#22-命令文档)
- [三. 源码](#三-源码)
- [四. 调试](#四-调试)
- [4.1. System 环境变量](#41-system-环境变量)
- [4.2. VSCode PYTHONPATH](#42-vscode-pythonpath)
- [4.3. inline import](#43-inline-import)
- [五. 测试](#五-测试)

## 一. 说明

本文档适用于全局性规则要义;

## 二. 源码
## 二. 文档

### 2.1. 规则文档

pass

### 2.2. 命令文档

1. [【Command】bash or ps1](../../Temp/bash/bash_or_ps1.md)
2. [【Command】python script](../../Temp/bash/python_command.md)

## 三. 源码

1. 统一采用`com.dvsnier` 命名空间;
2. 包结构,统一定义: `com.dvsnier.xxx`, 且`xxx` 包名称一定要和目录层次一一对应, 可以避免潜在无关紧要问题;

## . 调试
## . 调试

### 3.1. System 环境变量
### 4.1. System 环境变量

目前我们规定如下可选全局变量:

Expand All @@ -42,7 +56,7 @@ export BASE_PROJECT_PREFIX="/Users/.../Python-DeMo"
BASE_PROJECT_PREFIX="D:\\...\\Python-DeMo"
```

### 3.2. VSCode PYTHONPATH
### 4.2. VSCode PYTHONPATH

VSCode 环境变量指定的默认配置选项为:

Expand Down Expand Up @@ -83,7 +97,7 @@ PYTHONPATH=/Users/.../Python-DeMo:/Users/.../Python-DeMo/tests:${PYTHONPATH}
PYTHONPATH=D:\\WorkSpace\\...\\Python-DeMo;D:\\WorkSpace\\...\\Python-DeMo\\tests;%PYTHONPATH%
```

### 3.3. inline import
### 4.3. inline import

**内联导入**:

Expand All @@ -99,6 +113,6 @@ pip2 install -e .
pip3 install -e .
```

## . 测试
## . 测试

1. 统一采用和源码空间统一的目录结构和命名空间形式;
5 changes: 5 additions & 0 deletions template/test_template.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
# -*- coding:utf-8 -*-

# import logging
import unittest

# from com.dvsnier.config.journal.common_config import config


class Test_XXX(unittest.TestCase):
''' the test xxx '''
@classmethod
def setUpClass(cls):
print("...the set up...")
print('')
# kwargs = {'output_dir_name': 'log', 'file_name': 'config', 'level': logging.DEBUG}
# cls._logging = config(kwargs)

def setUp(self):
super(Test_XXX, self).setUp()
Expand Down

0 comments on commit e1edd65

Please sign in to comment.