diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index d7881234..00000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,50 +0,0 @@ -# Python CircleCI 2.0 configuration file -# -# Check https://circleci.com/docs/2.0/language-python/ for more details - -version: 2 - -jobs: - build: - docker: - - image: circleci/python:3.6 - working_directory: ~/repo - steps: - - checkout - - restore_cache: - keys: - - v1-dependencies-{{ checksum "doc/requirements.txt" }} - # fallback to using the latest cache if no exact match is found - - v1-dependencies- - - run: - name: Install system packages - command: | - sudo -E apt-get -yq update - sudo apt install -y cmake - sudo apt install -y gcc - sudo apt install -y libnfft3-dev - - run: - name: Install dependencies - command: | - python3 -m venv venv - . venv/bin/activate - pip install -r doc/requirements.txt - - save_cache: - paths: - - ./venv - key: v1-dependencies-{{ checksum "doc/requirements.txt" }} - - run: - name: Running CircleCI tests - command: | - . venv/bin/activate - pip install Cython - pip install git+https://github.com/ghisvail/pyNFFT - pip install pysap-mri - pip install sf_tools - pip install pysap-astro - pip install -e . - python .circleci/test_script.py - - store_artifacts: - path: test-reports - destination: test-reports - diff --git a/.circleci/test_script.py b/.circleci/test_script.py deleted file mode 100644 index 97bf3641..00000000 --- a/.circleci/test_script.py +++ /dev/null @@ -1,18 +0,0 @@ -import os -import subprocess - -currentdir = os.path.dirname(__file__) -examplesdir = os.path.join(currentdir, os.pardir, "examples") - -example_files = [] -for root, dirs, files in os.walk(examplesdir): - for basneame in files: - if basneame.endswith(".py"): - example_files.append(os.path.abspath( - os.path.join(root, basneame))) -print("'{0}' examples found!".format(len(example_files))) - -for path in example_files: - print("-- ", path) - cmd = ["python3", path] - subprocess.check_call(cmd, env=os.environ) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 9fb83a1d..33525ef1 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -36,7 +36,7 @@ jobs: conda list python --version - - name: Install MacOS Dependencies + - name: Install macOS Dependencies shell: bash -l {0} if: runner.os == 'macOS' run: | @@ -64,6 +64,13 @@ jobs: name: unit-test-results-${{ matrix.os }}-${{ matrix.python-version }} path: pytest.xml + - name: Run Examples + continue-on-error: true + shell: bash -l {0} + run: | + python -m pip install . + python pysap/test/test_examples.py + - name: Check Distribution shell: bash -l {0} run: | @@ -98,7 +105,7 @@ jobs: python-version: ${{ matrix.python-version }} auto-activate-base: false - - name: Install MacOS Dependencies + - name: Install macOS Dependencies shell: bash -l {0} if: runner.os == 'macOS' run: | diff --git a/.gitignore b/.gitignore index f732cde4..4fdd70f3 100644 --- a/.gitignore +++ b/.gitignore @@ -9,7 +9,6 @@ *.log *~ .coverage -.* # Folders # ########### diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index eb5959d9..00000000 --- a/.travis.yml +++ /dev/null @@ -1,112 +0,0 @@ -language: python -sudo: required - -addons: - homebrew: - packages: &macos_packages - - cmake - - pkgconfig - - cfitsio - - libomp - update: true - -matrix: - include: - - os: linux - dist: xenial - python: 3.5 - name: "Linux Xenial Python 3.5" - - os: linux - dist: xenial - python: 3.6 - name: "Linux Xenial Python 3.6" - - os: linux - dist: xenial - python: 3.7 - name: "Linux Xenial Python 3.7" - - os: linux - dist: xenial - python: 3.8 - name: "Linux Xenial Python 3.8" - - os: osx - osx_image: xcode11.3 - language: shell - env: PYTHON_VERSION=3.6 - name: "macOS 10.14 Python 3.6" - addons: - homebrew: - packages: - - *macos_packages - - os: osx - osx_image: xcode11.3 - language: shell - env: PYTHON_VERSION=3.7 - name: "macOS 10.14 Python 3.7" - addons: - homebrew: - packages: - - *macos_packages - - os: osx - osx_image: xcode11.3 - language: shell - env: PYTHON_VERSION=3.8 - name: "macOS 10.14 Python 3.8" - addons: - homebrew: - packages: - - *macos_packages - -before_install: - - if [ $TRAVIS_OS_NAME = 'linux' ]; then sudo apt-get update; fi - - if [ $TRAVIS_OS_NAME = 'linux' ]; then sudo updatedb; fi - - if [ $TRAVIS_OS_NAME = 'osx' ]; - then curl https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -o miniconda.sh; - else wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh; - fi - - if [ $TRAVIS_OS_NAME = 'linux' ]; then - export CPLUS_INCLUDE_PATH=$(cd /opt/python/3.*/include/python3.*; pwd); - fi - - chmod +x miniconda.sh - - ./miniconda.sh -b -p $HOME/miniconda - - export PATH=$HOME/miniconda/bin:$PATH - - hash -r - - conda update --all -y; - - conda info -a - - if [ $TRAVIS_OS_NAME = 'linux' ]; then sudo apt install -y libnfft3-dev; fi - - if [ $TRAVIS_OS_NAME = 'osx' ]; then echo "backend':' TkAgg" > matplotlibrc; fi - - if [ $TRAVIS_OS_NAME = 'osx' ]; then export MACOSX_DEPLOYMENT_TARGET=10.14; fi - -install: - - if [ $TRAVIS_OS_NAME = 'osx' ]; - then conda create -n testenv --yes pip python=$PYTHON_VERSION; - else conda create -n testenv --yes pip python=$TRAVIS_PYTHON_VERSION; - fi - - source activate testenv - - pip install --upgrade pip - - python --version - - pip --version - - if [ $TRAVIS_OS_NAME = 'linux' ]; then locate pyconfig.h; fi - - mkdir -p $HOME/.local/share/pysap - - git clone https://github.com/CEA-COSMIC/pysap-data.git $HOME/.local/share/pysap/pysap-data - - ln -s $HOME/.local/share/pysap/pysap-data/pysap-data/* $HOME/.local/share/pysap - - rm $HOME/.local/share/pysap/__init__.py - - ls -l $HOME/.local/share/pysap - - pip install cython numpy - - if [ $TRAVIS_OS_NAME = 'linux' ]; then pip install git+https://github.com/ghisvail/pyNFFT.git; fi - - pip install nose nose-exclude coverage coveralls pycodestyle - - pip install -b $TRAVIS_BUILD_DIR/build -t $TRAVIS_BUILD_DIR/install --no-clean --no-deps . - - ls $TRAVIS_BUILD_DIR/install - - if [ $TRAVIS_OS_NAME = 'osx' ]; - then otool -L $TRAVIS_BUILD_DIR/install/pysparse.so; - else ldd $TRAVIS_BUILD_DIR/install/pysparse.so; - fi - - export PYTHONPATH=$TRAVIS_BUILD_DIR/install:$PYTHONPATH - - if [[ $TRAVIS_PYTHON_VERSION == '3.5' ]]; then pip install "astropy<4.0" "matplotlib<3.0.3"; fi - -script: - - python setup.py nosetests - - pycodestyle pysap --ignore="E121,E123,E126,E226,E24,E704,E402,E731,E722,E741,W503,W504,W605" - - pycodestyle examples --ignore="E121,E123,E126,E226,E24,E704,E402,E731,E741,W503,W504,W605" - -after_success: - - coveralls diff --git a/pysap/info.py b/pysap/info.py index c6a51650..4d00ca3c 100644 --- a/pysap/info.py +++ b/pysap/info.py @@ -10,7 +10,7 @@ # Module current version version_major = 0 version_minor = 0 -version_micro = 4 +version_micro = 5 # Expected by setup.py: string of form "X.Y.Z" __version__ = "{0}.{1}.{2}".format(version_major, version_minor, version_micro) @@ -67,20 +67,20 @@ VERSION = __version__ PROVIDES = ["pysap"] REQUIRES = [ - "scipy>=1.3.0", - "numpy>=1.16.4", - "matplotlib>=3.0.0", - "astropy>=3.0.0", - "nibabel>=2.3.2", - "pyqtgraph>=0.10.0", - "progressbar2>=3.34.3", - "modopt>=1.4.0", - "scikit-learn>=0.19.1", - "PyWavelets>=1.0.0" + "scipy==1.5.4", + "numpy==1.19.5", + "matplotlib==3.3.4", + "astropy==4.1", + "nibabel==3.2.1", + "pyqtgraph==0.11.1", + "progressbar2==3.53.1", + "modopt==1.5.0", + "scikit-learn==0.24.1", + "PyWavelets==1.1.1" ] PREINSTALL_REQUIRES = [ - "pybind11>=2.3.0", - "pyqt5>=5.12.2" + "pybind11==2.6.2", + "pyqt5==5.15.4" ] EXTRA_REQUIRES = { "gui": { diff --git a/pysap/test/test_examples.py b/pysap/test/test_examples.py new file mode 100644 index 00000000..04ddbde3 --- /dev/null +++ b/pysap/test/test_examples.py @@ -0,0 +1,21 @@ +import os +import subprocess + +currentdir = os.path.dirname(__file__) +examplesdir = os.path.join( + currentdir, os.path.join(os.pardir, os.pardir), 'examples' +) + +example_files = [] +for root, dirs, files in os.walk(examplesdir): + for basneame in files: + if basneame.endswith('.py'): + example_files.append(os.path.abspath( + os.path.join(root, basneame) + )) +print('"{0}" examples found!'.format(len(example_files))) + +for path in example_files: + print('-- ', path) + cmd = ['python3', path] + subprocess.check_call(cmd, env=os.environ) diff --git a/setup.cfg b/setup.cfg index b8d0ea18..0a6a66b3 100644 --- a/setup.cfg +++ b/setup.cfg @@ -3,6 +3,7 @@ verbosity=2 nologcapture=0 cover-package=pysap with-coverage=1 +ignore-files=test_examples.py [build_sphinx] source-dir=doc @@ -15,4 +16,3 @@ repository=http://pypi.python.org/pypi [metadata] description-file = README.rst -