nikola icon indicating copy to clipboard operation
nikola copied to clipboard

nikola plugin --upgrade broken

Open msghens opened this issue 1 year ago • 4 comments

Environment

Python Version: Python 3.8.10

Nikola Version: Nikola v8.3.0

Operating System: Windows Subsystem for Linux

NAME="Ubuntu" VERSION="20.04.6 LTS (Focal Fossa)" ID=ubuntu ID_LIKE=debian PRETTY_NAME="Ubuntu 20.04.6 LTS" VERSION_ID="20.04"

Description:

When command nikola plugin --upgrade is run in a site directory, I get:

 nikola plugin --upgrade
[2024-01-12 06:32:54] WARNING: plugin: This is not very smart, it just reinstalls some plugins and hopes for the best
Traceback (most recent call last):
  File "/home/msghens/nik/lib/python3.8/site-packages/doit/doit_cmd.py", line 294, in run
    return command.parse_execute(args)
  File "/home/msghens/nik/lib/python3.8/site-packages/doit/cmd_base.py", line 150, in parse_execute
    return self.execute(params, args)
  File "/home/msghens/nik/lib/python3.8/site-packages/nikola/plugin_categories.py", line 131, in execute
    return self._execute(options, args)
  File "/home/msghens/nik/lib/python3.8/site-packages/nikola/plugins/command/plugin.py", line 152, in _execute
    return self.do_upgrade(url)
  File "/home/msghens/nik/lib/python3.8/site-packages/nikola/plugins/command/plugin.py", line 200, in do_upgrade
    for plugin in self.site.plugin_manager.getAllPlugins():
AttributeError: 'PluginManager' object has no attribute 'getAllPlugins'

msghens avatar Jan 12 '24 14:01 msghens

Gotta love dynamic languages that let you have obviously broken code. (Fix in PR #3738)

Kwpolska avatar Jan 12 '24 19:01 Kwpolska

Gotta love dynamic languages that let you have obviously broken code. (Fix in PR #3738)

I guess we should add a type checker like mypy to CI.

felixfontein avatar Jan 12 '24 22:01 felixfontein

I agree mypy would be a great addition, but very few places in Nikola have types, and we probably have a bunch of hacks that were considered Pythonic back in the day, but don’t really work in a fully-typed environment; or who-cares-about-structure things like tuples or dicts instead of classes. mypy currently produces a ton of warnings even without --strict. I opened #3739 for future work on type annotations.

Kwpolska avatar Jan 12 '24 22:01 Kwpolska

This will fix also this error?

 mte90    nikola plugin
[2024-02-13 10:10:54] ERROR: Nikola: Unknown command plugin
[2024-02-13 10:10:54] INFO: Nikola: Did you mean "clean"?

With the latest 8.3.0

Mte90 avatar Feb 13 '24 09:02 Mte90

just a ping

Mte90 avatar Mar 26 '24 09:03 Mte90

Released v8.3.1 with a fix.

Kwpolska avatar Apr 29 '24 12:04 Kwpolska