Skip to content

Commit 9890c7a

Browse files
authored
Fix GH Action (#507)
* Debug import numpy * No pip upgrade * Use ubuntu-latest image * Use ubuntu-20.04 image * Remove pip upgrade
1 parent ee9ea26 commit 9890c7a

File tree

3 files changed

+15
-18
lines changed

3 files changed

+15
-18
lines changed

.github/workflows/python-package.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
strategy:
1717
fail-fast: false
1818
matrix:
19-
os: [ubuntu-18.04, macos-10.15, windows-latest]
19+
os: [ubuntu-20.04, macos-10.15, windows-latest]
2020
python-version: [3.6, 3.7, 3.8, 3.9]
2121

2222
steps:
@@ -36,7 +36,6 @@ jobs:
3636

3737
- name: Install dependencies
3838
run: |
39-
python -m pip install --upgrade pip
4039
python -m pip install --only-binary=numpy,scipy numpy scipy Cython pytest pytest-cov flake8
4140
python -m pip install -e .[tests]
4241

.github/workflows/python-publish.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
strategy:
2020
fail-fast: false
2121
matrix:
22-
os: [ubuntu-18.04, macos-10.15, windows-latest]
22+
os: [ubuntu-20.04, macos-10.15, windows-latest]
2323
python-version: [3.6, 3.7, 3.8, 3.9]
2424

2525
steps:
@@ -39,14 +39,13 @@ jobs:
3939

4040
- name: Install dependencies
4141
run: |
42-
python -m pip install --upgrade pip
4342
python -m pip install --only-binary=numpy,scipy numpy scipy Cython wheel
4443
4544
- name: Build wheels
4645
run: python setup.py bdist_wheel
4746

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

5251
- name: Publish wheels to GitHub artifacts
@@ -58,7 +57,7 @@ jobs:
5857

5958
publish-pypi:
6059
needs: [build-wheels]
61-
runs-on: ubuntu-18.04
60+
runs-on: ubuntu-20.04
6261
steps:
6362
- uses: actions/checkout@v2
6463

@@ -70,14 +69,13 @@ jobs:
7069
- name: Set up Python
7170
uses: actions/setup-python@v2
7271
with:
73-
python-version: 3.8
72+
python-version: 3.9
7473

7574
- name: Display Python version
7675
run: python -c "import sys; print(sys.version)"
7776

7877
- name: Install dependencies
7978
run: |
80-
python -m pip install --upgrade pip
8179
python -m pip install --only-binary=numpy,scipy numpy scipy Cython wheel
8280
8381
- name: Build source tar file

setup.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,6 @@
1313
# limitations under the License.
1414
# ============================================================================
1515

16-
import os
17-
import sys
18-
import glob
19-
from setuptools import Extension, setup, find_packages
20-
2116

2217
"""
2318
Release instruction:
@@ -29,10 +24,12 @@
2924
"""
3025

3126

32-
try:
33-
import numpy as np
34-
except ImportError:
35-
exit("Please install numpy>=1.14 first.")
27+
import os
28+
import sys
29+
import glob
30+
from setuptools import Extension, setup, find_packages
31+
32+
import numpy as np
3633

3734
try:
3835
from Cython.Build import cythonize
@@ -149,7 +146,10 @@ def extract_gcc_binaries():
149146
),
150147
Extension(
151148
"cornac.models.hpf.hpf",
152-
sources=["cornac/models/hpf/cython/hpf" + ext, "cornac/models/hpf/cpp/cpp_hpf.cpp",],
149+
sources=[
150+
"cornac/models/hpf/cython/hpf" + ext,
151+
"cornac/models/hpf/cpp/cpp_hpf.cpp",
152+
],
153153
include_dirs=[
154154
"cornac/models/hpf/cpp/",
155155
"cornac/utils/external/eigen/Eigen",

0 commit comments

Comments
 (0)