Skip to content

Commit f8e1849

Browse files
committed
Fix some automated testing quirks
1) Upgrade GitHub Action workflow. 2) Remove support for Python 3.7 since champ/seaborn no longer supports it. 3) Add a few apt requirements and pip hacks in GitHub Action. These are needed to support GitHub's broken handling of Python 3.10 (and even still, leidenalg is currently broken on Python >3.9, so 3.10 testing cannot even be enabled until that is fixed upstream).
1 parent cf416e9 commit f8e1849

File tree

2 files changed

+39
-34
lines changed

2 files changed

+39
-34
lines changed

.github/workflows/python-package.yml

Lines changed: 36 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -15,30 +15,41 @@ jobs:
1515
runs-on: ubuntu-latest
1616
strategy:
1717
matrix:
18-
python-version: ['3.8', '3.9']
18+
python-version: ["3.8", "3.9"] # leidenalg breaks Python>3.9 at the moment
1919

2020
steps:
21-
- uses: actions/checkout@v2
22-
- name: Set up Python ${{ matrix.python-version }}
23-
uses: actions/setup-python@v2
24-
with:
25-
python-version: ${{ matrix.python-version }}
26-
- name: Install dependencies
27-
run: |
28-
python -m pip install --upgrade pip
29-
python -m venv env
30-
source env/bin/activate
31-
pip install Cython flake8 numpy pybind11 pytest pythran
32-
sudo apt install bison build-essential flex libigraph0-dev libigraph0v5 libxml2 libxml2-dev python3-dev python3-igraph zlib1g-dev
33-
python setup.py install
34-
- name: Lint with flake8
35-
run: |
36-
source env/bin/activate
37-
# stop the build if there are Python syntax errors or undefined names
38-
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --exclude env/
39-
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
40-
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics --exclude env/
41-
- name: Test with pytest
42-
run: |
43-
source env/bin/activate
44-
pytest tests/
21+
- uses: actions/checkout@v3
22+
- name: Set up Python ${{ matrix.python-version }}
23+
uses: actions/setup-python@v3
24+
with:
25+
python-version: ${{ matrix.python-version }}
26+
- name: Install dependencies
27+
run: |
28+
python -m pip install --upgrade pip
29+
python -m venv env
30+
source env/bin/activate
31+
32+
# various build requirements for Python 3.10 Github Action
33+
sudo apt install autoconf automake bison build-essential cython flex gcc gfortran libfreetype-dev \
34+
libfreetype6 libfreetype6-dev libigraph0-dev libigraph0v5 liblapack-dev libopenblas-dev libxml2 \
35+
libxml2-dev pkg-config python-dev python3-dev python3-freetype python3-igraph zlib1g-dev
36+
37+
pip install cython flake8 pytest
38+
39+
# the following don't seem to be handled correctly in pip dependency
40+
# checking for the Python 3.10 GitHub Action?
41+
# we don't even use pandas, but champ forces it
42+
pip install igraph leidenalg louvain matplotlib numpy pandas pybind11 pythran scipy
43+
44+
python setup.py install
45+
- name: Lint with flake8
46+
run: |
47+
source env/bin/activate
48+
# stop the build if there are Python syntax errors or undefined names
49+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --exclude env/
50+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
51+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics --exclude env/
52+
- name: Test with pytest
53+
run: |
54+
source env/bin/activate
55+
pytest tests/

setup.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,14 @@
2424
'Development Status :: 5 - Production/Stable',
2525
'Topic :: Scientific/Engineering :: Information Analysis',
2626
'Programming Language :: Python :: 3',
27-
'Programming Language :: Python :: 3.7',
2827
'Programming Language :: Python :: 3.8',
2928
'Programming Language :: Python :: 3.9',
3029
'Programming Language :: Python :: 3.10',
3130
'Programming Language :: Python :: 3 :: Only',
3231
'License :: OSI Approved :: MIT License'
3332
],
34-
python_requires='>=3.7, <4',
35-
install_requires=['champ', 'louvain', 'matplotlib',
36-
"numpy<1.22.0; python_version<'3.8'",
37-
"numpy; python_version>='3.8'",
38-
'psutil', 'python-igraph',
39-
"scipy<1.8; python_version<'3.8'",
40-
"scipy; python_version>='3.8'",
41-
'seaborn', 'sklearn']
33+
python_requires='>=3.8, <4',
34+
install_requires=['champ', 'louvain', 'matplotlib', "numpy", 'psutil',
35+
'python-igraph', "scipy", 'seaborn', 'sklearn']
4236

4337
)

0 commit comments

Comments
 (0)