-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from phobson/maint-0.2.x
test clean up and better conda recipe
- Loading branch information
Showing
9 changed files
with
145 additions
and
10 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package: | ||
name: paramnormal | ||
version: v0.2.dev | ||
|
||
source: | ||
git_url: https://github.com/phobson/paramnormal.git | ||
git_tag: master | ||
# patches: | ||
# List any patch files here | ||
# - fix.patch | ||
|
||
build: | ||
noarch_python: True | ||
number: 1 | ||
|
||
requirements: | ||
build: | ||
- python | ||
- numpy | ||
- scipy | ||
- matplotlib | ||
|
||
run: | ||
- python | ||
- numpy | ||
- scipy | ||
- matplotlib | ||
|
||
test: | ||
imports: | ||
- paramnormal | ||
|
||
# commands: | ||
# - PWD=`pwd`; echo $PWD | ||
|
||
requires: | ||
- nose | ||
|
||
about: | ||
home: http://phobson.github.io/paramnormal/ | ||
license: BSD License | ||
summary: 'Conventionally parameterized probability distributions.' | ||
|
||
# See | ||
# http://docs.continuum.io/conda/build.html for | ||
# more information about meta.yaml/configure |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
"%PYTHON%" setup.py install | ||
if errorlevel 1 exit 1 | ||
|
||
:: Add more build steps here, if they are necessary. | ||
|
||
:: See | ||
:: http://docs.continuum.io/conda/build.html | ||
:: for a list of environment variables that are set during the build process. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
|
||
$PYTHON setup.py install | ||
|
||
# Add more build steps here, if they are necessary. | ||
|
||
# See | ||
# http://docs.continuum.io/conda/build.html | ||
# for a list of environment variables that are set during the build process. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
from .dist import * | ||
from . import activity | ||
from . import utils | ||
|
||
from .tests import test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
from warnings import simplefilter | ||
from numpy import errstate | ||
from numpy.testing import Tester | ||
|
||
class _NoseWrapper(Tester): # pragma: no cover | ||
""" | ||
This is simply a monkey patch for numpy.testing.Tester. | ||
It allows extra_argv to be changed from its default None to ['--exe'] so | ||
that the tests can be run the same across platforms. It also takes kwargs | ||
that are passed to numpy.errstate to suppress floating point warnings. | ||
""" | ||
def test(self, label='fast', verbose=1, extra_argv=['--exe'], | ||
doctests=False, coverage=False, **kwargs): | ||
''' Run tests for module using nose | ||
%(test_header)s | ||
doctests : boolean | ||
If True, run doctests in module, default False | ||
coverage : boolean | ||
If True, report coverage of NumPy code, default False | ||
(Requires the coverage module: | ||
http://nedbatchelder.com/code/modules/coverage.html) | ||
kwargs | ||
Passed to numpy.errstate. See its documentation for details. | ||
''' | ||
|
||
# cap verbosity at 3 because nose becomes *very* verbose beyond that | ||
verbose = min(verbose, 3) | ||
|
||
from numpy.testing import utils | ||
utils.verbose = verbose | ||
|
||
if doctests: | ||
print("Running unit tests and doctests for %s" % self.package_name) | ||
else: | ||
print("Running unit tests for %s" % self.package_name) | ||
|
||
self._show_system_info() | ||
|
||
# reset doctest state on every run | ||
import doctest | ||
from numpy.testing.noseclasses import NumpyTestProgram | ||
|
||
doctest.master = None | ||
|
||
argv, plugins = self.prepare_test_args(label, verbose, extra_argv, | ||
doctests, coverage) | ||
with errstate(**kwargs): | ||
simplefilter('ignore', category=DeprecationWarning) | ||
t = NumpyTestProgram(argv=argv, exit=False, plugins=plugins) | ||
|
||
return t.result | ||
|
||
test = _NoseWrapper().test |