Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix failures in CI ahead of first release, drop Python 3.5 #11

Merged
merged 38 commits into from
Feb 14, 2020
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
c8cf8a1
Silence junit_family warnings
Feb 10, 2020
42fad1c
Remove Python 3.5 support
Feb 10, 2020
05473b1
Silence deprecation warnings for autodoc_default_flags
Feb 10, 2020
ef17ad7
Download flag files from cloud in tests when testing from generic dirs
Feb 10, 2020
1c0ebbe
Merge branch 'master' into CI/fix_failures
Feb 10, 2020
acda060
Bump Python version in README.rst
Feb 10, 2020
fc67508
Extend cloud download approach to test_flagser, fix incorrect url
Feb 10, 2020
80a1322
Correct dir path to file path
Feb 10, 2020
04b2059
Linting
Feb 10, 2020
78764aa
Use copyfile instead of copyfileobj
Feb 10, 2020
62e20aa
Use urlretrieve instead of urlopen
Feb 11, 2020
c680198
Add sudo permissions to pytest line in manylinux
Feb 11, 2020
ff15954
Remove sudo, add conftest file defining --webdl, implement on flagio
Feb 11, 2020
0bc2daf
Try new approach to avoid issues with --pyargs and command line argum…
Feb 12, 2020
92709bc
Add forgotten import dot and linting
Feb 12, 2020
dbf40d8
Remove nightlies from Azure CI
Feb 12, 2020
c70a943
Uninstall dev environment after testing it
Feb 12, 2020
18d8b96
Change flagser docstring formatting to avoid sphinx errors
Feb 12, 2020
163abb5
Uninstall dev after testing dev in docker_scripts.sh
Feb 12, 2020
225fcb2
Avoid unnecessary coverage report generations and uploads
Feb 12, 2020
cd94ed7
Wording changes in comments
Feb 12, 2020
6a2ed97
Change bash to script in windows jobs
Feb 12, 2020
76a658c
Remove contradictory passed options
Feb 12, 2020
1d059ee
Reintroduce coverage reports for all systems
Feb 12, 2020
678ed15
Try with sudo in manylinux, pass /D in windows
Feb 12, 2020
7b6f83b
Refactor tests
Feb 12, 2020
7f8f103
Update CODE_AUTHORS
Feb 12, 2020
0a4e781
UPDATE LICENSE
Feb 12, 2020
3db2f81
Update RELEASE
Feb 12, 2020
1398825
Update MAINTAINER variable in setup.py
Feb 12, 2020
865b489
Update GOVERNANCE
Feb 12, 2020
eb946a2
Better docstring formatting in flagser.py
Feb 12, 2020
02a16e1
Add sudo to pytest steps in linux systems
Feb 12, 2020
c7046ff
Remove sudo, create temp dir for pytests on wheels
Feb 12, 2020
adb7e39
Add sudo only in one place
Feb 12, 2020
7d74bf0
Do not delete folders/files
Feb 13, 2020
073cce0
Minor improvements in docs and variable names
Feb 13, 2020
bd7d58e
Correct mistake in GOVERNANCE
Feb 13, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Dependencies

pyflagser requires:

- Python (>= 3.5)
- Python (>= 3.6)
- numpy (>= 1.17.0)
- scipy (>= 0.17.0)

Expand Down
17 changes: 0 additions & 17 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ jobs:
vmImage: 'ubuntu-16.04'
strategy:
matrix:
Python35:
python.version: '3.5'
Python36:
python.version: '3.6'
Python37:
Expand Down Expand Up @@ -43,8 +41,6 @@ jobs:
vmImage: 'macOS-10.14'
strategy:
matrix:
Python35:
python.version: '3.5'
Python36:
python.version: '3.6'
Python37:
Expand Down Expand Up @@ -85,9 +81,6 @@ jobs:
vmImage: 'vs2017-win2016'
strategy:
matrix:
Python35:
python_ver: '35'
python.version: '3.5'
Python36:
python_ver: '36'
python.version: '3.6'
Expand Down Expand Up @@ -128,11 +121,6 @@ jobs:
vmImage: 'ubuntu-16.04'
strategy:
matrix:
Python35:
arch: x86_64
plat: manylinux2010_x86_64
python_ver: '35'
python.version: '3.5'
Python36:
arch: x86_64
plat: manylinux2010_x86_64
Expand Down Expand Up @@ -212,8 +200,6 @@ jobs:
vmImage: 'macOS-10.14'
strategy:
matrix:
Python35:
python.version: '3.5'
Python36:
python.version: '3.6'
Python37:
Expand Down Expand Up @@ -327,9 +313,6 @@ jobs:
vmImage: 'vs2017-win2016'
strategy:
matrix:
Python35:
python_ver: '35'
python.version: '3.5'
Python36:
python_ver: '36'
python.version: '3.6'
Expand Down
2 changes: 1 addition & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
mathjax_path = ('https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/'
'MathJax.js?config=TeX-AMS_SVG')

autodoc_default_flags = ['members', 'inherited-members']
autodoc_default_options = {'members': True, 'inherited-members': True}

