From 36156a49062f344bee22bd87310b5e03f0955c5d Mon Sep 17 00:00:00 2001 From: Vivien Maisonneuve Date: Mon, 16 Jun 2014 18:33:25 +0200 Subject: [PATCH] Makefile for virtualenv --- .gitignore | 3 ++- Makefile | 12 +++++++++++- pypol/.gitignore | 1 + pypol/linear.py | 5 +++-- setup.py | 2 +- 5 files changed, 18 insertions(+), 5 deletions(-) create mode 100644 pypol/.gitignore diff --git a/.gitignore b/.gitignore index d93c13c..6e4e70b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ /build/ /dist/ /MANIFEST +/pypol.egg-info/ +/venv/ __pycache__ -/venv diff --git a/Makefile b/Makefile index 8b3f1c4..edb6c69 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,6 @@ PYTHON=python3 +PIP=pip3 +VIRTUALENV=pyvenv RM=rm -rf .PHONY: default @@ -15,4 +17,12 @@ test: .PHONY: clean clean: - $(RM) build dist MANIFEST pypol/__pycache__ tests/__pycache__ venv + $(RM) build dist MANIFEST venv + $(RM) pypol.egg-info pypol/islhelper.*.so pypol/__pycache__ + $(RM) tests/__pycache__ + +.PHONY: venv +venv: + $(RM) venv + $(VIRTUALENV) venv + . venv/bin/activate; $(PIP) install -e . diff --git a/pypol/.gitignore b/pypol/.gitignore new file mode 100644 index 0000000..1476115 --- /dev/null +++ b/pypol/.gitignore @@ -0,0 +1 @@ +/islhelper.*.so diff --git a/pypol/linear.py b/pypol/linear.py index be30fad..e69600f 100644 --- a/pypol/linear.py +++ b/pypol/linear.py @@ -1,11 +1,12 @@ import functools import numbers -import json import ctypes, ctypes.util -from pypol import isl, islhelper from fractions import Fraction, gcd +from . import isl, islhelper + + libisl = ctypes.CDLL(ctypes.util.find_library('isl')) libisl.isl_printer_get_str.restype = ctypes.c_char_p diff --git a/setup.py b/setup.py index 08587b7..57aa813 100755 --- a/setup.py +++ b/setup.py @@ -8,6 +8,6 @@ setup( author='MINES ParisTech', packages=['pypol'], ext_modules = [ - Extension('pypol/islhelper', sources=['pypol/islhelper.c']) + Extension('pypol.islhelper', sources=['pypol/islhelper.c']) ] ) -- 2.20.1