Skip to content

Octoprint 2.0.0 fixes#3

Open
jacopotediosi wants to merge 5 commits into
arekm:develfrom
jacopotediosi:octoprint-2.0.0-fixes
Open

Octoprint 2.0.0 fixes#3
jacopotediosi wants to merge 5 commits into
arekm:develfrom
jacopotediosi:octoprint-2.0.0-fixes

Conversation

@jacopotediosi
Copy link
Copy Markdown

Hi, I'm an active contributor to OctoPrint core. I helped ship OctoPrint 2.0.0rc1 and I'm now helping plugins stay compatible with the new and upcoming OctoPrint releases, which is why you're receiving this PR.


This PR fixes the compatibility issues preventing this plugin from being installed on OctoPrint 2.0.0rc1.

In particular:

  • Removes the use of printer._comm and printer._get_free_remote_name, which no longer exist in OctoPrint 2.0.0 (ref) and were never intended for public use. In doing so, I also removed _get_remote_filename, which is a fallback that should never be needed, as I can't imagine a case where the vfat ioctl would fail to calculate the short filename.
  • Hardens PNotify notifications to prevent HTML injections.
  • Implements is_template_autoescaped (ref).
  • Migrates the installation method to pyproject (ref). This has been done via the octoprint dev plugin:migrate-to-pyproject command, with minor manual adjustments to the generated files.
  • Update pre-commit hooks to be compatible with recent Python versions and to align with those currently used by OctoPrint.

I tested the installation on both OctoPrint 2.0.0rc1 and the latest stable version 1.11.7, and now the plugin installs correctly and doesn't log any warnings. Please note that I don't have the hardware to actually test the plugin's functionality, so that's up to you.

This was done via the "octoprint dev plugin:migrate-to-pyproject" command, with minor manual adjustments to the generated files.

Ref: https://docs.octoprint.org/en/dev/plugins/migration_pyproject_toml.html
It has been removed in OctoPrint 2.0.0 and it was never intended for public use
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant