From b17999ca697d5ecaf5e5bbbcc0468af806ccde7d Mon Sep 17 00:00:00 2001 From: zhenwei-li Date: Fri, 2 Jul 2021 16:58:00 +0800 Subject: [PATCH 1/8] the bash command --- Temp/bash/cmd.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 Temp/bash/cmd.md diff --git a/Temp/bash/cmd.md b/Temp/bash/cmd.md new file mode 100644 index 0000000..76fbfb2 --- /dev/null +++ b/Temp/bash/cmd.md @@ -0,0 +1,26 @@ +# 命令 + +- [一. 删除缓存](#一-删除缓存) + - [1.1. pyc and pycache](#11-pyc-and-pycache) + - [1.2. 扩展目录](#12-扩展目录) + +## 一. 删除缓存 + +### 1.1. pyc and pycache + +```bash +# the delete files +find . -name '*.pyc' -delete +# the delete directory +find . -type d -name __pycache__ -exec rm -r {} + +``` + +### 1.2. 扩展目录 + +推荐删除扩展目录: + +```bash +find . -type d -name build -exec rm -r {} + +find . -type d -name dist -exec rm -r {} + +find . -type d -name .tox -exec rm -r {} + +``` From 3efff3e8212aa9694bfad43fa02bbc8a6d6aeaa0 Mon Sep 17 00:00:00 2001 From: zhenwei-li Date: Fri, 2 Jul 2021 17:05:49 +0800 Subject: [PATCH 2/8] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E7=BC=93=E5=AD=98=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .rmcache.bash | 4 ++++ 1 file changed, 4 insertions(+) create mode 100755 .rmcache.bash diff --git a/.rmcache.bash b/.rmcache.bash new file mode 100755 index 0000000..ffa2c44 --- /dev/null +++ b/.rmcache.bash @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +find . -type d -name __pycache__ -exec rm -r {} + +find . -type f -name '*.pyc' -delete From a92fd732017cf1ce37a2c27792b03a54a9dd3ed3 Mon Sep 17 00:00:00 2001 From: zhenwei-li Date: Fri, 2 Jul 2021 21:22:57 +0800 Subject: [PATCH 3/8] =?UTF-8?q?=E9=80=82=E9=85=8D=20darwin=20=E5=92=8C=20w?= =?UTF-8?q?in32=20=E5=B9=B3=E5=8F=B0=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vscode/settings.json | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 105b27d..a2a5a29 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -6,10 +6,16 @@ "./src", "./mock", "./test", + // darwin "./venv2/bin", - "./venv2/Lib/python2.7/site-packages", + "./venv2/lib/python2.7/site-packages", "./venv/bin", - "./venv/Lib/python3.7/site-packages", + "./venv/lib/python3.7/site-packages", + // win32 + "./venv2/Scripts", + "./venv2/Lib/site-packages", + "./venv/Scripts", + "./venv/Lib/site-packages", ], "python.analysis.logLevel": "Trace", // "python.analysis.watchSearchPaths": true, @@ -28,10 +34,16 @@ "./src", "./mock", "./tests", + // darwin "./venv2/bin", - "./venv2/Lib/python2.7/site-packages", + "./venv2/lib/python2.7/site-packages", "./venv/bin", - "./venv/Lib/python3.7/site-packages", + "./venv/lib/python3.7/site-packages", + // win32 + "./venv2/Scripts", + "./venv2/Lib/site-packages", + "./venv/Scripts", + "./venv/Lib/site-packages", ], // "python.autoUpdateLanguageServer": true, // "python.defaultInterpreterPath": "${workspaceFolder}/venv2/bin/python", From d210dc9e3e6e1fc0954a81bea2dfd219fc43c815 Mon Sep 17 00:00:00 2001 From: zhenwei-li Date: Fri, 2 Jul 2021 22:54:09 +0800 Subject: [PATCH 4/8] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20sys.path=20=E5=8F=82?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Temp/debug/env/interpreterInfo.py | 6 ++++-- Temp/debug/env/printEnvVariables.py | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Temp/debug/env/interpreterInfo.py b/Temp/debug/env/interpreterInfo.py index 00656fc..798dbc5 100644 --- a/Temp/debug/env/interpreterInfo.py +++ b/Temp/debug/env/interpreterInfo.py @@ -9,11 +9,13 @@ obj["versionInfo"] = tuple(sys.version_info) obj["sysPrefix"] = sys.prefix obj["sysVersion"] = sys.version -obj["is64Bit"] = sys.maxsize > 2 ** 32 +obj["sysPath"] = sys.path +obj["sysPlatform"] = sys.platform +obj["is64Bit"] = sys.maxsize > 2**32 obj["PWD"] = os.environ.get('PWD') obj["VIRTUAL_ENV"] = os.environ.get('VIRTUAL_ENV') -values = json.dumps(obj) +values = json.dumps(obj, indent=4) # print(values) print('ref: ./Temp/debug/env/interpreterInfo.json') with open('./Temp/debug/env/interpreterInfo.json', 'w') as file: diff --git a/Temp/debug/env/printEnvVariables.py b/Temp/debug/env/printEnvVariables.py index a2be1e2..8e7845a 100644 --- a/Temp/debug/env/printEnvVariables.py +++ b/Temp/debug/env/printEnvVariables.py @@ -4,7 +4,7 @@ import os import json -values = json.dumps(dict(os.environ)) +values = json.dumps(dict(os.environ), indent=4) # print(values) print('ref: ./Temp/debug/env/printEnvVariables.json') with open('./Temp/debug/env/printEnvVariables.json', 'w') as file: From a4ccbdfc718c36b7795f6677147c0ae0f1e1d3d0 Mon Sep 17 00:00:00 2001 From: zhenwei-li Date: Fri, 2 Jul 2021 23:23:40 +0800 Subject: [PATCH 5/8] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20sysModules=20=E8=B0=83?= =?UTF-8?q?=E8=AF=95=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Temp/debug/env/interpreterInfo.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Temp/debug/env/interpreterInfo.py b/Temp/debug/env/interpreterInfo.py index 798dbc5..2deace4 100644 --- a/Temp/debug/env/interpreterInfo.py +++ b/Temp/debug/env/interpreterInfo.py @@ -1,12 +1,16 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. +from ast import Str import json import os import sys obj = {} obj["versionInfo"] = tuple(sys.version_info) +obj["sysModules"] = {} +for (k, v) in sys.modules.items(): + (obj["sysModules"])[str(k)] = str(v) obj["sysPrefix"] = sys.prefix obj["sysVersion"] = sys.version obj["sysPath"] = sys.path From c2d3a1ae5898fda732c4ce9086f9ef3dd3fd3533 Mon Sep 17 00:00:00 2001 From: zhenwei-li Date: Sat, 3 Jul 2021 11:13:21 +0800 Subject: [PATCH 6/8] =?UTF-8?q?=E5=AF=BC=E5=85=A5=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Temp/debug/env/interpreterInfo.py | 1 - 1 file changed, 1 deletion(-) diff --git a/Temp/debug/env/interpreterInfo.py b/Temp/debug/env/interpreterInfo.py index 2deace4..a4682b5 100644 --- a/Temp/debug/env/interpreterInfo.py +++ b/Temp/debug/env/interpreterInfo.py @@ -1,7 +1,6 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from ast import Str import json import os import sys From 6134444a90e323cbbc6ec49b93eeaa9a3441c1e3 Mon Sep 17 00:00:00 2001 From: zhenwei-li Date: Sat, 3 Jul 2021 11:21:39 +0800 Subject: [PATCH 7/8] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20base=5Fproject=5Fprefi?= =?UTF-8?q?x=20=E7=8E=AF=E5=A2=83=E5=8F=98=E9=87=8F=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Temp/debug/env/interpreterInfo.py | 1 + 1 file changed, 1 insertion(+) diff --git a/Temp/debug/env/interpreterInfo.py b/Temp/debug/env/interpreterInfo.py index a4682b5..7ea4f99 100644 --- a/Temp/debug/env/interpreterInfo.py +++ b/Temp/debug/env/interpreterInfo.py @@ -6,6 +6,7 @@ import sys obj = {} +obj["base_project_prefix"] = os.getenv('base_project_prefix') obj["versionInfo"] = tuple(sys.version_info) obj["sysModules"] = {} for (k, v) in sys.modules.items(): From 0d74c7d056515e172072fd3992c3e186a80e893f Mon Sep 17 00:00:00 2001 From: zhenwei-li Date: Sat, 3 Jul 2021 13:06:21 +0800 Subject: [PATCH 8/8] the readme upgrade --- README.md | 64 +++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 41 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 9fe2d60..017642d 100644 --- a/README.md +++ b/README.md @@ -189,8 +189,10 @@ source ./venv/bin/activate ```bash # python python2 --version +python3 --version # python help -python2 --help > ./Temp/help/python_help.txt +python2 --help > ./Temp/help/python2_help.txt +python3 --help > ./Temp/help/python3_help.txt ``` ### 4.2 pip setuptools wheel version @@ -198,28 +200,35 @@ python2 --help > ./Temp/help/python_help.txt ```bash # pip python2 -m pip --version +python3 -m pip --version # pip setuptools wheel help -python2 -m pip --help > ./Temp/help/python_pip_help.txt -## python2 -m setuptools --help > ./Temp/help/python_setuptools_help.txt -python2 -m setup.py --help-commands > ./Temp/help/python_setuptools_help.txt -python2 -m wheel --help > ./Temp/help/python_wheel_help.txt +python2 -m pip --help > ./Temp/help/python2_pip_help.txt +python3 -m pip --help > ./Temp/help/python3_pip_help.txt +## python2 -m setuptools --help > ./Temp/help/python2_setuptools_help.txt +## python3 -m setuptools --help > ./Temp/help/python3_setuptools_help.txt +python2 -m setup.py --help-commands > ./Temp/help/python2_setuptools_help.txt +python3 -m setup.py --help-commands > ./Temp/help/python3_setuptools_help.txt +python2 -m wheel --help > ./Temp/help/python2_wheel_help.txt +python3 -m wheel --help > ./Temp/help/python3_wheel_help.txt ``` #### 4.2.1 pip freeze list ```bash # pip freeze -python2 -m pip freeze > ./Temp/python_pip_freeze.txt -python2 -m pip list > ./Temp/python_pip_list.txt +python2 -m pip freeze > ./Temp/python2_pip_freeze.txt +python3 -m pip freeze > ./Temp/python3_pip_freeze.txt +python2 -m pip list > ./Temp/python2_pip_list.txt +python3 -m pip list > ./Temp/python3_pip_list.txt ``` #### 4.2.2 pip cache ```bash # pip cache list -python2 -m pip cache list > ./out/dist/pip_cache_list.txt -python3 -m pip cache list > ./out/dist/pip_cache_list.txt +python2 -m pip cache list > ./out/dist/pip2_cache_list.txt +python3 -m pip cache list > ./out/dist/pip3_cache_list.txt # pip no cache install python2 -m pip --no-cache-dir install com.dvsnier.* python3 -m pip --no-cache-dir install com.dvsnier.* @@ -250,8 +259,8 @@ python3 -m build > ./out/dist/build.txt ```bash # setup sdist -python2 setup.py sdist > ./out/dist/setup_sdist.txt -python3 setup.py sdist > ./out/dist/setup_sdist.txt +python2 setup.py sdist > ./out/dist/setup2_sdist.txt +python3 setup.py sdist > ./out/dist/setup3_sdist.txt python2 setup.py bdist_wheel --universal python3 setup.py bdist_wheel --universal @@ -265,8 +274,10 @@ python3 setup.py bdist_wheel ```bash # virtualenv python2 -m virtualenv --version +python3 -m virtualenv --version # virtualenv help -python2 -m virtualenv --help > ./Temp/help/python_virtualenv_help.txt +python2 -m virtualenv --help > ./Temp/help/python2_virtualenv_help.txt +python3 -m virtualenv --help > ./Temp/help/python3_virtualenv_help.txt ``` ### 4.4 tox tox-travis version @@ -275,9 +286,13 @@ python2 -m virtualenv --help > ./Temp/help/python_virtualenv_help.txt # tox python2 -m tox --version # python2 -m tox-travis --version +python3 -m tox --version +# python3 -m tox-travis --version # tox tox-travis help -python2 -m tox --help > ./Temp/help/python_tox_help.txt -# python2 -m tox-travis --help > ./Temp/help/python_tox_travis_help.txt +python2 -m tox --help > ./Temp/help/python2_tox_help.txt +# python2 -m tox-travis --help > ./Temp/help/python2_tox_travis_help.txt +python3 -m tox --help > ./Temp/help/python3_tox_help.txt +# python3 -m tox-travis --help > ./Temp/help/python3_tox_travis_help.txt ``` 如若快捷生成脚本,参考如下命令: @@ -297,8 +312,10 @@ tox ```bash # twine python2 -m twine --version +python3 -m twine --version # twine help -python2 -m twine --help > ./Temp/help/python_twine_help.txt +python2 -m twine --help > ./Temp/help/python2_twine_help.txt +python3 -m twine --help > ./Temp/help/python3_twine_help.txt # check python check and upload dist format twine check dist/* @@ -489,8 +506,8 @@ name = com.dvsnier.xxx version = 0.0.1.dev1 author = dvsnier author_email = dovsnier@qq.com -description = this is dvsnier directory. -long_description = file: ./doc/description/directory/README.md +description = this is dvsnier xxx. +long_description = file: ./doc/description/xxx/README.md long_description_content_type = text/markdown keywords = xxx, development url = https://github.com/Alinvor/Python-DeMo @@ -511,7 +528,6 @@ classifiers = Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 License :: OSI Approved :: MIT License - Operating System :: OS Independent python_requires = >=2.7 @@ -577,10 +593,11 @@ def read_text(file_name): # # the repaired your home name # -PROJECT_PREFIX = '/Users/.../Python-DeMo/' -project = PROJECT_PREFIX +# PROJECT_PREFIX = '/Users/.../Python-DeMo/' +# project = PROJECT_PREFIX +project = os.getenv('base_project_prefix') print(project) -PROJECT_DIRECTORY = 'directory' # project directory +PROJECT_DIRECTORY = 'xxx' # project directory PROJECT_README_FILE = 'README.md' # project readme file README_ROOT_DIRECTORY = os.path.join(project, 'doc/description') README_PROJECT_DIRECTORY = os.path.join(README_ROOT_DIRECTORY, PROJECT_DIRECTORY) @@ -615,7 +632,7 @@ PROJECT_DESCRIPTION = os.path.join(README_PROJECT_DIRECTORY, PROJECT_README_FILE # | 22 | | | | | | DVSNIER_NAME = 'com.dvsnier.xxx' # Required DVSNIER_VERSION = '0.0.1.dev1' # Required -DVSNIER_DESCRIPTOIN = 'this is dvsnier directory.' # Optional +DVSNIER_DESCRIPTOIN = 'this is dvsnier xxx.' # Optional # Get the long description from the README file DVSNIER_LONG_DESCRIPTOIN = read_text(str(PROJECT_DESCRIPTION)) # Optional DVSNIER_LONG_DESCRIPTION_CONTENT_TYPE = 'text/markdown' # Optional @@ -633,6 +650,7 @@ DVSNIER_CLASSIFIERS = [ # Optional # Indicate who your project is intended for # 'Intended Audience :: Developers', # 'Topic :: Software Development :: Build Tools', + 'Topic :: Software Development :: Libraries', # Pick your license as you wish 'License :: OSI Approved :: MIT License', @@ -644,7 +662,7 @@ DVSNIER_CLASSIFIERS = [ # Optional 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', # 'Programming Language :: Python :: 3 :: Only', - 'Operating System :: OS Independent' + # 'Operating System :: OS Independent' ] DVSNIER_KEYWORDS = 'xxx, development' # Optional DVSNIER_PACKAGE_DIR = {'': 'src'} # Optional