Skip to content

Commit

Permalink
Fix GH Action (PreferredAI#507)
Browse files Browse the repository at this point in the history
* Debug import numpy

* No pip upgrade

* Use ubuntu-latest image

* Use ubuntu-20.04 image

* Remove pip upgrade
  • Loading branch information
tqtg authored Apr 15, 2023
1 parent ee9ea26 commit 9890c7a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 18 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-18.04, macos-10.15, windows-latest]
os: [ubuntu-20.04, macos-10.15, windows-latest]
python-version: [3.6, 3.7, 3.8, 3.9]

steps:
Expand All @@ -36,7 +36,6 @@ jobs:

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --only-binary=numpy,scipy numpy scipy Cython pytest pytest-cov flake8
python -m pip install -e .[tests]
Expand Down
10 changes: 4 additions & 6 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-18.04, macos-10.15, windows-latest]
os: [ubuntu-20.04, macos-10.15, windows-latest]
python-version: [3.6, 3.7, 3.8, 3.9]

steps:
Expand All @@ -39,14 +39,13 @@ jobs:

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --only-binary=numpy,scipy numpy scipy Cython wheel
- name: Build wheels
run: python setup.py bdist_wheel

- name: Rename Linux wheels to supported platform of PyPI
if: matrix.os == 'ubuntu-18.04'
if: matrix.os == 'ubuntu-20.04'
run: for f in dist/*.whl; do mv "$f" "$(echo "$f" | sed s/linux/manylinux1/)"; done

- name: Publish wheels to GitHub artifacts
Expand All @@ -58,7 +57,7 @@ jobs:

publish-pypi:
needs: [build-wheels]
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2

Expand All @@ -70,14 +69,13 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: 3.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 scipy Cython wheel
- name: Build source tar file
Expand Down
20 changes: 10 additions & 10 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@
# limitations under the License.
# ============================================================================

import os
import sys
import glob
from setuptools import Extension, setup, find_packages


"""
Release instruction:
Expand All @@ -29,10 +24,12 @@
"""


try:
import numpy as np
except ImportError:
exit("Please install numpy>=1.14 first.")
import os
import sys
import glob
from setuptools import Extension, setup, find_packages

import numpy as np

try:
from Cython.Build import cythonize
Expand Down Expand Up @@ -149,7 +146,10 @@ def extract_gcc_binaries():
),
Extension(
"cornac.models.hpf.hpf",
sources=["cornac/models/hpf/cython/hpf" + ext, "cornac/models/hpf/cpp/cpp_hpf.cpp",],
sources=[
"cornac/models/hpf/cython/hpf" + ext,
"cornac/models/hpf/cpp/cpp_hpf.cpp",
],
include_dirs=[
"cornac/models/hpf/cpp/",
"cornac/utils/external/eigen/Eigen",
Expand Down

0 comments on commit 9890c7a

Please sign in to comment.