diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index b00dcb736dd210823c86299ff085ca56dd418f88..054696851d1646c66a20ba2e084daeb72d459d21 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -11,33 +11,42 @@ on: jobs: build: - - runs-on: ubuntu-18.04 + name: Building on ${{ matrix.os }} + runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: + os: [ubuntu-18.04, macos-latest, windows-latest] python-version: [3.6, 3.7, 3.8, 3.9] steps: - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} + + - name: Brew unlink gcc@9 to avoid build error with OpenMP on MacOS + if: matrix.os == 'macos-latest' + run: brew unlink gcc@9 + - name: Display Python version run: python -c "import sys; print(sys.version)" + - name: Install dependencies run: | python -m pip install --upgrade pip - python -m pip install --only-binary=numpy,scipy numpy~=1.19.0 scipy Cython pytest pytest-cov codecov flake8 + python -m pip install --only-binary=numpy,scipy numpy~=1.19.0 scipy Cython pytest pytest-cov flake8 python -m pip install -e .[tests] - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Lint with flake8 run: | # stop the build if there are Python syntax errors or undefined names flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: Test with pytest run: | python -m pytest --cov=cornac diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 4e083592ed5ed0101bbfed0a7c30e67d86959adf..0cbff71ea5699e7aca6967a8c157e854312a1786 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -17,6 +17,7 @@ jobs: name: Building on ${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: + fail-fast: false matrix: os: [ubuntu-18.04, macos-latest, windows-latest] python-version: [3.6, 3.7, 3.8, 3.9] @@ -28,17 +29,14 @@ jobs: uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} - + + - name: Brew unlink gcc@9 to avoid build error with OpenMP on MacOS + if: matrix.os == 'macos-latest' + run: brew unlink gcc@9 + - name: Display Python version run: python -c "import sys; print(sys.version)" - - name: Install GCC with OpenMP support for MacOS - if: matrix.os == 'macos-latest' - run: | - brew reinstall gcc@9 - brew unlink gcc - brew link gcc - - name: Install dependencies run: | python -m pip install --upgrade pip diff --git a/setup.py b/setup.py index 0629dd88c7e10001295e2b1054e6e3d9329670e7..2326a1fd4e1963e7371974c148829b9c1d36b1cc 100644 --- a/setup.py +++ b/setup.py @@ -97,8 +97,8 @@ else: os.environ["CC"] = gcc os.environ["CXX"] = gcc else: - USE_OPENMP = False - print("No GCC available. Install gcc from Homebrew " "using brew install gcc.") + USE_OPENMP = False + print("No GCC available. Install gcc from Homebrew using brew install gcc.") # required arguments for default gcc of OSX compile_args.extend(["-O2", "-stdlib=libc++", "-mmacosx-version-min=10.7"]) link_args.extend(["-O2", "-stdlib=libc++", "-mmacosx-version-min=10.7"]) @@ -305,7 +305,7 @@ setup( extras_require={"tests": ["pytest", "pytest-pep8", "pytest-xdist", "pytest-cov"]}, cmdclass=cmdclass, packages=find_packages(), - classifiers=( + classifiers=[ "Development Status :: 5 - Production/Stable", "Intended Audience :: Science/Research", "Intended Audience :: Education", @@ -318,5 +318,5 @@ setup( "License :: OSI Approved :: Apache Software License", "Topic :: Software Development", "Topic :: Scientific/Engineering", - ), + ], )