mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-14 07:40:07 +02:00
dev-python/nose: new recipe (#3308)
This commit is contained in:
117
dev-python/nose/nose-1.3.7.recipe
Normal file
117
dev-python/nose/nose-1.3.7.recipe
Normal file
@@ -0,0 +1,117 @@
|
||||
SUMMARY="A Python module which extends unittest to make testing easier"
|
||||
DESCRIPTION="nose extends the test loading and running features of unittest, \
|
||||
making it easier to write, find and run tests.
|
||||
|
||||
By default, nose will run tests in files or directories under the current \
|
||||
working directory whose names include \"test\" or \"Test\" at a word boundary \
|
||||
(like \"test_this\" or \"functional_test\" or \"TestClass\" but not \
|
||||
\"libtest\"). Test output is similar to that of unittest, but also includes \
|
||||
captured stdout output from failing tests, for easy print-style debugging.
|
||||
|
||||
These features, and many more, are customizable through the use of plugins. \
|
||||
Plugins included with nose provide support for doctest, code coverage, and \
|
||||
profiling, flexible attribute-based test selection, output capture and more."
|
||||
HOMEPAGE="https://readthedocs.io/docs/nose/
|
||||
https://pypi.python.org/pypi/nose/
|
||||
https://github.com/nose-devs/nose"
|
||||
COPYRIGHT="2008-2010 anatoly techtonik"
|
||||
LICENSE="GNU LGPL v2.1"
|
||||
REVISION="1"
|
||||
SOURCE_URI="https://github.com/nose-devs/nose/archive/release_$portVersion.tar.gz"
|
||||
CHECKSUM_SHA256="ab1ee7744662c5bf58a510ae46d879ebe140c3e40d6871c09b36b24b6a480b39"
|
||||
SOURCE_FILENAME="nose-$portVersion.tar.gz"
|
||||
SOURCE_DIR="nose-release_$portVersion"
|
||||
|
||||
ARCHITECTURES="any"
|
||||
|
||||
PROVIDES="
|
||||
nose = $portVersion
|
||||
"
|
||||
REQUIRES="
|
||||
haiku
|
||||
"
|
||||
BUILD_REQUIRES="
|
||||
haiku_devel
|
||||
setuptools_python
|
||||
setuptools_python3
|
||||
six_python
|
||||
six_python3
|
||||
"
|
||||
BUILD_PREREQUIRES="
|
||||
cmd:python
|
||||
cmd:python3
|
||||
"
|
||||
|
||||
PYTHON_PACKAGES=(python python3)
|
||||
PYTHON_VERSIONS=(2.7 3.6)
|
||||
for i in "${!PYTHON_PACKAGES[@]}"; do
|
||||
pythonPackage=${PYTHON_PACKAGES[i]}
|
||||
pythonVersion=${PYTHON_VERSIONS[$i]}
|
||||
eval "PROVIDES_$pythonPackage=\"
|
||||
nose_$pythonPackage = $portVersion
|
||||
cmd:nosetests_$pythonVersion
|
||||
\""
|
||||
eval "REQUIRES_$pythonPackage=\"
|
||||
haiku
|
||||
cmd:python$pythonVersion
|
||||
\""
|
||||
done
|
||||
|
||||
BUILD()
|
||||
{
|
||||
for i in "${!PYTHON_PACKAGES[@]}"; do
|
||||
pythonPackage=${PYTHON_PACKAGES[i]}
|
||||
pythonVersion=${PYTHON_VERSIONS[$i]}
|
||||
|
||||
rm -rf "$sourceDir"-$pythonPackage
|
||||
cp -a "$sourceDir" "$sourceDir"-$pythonPackage
|
||||
cd "$sourceDir"-$pythonPackage
|
||||
|
||||
python=python$pythonVersion
|
||||
$python setup.py build
|
||||
done
|
||||
}
|
||||
|
||||
INSTALL()
|
||||
{
|
||||
for i in "${!PYTHON_PACKAGES[@]}"; do
|
||||
pythonPackage=${PYTHON_PACKAGES[i]}
|
||||
pythonVersion=${PYTHON_VERSIONS[$i]}
|
||||
|
||||
cd "$sourceDir"-$pythonPackage
|
||||
sed -i \
|
||||
-e "/data_files =/ s|'man/|'$relativeManDir/|" \
|
||||
setup.py
|
||||
|
||||
python=python$pythonVersion
|
||||
installLocation=$prefix/lib/$python/vendor-packages
|
||||
export PYTHONPATH=$installLocation
|
||||
mkdir -p "$installLocation"
|
||||
$python setup.py install \
|
||||
--root=/ --prefix="$prefix" --skip-build
|
||||
|
||||
rm $binDir/nosetests
|
||||
packageEntries $pythonPackage \
|
||||
"$binDir" \
|
||||
"$prefix"/lib/$python
|
||||
done
|
||||
|
||||
cd "$sourceDir"
|
||||
mkdir -p "$docDir"
|
||||
cp -rt "$docDir" \
|
||||
README.txt DEVELOPERS.txt CHANGELOG NOTES NEWS* doc/*
|
||||
rm "$docDir"/{doc_tests,Makefile}
|
||||
}
|
||||
|
||||
TEST()
|
||||
{
|
||||
for i in "${!PYTHON_PACKAGES[@]}"; do
|
||||
pythonPackage=${PYTHON_PACKAGES[i]}
|
||||
pythonVersion=${PYTHON_VERSIONS[$i]}
|
||||
|
||||
cd "$sourceDir"-$pythonPackage
|
||||
|
||||
python=python$pythonVersion
|
||||
$python setup.py test || echo Tests failed with $python && true
|
||||
done
|
||||
}
|
||||
Reference in New Issue
Block a user