cameroncros / OctoPrint-DiscordRemote

Discord plugin for OctoPrint
MIT License
68 stars 32 forks source link

Octoprint attempts to upgrade to v4.0.0 even when python 3.8 requirement isnt met #239

Closed LyricPants66133 closed 1 year ago

LyricPants66133 commented 1 year ago

I am on Octoprint 1.8.1, Octopi 0.18, python 3.7.3. Octoprint prompts me to upgrade the plugin to v4.0.0, despite the fact that python 3.8 is needed to upgrade.

Logs: Octoprint.log:

2023-04-21 02:47:01,647 - octoprint.plugins.softwareupdate - INFO - Starting update of discordremote to v4.0.0...
2023-04-21 02:47:09,293 - octoprint.plugins.softwareupdate - ERROR - Update of discordremote can not be performed, please also check plugin_softwareupdate_console.log for possible causes of this
Traceback (most recent call last):
  File "/home/pi/oprint/lib/python3.7/site-packages/octoprint/plugins/softwareupdate/__init__.py", line 2193, in _perform_update
    force=force,
  File "/home/pi/oprint/lib/python3.7/site-packages/octoprint/plugins/softwareupdate/updaters/pip.py", line 127, in perform_update
    "Error while executing pip install", (stdout, stderr)
octoprint.plugins.softwareupdate.exceptions.UpdateError: Error while executing pip install
2023-04-21 02:47:09,432 - octoprint.plugins.softwareupdate - INFO - Saved update log to disk

plugin_softwareupdate_console.log:

2023-04-21 02:47:01,656   /home/pi/oprint/bin/python3 -m pip --disable-pip-version-check install https://github.com/cameroncros/OctoPrint-DiscordRemote/archive/v4.0.0.zip --no-cache-dir
2023-04-21 02:47:05,842 > Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
2023-04-21 02:47:05,844 > Collecting https://github.com/cameroncros/OctoPrint-DiscordRemote/archive/v4.0.0.zip
2023-04-21 02:47:05,857 > Downloading https://github.com/cameroncros/OctoPrint-DiscordRemote/archive/v4.0.0.zip (91 kB)
2023-04-21 02:47:05,858 > ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 91.2/91.2 kB 1.6 MB/s eta 0:00:00
2023-04-21 02:47:05,859 > Preparing metadata (setup.py): started
2023-04-21 02:47:08,237 > Preparing metadata (setup.py): finished with status 'done'
2023-04-21 02:47:08,239 > Requirement already satisfied: pillow in /home/pi/oprint/lib/python3.7/site-packages (from OctoPrint-DiscordRemote==4.0.0) (8.2.0)
2023-04-21 02:47:09,284 > INFO: pip is looking at multiple versions of octoprint-discordremote to determine which version is compatible with other requirements. This could take a while.
2023-04-21 02:47:09,290 ! ERROR: Ignored the following versions that require a different python version: 2.0.0 Requires-Python >=3.8.0; 2.0.1 Requires-Python >=3.8.0; 2.1.0 Requires-Python >=3.8.0; 2.1.1 Requires-Python >=3.8.0; 2.2.0 Requires-Python >=3.8.0; 2.2.1 Requires-Python >=3.8.0; 2.2.2 Requires-Python >=3.8.0
2023-04-21 02:47:09,291 ! ERROR: Could not find a version that satisfies the requirement discord.py==2.2.2 (from octoprint-discordremote) (from versions: 0.1.0, 0.2.0, 0.2.1, 0.3.0, 0.3.1, 0.4.0, 0.4.1, 0.5.0, 0.5.1, 0.6.0, 0.6.1, 0.6.2, 0.6.3, 0.7.0, 0.8.0, 0.9.0, 0.9.1, 0.9.2, 0.10.0, 0.11.0, 0.12.0, 0.13.0, 0.14.0, 0.14.1, 0.14.2, 0.14.3, 0.15.0, 0.15.1, 0.16.0, 0.16.1, 0.16.2, 0.16.3, 0.16.4, 0.16.5, 0.16.6, 0.16.7, 0.16.8, 0.16.9, 0.16.10, 0.16.11, 0.16.12, 1.0.0, 1.0.1, 1.1.0, 1.1.1, 1.2.0, 1.2.1, 1.2.2, 1.2.3, 1.2.4, 1.2.5, 1.3.0, 1.3.1, 1.3.2, 1.3.3, 1.3.4, 1.4.0, 1.4.1, 1.4.2, 1.5.0, 1.5.1, 1.6.0, 1.7.0, 1.7.1, 1.7.2, 1.7.3)
2023-04-21 02:47:09,292 ! ERROR: No matching distribution found for discord.py==2.2.2
cameroncros commented 1 year ago

I am not sure if this is a octoprint problem, a discord remote problem or something else. If the plugin just failed to install/update I am inclined to just ignore this problem, although I recognise it is probably a nuisance.

If you know of how to fix this, please let me know.

LyricPants66133 commented 1 year ago

Did some research and found a fix. See PR.

cameroncros commented 1 year ago

Alas, fix does not appear to have worked :(

https://github.com/cameroncros/OctoPrint-DiscordRemote/discussions/241

LyricPants66133 commented 1 year ago

See my merged PR. Another fix must also be performed on the octoprint plugin repository so that OctoPrint’s built-in Plugin Manager can work properly. I didn't do it since I am not a maintainer of this plug in.

What compatibility should look like: (This is not properly formatted, and comments can be removed. Also, iirc, 1.8.0 is the first Octoprint version to support python 3.8)


compatibility:
octoprint:
  - 1.8.0

  # List of compatible operating systems
  #
  # Possible values:
  #
  # - windows
  # - linux
  # - macos
  # - freebsd
  #
  # There are also two OS groups defined that get expanded on usage:
  #
  # - posix: linux, macos and freebsd
  # - nix: linux and freebsd
  #
  # You can also remove the whole "os" block. Removing it will default to all
  # operating systems being supported.

  os:
  - linux

  # Compatible Python version
  #
  # Plugins should aim for compatibility for Python 2 and 3 for now, in which case the value should be ">=2.7,<4".
  #
  # Plugins that only wish to support Python 3 should set it to ">=3,<4".
  #
  # If your plugin only supports Python 2 (worst case, not recommended for newly developed plugins since Python 2
  # is EOL), leave at ">=2.7,<3"

  python: ">=3.8,<4"
cameroncros commented 1 year ago

Ah, right, reading fail. I'll make that change as well.

cameroncros commented 1 year ago

https://github.com/OctoPrint/plugins.octoprint.org/pull/1183

cp2004 commented 1 year ago

Just to chime in on this having seen the plugin repository PR - changing that will only affect finding the plugin in the plugin manager and installing it for the first time - it doesn't have any impact for subsequent updates. Still worth doing for avoiding initial install problems.

You can disable update checks for Python 2 installs only (this is built in to OctoPrint through plugins.octoprint.org) but not for a specific Python version unfortunately.

Blocking install with python_requires in the setup.py is the best option currently.

Also, iirc, 1.8.0 is the first Octoprint version to support python 3.8

3.8 has been supported since 1.4.0, with subsequent versions added as soon as possible after release. 1.8.0 added compatibility with 3.10 I believe, and 1.8.6 has support up to 3.11. OctoPi 0.18 comes with Python 3.7, and then OctoPi 1.0 comes with 3.9 installed.

cameroncros commented 1 year ago

With v5.x being the new way forward (at least for development and support from me), I am going to close this off.