jhkorhonen / MOODS

MOODS: Motif Occurrence Detection Suite
Other
95 stars 12 forks source link

PyPi package #14

Closed fabio-t closed 5 years ago

fabio-t commented 7 years ago

Would you consider registering MOODS on PyPi?

This would allow installation via pip.. and most importantly, would simplify installation for tools depending on MOODS.

Since you already have a setup.py, it's very easy to do.

jhkorhonen commented 7 years ago

It's a good idea. I'm chronically short on time to work on MOODS, so I can't make promises on when I can actually do this, though.

fabio-t commented 7 years ago

Thanks! If it may help, you can just register on PyPi and Test PyPi and then I'll provide you with the exact commands needed to upload the latest version. That would reduce a bit your load I guess.

jhkorhonen commented 7 years ago

I think it's better that I actually understand what I am doing, since I will probably have to maintain it in the future too :)

And it's not so much that this would take too much time, it's more that finding time I can allocate to working on MOODS is quite difficult in itself. But I'll try to get this done.

fabio-t commented 5 years ago

Hi, the lack of a PyPi package was making our RGT package installation a maintenance nightmare. I've had to apply a minor change (added a MANIFEST.in to include headers in the package, and upped the minor version) and then published it on PyPi :)

You can see it here: https://pypi.org/project/MOODS-python and install it via pip install --user moods-python.

I can give you the full ownership if you desire, for the future.

As far as the procedure goes..

1) first I made a fork, and then a "pypi-ready" branch by following your compilation instructions: https://github.com/fabio-t/MOODS/tree/pypi-ready

2) that fork is a self-contained python package, installable via python setup.py install or pip install --user ., and therefore from there you can create and publish a python distribution

3) PyPi upload:

# create the distribution package
python setup.py sdist

# install the package twine, if you haven't already
# pip2 install --user twine

# then upload to TestPyPI (you must be registered and added to the moods-python project):
twine upload --repository-url https://test.pypi.org/legacy/ dist/*

# check on https://testpypi.python.org/pypi that the release is OK
pip2 install --user --index-url https://test.pypi.org/simple/ --no-deps moods-python

# then upload to the real PyPI
twine upload dist/*

# you can now check on the real PyPI https://pypi.python.org/pypi,
# remove the test moods-python and install the real one.
# if there is a problem, you MUST up the version to release again.
# A released package on PyPi can never be "updated".
pip2 uninstall moods-python
pip2 install --user moods-python
jhkorhonen commented 5 years ago

This is great! In retrospect, I should have just let you do this earlier, since it's quite apparent that I'm not really finding enough time to work on MOODS, as I'm increasingly drifting away from bioinformatics.

If you are happy to do it, it would be great if you can maintain the PyPi package at least for now. In this case, I could add you to the GitHub page as a contact for the PyPi package?

As an aside, there's a couple of things in the develop branch that should be released as 1.9.4 update, but this has been sidelined by other academic responsibilities.

fabio-t commented 5 years ago

I'm happy to maintain it, and I can sure add more information - will do it in the next release, then, as it needs to be specified in setup.py.

It would seem a good idea to upgrade to 1.9.4 after I send a pull request to your develop branch with the setup.py modifications needed to make the package "prettier", eg I also need to check why the README wasn't recognised for the purpose of the "Project description". Should be able to do this soon, in a few days.

What was the status of 1.9.4 as you remember it? Seems like fairly minor changes to me, although without unittests I would still manually check for any regressions or changes in output.

jhkorhonen commented 5 years ago

I'm now temporarily free from various deadlines and PC duties, so I'll allocate some time for updating MOODS over this and the next week.

I found a minor bug in the variant matching code, so I'll have to fix that, and I should add some features to moods_dna.py, but this shouldn't take too much time.

fabio-t commented 5 years ago

Great news :)

jhkorhonen commented 5 years ago

There's now a rel/v1.9.4 branch that's more or less ready for release—there's some more stuff I want to add in the near future, but it's better to leave that for 1.9.5.

So if I'm not forgetting anything, we'll need to update the setup.pyand the documentation in various readmes?

fabio-t commented 5 years ago

In the setup call, you should add a "long_description" value, after loading the readme from the file.

Eg:

# read the contents of your README file
from os import path
this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, 'readme.MD'), encoding='utf-8') as f:
    long_description = f.read()

setup (name = 'MOODS-python',
       version = '1.9.4',
       description = 'MOODS: Motif Occurrence Detection Suite',
       long_description = long_description,
       long_description_content_type="text/markdown",
       maintainer = "Janne H. Korhonen",
       maintainer_email = "janne.h.korhonen@gmail.com",
       url='https://www.cs.helsinki.fi/group/pssmfind/',
       license = "GPLv3 / Biopython license",
       ext_modules = [tools_mod, scan_mod, parsers_mod],
       packages = ["MOODS"],
)

This would show the README content on the PyPi package page.

You may also want to add the classifiers (a list of strings) and keywords (a string of comma-separated words) as additional fields to setup():

classifiers=["Topic :: Scientific/Engineering :: Bio-Informatics"]
keywords="PWM, PSSM, motif scan"

When you are happy with the changes and merged to master, I will update the PyPi package :)

fabio-t commented 5 years ago

Oh, and I forgot to reply to this:

In this case, I could add you to the GitHub page as a contact for the PyPi package?

How course it'd be happy to be the PyPi contact, so to speak. Feel free to tag me in if people raise issues here on github.

jhkorhonen commented 5 years ago

I added moods-dna.py as a script to setup.py so that it will be included in the PyPi package as a command line utility. I'll still have to check that this works in a sensible way and possibly adjust some file names. (Ideally this should be implemented using entry points, but leaving that for the next update for now.)

jhkorhonen commented 5 years ago

MOODS 1.9.4 is out now, sorry for the delays.