Skip to content

Commit

Permalink
Fix failures in CI ahead of first release, drop Python 3.5 (#11)
Browse files Browse the repository at this point in the history
* Silence junit_family warnings

* Remove Python 3.5 support

* Silence deprecation warnings for autodoc_default_flags

* Download flag files from cloud in tests when testing from generic dirs

* Bump Python version in README.rst

* Extend cloud download approach to test_flagser, fix incorrect url

* Correct dir path to file path

* Linting

* Use copyfile instead of copyfileobj

* Use urlretrieve instead of urlopen

* Add sudo permissions to pytest line in manylinux

* Remove sudo, add conftest file defining --webdl, implement on flagio

- Comment tests in test_flagser to silence failures

* Try new approach to avoid issues with --pyargs and command line arguments

* Add forgotten import dot and linting

* Remove nightlies from Azure CI

* Uninstall dev environment after testing it

* Change flagser docstring formatting to avoid sphinx errors

* Uninstall dev after testing dev in docker_scripts.sh

Also replace dot in pytest with pyflagser

* Avoid unnecessary coverage report generations and uploads

* Wording changes in comments

* Change bash to script in windows jobs

* Remove contradictory passed options

* Reintroduce coverage reports for all systems

* Try with sudo in manylinux, pass /D in windows

* Refactor tests

* Update CODE_AUTHORS

* UPDATE LICENSE

* Update RELEASE

* Update MAINTAINER variable in setup.py

* Update GOVERNANCE

* Better docstring formatting in flagser.py

* Add sudo to pytest steps in linux systems

* Remove sudo, create temp dir for pytests on wheels

* Add sudo only in one place

* Do not delete folders/files

* Minor improvements in docs and variable names

* Correct mistake in GOVERNANCE
  • Loading branch information
ulupo authored Feb 14, 2020
1 parent b1126ff commit eb43890
Show file tree
Hide file tree
Showing 17 changed files with 135 additions and 175 deletions.
16 changes: 9 additions & 7 deletions .azure-ci/docker_scripts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,25 @@

set -x

# upgrading pip and setuptools
# Upgrade pip and setuptools. TODO: Monitor status of pip versions
PYTHON_PATH=$(eval find "/opt/python/*${python_ver}*" -print)
export PATH=${PYTHON_PATH}/bin:${PATH}
pip install --upgrade pip==19.3.1 setuptools

# installing cmake
# Install CMake
pip install cmake

# installing and uninstalling pyflagser
# Install dev environment
cd /io
pip install -e ".[doc, tests]"
pip uninstall -y pyflagser

# testing, linting
# Test dev install with pytest and flake8
pytest --cov . --cov-report xml
flake8 --exit-zero /io/

# building wheels
pip install wheel twine
# Uninstal pyflagser dev
pip uninstall -y pyflagser

# Build wheels
pip install wheel
python setup.py sdist bdist_wheel
1 change: 1 addition & 0 deletions CODE_AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@

Guillaume Tauzin, [email protected]
Julian Burella Pérez, [email protected]
Umberto Lupo, [email protected]
14 changes: 6 additions & 8 deletions GOVERNANCE.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
This file describe the governance of the Giotto project.
This file describe the governance of the pyflagser project.

Project owner:
--------------
Expand All @@ -10,12 +10,10 @@ Authors:

- Please refer to the `authors <https://github.com/giotto-ai/pyflagser/blob/master/CODE_AUTHORS>`_ file

Giotto Project Team:
--------------------
Pyflagser Project Team:
-----------------------

- Umberto Lupo [email protected] (Maintainer & Developer)
- Guillaume Tauzin [email protected] (Maintainer)
- Umberto Lupo [email protected] (Maintainer)
- Julian Burella Pérez [email protected] (Developer)
- Matteo Caorsi [email protected] (Project Leader)
- Philippe Nguyen [email protected] (Developer)

Former Project Team Members:
----------------------------
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright 2019 L2F SA.
Copyright 2020 L2F SA.
Licensed under the GNU Affero General Public License (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License below or at https://www.gnu.org/licenses/agpl-3.0.html
Expand Down
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
2 changes: 1 addition & 1 deletion RELEASE.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Thanks to our Contributors

This release contains contributions from many people:

Guillaume Tauzin and Julian Burella Pérez.
Guillaume Tauzin, Julian Burella Pérez and Umberto Lupo.

We are also grateful to all who filed issues or helped resolve them, asked and
answered questions, and were part of inspiring discussions.
105 changes: 14 additions & 91 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 All @@ -154,14 +142,6 @@ jobs:
inputs:
versionSpec: '$(python.version)'

- bash: |
sed -i "s/'pyflagser'/'pyflagser-nightly'/1" setup.py
sed -i "s/__version__.*/__version__ = '$(Build.BuildNumber)'/1" pyflagser/_version.py
cat pyflagser/_version.py
failOnStderr: true
condition: eq(variables['nightly_check'], 'true')
displayName: 'Change name to pyflagser-nightly'
- task: Bash@3
inputs:
filePath: .azure-ci/build_manylinux2010.sh
Expand All @@ -182,7 +162,7 @@ jobs:
pip install pytest pytest-cov pytest-azurepipelines pytest-benchmark flake8 hypothesis
mkdir tmp_test_cov
cd tmp_test_cov
pytest --pyargs pyflagser --ignore-glob='flagser*' --no-cov --no-coverage-upload
python -m pyflagser.tests --webdl --no-cov --no-coverage-upload
failOnStderr: true
displayName: 'Test the wheels with pytest'
Expand All @@ -198,22 +178,13 @@ jobs:
pathToPublish: '$(Build.ArtifactStagingDirectory)'
artifactName: 'wheel_and_doc'

- bash: |
pip install twine
for f in dist/*linux* ; do sudo mv "$f" "${f/linux/manylinux2010}"; done
twine upload -u giotto-learn -p $(pypi_psw) --skip-existing dist/*
condition: eq(variables['nightly_check'], 'true')
displayName: 'Upload nightly wheels to PyPI'

- job: 'macOS1014'
condition: eq(variables['build_check'], 'true')
pool:
vmImage: 'macOS-10.14'
strategy:
matrix:
Python35:
python.version: '3.5'
Python36:
python.version: '3.6'
Python37:
Expand All @@ -226,16 +197,6 @@ jobs:
inputs:
versionSpec: '$(python.version)'

- bash: |
sed -i.bak "s/'pyflagser'/'pyflagser-nightly'/1" setup.py
rm setup.py.bak
sed -i.bak "s/__version__.*/__version__ = '$(Build.BuildNumber)'/1" pyflagser/_version.py
cat pyflagser/_version.py
rm pyflagser/_version.py.bak
failOnStderr: true
condition: eq(variables['nightly_check'], 'true')
displayName: 'Change name to pyflagser-nightly'
- script: |
brew update
brew install gcc
Expand All @@ -251,24 +212,17 @@ jobs:
failOnStderr: true
displayName: 'Install dev environment'

- script: |
pip uninstall -y pyflagser
condition: eq(variables['nightly_check'], 'false')
failOnStderr: true
displayName: 'Uninstall pyflagser dev'
- script: |
pip uninstall -y pyflagser-nightly
condition: eq(variables['nightly_check'], 'true')
failOnStderr: true
displayName: 'Uninstall pyflagser-nightly dev'
- script: |
pytest --cov pyflagser --cov-report xml
flake8
failOnStderr: true
displayName: 'Test with pytest and flake8'
- script: |
pip uninstall -y pyflagser
failOnStderr: true
displayName: 'Uninstall pyflagser dev'
- script: |
pip install wheel
python setup.py sdist bdist_wheel
Expand All @@ -282,7 +236,7 @@ jobs:
- script: |
mkdir tmp_test_cov
cd tmp_test_cov
pytest --pyargs pyflagser --ignore-glob='flagser*' --no-cov --no-coverage-upload
python -m pyflagser.tests --webdl --no-cov --no-coverage-upload
failOnStderr: true
displayName: 'Test the wheels with pytest'
Expand Down Expand Up @@ -314,22 +268,13 @@ jobs:
pathToPublish: '$(Build.ArtifactStagingDirectory)'
artifactName: 'wheel_and_doc'

- bash: |
pip install twine
twine upload -u giotto-learn -p $(pypi_psw) --skip-existing dist/*
condition: eq(variables['nightly_check'], 'true')
displayName: 'Upload nightly wheels to PyPI'

- job: 'win2016'
condition: eq(variables['build_check'], 'true')
pool:
vmImage: 'vs2017-win2016'
strategy:
matrix:
Python35:
python_ver: '35'
python.version: '3.5'
Python36:
python_ver: '36'
python.version: '3.6'
Expand All @@ -345,14 +290,6 @@ jobs:
inputs:
versionSpec: '$(python.version)'

- bash: |
sed -i "s/'pyflagser'/'pyflagser-nightly'/1" setup.py
sed -i "s/__version__.*/__version__ = '$(Build.BuildNumber)'/1" pyflagser/_version.py
cat pyflagser/_version.py
failOnStderr: true
condition: eq(variables['nightly_check'], 'true')
displayName: 'Change name to pyflagser-nightly'
- script: |
python -m pip install --upgrade pip setuptools
failOnStderr: true
Expand All @@ -363,24 +300,17 @@ jobs:
failOnStderr: true
displayName: 'Install dev environment'
- script: |
pip uninstall -y pyflagser
condition: eq(variables['nightly_check'], 'false')
failOnStderr: true
displayName: 'Uninstall pyflagser dev'
- script: |
pip uninstall -y pyflagser-nightly
condition: eq(variables['nightly_check'], 'true')
failOnStderr: true
displayName: 'Uninstall pyflagser-nightly dev'
- script: |
pytest --cov pyflagser --cov-report xml
flake8
failOnStderr: true
displayName: 'Test with pytest and flake8'
- script: |
pip uninstall -y pyflagser
failOnStderr: true
displayName: 'Uninstall pyflagser dev'
- bash: |
sed -i $'s/\r$//' README.rst
pip install wheel
Expand All @@ -392,10 +322,10 @@ jobs:
failOnStderr: true
displayName: 'Install the wheels'

- bash: |
- script: |
mkdir tmp_test_cov
cd tmp_test_cov
pytest --pyargs pyflagser --ignore-glob='flagser*' --no-cov --no-coverage-upload
python -m pyflagser.tests --webdl --no-cov --no-coverage-upload
failOnStderr: true
displayName: 'Test the wheels with pytest'
Expand All @@ -410,10 +340,3 @@ jobs:
inputs:
pathToPublish: '$(Build.ArtifactStagingDirectory)'
artifactName: 'wheel_and_doc'

- bash: |
pip install twine
twine upload -u giotto-learn -p $(pypi_psw) --skip-existing dist/*
failOnStderr: true
condition: eq(variables['nightly_check'], 'true')
displayName: 'Upload nightly wheels to PyPI'
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
4 changes: 1 addition & 3 deletions pyflagser/_version.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
"""
``pyflagser`` is a python API for the C++ flagser library.
"""
"""``pyflagser`` is a python API for the C++ flagser library."""

# PEP0440 compatible formatted version, see:
# https://www.python.org/dev/peps/pep-0440/
Expand Down
5 changes: 3 additions & 2 deletions pyflagser/flagio.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@


def loadflag(fname, fmt='csr', dtype=None):
"""Load a flag matrix from a ``.flag`` file.
"""Load a ``.flag`` file, and return a matrix representation.
Parameters
----------
fname : file, str, or pathlib.Path, required
Filename of extension ``.flag``.
Filename of extension ``.flag`` containing the information of a flag
matrix.
fmt : {'dense', 'dia', 'csr', 'csc', 'lil', ...}, optional, default: 'csr'
Matrix format of the result. By default, a CSR sparse matrix is
Expand Down
Loading

0 comments on commit eb43890

Please sign in to comment.