# soutil **Repository Path**: python_so/soutil ## Basic Information - **Project Name**: soutil - **Description**: 我的工具组件库,个人使用 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-04-30 - **Last Updated**: 2025-02-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 自动生成依赖配置文件 ```shell # 安装工具 pip3 install pipreqs -i https://pypi.tuna.tsinghua.edu.cn/simple # 自动分析源码,生成 requirements.txt pipreqs . --encoding=utf8 --force # 上面的命令 如果出现 pipreqs command not found # 查看 pip3 install pipreqs 安装时控制台打印的 pipreqs 路径,例如 pipreqs in /Users/zhongwen/Library/Python/3.9/lib/python/site-packages (0.4.13) # 就去配置环境,如下即可解决 export PATH=$PATH:/Users/zhongwen/Library/Python/3.9/bin ``` # 安装到本地全局 ```shell # 安装到全局 python setup.py install ``` # 安装到当前虚拟环境 ```shell # 安装到当前虚拟路径中 pip3 install . ``` # 安装到指定的虚拟路径 ```shell # 切换到虚拟路径 source ~/codesource/company/me/python/scripts/venv/bin/activate # 安装 pip3 install . ``` # 打包至私服 ```shell # 将配置文件拷贝至用户根目录下 cp .pypirc ~/ # 安装必须依赖 pip3 install twine -i https://pypi.tuna.tsinghua.edu.cn/simple # 打包前清理 rm -rf ./build ./dist ./soutil.egg-info # 打包 python setup.py sdist bdist_wheel # 上传,-r 可以选择仓库地址 twine upload -r nexus dist/* ``` # 私服地址 ```shell # 使用带有用户名和密码认证的方式安装 pip3 install xxx -i https://develop:rWs0VNaF2dZV35hR@nexus.hanokl.com/repository/hk-pypi-group/simple ``` # 配置全局个人私服 ```shell # 配置全局私服,Windows系统在python安装目录中创建一个pip.ini文件,内容一样 [ ! -d ~/.pip ] && echo "mkdir ~/.pip" && mkdir ~/.pip echo "\ [global] timeout = 6000 index-url=https://guest:5cgr57Yy6coDaxac@nexus.hanokl.com/repository/hk-pypi-group/simple [install] trusted-host=nexus.hanokl.com " > ~/.pip/pip.conf ``` # 常见问题 `三个引号函数没有自动生成注释:https://www.cnblogs.com/l7planet/p/13807646.html`