A CLI tool to help with maintaining OctoPrint Plugins
Project description
octoprint-plugin-tool
A CLI tool (and library) to help with maintaining OctoPrint Plugins.
Installation
pip install octoprint-plugin-tool
octoprint-plugin-tool requires Python 3.9 or later.
Usage
As a Python library
import sys
from octoprint_plugin_tool import migrate_to_pyproject
def log(message, warning: bool = False, error: bool = False):
if warning:
message = f"[WARNING] {message}"
print(message, file=sys.stderr if error else sys.stdout)
if migrate_to_pyproject("/path/to/plugin", force=False, rename=True):
print("Yay!")
else:
print("Nay!", file=sys.stderr)
As a command line tool
$ octoprint-plugin-tool
usage: octoplugin-tool [-h] [--verbose] {to-pyproject} ...
A CLI tool to help with maintaining OctoPrint Plugins
positional arguments:
{to-pyproject}
to-pyproject Migrate legacy setup.py based OctoPrint plugin to modern
pyproject.toml based packaging
options:
-h, --help show this help message and exit
--verbose, -v increase logging verbosity
to-pyproject
This subcommand allows you to migrate most setup.py based OctoPrint plugins generated from
OctoPrint's plugin template until June 2025 (e.g. through octoprint dev plugin:new) to
more modern pyproject.toml based tooling.
Current limitations include the use of any non-string values for the various plugin_ properties,
the use of plugin_additional_packages or additional_setup_parameters, or non-compliant package
or identifier names.
The tool will bail if it detects any issues and give you an error indicating what's wrong.
$ octoprint-plugin-tool to-pyproject --help
usage: octoplugin-tool to-pyproject [-h] [--path PATH] [--force]
[--rename-package]
options:
-h, --help show this help message and exit
--path PATH Path of the local plugin development folder to migrate, if
other than cwd
--force Force migration, even if setup.py looks wrong
--rename-package Automatically rename package to recommended naming scheme
Example
$ octoprint-plugin-tool to-pyproject --path OctoPrint-RequestSpinner/
Attempting to migrate plugin in OctoPrint-RequestSpinner
Extracting plugin data from OctoPrint-RequestSpinner/setup.py...
Validating and migrating plugin data for plugin in OctoPrint-RequestSpinner...
Plugin still supports EOL Python 3.7 or 3.8, not enabling PEP639
Generating OctoPrint-RequestSpinner/pyproject.toml...
Generating OctoPrint-RequestSpinner/setup.py...
Generating OctoPrint-RequestSpinner/Taskfile.yml...
Updating OctoPrint-RequestSpinner/MANIFEST.in as necessary...
Adding "recursive-include octoprint_requestspinner/templates *"...
Adding "recursive-include octoprint_requestspinner/translations *"...
Adding "recursive-include octoprint_requestspinner/static *"...
Cleaning up...
Removing no longer needed OctoPrint-RequestSpinner/requirements.txt...
... done!
PLEASE REVIEW THE CHANGES THOROUGHLY AND MAKE SURE TO TEST YOUR PLUGIN AND ITS INSTALLATION!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file octoprint_plugin_tool-0.1.1.tar.gz.
File metadata
- Download URL: octoprint_plugin_tool-0.1.1.tar.gz
- Upload date:
- Size: 22.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c65adee7fccef1cd5794e0edbf32bd290bda32b3b0b8d9c03ba45e61783e3844
|
|
| MD5 |
bb40ad69ec9aebb26fe09633d064d8b4
|
|
| BLAKE2b-256 |
c846414ec48a6accf12b2aa09e2fa89a42958654fb6fa3fa2609a13cdc7eac37
|
Provenance
The following attestation bundles were made for octoprint_plugin_tool-0.1.1.tar.gz:
Publisher:
ci.yml on OctoPrint/octoprint-plugin-tool
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
octoprint_plugin_tool-0.1.1.tar.gz -
Subject digest:
c65adee7fccef1cd5794e0edbf32bd290bda32b3b0b8d9c03ba45e61783e3844 - Sigstore transparency entry: 1437401287
- Sigstore integration time:
-
Permalink:
OctoPrint/octoprint-plugin-tool@008f79c14fb3bfc3259b3d2d21815e0a4682e837 -
Branch / Tag:
refs/tags/0.1.1 - Owner: https://github.com/OctoPrint
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@008f79c14fb3bfc3259b3d2d21815e0a4682e837 -
Trigger Event:
release
-
Statement type:
File details
Details for the file octoprint_plugin_tool-0.1.1-py3-none-any.whl.
File metadata
- Download URL: octoprint_plugin_tool-0.1.1-py3-none-any.whl
- Upload date:
- Size: 21.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2e574893e902531bf4fac4c4efefd0d64c672a69c89ebc53a17af3384b72ceba
|
|
| MD5 |
90f3e2f993eac59fa17b4f9c37a44f37
|
|
| BLAKE2b-256 |
13d3d3f74caf0b42f1a931382d7407f4b84fb7a71688d9baa0d1558667016918
|
Provenance
The following attestation bundles were made for octoprint_plugin_tool-0.1.1-py3-none-any.whl:
Publisher:
ci.yml on OctoPrint/octoprint-plugin-tool
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
octoprint_plugin_tool-0.1.1-py3-none-any.whl -
Subject digest:
2e574893e902531bf4fac4c4efefd0d64c672a69c89ebc53a17af3384b72ceba - Sigstore transparency entry: 1437401289
- Sigstore integration time:
-
Permalink:
OctoPrint/octoprint-plugin-tool@008f79c14fb3bfc3259b3d2d21815e0a4682e837 -
Branch / Tag:
refs/tags/0.1.1 - Owner: https://github.com/OctoPrint
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@008f79c14fb3bfc3259b3d2d21815e0a4682e837 -
Trigger Event:
release
-
Statement type: