From 83d682ba67ee9f04ed5b2793ca277dd6c597c145 Mon Sep 17 00:00:00 2001 From: bricoletc Date: Mon, 24 Jan 2022 21:49:38 +0000 Subject: [PATCH] Update README and fixup setups * Add licence file and python requires to setup.cfg * Fix-up setup.py * Update README to reflect new backend build strategy --- README.md | 39 ++++++++++++++++++++++++++------------- setup.cfg | 2 ++ setup.py | 7 +++++-- 3 files changed, 33 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index edde10f..a51fe00 100644 --- a/README.md +++ b/README.md @@ -44,35 +44,48 @@ singularity exec "$URI" gramtools #### Latest release +We recommend installing inside a virtual environment: ```sh -VERSION="1.7.0" -wget -O - "https://github.com/iqbal-lab-org/gramtools/releases/download/v${VERSION}/gramtools-${VERSION}.tar.gz" | tar xfz - -pip install "./gramtools-${VERSION}" +python -m venv venv_gramtools && source venv_gramtools/bin/activate ``` -The latest release includes a precompiled binary for Linux. This will be used if it works on your machine, else it will get compiled during the installation. -We recommend installing inside a virtual environment: ```sh -python -m venv gram_ve && source gram_ve/bin/activate -pip install pip==20.0.2 -pip install gramtools-${VERSION} +VERSION="1.9.0" +wget -O - "https://github.com/iqbal-lab-org/gramtools/releases/download/v${VERSION}/gramtools-${VERSION}.tar.gz" | tar xfz - +pip install ./gramtools-"${VERSION}" ``` +gramtools contains a compiled backend component. The latest release includes a +precompiled backend for Linux. Run `gramtools` to see if it is compatible with your +machine. If gramtools tells you it is not, run the following to compile the backend on +your machine: + +``` +pip install conan +bash ./gramtools-"${VERSION}" +``` + +Please report any errors via the [issue tracker](https://github.com/iqbal-lab-org/gramtools/issues). #### Latest source +This will always compile the binary. + ```sh -pip install git+https://github.com/iqbal-lab-org/gramtools +git clone https://github.com/iqbal-lab-org/gramtools +pip install conan +bash ./gramtools/build.sh +pip install ./gramtools ``` -This will always compile the binary. #### Requirements -`Python >= 3.6` and `pip >= 20.0.2` +`Python >= 3.6` and `pip >= 20.0.2`. -If the binary needs to be compiled, you also need `CMake >= 3.1.2` and a C++17 +If the backend needs to be compiled, you also need `CMake >= 3.1.2` and a C++17 compatible compiler: `g++ >=8` (tested) or `clang >=7` (untested). -For `gramtools discover` to work, you additionally need `R` and `Perl` available at runtime. +For `gramtools discover` to work, you additionally need to install `py-cortex-api` (it +is installable via PyPi/pip) and have `R` and `Perl` on your $PATH. ## Usage diff --git a/setup.cfg b/setup.cfg index 907dc4e..8ad8de4 100644 --- a/setup.cfg +++ b/setup.cfg @@ -8,6 +8,7 @@ long_description = file: README.md long_description_content_type = text/markdown url = https://github.com/iqbal-lab-org/gramtools licence = MIT +licence_file = LICENCE [options] packages = find: @@ -17,6 +18,7 @@ install_requires = Cython == 0.29.16 pysam == 0.15.4 cluster_vcf_records >= 0.9.2 +python_requires = >=3.6 [options.entry_points] console_scripts = diff --git a/setup.py b/setup.py index d620937..61cab1b 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,9 @@ +import unittest +import setuptools + # For pysam to use existing htslib compiled by the backend -os.environ["HTSLIB_LIBRARY_DIR"] = str(cmake_dir / "libgramtools" / "lib") -os.environ["HTSLIB_INCLUDE_DIR"] = str(cmake_dir / "libgramtools" / "include") +# os.environ["HTSLIB_LIBRARY_DIR"] = str(cmake_dir / "libgramtools" / "lib") +# os.environ["HTSLIB_INCLUDE_DIR"] = str(cmake_dir / "libgramtools" / "include") def _test_backend(root_dir):