lektor / lektor-disqus-comments

Adds disqus comments to a Lektor website.
Other
10 stars 3 forks source link

Unable to install the plugin with CLI #5

Open AlexAndorra opened 3 years ago

AlexAndorra commented 3 years ago

Hi team, and thanks a lot for developing this plugin!

Bug description I just tried to install the plugin with lektor plugins add lektor-disqus-comments, but this raises NameError: name 'long' is not defined. Do you happen to have an idea of where it's coming from?

Thanks in advance for the help, and happy holidays 🎄 🎁 🍾

Packages

Full traceback

Traceback (most recent call last):
  File "/Users/alex_andorra/opt/anaconda3/envs/wedding/bin/lektor", line 10, in <module>
    sys.exit(main())
  File "/Users/alex_andorra/opt/anaconda3/envs/wedding/lib/python3.9/site-packages/lektor/cli.py", line 627, in main
    cli.main(args=args, prog_name=name)
  File "/Users/alex_andorra/opt/anaconda3/envs/wedding/lib/python3.9/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/Users/alex_andorra/opt/anaconda3/envs/wedding/lib/python3.9/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/alex_andorra/opt/anaconda3/envs/wedding/lib/python3.9/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/alex_andorra/opt/anaconda3/envs/wedding/lib/python3.9/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/alex_andorra/opt/anaconda3/envs/wedding/lib/python3.9/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/Users/alex_andorra/opt/anaconda3/envs/wedding/lib/python3.9/site-packages/click/decorators.py", line 73, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/Users/alex_andorra/opt/anaconda3/envs/wedding/lib/python3.9/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/Users/alex_andorra/opt/anaconda3/envs/wedding/lib/python3.9/site-packages/lektor/cli.py", line 505, in plugins_add_cmd
    info = add_package_to_project(project, name)
  File "/Users/alex_andorra/opt/anaconda3/envs/wedding/lib/python3.9/site-packages/lektor/packages.py", line 62, in add_package_to_project
    cfg['packages.%s' % canonical_name] = version
  File "/Users/alex_andorra/opt/anaconda3/envs/wedding/lib/python3.9/site-packages/inifile.py", line 463, in __setitem__
    self._changes[name] = self.dialect.to_string(value)
  File "/Users/alex_andorra/opt/anaconda3/envs/wedding/lib/python3.9/site-packages/inifile.py", line 172, in to_string
    if isinstance(value, (int, long, float)):
NameError: name 'long' is not defined
runfalk commented 3 years ago

This seems to be a Python 3 error in the inifile dependency (https://github.com/mitsuhiko/python-inifile/blob/master/inifile.py). Which is really weird because that has been fixed since in the current version which was released in 2017.

Your lektor version is old, but 3.1.3 did not pin the version of the inifile dependency. Have you added any other plugins? As this plugins doesn't have any dependencies I doubt that it's the cause. Did the virtualenv work before this? Could you run lektor server before adding the plugin?

How did you install lektor?

AlexAndorra commented 3 years ago

Thanks for your answer @runfalk !

Have you added any other plugins?

Yes, here are all the plugins my project has:

[packages]
lektor-markdown-header-anchors = 0.3
lektor-markdown-highlighter = 0.3
lektor-simplemde = 0.5
lektor-tags = 0.2
lektor-disqus-comments = 0.4.1

Did the virtualenv work before this? Could you run lektor server before adding the plugin?

Yes and yes. I had absolutely no problem developing the website before that. Actually, the funny thing is that I just discovered installing lektor-disqus-comments works when you add it to the .lektoproject file! It's only when you do lektor plugins add lektor-disqus-comments that it fails, with the error above 🤔

How did you install lektor?

I installed everything with an environment.yml file and conda-forge. Here it is for reference:

channels:
- conda-forge
dependencies:
- python>=3.7
- pip
- lektor
- flask
- requests
- jinja2
- werkzeug
- mamba

Does any of this help?