Skip to content

Commit

Permalink
Update README and fixup setups
Browse files Browse the repository at this point in the history
* Add licence file and python requires to setup.cfg
* Fix-up setup.py
* Update README to reflect new backend build strategy
  • Loading branch information
bricoletc committed Jan 24, 2022
1 parent bedd00a commit 83d682b
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 15 deletions.
39 changes: 26 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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 =
Expand Down
7 changes: 5 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -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):
Expand Down

0 comments on commit 83d682b

Please sign in to comment.