HCGB-IGTP / XICRA

Small RNAseq pipeline for paired-end reads
MIT License
7 stars 3 forks source link

Fix setup.py #4

Closed JFsanchezherrero closed 3 years ago

JFsanchezherrero commented 3 years ago

Add python packages directly from requirements.txt file and avoid setting the code in setup.py: https://github.com/HCGB-IGTP/XICRA/blob/d5348dc00eac1a279fb3542d90ea93d056a9eeea/XICRA_pip/setup.py#L31-L33

Set VERSION to be retrieved from VERSION file https://github.com/HCGB-IGTP/XICRA/blob/d5348dc00eac1a279fb3542d90ea93d056a9eeea/XICRA_pip/setup.py#L10

Check examples on how to add VERSION and requierements in BacterialTyper setup.py

def get_require_modules():
    """
    Get main python requirements modules
    """
    with open("./BacterialTyper/config/python/python_requirements_summary.csv", 'r') as f:
        myModules = [line.strip().split(',')[0] for line in f]

    return myModules

def get_version():
    """
    Original code: PhiSpy setup.py 
    https://github.com/linsalrob/PhiSpy/blob/master/setup.py
    """
    with open("VERSION", 'r') as f:
        v = f.readline().strip()
    return v

Then in setup()

setup(
    version=get_version(),
    install_requires=get_require_modules()
    ....
)
JFsanchezherrero commented 3 years ago

It is done already!