Skip to content

Commit dd4bc6e

Browse files
authored
Merge pull request #16 from pycompression/readthedocs
Create documentation on readthedocs.
2 parents 3803437 + 746f771 commit dd4bc6e

File tree

6 files changed

+43
-3
lines changed

6 files changed

+43
-3
lines changed

.readthedocs.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
version: 2
2+
formats: [] # Do not build epub and pdf
3+
4+
python:
5+
install:
6+
- method: pip
7+
path: .
8+
conda:
9+
environment: docs/conda-environment.yml

.travis.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
11
language: python
2-
dist: focal
2+
3+
before_install:
4+
# Install conda
5+
- export MINICONDA=${HOME}/miniconda
6+
- export PATH=${MINICONDA}/bin:${PATH}
7+
- wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
8+
- bash miniconda.sh -b -f -p ${MINICONDA}
9+
- conda config --set always_yes yes
10+
- conda config --add channels defaults
11+
- conda config --add channels conda-forge
312

413
install:
5-
- sudo apt-get update && sudo apt-get install -y libisal-dev
6-
- pip install tox
14+
- conda create -n python-isal python=$TRAVIS_PYTHON_VERSION tox isa-l
15+
- source activate python-isal
716

817
python: 3.6 # Use the oldest supported version of python as default.
918
script:

CHANGELOG.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Changelog
99
1010
version 0.1.0-dev
1111
-----------------
12+
+ Publish API documentation on readthedocs.
1213
+ Add API documentation.
1314
+ Ensure the igzip module is fully compatible with the gzip stdlib module.
1415
+ Add compliance tests from CPython to ensure isal_zlib and igzip are validated

README.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
.. image:: https://readthedocs.org/projects/python-isal/badge
2+
:target: https://python-isal.readthedocs.io
3+
:alt:
4+
5+
16
python-isal
27
===========
38

@@ -48,6 +53,9 @@ They can be imported as follows
4853
their api and functions are the same as the stdlib's modules. Except where
4954
isa-l does not support the same calls as zlib (See differences below).
5055

56+
A full API documentation can be found on `our readthedocs page
57+
<https://python-isal.readthedocs.io>`_.
58+
5159
``python -m isal.igzip`` implements a simple gzip-like command line
5260
application (just like ``python -m gzip``).
5361

docs/conda-environment.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name: rtd
2+
channels:
3+
- conda-forge
4+
- defaults
5+
dependencies:
6+
- isa-l
7+
- python >=3.6
8+
- sphinx
9+
- setuptools

setup.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
# SOFTWARE.
2020

2121
import os
22+
import sys
2223
from pathlib import Path
2324

2425
from setuptools import Extension, find_packages, setup
@@ -29,6 +30,9 @@
2930
CONDA_PREFIX = os.environ.get("CONDA_PREFIX")
3031
if CONDA_PREFIX:
3132
EXTENSION_OPTS["include_dirs"] = [os.path.join(CONDA_PREFIX, "include")]
33+
if os.environ.get("READTHEDOCS"):
34+
# Readthedocs uses a conda environment but does not activate it.
35+
EXTENSION_OPTS["include_dirs"] = [os.path.join(sys.exec_prefix, "include")]
3236

3337
setup(
3438
name="isal",

0 commit comments

Comments
 (0)