Skip to content

Try out Pipenv#327

Closed
yagebu wants to merge 5 commits intomasterfrom
pipenv
Closed

Try out Pipenv#327
yagebu wants to merge 5 commits intomasterfrom
pipenv

Conversation

@yagebu
Copy link
Member

@yagebu yagebu commented Sep 19, 2021

This is an attempt to see if pipenv can be a safer alternative to using Lektor's builtin plugin mechanism to build the site.

Edit: I've personally been using pipenv for a while now for my personal Lektor projects and it's been a joy to use (just like poetry would be as well I guess). I know my dependencies are locked and will work unless I explicitly try to upgrade. I think the same would work well for this repo - these updates could be automated with dependabot or renovate.

@yagebu yagebu force-pushed the pipenv branch 5 times, most recently from 4ec0f84 to 30b20dc Compare February 20, 2022 14:50
@yagebu yagebu force-pushed the pipenv branch 2 times, most recently from 65f5116 to a171900 Compare April 2, 2022 09:11
@dairiki dairiki force-pushed the master branch 2 times, most recently from 75792c7 to 7b6c4b0 Compare July 27, 2022 20:00
@yagebu yagebu force-pushed the pipenv branch 2 times, most recently from 852bc02 to f942358 Compare September 3, 2022 11:46
@yagebu
Copy link
Member Author

yagebu commented Sep 3, 2022

Please consider Poetry as well.

I did consider poetry. I don't think there's much difference between the tools for this use case and I've just had more experience with pipenv, which has worked very well for my lektor projects.

@yagebu yagebu requested a review from dairiki September 3, 2022 15:25
@dairiki
Copy link
Contributor

dairiki commented Sep 3, 2022

@yagebu I do think this is the way of the future. Much cleaner, more stable. Great work.

We should almost definitely work on moving Lektor out of the package management business and in this direction. Because of backward compatibility concerns, we'll probably first have to deprecate Lektor's plugin management facilities, and update Lektor's documentation to describe and recommend doing things without using Lektors plugin management: i.e. using pipenv (or poetry, or plain old pip) to manage a virtualenv for each Lektor project.

Before we've done that, my gut feeling is that we should be eating our own dog food here. It's good to have lektor-website as an example of the recommended/canonical way to put together a Lektor project. As long as the Lektor docs still recommend the use of lektor plugins add, dropping local plugins into packages/, etc. it is confusing (and looks a little bad) to use a completely different method of managing plugins here.

@dairiki
Copy link
Contributor

dairiki commented Jul 19, 2023

FWIW, I am now managing all of the Lektor sites (and most of my Python projects, in general) with PDM. It's working very well for me.
(For a while, I tried using poetry with some of my projects and PDM with others. PDM worked better for me, so I've now converted them all to PDM.)

PDM has matured to the point where I think it works very well. PDM is a generation more developed that pipenv, so supports things like scripts, dev requirements, etc. pretty well.

E.g. from a clean clone of a project repo, when properly configured, all that is necessary is:

# create venv, install requirements (from pdm.lock)
pdm install

# run the `server` script, defined in pyproject.toml, e.g. `lektor server`
pdm server

There is a github action that makes use of PDM in Github workflows straightforward.

For me, PDM has advantages over poetry in that it's more recent, so more standards-based (e.g. PEP 621 support). It is under active maintenance and development. And it makes more sense to me — for whatever reason, I can figure out the appropriate PDM command to accomplish a task easier than with poetry.

If, for comparison, you'd like me to come up with an equivalent PR to this one, except using PDM, let me know.
For comparison, #377 is a roughly equivalent PR that uses PDM rather than Pipenv.

@yagebu
Copy link
Member Author

yagebu commented Jun 22, 2024

Closing this one, I'm not motivated to follow up on this one. I'm not using pipenv myself anymore to manage my Lektor environments, rather I'm just using plain old virtualenvs (using uv for speed). Not against using PDM instead.

@yagebu yagebu closed this Jun 22, 2024
@yagebu yagebu deleted the pipenv branch June 22, 2024 11:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants