python-packaging
為 PyPI 建立 Python 套件
또한 다음에서 사용할 수 있습니다: sickn33,ActiveInferenceInstitute
打包 Python 專案時常會出現結構和中繼資料錯誤。本技能提供清晰的佈局、配置範例和發佈步驟,協助建立可分發的套件。
스킬 ZIP 다운로드
Claude에서 업로드
설정 → 기능 → 스킬 → 스킬 업로드로 이동
토글을 켜고 사용 시작
테스트해 보기
"python-packaging" 사용 중입니다. I need a simple pyproject.toml and folder layout for a library.
예상 결과:
- 使用包含套件資料夾和測試的 src 佈局。
- 在 pyproject.toml 中定義建置系統和專案中繼資料。
- 新增依賴項目和可選的開發工具。
- 包含用於打包的 README 和 LICENSE。
"python-packaging" 사용 중입니다. How do I set up CLI commands for my package?
예상 결과:
- 安裝 Click 作為依賴項目。
- 建立帶有 click 命令的 cli.py 模組。
- 在 pyproject.toml 區段中定義進入點。
- 以可編輯模式安裝以測試命令。
"python-packaging" 사용 중입니다. What are the steps to publish to PyPI?
예상 결과:
- 使用 python -m build 建置套件。
- 使用 twine check dist/* 驗證。
- 先上傳到 TestPyPI 進行測試。
- 使用 twine upload dist/* 上傳到 PyPI。
보안 감사
안전Pure documentation skill containing educational content about Python packaging. No executable scripts, network calls, file access, or code execution paths present. All static findings are false positives: the scanner misidentified repository names as cryptographic algorithms, bash documentation examples as shell execution, and legitimate config file references as credential access attempts.
위험 요인
🌐 네트워크 접근 (25)
⚙️ 외부 명령어 (77)
📁 파일 시스템 액세스 (2)
품질 점수
만들 수 있는 것
打包可重複使用的模組
為共享的 Python 函式庫設計乾淨的結構和中繼資料。
發佈命令列工具
定義進入點並將 CLI 套件發佈到 PyPI。
自動化發佈
使用建置和上傳步驟設定發佈工作流程。
이 프롬프트를 사용해 보세요
提供一個最小的 src 佈局和 pyproject.toml,用於名為 acme-tools 的小型 Python 函式庫。
展示如何為現有套件新增一個基於 Click、名為 acme 的 CLI 進入點。
列出使用 twine 建置 wheel 並發佈到 TestPyPI 和 PyPI 的步驟。
草擬一個 GitHub Actions 工作流程,在建立版本時進行建置和上傳。
모범 사례
- 使用 src 佈局以獲得更安全的匯入
- 在乾淨的環境中測試安裝
- 在發佈到 PyPI 之前先發佈到 TestPyPI
피하기
- 未驗證中繼資料就發佈
- 依賴隱含的 setup.py 預設值
- 發佈時跳過 wheel 建置
자주 묻는 질문
這與現代 Python 打包相容嗎?
這個技能不能做什麼?
它可以幫助處理 CI 或 GitHub Actions 嗎?
它會收集或傳送我的資料嗎?
如果我的建置失敗怎麼辦?
它如何與 Poetry 或 Flit 比較?
개발자 세부 정보
작성자
wshobson라이선스
MIT
리포지토리
https://github.com/wshobson/agents/tree/main/plugins/python-development/skills/python-packaging참조
main
파일 구조
📄 SKILL.md