Registry / devops / pyroma

pyroma

JSON →
library5.0.1pypypi✓ verified 85d ago

Pyroma is a Python library and command-line tool designed to test your project's packaging friendliness. It evaluates a Python project's metadata, structure, and configuration (e.g., `setup.py`, `pyproject.toml`) against a set of best practices to determine how well-prepared it is for distribution on PyPI. The current version is 5.0.1, with major releases occurring roughly annually and minor updates as needed.

pip install pyroma
INSTALL
IMPORT
SIG · PYROMA
P
pyroma
devopspythonv5.0.1
Install
3.6s avg
Import
Disk
39MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v5.0.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 36.3MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 3.6s · import 0.000s · 37MB
39MB installed
● package 39MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ratings
from pyroma import ratings
from pyroma import ratings; ratings.run_pyroma
run
from pyroma import run
from pyroma import ratings; ratings.run_pyroma
main
from pyroma import main
from pyroma import ratings; ratings.run_pyroma

This quickstart demonstrates how to programmatically use Pyroma. It creates a temporary, minimal Python project directory, runs `pyroma.ratings.run_pyroma` on it, prints the score and any messages, and then cleans up the temporary files. This pattern is useful for integrating Pyroma checks into custom scripts or CI/CD pipelines.

import os import shutil from pathlib import Path from pyroma import ratings # Create a dummy project directory for testing project_root = Path("temp_pyroma_project") project_root.mkdir(exist_ok=True) # Create a minimal setup.py, README.md, and __init__.py (project_root / "setup.py").write_text( "from setuptools import setup; setup(name='dummy', version='0.1.0', description='A dummy project for pyroma test', packages=['dummy_pkg'])" ) (project_root / "README.md").write_text("# Dummy Project\n\nThis is a temporary project for pyroma testing.") (project_root / "dummy_pkg").mkdir(exist_ok=True) (project_root / "dummy_pkg" / "__init__.py").touch() # Run pyroma on the dummy project print(f"Running pyroma on: {project_root.resolve()}") score, messages = ratings.run_pyroma(project_root) print(f"\nPyroma Score: {score}/10") print("Messages:") if messages: for message in messages: print(f"- {message}") else: print("No messages (perfect score).") # Clean up the dummy project if project_root.exists(): shutil.rmtree(project_root) print(f"\nCleaned up {project_root}")
pyroma --version
Debug
Known issues
breakingIn Pyroma v5.0.0, the programmatic API (`run_pyroma`) and the command-line interface (CLI) shifted to operate on a *directory path* rather than directly on a `setup.py` file. Calls explicitly passing a `setup.py` file path will no longer work.
fix
Update your code to pass the project's root directory: `pyroma.ratings.run_pyroma('/path/to/project_root')`. For the CLI, use `pyroma /path/to/project_root` or simply `pyroma .` from within the project's root.
affects: >=5.0.0
breakingPyroma v5.0.0 raised the minimum required Python version to 3.9. Projects attempting to use Pyroma on older Python runtimes will encounter an `ImportError` or installation failure.
fix
Ensure your environment uses Python 3.9 or newer. If you must use an older Python version, pin Pyroma to a compatible version, e.g., `pyroma<5.0.0`.
affects: >=5.0.0
gotchaPyroma assesses a project's 'packaging friendliness' based on its metadata and structure, not the functional correctness or code quality of the Python application itself. A project can be fully functional but receive a low Pyroma score if its packaging configuration is non-standard or incomplete.
fix
Understand Pyroma's scope as a packaging linter. Focus on addressing specific warnings related to `setup.py`, `pyproject.toml`, `README`, and package structure to improve its distribution readiness, rather than expecting it to validate application logic.
affects: All versions
gotchaWhen using Pyroma via the CLI, ensure you are in the project's root directory or explicitly specify the project's root. If run without arguments from a non-project directory, it will attempt to analyze the current directory and might report 'No setup.py or pyproject.toml found' errors.
fix
Always execute `pyroma .` from your project's root directory, or provide the full path to the root: `pyroma /path/to/my/project`.
affects: All versions
Upgrade
Version history
5.0.1latest on PyPI · released Dec 9, 2025
Audit
Dependencies

No dependency data recorded yet.

Agent activity
9 hits · last 30 days
node
8
Resources
pyroma — pip install pyroma · libregistry