Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nikola plugin --upgrade broken #3737

Closed
msghens opened this issue Jan 12, 2024 · 6 comments · Fixed by #3738
Closed

nikola plugin --upgrade broken #3737

msghens opened this issue Jan 12, 2024 · 6 comments · Fixed by #3738
Assignees
Milestone

Comments

@msghens
Copy link
Contributor

msghens commented Jan 12, 2024

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'
@Kwpolska
Copy link
Member

Kwpolska commented Jan 12, 2024

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

@Kwpolska Kwpolska self-assigned this Jan 12, 2024
@Kwpolska Kwpolska added this to the v8.3.1 milestone Jan 12, 2024
@felixfontein
Copy link
Contributor

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.

@Kwpolska
Copy link
Member

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.

@Mte90
Copy link
Contributor

Mte90 commented Feb 13, 2024

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
Copy link
Contributor

Mte90 commented Mar 26, 2024

just a ping

Kwpolska added a commit that referenced this issue Apr 29, 2024
@Kwpolska
Copy link
Member

Released v8.3.1 with a fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants