From 40f54dc5ded8f03ef58365d035ffa229d6022b43 Mon Sep 17 00:00:00 2001 From: Jirka Borovec Date: Wed, 28 Oct 2020 13:56:22 +0100 Subject: [PATCH] clean docs conf. * install py27 --- .github/workflows/ci-testing.yml | 2 +- .travis.yml | 2 +- README.md | 2 +- circle.yml | 2 +- docs/source/conf.py | 9 +++++---- requirements-py27.txt | 2 +- requirements.txt | 4 ++-- setup.cfg | 4 +++- setup.py | 3 ++- 9 files changed, 17 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci-testing.yml b/.github/workflows/ci-testing.yml index 7b241c50..93604536 100644 --- a/.github/workflows/ci-testing.yml +++ b/.github/workflows/ci-testing.yml @@ -81,7 +81,7 @@ jobs: python setup.py check --metadata --strict python setup.py install --dry-run --user python setup.py build_ext --inplace - coverage run --source imsegm -m py.test imsegm tests --durations=25 --junitxml=junit/test-results-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.requires }}.xml + coverage run --source imsegm -m pytest imsegm tests --durations=25 --junitxml=junit/test-results-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.requires }}.xml flake8 . - name: Upload pytest test results diff --git a/.travis.yml b/.travis.yml index aa059487..6c829ff1 100755 --- a/.travis.yml +++ b/.travis.yml @@ -63,7 +63,7 @@ before_script: script: - python setup.py build_ext --inplace # - pytest imsegm -v --doctest-modules - - coverage run --source imsegm -m py.test imsegm tests # --flake8 + - coverage run --source imsegm -m pytest imsegm tests # --flake8 # - nosetests imsegm tests -v --exe --with-doctest --with-xunit --with-coverage --cover-package=imsegm - python setup.py install --dry-run diff --git a/README.md b/README.md index 8ec79972..cf0f8796 100755 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Image segmentation toolbox -[![Build Status](https://travis-ci.org/Borda/pyImSegm.svg?branch=master)](https://travis-ci.org/Borda/pyImSegm) +[![Build Status](https://travis-ci.com/Borda/pyImSegm.svg?branch=master)](https://travis-ci.com/Borda/pyImSegm) [![codecov](https://codecov.io/gh/Borda/pyImSegm/branch/master/graph/badge.svg?token=BCvf6F5sFP)](https://codecov.io/gh/Borda/pyImSegm) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/48b7976bbe9d42bc8452f6f9e573ee70)](https://www.codacy.com/app/Borda/pyImSegm?utm_source=github.com&utm_medium=referral&utm_content=Borda/pyImSegm&utm_campaign=Badge_Grade) [![CircleCI](https://circleci.com/gh/Borda/pyImSegm.svg?style=svg&circle-token=a30180a28ae7e490c0c0829d1549fcec9a5c59d0)](https://circleci.com/gh/Borda/pyImSegm) diff --git a/circle.yml b/circle.yml index 1191b97d..102700c5 100755 --- a/circle.yml +++ b/circle.yml @@ -21,7 +21,7 @@ references: command: | unset DISPLAY mkdir output && mkdir results && mkdir test-reports - coverage run --source imsegm -m py.test imsegm tests -v --junitxml=test-reports/pytest_junit.xml + coverage run --source imsegm -m pytest imsegm tests -v --junitxml=test-reports/pytest_junit.xml coverage report python setup.py check --metadata --strict diff --git a/docs/source/conf.py b/docs/source/conf.py index 789cb4c8..3f9c626b 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -21,8 +21,9 @@ import m2r -PATH_ROOT = os.path.join('..', '..') +PATH_UP = os.path.join('..', '..') PATH_HERE = os.path.abspath(os.path.dirname(__file__)) +PATH_ROOT = os.path.realpath(os.path.join(PATH_HERE, PATH_UP)) sys.path.insert(0, os.path.abspath(PATH_ROOT)) import imsegm # noqa: E402 @@ -65,7 +66,7 @@ readme = re.sub(r'(!\[.*.gif\))', '', readme) for dir_name in (os.path.basename(p) for p in glob.glob(os.path.join(PATH_ROOT, '*')) if os.path.isdir(p)): - readme = readme.replace('](%s/' % dir_name, '](%s/%s/' % (PATH_ROOT, dir_name)) + readme = readme.replace('](%s/' % dir_name, '](%s/%s/' % (PATH_UP, dir_name)) with open('readme.md', 'w') as fp: fp.write(readme) @@ -74,7 +75,7 @@ # If your documentation needs a minimal Sphinx version, state it here. -needs_sphinx = '2.2' +needs_sphinx = '2.4' # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom @@ -260,7 +261,7 @@ def run_apidoc(_): for pkg in PACKAGES: argv = ['-e', '-o', os.path.join(PATH_HERE, 'api'), - os.path.join(PATH_HERE, PATH_ROOT, pkg), + os.path.join(PATH_ROOT, pkg), 'tests/*', '--force'] try: diff --git a/requirements-py27.txt b/requirements-py27.txt index 8d51c5d2..2e38603d 100644 --- a/requirements-py27.txt +++ b/requirements-py27.txt @@ -3,7 +3,7 @@ Cython >= 0.23 numpy >= 1.9, < 1.16.0 # version 1.16 breaks skimage 0.14 scipy >= 0.15.1, < 1.3 pandas >= 0.14.1, < 0.24 -pillow >= 2.1.0 +pillow >= 2.1.0, != 7 matplotlib >= 2.0.2, < 3.0.0 scikit-learn >= 0.18.1, < 0.21 scikit-image >= 0.13.0, < 0.15 diff --git a/requirements.txt b/requirements.txt index 7957eb2f..4c8a2126 100755 --- a/requirements.txt +++ b/requirements.txt @@ -2,8 +2,8 @@ six >= 1.10 Cython >= 0.28 # 0.27 fails with python 3.7 numpy >= 1.13.3 # version 1.16 breaks skimage 0.14 scipy >= 1.0 -pandas >= 0.19 -pillow >= 4.0, < 7 # fail loading JPG images +pandas >= 0.21 +pillow >= 4.0, != 7 # fail loading JPG images matplotlib >= 2.0.2 scikit-learn >= 0.18.1 scikit-image >= 0.13.0 diff --git a/setup.cfg b/setup.cfg index 1fb896ed..653e1c31 100644 --- a/setup.cfg +++ b/setup.cfg @@ -17,7 +17,9 @@ verbose = 2 # max-complexity = 10 [tool:pytest] -addopts = --doctest-modules +addopts = + --doctest-modules + --color=yes log_cli = 1 log_cli_level = CRITICAL #log_cli_format = %(message)s diff --git a/setup.py b/setup.py index 0e0a0e0a..ae69e4a7 100644 --- a/setup.py +++ b/setup.py @@ -66,9 +66,10 @@ def _parse_requirements(file_path): if sys.version_info.major == 2: # numpy v1.17 drops support for py2 setup_reqs = ['Cython', 'numpy<1.17'] + install_reqs = _parse_requirements(os.path.join(HERE, 'requirements-py27.txt')) else: setup_reqs = ['Cython', 'numpy'] -install_reqs = _parse_requirements(os.path.join(HERE, 'requirements.txt')) + install_reqs = _parse_requirements(os.path.join(HERE, 'requirements.txt')) setup(