Skip to content

Commit

Permalink
Support ReadTheDocs
Browse files Browse the repository at this point in the history
  • Loading branch information
jdemeyer committed Apr 14, 2017
1 parent 17a768c commit 38e62d8
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 18 deletions.
2 changes: 2 additions & 0 deletions readthedocs-conda.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dependencies:
- gmp
5 changes: 5 additions & 0 deletions readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
conda:
file: readthedocs-conda.yml
python:
version: 2.7
pip_install: true
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ Cython
pytest
cysignals
flake8
git+https://github.com/jdemeyer/sphinx
39 changes: 21 additions & 18 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,42 +1,45 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from distutils.core import setup
from distutils.extension import Extension
import Cython.Build

import os
import subprocess
import sys

# When building with readthedocs, install the requirements too
# See https://github.com/rtfd/readthedocs.org/issues/2776
if "READTHEDOCS" in os.environ:
reqs = "requirements.txt"
if os.path.isfile(reqs):
subprocess.check_call([sys.executable, "-m", "pip", "install", "-r", reqs])

from distutils.core import setup
from distutils.extension import Extension
import Cython.Build

from copy import copy


# CONFIG VARIABLES

cythonize_dir = "build"

fplll = {"include_dirs": [],
"library_dirs": [],
prefix = sys.exec_prefix
include_dirs = [os.path.join(prefix, "include")]
library_dirs = [os.path.join(prefix, "lib")]

fplll = {"include_dirs": include_dirs,
"library_dirs": library_dirs,
"language": "c++",
"libraries": ["gmp", "mpfr", "fplll"],
"extra_compile_args": ["-std=c++11"],
"extra_link_args": ["-std=c++11"]}

other = {"include_dirs": [],
"library_dirs": [],
other = {"include_dirs": include_dirs,
"library_dirs": library_dirs,
"libraries": ["gmp"]}

config_pxi = []


# VIRTUALENVS

if "VIRTUAL_ENV" in os.environ:
prefix = os.environ["VIRTUAL_ENV"]
fplll["include_dirs"] = [os.path.join(prefix, "include")]
fplll["library_dirs"] = [os.path.join(prefix, "lib")]
other["include_dirs"] = [os.path.join(prefix, "include")]
other["library_dirs"] = [os.path.join(prefix, "lib")]


# QD
have_qd = False
Expand Down Expand Up @@ -123,7 +126,7 @@
ext_modules=Cython.Build.cythonize(extensions,
include_path=["src"],
build_dir=cythonize_dir,
compiler_directives={'embedsignature': True}),
compiler_directives={'binding': True}),
package_dir={"": "src"},
packages=["fpylll", "fpylll.gmp", "fpylll.fplll", "fpylll.algorithms", "fpylll.tools"],
license='GNU General Public License, version 2 or later',
Expand Down

0 comments on commit 38e62d8

Please sign in to comment.