-
Notifications
You must be signed in to change notification settings - Fork 292
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
Requirements installation #423
Comments
hey @pslacerda |
numpy will always be installed, so all code similar to the following should be removed try:
import numpy as np
... |
@ye11owSub, I forgot to mention that these mechanisms are for plugin requeriments. Like in the Vina plugin: https://pymolwiki.org/index.php/Vina |
@pslacerda |
Yes, numpy specifically is already shipped with PyMOL by default, however the pip mechanism allow the installation of plugins requeriments from PyPI.org other than numpy. The snippets are only illustrative, but suggests the workaround for regular pip packages, conda packages (like from conda-forge) and zip packages (like wheel and github zip packages). |
A while back one idea that I had for "Package Manager V2" was user-friendlier handling of dependencies like these so users wouldn't have to do much manual work. One of them was to specify them in some sort of text file for PyMOL to read and install from (similar to an environments/requirement that pip and conda uses); or have something that parses the plugin files to create a dependency tree and install missing packages from there. I'm assuming your approach would require changes to the plugins themselves? |
In this case, I see two options for installing specific dependencies:
[project.optional-dependencies]
scripts = [
"a==1.2.3",
"b==4.5.6",
"c==7.8.9",
] The installation process will look like: |
@JarrettSJohnson the idea of a better Package Manager is sound. Maybe requirements may be declared on the single file docstring. """
= vina.py =
This plugin enables small scale virtual screening with the AutoDock Vina
software stack. It uses Meeko and Scrubber to prepare molecular ligands,
and PLIP to analyze the results.
It was tested on PyMOL 3.0 with Python 3.10. Currently supports only
Linux and probably Mac.
@author Pedro Sousa Lacerda
@email [email protected]
@pip_requires
meeko
https://github.com/forlilab/scrubber/archive/refs/heads/develop.zip
@conda_requires
conda-forge::vina>=3
openbabel==3.1.1
""" Or maybe install by function calls declared on the code preceding the import. This approach works for single- and multi-file plugins with not much noise in the code. from pymol import cmd as pm
pm.pip_requires([
"meeko==0.6.1",
"https://github.com/forlilab/scrubber/archive/refs/heads/develop.zip"
])
pm.conda_requires([
"conda-forge::vina>=3",
"openbabel==3.1.1"
]) @ye11owSub |
What do you mean by that? Why? |
|
How proposed solutions resolve conflicts? I have no idea. Even if all requirements from all plugins are requested to pip or conda on a single call, conflicts could happens. |
@JarrettSJohnson, the require directives could check if is a clean install and fail otherwise. Edit: It isn't a solution for the function call solution because it could upgrade to unwanted versions. All previously installed plugins requirements must be analyzed together. |
It's the same thing. This approach will only work if you want to run a script separately from everything else, like a "one time run"
You could store all the dependencies in the |
They're very similar indeed despite I prefer my docstring approach because looks prettier. However many single file PyMOL plugins (in the sense that extends PyMOL via
This approach you stated is the one i used on the DRUGpy plugin, however the install is slightly different. |
I mean, it's the same thing. We both provided a link to PEP 723.
my idea is:
You can name this group of dependencies whatever you want. "scripts" sounds like a suitable name for this.
I'm using the
I think none of these examples would be appropriate. You should not force a user to update, install, or remove anything during runtime. |
They're similar but are different. Despite being uglier and already have a tool fully developed, PEP 723 requires more character typing and don't support Anaconda/Mamba.
Most PyMOL-Scripts-Repo don't require third-party packages. Also they aren't "one time run" scripts, but plugins extending PyMOL with
The user isn't being forced, he/she's installing a given plugin along with its dependencies. |
Hi,
PyMOL deserves a package requirement installation engine for plugins. The following code snippets are the main mechanisms of package installation.
The text was updated successfully, but these errors were encountered: