[med-svn] [python-cobra] 01/03: Imported Upstream version 0.5.8
Afif Elghraoui
afif at moszumanska.debian.org
Tue Dec 13 07:34:14 UTC 2016
This is an automated email from the git hooks/post-receive script.
afif pushed a commit to branch master
in repository python-cobra.
commit dd7da32c13154ea7d247e84f6993ec11202f6d61
Author: Afif Elghraoui <afif at debian.org>
Date: Mon Dec 12 22:32:15 2016 -0800
Imported Upstream version 0.5.8
---
INSTALL.rst | 29 +++++++++++++++++++++++++----
cobra/VERSION | 2 +-
cobra/test/__init__.py | 13 ++++++++++---
develop-requirements.txt | 1 +
setup.py | 1 +
5 files changed, 38 insertions(+), 8 deletions(-)
diff --git a/INSTALL.rst b/INSTALL.rst
index 869902f..fb43ae7 100644
--- a/INSTALL.rst
+++ b/INSTALL.rst
@@ -50,7 +50,7 @@ Get the `detailed contribution instructions <CONTRIBUTING.rst>`_ for contributin
Installation of optional dependencies
=====================================
-Optional Dependencies
+Optional dependencies
~~~~~~~~~~~~~~~~~~~~~
On windows, these can downloaded from [this site]
@@ -71,6 +71,15 @@ yum).
4. `scipy <http://scipy.org>`_ >= 0.11 for ArrayBasedModel and saving to \*.mat files.
- `Windows scipy installer <http://www.lfd.uci.edu/~gohlke/pythonlibs/#scipy>`_
+5. `pytest <http://docs.pytest.org/en/latest/>`_ and `pytest-benchmark
+ <http://pytest-benchmark.readthedocs.io/en/latest/>`_ are required
+ for testing
+
+You can install all packages directly by
+
+.. code:: shell
+
+ pip install "cobra[all]"
Other solvers
~~~~~~~~~~~~~
@@ -103,8 +112,20 @@ using rational operations, giving exact solutions.
Testing your installation
=========================
-1. Start python
-2. Type the following into the Python shell
+While it is not a hard requirement for using cobrapy, you need pytest and
+pytest-benchmark to run its tests. First do
+
+.. code:: shell
+
+ pip install pytest pytest-benchmark
+
+or to install cobrapy directly with the test dependencies
+
+.. code:: shell
+
+ pip install "cobra[test]"
+
+Then start python and type the following into the Python shell
.. code:: python
@@ -112,4 +133,4 @@ Testing your installation
test_all()
You should see some skipped tests and expected failures, and the
-function should return ``False``.
+function should return ``True``.
diff --git a/cobra/VERSION b/cobra/VERSION
index b49b253..659914a 100644
--- a/cobra/VERSION
+++ b/cobra/VERSION
@@ -1 +1 @@
-0.5.6
+0.5.8
diff --git a/cobra/test/__init__.py b/cobra/test/__init__.py
index e30f8bb..5e6d441 100644
--- a/cobra/test/__init__.py
+++ b/cobra/test/__init__.py
@@ -1,6 +1,10 @@
from os.path import join, abspath, dirname
from cobra.io import read_sbml_model
-import pytest
+try:
+ import pytest
+ import pytest_benchmark
+except ImportError:
+ pytest = None
try:
from cPickle import load as _load
except ImportError:
@@ -38,5 +42,8 @@ def create_test_model(model_name="salmonella"):
def test_all():
""" alias for running all unit-tests on installed cobra
"""
- return pytest.main(
- ['--pyargs', 'cobra', '--benchmark-skip', '-v', '-rs']) == 0
+ if pytest:
+ return pytest.main(
+ ['--pyargs', 'cobra', '--benchmark-skip', '-v', '-rs']) == 0
+ else:
+ raise ImportError('missing package pytest required for testing')
diff --git a/develop-requirements.txt b/develop-requirements.txt
index 2380179..cb2a77b 100644
--- a/develop-requirements.txt
+++ b/develop-requirements.txt
@@ -14,3 +14,4 @@ tabulate
tox
pep8
pytest
+pytest-benchmark
diff --git a/setup.py b/setup.py
index 173c115..3efc7af 100644
--- a/setup.py
+++ b/setup.py
@@ -136,6 +136,7 @@ extras = {
'matlab': ["pymatbridge"],
'sbml': ["python-libsbml", "lxml"],
'array': ["numpy>=1.6", "scipy>=0.11.0"],
+ 'test': ["pytest", "pytest-benchmark"],
'display': ["matplotlib", "palettable", "pandas>=0.17.0", "tabulate"]
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/python-cobra.git
More information about the debian-med-commit
mailing list