klamt-lab / autopacmen

Retrieves kcat data and adds protein allocation constraints to stoichiometric metabolic models according to the sMOMENT method
Apache License 2.0
12 stars 7 forks source link

pip install does not actually install package sources #4

Closed yaccos closed 3 years ago

yaccos commented 3 years ago

When running pip install autopacmen-Paulocracy, all dependencies are installed as well as the package metadata. However, none of the actual scripts in the package are installed. When checking the Pypi index and downloading the sources, it turns out that the sources from Pypi do not include the scripts, only the package metadata. The same problem appears when cloning this repository and using pip to install the package locally.

Paulocracy commented 3 years ago

Hello yaccos and first of all thank you for all your helpful issues :D You're right that the pip command doesn't work properly D:, as I found out I forgot to add an argument for setuptools.setup() in setup.py so that the files where not included. I just pushed a commit which should fix the issue, and the next release (in a few minutes) should have this issue fixed. If not or if other issues arise, you may gladly let me know!

yaccos commented 3 years ago

I am sorry that your patch does not work properly. Adding the argument for setuptools.setup() does indeed make the package include the scripts. However, the autopacmen package does still not export any of its functions. These functions must be explictly specified in the __init__.py file using import directories. For instance, if you want to export the function parse_bigg_metabolites_file, you must specify from .submodules.parse_bigg_metabolites_file import parse_bigg_metabolites_file (note the leading dot). In addition you must add a leading dot on line 24 in submodules/parse_bigg_metabolites_file.py, making it read: from .helper_general import json_write, standardize_folder .helper_general import json_write, standardize_folder. Rince and repeat for all the other function and variables (including examples) you want to be public by the package.

Paulocracy commented 3 years ago

Hello again \o/ After several tries and reconsiderations, I just released a new version of AutoPACMEN (0.6.0) in which the repository's code is reorganized so that it should work better as a pip package. Importantly, the internal referencing for AutoPACMEN's modules should work now. However, I did not make any functions "public" since I wanted to keep the repository's structure transparent in the module, i.e., autopacmen.submodules has still to be called. If you find any new or still existing issues, you may - as always - gladly let me know!

yaccos commented 3 years ago

Thank you very much for your help and effort. Now it seems like the pip package finally works. Personally, I have no problems with the decision to keep the repository structure transparant in the package. However, I might assume that somebody will find it a bit user-hostile to write statements such as from autopacmen.submodules.create_smoment_model_reaction_wise import create_smoment_model_reaction_wise_with_sbml. Again, this is not a problem for me.