python-package-dev

Package research code into a distributable Python project with pyproject.toml.

33|6|Updated Mar 17, 2026
One-click install
npx skills add https://github.com/xjtulyc/awesome-rosetta-skills --skill python-package-dev
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: python-package-dev
Source: https://github.com/xjtulyc/awesome-rosetta-skills/tree/main/skills/23-research-workflow/python-package-dev
Command: npx skills add https://github.com/xjtulyc/awesome-rosetta-skills --skill python-package-dev

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires build, pytest, pytest-cov, sphinx, setuptools, twine.

What problem does it solve?

This Skill helps you turn research code into a well-structured, installable Python package that is easy to test, document, and publish for reuse and reproducibility.

Core Features & Use Cases

  • pyproject.toml-first packaging: Defines build system and project metadata using modern PEP 517/518 workflows for consistent packaging.
  • Research-grade testing with pytest: Adds unit/integration tests and encourages measurable quality via coverage (pytest-cov).
  • Sphinx documentation & API reference: Generates API docs from docstrings (autodoc) to support maintenance and academic adoption.
  • Publishing for academic software: Prepares builds for distribution to PyPI (and optionally conda workflows) using standard tooling.
  • Use Case: You have a statistical analysis toolkit used across multiple papers and notebooks; you want one reusable Python package with automated tests and Sphinx docs so collaborators can install and cite the same version.

Quick Start

Use this skill to set up your repository with a src-layout package, write tests with pytest, generate Sphinx API docs, and prepare a PyPI-ready release.

Frequently Asked Questions about python-package-dev

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I package my research code into a Python project using pyproject.toml?

To package research code, use a modern pyproject.toml configuration with a src layout structure to define build system metadata and dependencies. This approach ensures consistent packaging and prepares your project for installation, testing, and distribution.

What's the best way to set up pytest testing with coverage for a Python package?

Setting up pytest testing with coverage requires configuring pytest-cov alongside your src layout structure. This integration enables measurable quality assurance by running unit and integration tests while tracking code coverage for your research software.

How do I generate Sphinx API documentation for a research Python package?

Generating Sphinx API documentation involves using autodoc to extract API references directly from your docstrings. This process produces maintainable documentation that supports academic adoption and collaboration by detailing your package's functions.

Can I use continuous integration to automate PyPI releases for research software?

Yes, you can use CI-friendly automation with deterministic tooling to build and publish releases to PyPI. Configuring your pyproject.toml with semantic versioning and standard tools like build and twine enables repeatable, automated distribution.

Does this packaging workflow support both PyPI and conda distribution?

Yes, the packaging workflow prepares builds for distribution to PyPI and optionally supports conda workflows. By standardizing your build configuration and dependency declarations, you can distribute your research software across multiple package repositories.