# Add any paths that contain templates here, relative to this directory.
templates_path = ['templates']
Expand Down
44 changes: 34 additions & 10 deletions pyflagser/tests/test_flagio.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,43 @@
"""Testing for the python bindings of the C++ flagser library."""

import os
import shutil
from tempfile import mkdtemp
from urllib.request import urlopen

import numpy as np
import scipy.sparse as sp
import pytest
import os
import scipy.sparse as sp
from numpy.testing import assert_almost_equal

from pyflagser import loadflag, saveflag

flag_files = []

dirname = os.path.join(os.path.dirname(__file__), "../../flagser/test")
for file in os.listdir(dirname):
if file.endswith(".flag"):
flag_files.append(os.path.join(dirname, file))
try:
dirname = os.path.join(os.path.dirname(__file__), "../../flagser/test")
list_dir = os.listdir(dirname)
flag_files = [os.path.join(dirname, fname)
for fname in os.listdir(dirname)
if fname.endswith(".flag")]
download_files = False
except FileNotFoundError:
# Download from remote bucket
temp_dir = mkdtemp()
bucket_url = 'https://storage.googleapis.com/l2f-open-models/giotto-tda' \
ulupo marked this conversation as resolved.
Show resolved Hide resolved
'/flagser/test/'
flag_files_list = bucket_url + 'flag_files_list.txt'
with urlopen(flag_files_list) as f:
flag_file_names = f.read().decode('utf8').splitlines()
flag_files = []
for fname in flag_file_names:
url = bucket_url + fname
fpath = os.path.join(temp_dir, fname)
with urlopen(url) as response, open(fpath, 'wb') as out_file:
shutil.copyfile(response, out_file)
flag_files.append(fpath)
download_files = True


@pytest.mark.parametrize("flag_file",
[(flag_file) for flag_file in flag_files])
@pytest.mark.parametrize("flag_file", flag_files)
def test_flagio(flag_file):
flag_matrix = loadflag(flag_file)
_, fname_temp = os.path.split(flag_file)
Expand All @@ -29,3 +49,7 @@ def test_flagio(flag_file):
flag_matrix_temp.diagonal())
assert_almost_equal(np.sort(np.hstack([sp.find(flag_matrix)])),
np.sort(np.hstack([sp.find(flag_matrix_temp)])))


if download_files:
shutil.rmtree(temp_dir)
37 changes: 30 additions & 7 deletions pyflagser/tests/test_flagser.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
"""Testing for the python bindings of the C++ flagser library."""

import pytest
import os
import shutil
from tempfile import mkdtemp
from urllib.request import urlopen

import pytest
from numpy.testing import assert_almost_equal

from pyflagser import loadflag, flagser

flag_files = []

dirname = os.path.join(os.path.dirname(__file__), "../../flagser/test")
for file in os.listdir(dirname):
if file.endswith(".flag"):
flag_files.append(os.path.join(dirname, file))

betti = {
'a.flag': [1, 2, 0],
Expand All @@ -33,6 +31,27 @@
'd10.flag': [1, 0, 0, 0, 0, 0, 0, 0, 0, 1334961],
}

try:
dirname = os.path.join(os.path.dirname(__file__), "../../flagser/test")
list_dir = os.listdir(dirname)
flag_files = [os.path.join(dirname, fname)
for fname in os.listdir(dirname)
if fname.endswith(".flag")]
download_files = False
except FileNotFoundError:
# Download from remote bucket
temp_dir = mkdtemp()
bucket_url = 'https://storage.googleapis.com/l2f-open-models/giotto-tda' \
'/flagser/test/'
flag_files = []
for fname in betti.keys():
url = bucket_url + fname
fpath = os.path.join(temp_dir, fname)
with urlopen(url) as response, open(fpath, 'wb') as out_file:
shutil.copyfile(response, out_file)
flag_files.append(fpath)
download_files = True


@pytest.mark.parametrize("flag_file, betti",
[(flag_file, betti[os.path.split(flag_file)[1]])
Expand All @@ -43,3 +62,7 @@ def test_flagser(flag_file, betti):

ret = flagser(flag_matrix)
assert_almost_equal(ret['betti'], betti)


if download_files:
shutil.rmtree(temp_dir)
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
description-file = README.rst

[tool:pytest]
junit_family=xunit1

addopts =
--ignore flagser
--ignore pybind11
Expand Down
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
MAINTAINER = 'Guillaume Tauzin'
MAINTAINER_EMAIL = '[email protected]'
URL = 'https://github.com/giotto-ai/pyflagser'
LICENSE = 'AGPLv3'
LICENSE = 'GNU AGPLv3'
DOWNLOAD_URL = 'https://github.com/giotto-ai/pyflagser/tarball/v0.1.0'
VERSION = __version__ # noqa
CLASSIFIERS = ['Intended Audience :: Science/Research',
Expand All @@ -41,9 +41,9 @@
'Operating System :: POSIX',
'Operating System :: Unix',
'Operating System :: MacOS',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7']
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8']
KEYWORDS = 'topological data analysis, persistent ' + \
'homology, directed flags complex, persistence diagrams'
INSTALL_REQUIRES = requirements
Expand Down