My Package
My Package【免费下载链接】agentsMulti-harness agentic plugin marketplace for Claude Code, Codex, Cursor, OpenCode, GitHub Copilot, and Google Antigravity项目地址: https://gitcode.com/GitHub_Trending/agents24/agentsBrief description of your package.Installationpip install my-packageQuick Startfrom my_package import something result something.do_stuff()FeaturesFeature 1Feature 2Feature 3DocumentationFull documentation: https://my-package.readthedocs.ioDevelopmentgit clone https://github.com/username/my-package.git cd my-package pip install -e .[dev] pytestLicenseMIT## 七、常见进阶分发模式Pattern 19 20 ### 多架构 wheelscibuildwheel 含 C 扩展的包需要在每个目标平台分别编译。用 cibuildwheel 配合 GitHub Actions 矩阵即可一键产出 Windows/macOS/Linux 的 wheel yaml # .github/workflows/wheels.yml name: Build wheels on: [push, pull_request] jobs: build_wheels: name: Build wheels on ${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: matrix: os: [ubuntu-latest, windows-latest, macos-latest] steps: - uses: actions/checkoutv3 - name: Build wheels uses: pypa/cibuildwheelv2.16.2 - uses: actions/upload-artifactv3 with: path: ./wheelhouse/*.whl 对于纯 Python 包如 [plugin-eval](https://link.gitcode.com/i/c5b33a9bb539619ee6d10f93ef72338b) 采用 hatchling 构建、只打包 src/plugin_eval产物是通用的 py3-none-any wheel单一平台构建即可跨平台安装无需矩阵编译。 ### 私有包索引Private Package Index 企业内部发布可走私有索引如 JFrog Artifactory、AWS CodeArtifact 等 bash # Install from private index pip install my-package --index-url https://private.pypi.org/simple/ # Or add to pip.conf [global] index-url https://private.pypi.org/simple/ extra-index-url https://pypi.org/simple/ # Upload to private index twine upload --repository-url https://private.pypi.org/ dist/* extra-index-url 的作用是以私有索引为主源同时保留从公共 PyPI 拉取依赖的能力。 ## 八、文件模板.gitignore 与 MANIFEST.in ### Python 包专用 .gitignore gitignore # Build artifacts build/ dist/ *.egg-info/ *.egg .eggs/ # Python __pycache__/ *.py[cod] *$py.class *.so # Virtual environments venv/ env/ ENV/ # IDE .vscode/ .idea/ *.swp # Testing .pytest_cache/ .coverage htmlcov/ # Distribution *.whl *.tar.gz 说明*.so 用于忽略本地编译出的扩展二进制dist/ 与 *.whl、*.tar.gz 确保构建产物不进版本库发布时通过 CI 或本地 python -m build 重新生成。 ### MANIFEST.in 对于 sdist源码发行包pyproject.toml 中的 package-data 只管 wheelsdist 中要额外携带的文件README、LICENSE、数据文件需用 MANIFEST.in 声明 # MANIFEST.in include README.md include LICENSE include pyproject.toml recursive-include src/my_package/data *.json recursive-include src/my_package/templates *.html recursive-exclude * __pycache__ recursive-exclude * *.py[co] - include 指定仓库根目录下的单文件 - recursive-include dir pattern 递归收集某目录下匹配的文件 - recursive-exclude 用于剔除缓存与字节码防止污染 sdist。 ## 九、发布前的完整检查清单 发布流程是「构建 → 校验 → 试发布 → 正式发布」的串联每一步都有对应的检查项 - [ ] Code is tested (pytest passing) - [ ] Documentation is complete (README, docstrings) - [ ] Version number updated - [ ] CHANGELOG.md updated - [ ] License file included - [ ] pyproject.toml is complete - [ ] Package builds without errors - [ ] Installation tested in clean environment - [ ] CLI tools work (if applicable) - [ ] PyPI metadata is correct (classifiers, keywords) - [ ] GitHub repository linked - [ ] Tested on TestPyPI first - [ ] Git tag created for release 结合 [details.md](https://link.gitcode.com/i/ed97c8b61c73a99861d49e7372aef0ba) 的 Pattern 8–10完整发布链路是 bash # 1. 安装构建与上传工具 pip install build twine # 2. 本地构建生成 sdist 与 wheel python -m build # dist/ # my-package-1.0.0.tar.gz (source distribution) # my_package-1.0.0-py3-none-any.whl (wheel) # 3. 校验包元数据与 README 渲染 twine check dist/* # 4. 先发 TestPyPI 验证 twine upload --repository testpypi dist/* pip install --index-url https://test.pypi.org/simple/ my-package # 5. 一切正常后发布到正式 PyPI twine upload dist/*【免费下载链接】agentsMulti-harness agentic plugin marketplace for Claude Code, Codex, Cursor, OpenCode, GitHub Copilot, and Google Antigravity项目地址: https://gitcode.com/GitHub_Trending/agents24/agents创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考