-
Notifications
You must be signed in to change notification settings - Fork 60
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
pip install #100
Comments
Conda is used mainly because of rdkit usage in the molecule/smile/inchi functions. If matchms was on pypi you would need to install RDKit without using conda. Installing rdkit without conda is hard so we choose to not have a pypi package. We could make those rdkit dependent functions dynamically check if rdkit is installed and give an error when rdkit is missing, but this could be surprising and hard to document. |
I agree, installing RDKit without Conda is very annoying. However, only a minority of people consistently use Conda as package manager (unfortunately). At least providing the more general way to install matchms using pip gives those users the option to still be able to install it. They'll have to figure out how to get the RDKit dependency themselves. |
We can indeed consider to add a "matchms light" version to pip. from filtering
from similarity
The main gain I see is as @bittremieux said the higher accessibility for potential future users. |
This has become a bit more important now, since I see two ways how we could do it:
For the user that would not change too much. The importing might become a bit different, such as from matchms.filtering import normalize_intensitites
from matchms_chemistry.filtering import repair_inchi_inchikey_smiles
...
Let me know if you have any ideas or opinions on this @sverhoeven, @jspaaks, @fdiblen ? |
As you know we initially started to make a pip package. As far as I remember |
I would go with option 2 In other libraries I have seen methods not working because of missing dependencies and I don't mind it as long it is not the main functionality of the library. Documenting rdkit requirement and giving a warning when rdkit is missing when trying to access a rdkit powered method, is workable for me, but maybe not for others. It will make it much easier to publish using the https://github.com/NLeSC/python-template/blob/master/%7B%7Bcookiecutter.project_slug%7D%7D/.github/workflows/pypi.yml workflow. In the future we can make this repo pip only and have conda package on conda-forge using https://github.com/conda-forge/staged-recipes . We will need to remove bioconda channel as conda-forge package can not depend on other channels, can be fixed by installing pyteomics as pip package. Using a conda-forge recipe will be much less maintenance for us as they will maintain all the CI stuff. We will throw away a lot of work in this repo, but I think we should learn to let it go, let it go. |
I agree with @sverhoeven that option 2 would be the better one. The chemistry functionality is relatively minor and would be pretty small to extract into its own package. Also, then you'd have additional overhead by having to manage two packages instead of one. Giving a relevant error message when a user tries to use functions that require RDKit should be quite clear for most developers. Alternatively to conda-forge, you can also create a Bioconda package as it allows dependencies from the defaults, conda-forge, and bioconda channels. And if you have a |
Thanks for the feedback so far! try:
import rdkit
except ImportError:
_has_rdkit = False
else:
_has_rdkit = True And then add raise an error when the actual function is called? def add_fingerprint(....):
if not _has_rdkit:
raise ImportError("Conda package 'rdkit' is required for this functionality.") |
Yes indeed, that's pretty much what I'd recommend. You can specify RDKit as a dependency for |
(slowly) started working on this in PR #148 |
First version should be ready soon #148 |
Updates were merged (PR #148) and |
Besides via conda, it would be useful to submit matchms to PyPI as well so that non-conda users can easily install it using pip.
The text was updated successfully, but these errors were encountered: