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

Wrong way to install dependencies of plugins #865

Closed
dwt opened this issue Jan 22, 2021 · 2 comments · Fixed by #1065
Closed

Wrong way to install dependencies of plugins #865

dwt opened this issue Jan 22, 2021 · 2 comments · Fixed by #1065

Comments

@dwt
Copy link

dwt commented Jan 22, 2021

Hi there,

I've got the problem, that I can't install a local version of the Lektor-atom plugin, as it has an extras_requireof test.

This leads to a egg.info/requires.txt of

MarkupSafe
feedgenerator

[test]
lxml
pytest

Which of course is no valid requirements.txt file that pip can use, which then leads to an explosion when this is installed here.

I am not entirely sure what the correct way to consume this information is, but I suspect that one should go about using the pkg_resources package. Quick googling has provided this stackoverflow which looks promising.

@dwt
Copy link
Author

dwt commented Jan 29, 2021

Thinking about this more - it seems that Lektor is doing quite a bit of package managing itself - wouldn't it be much more simple if it merely creates a virtualenv and then uses pip to install the dependencies there directly instead of generating the egg_info, fetching the dependencies out of that and then installing them by hand?

I mean, I could easily send a pull request that filters out everything in those requirements after the first line that starts with '[' - but what you guys do there seems a bit excessive.

@dwt
Copy link
Author

dwt commented Feb 11, 2021

After finding and documenting the original bugs that triggered @mitsuhiko to take this approach, I have decided that cleaning the requires.txt file to become nearer to a requirements.txt file to be the simplest approach. What do y'all think?

dwt added a commit to dwt/lektor that referenced this issue Feb 18, 2021
dwt added a commit to dwt/lektor that referenced this issue Oct 21, 2021
dairiki added a commit to dairiki/lektor that referenced this issue Apr 16, 2023
The most recent version of pip (23.1) removes support for the
`--install-option` parameter to `pip install`.  This breaks our
`install_local_package` function, which uses `--install-option`
because `pip install --target` didn't used to work with `pip install
--editable`.

As it turns out, recent versions of pip support the use of `--target`
with `--editable`.  So here we make use of that.

Note that this also relieves us of the need to parse our local
plugin requirements ourselves (thus, hopefully, fixing lektor#865.)
dairiki added a commit to dairiki/lektor that referenced this issue Apr 16, 2023
The most recent version of pip (23.1) removes support for the
`--install-option` parameter to `pip install`.  This breaks our
`install_local_package` function, which uses `--install-option`
because `pip install --target` didn't used to work with `pip install
--editable`.

As it turns out, recent versions of pip support the use of `--target`
with `--editable`.  So here we make use of that.

Note that this also relieves us of the need to parse our local
plugin requirements ourselves (thus, hopefully, fixing lektor#865.)
dairiki added a commit to dairiki/lektor that referenced this issue Apr 16, 2023
The most recent version of pip (23.1) removes support for the
`--install-option` parameter to `pip install`.  This breaks our
`install_local_package` function, which uses `--install-option`
because `pip install --target` didn't used to work with `pip install
--editable`.

As it turns out, recent versions of pip support the use of `--target`
with `--editable`.  So here we make use of that.

Note that this also relieves us of the need to parse our local
plugin requirements ourselves (thus, hopefully, fixing lektor#865.)
dairiki added a commit to dairiki/lektor that referenced this issue Apr 16, 2023
The most recent version of pip (23.1) removes support for the
`--install-option` parameter to `pip install`.  This breaks our
`install_local_package` function, which uses `--install-option`
because `pip install --target` didn't used to work with `pip install
--editable`.

As it turns out, recent versions of pip support the use of `--target`
with `--editable`.  So here we make use of that.

Note that this also relieves us of the need to parse our local
plugin requirements ourselves (thus, hopefully, fixing lektor#865.)
dairiki added a commit that referenced this issue Apr 16, 2023
* test: add test for lektor.packages.install_local_package

* fix(packages): fix local plugin installation

The most recent version of pip (23.1) removes support for the
`--install-option` parameter to `pip install`.  This breaks our
`install_local_package` function, which uses `--install-option`
because `pip install --target` didn't used to work with `pip install
--editable`.

As it turns out, recent versions of pip support the use of `--target`
with `--editable`.  So here we make use of that.

Note that this also relieves us of the need to parse our local
plugin requirements ourselves (thus, hopefully, fixing #865.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant