diff --git a/.pypirc b/.pypirc index 4f1fd8479f1..c9c2d94d04c 100644 --- a/.pypirc +++ b/.pypirc @@ -1,6 +1,12 @@ [distutils] -index-servers=pypi +index-servers= + pypi + pypitest [pypi] -repository = https://pypi.python.org/pypi -username = kohr-h \ No newline at end of file +repository = https://upload.pypi.org/legacy +username = odlgroup + +[pypitest] +repository = https://test.pypi.org/legacy +username = kohr-h diff --git a/.travis.yml b/.travis.yml index 3e4c6d2e585..c36889b7b0f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -50,7 +50,7 @@ before_script: script: # Run tests, including PEP8 check, and produce a coverage report - - py.test --doctest-modules --cov --cov-report term-missing --pep8 + - py.test --doctest-modules --cov --cov-report term-missing --pep8 $TRAVIS_BUILD_DIR/odl # Build the Sphinx doc (only for Python 3.5 and the master branch) - if [[ "$TRAVIS_PYTHON_VERSION" == "3.5" && "$TRAVIS_BRANCH" == "master" ]]; then cd $TRAVIS_BUILD_DIR/doc/source && python generate_doc.py && cd -; diff --git a/MANIFEST.in b/MANIFEST.in index 44c2b78fd60..cdfdddc36df 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -5,3 +5,6 @@ include requirements.txt include setup.cfg include setup.py include test_requirements.txt +include odl/pytest.ini +exclude pytest.ini +recursive-include odl/test test*.py *test.py diff --git a/conda/meta.yaml b/conda/meta.yaml index 093d6bbc085..fc08245b91a 100644 --- a/conda/meta.yaml +++ b/conda/meta.yaml @@ -1,11 +1,11 @@ package: name: odl - version: "0.5.0" + version: "0.5.1" source: git_url: https://github.com/odlgroup/odl - git_rev: master # for testing, put any branch here - # git_rev: v0.5.0 # release + # git_rev: master # for testing, put any branch here + git_rev: v0.5.1 # release build: noarch_python: True @@ -30,6 +30,8 @@ requirements: test: imports: - odl + commands: + - python -c "import odl; odl.test()" about: home: https://github.com/odlgroup/odl diff --git a/doc/source/getting_started/installing.rst b/doc/source/getting_started/installing.rst index 859f28f396f..d05c18e6f08 100644 --- a/doc/source/getting_started/installing.rst +++ b/doc/source/getting_started/installing.rst @@ -408,7 +408,7 @@ After that, follow the `build instructions there `_. ASTRA projectors are fully supported in ODL. You can try using the conda package, but we can give no guarantee that it works out of the box: @@ -417,7 +417,7 @@ You can try using the conda package, but we can give no guarantee that it works $ conda install -c astra-toolbox astra-toolbox -For further instructions, check `the ASTRA GitHub page `_. +For further instructions, check `the ASTRA GitHub page `_. STIR for emission tomography @@ -467,5 +467,5 @@ If that does not help, `make an issue on GitHub `_. @@ -89,7 +101,7 @@ def run_tests(self): setup( name='odl', - version='0.5.0', + version='0.5.1', description='Operator Discretization Library', long_description=long_description, @@ -124,8 +136,11 @@ def run_tests(self): keywords='research development mathematics prototyping imaging tomography', - packages=find_packages(exclude=['*test*']), + packages=find_packages(), package_dir={'odl': 'odl'}, + package_data={'odl': find_tests() + ['odl/pytest.ini']}, + include_package_data=True, + entry_points={'pytest11': ['odl_plugins = odl.util.pytest_plugins']}, install_requires=[requires], tests_require=['pytest'], diff --git a/tools/release.sh b/tools/release.sh index 8695819d735..c011e1f119b 100755 --- a/tools/release.sh +++ b/tools/release.sh @@ -52,7 +52,7 @@ fi ### PyPI upload PYPI_DIST_DIR=$(cd dist && echo "$PWD") # Absolute path -PYPI_DIST_FILES="$(ls -1ad $PYPI_DIST_DIR/* | grep ${PACKAGE_NAME}-${VERSION})" +PYPI_DIST_FILES="$(find $PYPI_DIST_DIR/ -name ${PACKAGE_NAME}-${VERSION}*)" if [[ -z $PYPI_DIST_FILES ]]; then echo 'No distribution files found in the `dist` directory.' @@ -63,6 +63,7 @@ fi if [ $DRY_RUN -eq 1 ]; then echo "" echo "The following files would be uploaded to PyPI:" + echo "" echo -e "$PYPI_DIST_FILES" else PYPI_USER=odlgroup @@ -74,34 +75,41 @@ else $TWINE upload -u $PYPI_USER $PYPI_DIST_FILES || exit 1 fi fi - - ### Conda upload CONDA_USER="odlgroup" ANACONDA=$(which anaconda) # Find conda build directory -if [ -n $CONDA_ENV_PATH ]; then - CONDA_BUILD_DIR="$CONDA_ENV_PATH/../../conda-bld" +if [ -z $CONDA_PREFIX ]; then + # Not in a conda env + CONDA=$(which conda) + CONDA_DIR=$(dirname $CONDA) + CONDA_BUILD_DIR="$CONDA_DIR/../conda-bld" else - CONDA_BUILD_DIR="$(which conda)/../../conda-bld" + CONDA_BUILD_DIR="$CONDA_PREFIX/../../conda-bld" fi +# Prettify path +cd $CONDA_BUILD_DIR || exit 1 +CONDA_BUILD_DIR=$(pwd) +cd -- + # Compile all files in the build folders corresponding to package and version CONDA_DIST_FILES="" -CONDA_DIST_DIRS="linux-32 linux-64 osx-64 win-32 win-64" +CONDA_DIST_DIRS="linux-32 linux-64 osx-64 win-32 win-64 noarch" for DIR in $CONDA_DIST_DIRS; do if [ -d $CONDA_BUILD_DIR/$DIR ]; then - if [ -z $CONDA_DIST_FILES ]; then - CONDA_DIST_FILES="$(ls -1 $CONDA_BUILD_DIR/$DIR/$PACKAGE_NAME-$VERSION*)\n" - else - CONDA_DIST_FILES="$CONDA_DIST_FILES$(ls -1 $CONDA_BUILD_DIR/$DIR/$PACKAGE_NAME-$VERSION*)\n" + FOUND_FILES="$(find $CONDA_BUILD_DIR/$DIR -name $PACKAGE_NAME-$VERSION*)" + + if [[ $FOUND_FILES != "\n" ]]; then + CONDA_DIST_FILES+="$FOUND_FILES\n" fi fi done # Do the upload (or pretend to) if [ $DRY_RUN -eq 1 ]; then + echo "" echo "" echo "The following files would be uploaded to Anaconda Cloud:" echo -e $CONDA_DIST_FILES