question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Does Lektor assume too much?

See original GitHub issue

When running Lektor, it tries to solve so many things that – I believe – shouldn’t be solved by it:

It tries to reinvent Python packaging using a non-standard installation instruction curl -sf https://www.getlektor.com/install.sh | sh. Why? virtualenv, conda and pip solve this problem way better than Lektor ever can.

When running lektor server, it runs pip install. Why? I have a requirements.txt file and ran pip install myself three seconds ago.

Then it tries to install extra packages in packages/ (and often fails to update them because of cached files). Again, why? Shouldn’t I install them using pip install -e? And why do they have to be in packages/ anyways? I believe the location of a package should not matter for pip, and if I used pip install -e they could be anywhere.

Then lektor-webpack-support tries to run yarn install or npm install (and does so badly), and then webpack --watch. This is not an issue with Lektor, but an example of how this “let’s solve all the things” approach trickles down into plugins as well. Yes, you may run webpack --watch, but I should run yarn install.

I propose to get rid of most of these things, and replace them with standard Python packaging tools. That way Lektor will have to solve less problems, have a smaller code surface and less possibilities for issues and and will be easier to maintain. Also, when exclusively using standard installation tools, Lektor installations will be easier to maintain and understand for people who understand pip (everybody I assume?).

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
nixjdmcommented, May 2, 2018

In general, Lektor should be easy to run and setup, even for non-technical people.

Shouldn’t I install them using pip install -e

Packages (plugins) need to be known to Lektor. If they are in packages/ that is one way for them to be discovered. They can also be installed with lektor plugin add. Internally, the first does install the package with pip install --editable, and in the later, it simply uses pip install to grab it from pypi. On the file system, the later is in a cached dir, and not packages/. Lektor is aware of both locations so it can invoke the plugins when run.

Lektor could be enhanced to use a package that is installed by a manual pip install. Lektor would still have to be told where/how to find it though. Presumably with an addition to the projectfile, similar to a settings.py in Django. The location doesn’t really matter, so long as Lektor knows what the location is (or it’s name if installed in the env - something to discover it by).

Lektor installations will be easier to maintain and understand for people who understand pip

That’s true, the project would be smaller and easier to maintain. However, this is not the exclusive target audience. I believe the original hope (which I share) was to make Lektor accessible to a wider group of people, and not just people comfortable with Python (and pip). It’s part of what sets Lektor apart from other projects like Django or Pelican. It should be possible to build a Lektor site without knowledge of Python.

All that said, I recently accepted a pull request to make plugin development easier to some Python devs. Similarly, if there are ways to make things easier for people who do know Python (or front end devs), then I want to.

0reactions
davidismcommented, May 23, 2018

I’d say close this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Will i ever get used to the lektor? : r/learnpolish - Reddit
I think one of the problems is that the lektor voiceover rarely 100% matches up with whoever is talking. Sometimes it's a bit...
Read more >
Is there a reason Lektor is so strict about plugin distribution ...
No, I don't think my distribution would have to require lektor, so long as care is taken to make sure the rest of...
Read more >
Hugo vs Lektor? - support
:confused: To be honest, Lektor was quite straightforward to create a site with and theme, but it seems to have much less momentum...
Read more >
lektor/lektor - Gitter
I think it's currently buggy. It should fail loudly when the project is not in the right state, but it doesn't always. I'll...
Read more >
What do job titles mean abroad? - The Philosophers' Cocoon
Basically there are are two kinds of permanent positions: lektor ("lecturer") or professor ("full professor"). A lektor can however either be ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found