From 3d2c1733aa11fede6b2e86bfd4211a398c602c85 Mon Sep 17 00:00:00 2001 From: Jiri BOROVEC Date: Wed, 21 Aug 2019 21:20:21 +0200 Subject: [PATCH 1/8] update git ignore --- .gitignore | 117 +++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 113 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 7716419b6..584eb63f7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,115 @@ +*.jpg +*.png +*.weights +*.h5 +logs/ +*_test.py + +# Byte-compiled / optimized / DLL files __pycache__/ -*.pyc -*.c +*.py[cod] +*$py.class + +# C extensions *.so -/.pytest_cache -/.cache + +# Distribution / packaging +.Python +env/ +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +*.egg-info/ +.installed.cfg +*.egg + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +.hypothesis/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# pyenv +.python-version + +# celery beat schedule file +celerybeat-schedule + +# SageMath parsed files +*.sage.py + +# dotenv +.env + +# virtualenv +.venv +venv/ +ENV/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ + +# PyCharm IDE +.idea/ + +# Temporary +temp/ +temporary/ From 6f03fa6d09611a792f58d20322cffd7f702a8f2a Mon Sep 17 00:00:00 2001 From: Jiri BOROVEC Date: Wed, 21 Aug 2019 21:20:39 +0200 Subject: [PATCH 2/8] add requirements --- requirements.txt | 11 +++++++++++ tests/requirements.txt | 5 +++++ 2 files changed, 16 insertions(+) create mode 100644 requirements.txt create mode 100644 tests/requirements.txt diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 000000000..82a042e4b --- /dev/null +++ b/requirements.txt @@ -0,0 +1,11 @@ +cython +keras-resnet +git+https://github.com/cocodataset/cocoapi.git#subdirectory=PythonAPI +h5py +keras +matplotlib +numpy>=1.14 +opencv-python>=3.3.0 +pillow +progressbar2 +tensorflow \ No newline at end of file diff --git a/tests/requirements.txt b/tests/requirements.txt new file mode 100644 index 000000000..3be0885ea --- /dev/null +++ b/tests/requirements.txt @@ -0,0 +1,5 @@ +check-manifest +pytest +pytest-flake8 +pytest-xdist +coverage \ No newline at end of file From 07be31a45c322b14b1b5469ebaa05d8520d93a6f Mon Sep 17 00:00:00 2001 From: Jiri BOROVEC Date: Wed, 21 Aug 2019 21:20:52 +0200 Subject: [PATCH 3/8] update travis --- .travis.yml | 22 +++++++--------------- tests/requirements.txt | 5 +++-- 2 files changed, 10 insertions(+), 17 deletions(-) diff --git a/.travis.yml b/.travis.yml index 07cc6c5a5..7d1ecd87a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,23 +1,15 @@ language: python sudo: required python: - - '3.6' - '2.7' + - '3.6' install: - - pip install 'cython' - - pip install 'keras-resnet' - - pip install 'git+https://github.com/cocodataset/cocoapi.git#subdirectory=PythonAPI' - - pip install 'h5py' - - pip install 'keras' - - pip install 'matplotlib' - - pip install 'numpy>=1.14' - - pip install 'opencv-python>=3.3.0' - - pip install 'pillow' - - pip install 'progressbar2' - - pip install 'pytest-flake8' - - pip install 'pytest-xdist' - - pip install 'tensorflow' + - pip install -r requirements.txt + - pip install -r tests/requirements.txt cache: pip script: + - python setup.py check -m -s - python setup.py build_ext --inplace - - py.test --flake8 --forked + - coverage run --source keras_retinanet -m py.test keras_retinanet tests -v --doctest-modules --forked + - coverage report + - flake8 . --max-line-length=100 diff --git a/tests/requirements.txt b/tests/requirements.txt index 3be0885ea..772bea848 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -1,5 +1,6 @@ check-manifest -pytest -pytest-flake8 +# pytest pytest-xdist +pytest-cov +flake8 coverage \ No newline at end of file From 852dbb1e065513efa18256224ac99d21fd5c13ba Mon Sep 17 00:00:00 2001 From: Jiri BOROVEC Date: Wed, 21 Aug 2019 23:06:00 +0200 Subject: [PATCH 4/8] flake8 ignore actual issues --- .travis.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7d1ecd87a..31a957020 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,5 +11,7 @@ script: - python setup.py check -m -s - python setup.py build_ext --inplace - coverage run --source keras_retinanet -m py.test keras_retinanet tests -v --doctest-modules --forked - - coverage report - - flake8 . --max-line-length=100 + # ignore all actual PEP8 issues + - flake8 . --max-line-length=100 --ignore=E201,E202,E203,E221,E241,E251,E402,E501,W504 +after_success: + - coverage report \ No newline at end of file From c7293577a2428d84cccc65eeccdb69eb04c6b359 Mon Sep 17 00:00:00 2001 From: Jiri BOROVEC Date: Thu, 22 Aug 2019 15:54:15 +0200 Subject: [PATCH 5/8] review * simplify .gitignore * move flake8 to pytest * def keras-resnet==0.1.0 --- .gitignore | 57 +++--------------------------------------- .travis.yml | 4 +-- requirements.txt | 2 +- setup.cfg | 2 +- tests/requirements.txt | 3 ++- 5 files changed, 10 insertions(+), 58 deletions(-) diff --git a/.gitignore b/.gitignore index 584eb63f7..90448ca9d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,10 +1,3 @@ -*.jpg -*.png -*.weights -*.h5 -logs/ -*_test.py - # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] @@ -13,6 +6,10 @@ __pycache__/ # C extensions *.so +# Temporary +temp/ +temporary/ + # Distribution / packaging .Python env/ @@ -22,9 +19,6 @@ dist/ downloads/ eggs/ .eggs/ -lib/ -lib64/ -parts/ sdist/ var/ wheels/ @@ -32,12 +26,6 @@ wheels/ .installed.cfg *.egg -# PyInstaller -# Usually these files are written by a python script from a template -# before PyInstaller builds the exe, so as to inject date/other infos into it. -*.manifest -*.spec - # Installer logs pip-log.txt pip-delete-this-directory.txt @@ -53,54 +41,21 @@ coverage.xml *.cover .hypothesis/ -# Translations -*.mo -*.pot - -# Django stuff: -*.log -local_settings.py - -# Flask stuff: -instance/ -.webassets-cache - -# Scrapy stuff: -.scrapy - # Sphinx documentation docs/_build/ -# PyBuilder -target/ - # Jupyter Notebook .ipynb_checkpoints # pyenv .python-version - -# celery beat schedule file -celerybeat-schedule - -# SageMath parsed files -*.sage.py - # dotenv .env - # virtualenv .venv venv/ ENV/ -# Spyder project settings -.spyderproject -.spyproject - -# Rope project settings -.ropeproject - # mkdocs documentation /site @@ -109,7 +64,3 @@ ENV/ # PyCharm IDE .idea/ - -# Temporary -temp/ -temporary/ diff --git a/.travis.yml b/.travis.yml index 31a957020..03ab63bda 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,8 +10,8 @@ cache: pip script: - python setup.py check -m -s - python setup.py build_ext --inplace - - coverage run --source keras_retinanet -m py.test keras_retinanet tests -v --doctest-modules --forked + - coverage run --source keras_retinanet -m py.test keras_retinanet tests --doctest-modules --forked --flake8 # ignore all actual PEP8 issues - - flake8 . --max-line-length=100 --ignore=E201,E202,E203,E221,E241,E251,E402,E501,W504 + # - flake8 . --max-line-length=100 --ignore=E201,E202,E203,E221,E241,E251,E402,E501,W504 after_success: - coverage report \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 82a042e4b..b45a940ef 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ cython -keras-resnet +keras-resnet==0.1.0 git+https://github.com/cocodataset/cocoapi.git#subdirectory=PythonAPI h5py keras diff --git a/setup.cfg b/setup.cfg index 7279e65a3..354574e44 100644 --- a/setup.cfg +++ b/setup.cfg @@ -8,5 +8,5 @@ # E501 line too long (85 > 79 characters) # W504 line break after binary operator [tool:pytest] -flake8-max-line-length = 127 +flake8-max-line-length = 100 flake8-ignore = E201 E202 E203 E221 E241 E251 E402 E501 W504 diff --git a/tests/requirements.txt b/tests/requirements.txt index 772bea848..324f138ab 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -2,5 +2,6 @@ check-manifest # pytest pytest-xdist pytest-cov -flake8 +pytest-flake8 +# flake8 coverage \ No newline at end of file From 198ad7eead41673b36e2f7ea561c2c91373a3bb8 Mon Sep 17 00:00:00 2001 From: Jiri BOROVEC Date: Thu, 22 Aug 2019 16:29:02 +0200 Subject: [PATCH 6/8] add codecov --- .codecov.yml | 42 ++++++++++++++++++++++++++++++++++++++++++ .travis.yml | 3 ++- tests/requirements.txt | 3 ++- 3 files changed, 46 insertions(+), 2 deletions(-) create mode 100644 .codecov.yml diff --git a/.codecov.yml b/.codecov.yml new file mode 100644 index 000000000..4870d1442 --- /dev/null +++ b/.codecov.yml @@ -0,0 +1,42 @@ +#see https://github.com/codecov/support/wiki/Codecov-Yaml +codecov: + notify: + require_ci_to_pass: yes + +coverage: + precision: 0 # 2 = xx.xx%, 0 = xx% + round: nearest # how coverage is rounded: down/up/nearest + range: 40...100 # custom range of coverage colors from red -> yellow -> green + status: + # https://codecov.readme.io/v1.0/docs/commit-status + project: + default: + against: auto + target: 90% # specify the target coverage for each commit status + threshold: 20% # allow this little decrease on project + # https://github.com/codecov/support/wiki/Filtering-Branches + # branches: master + if_ci_failed: error + # https://github.com/codecov/support/wiki/Patch-Status + patch: + default: + against: auto + target: 40% # specify the target "X%" coverage to hit + # threshold: 50% # allow this much decrease on patch + changes: false + +parsers: + gcov: + branch_detection: + conditional: true + loop: true + macro: false + method: false + javascript: + enable_partials: false + +comment: + layout: header, diff + require_changes: false + behavior: default # update if exists else create new + # branches: * \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 03ab63bda..f08acf140 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,4 +14,5 @@ script: # ignore all actual PEP8 issues # - flake8 . --max-line-length=100 --ignore=E201,E202,E203,E221,E241,E251,E402,E501,W504 after_success: - - coverage report \ No newline at end of file + - coverage report + - codecov \ No newline at end of file diff --git a/tests/requirements.txt b/tests/requirements.txt index 324f138ab..366608c48 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -4,4 +4,5 @@ pytest-xdist pytest-cov pytest-flake8 # flake8 -coverage \ No newline at end of file +coverage +codecov \ No newline at end of file From 18eb79a8a9caf53f08d53def2bf47652840a7c54 Mon Sep 17 00:00:00 2001 From: Jiri BOROVEC Date: Wed, 4 Sep 2019 13:21:26 +0200 Subject: [PATCH 7/8] prune git-ignore --- .gitignore | 44 +------------------------------------------- .travis.yml | 11 ++++++++--- 2 files changed, 9 insertions(+), 46 deletions(-) diff --git a/.gitignore b/.gitignore index 90448ca9d..51f3274d9 100644 --- a/.gitignore +++ b/.gitignore @@ -3,64 +3,22 @@ __pycache__/ *.py[cod] *$py.class -# C extensions -*.so - -# Temporary -temp/ -temporary/ - # Distribution / packaging .Python -env/ build/ develop-eggs/ dist/ -downloads/ eggs/ .eggs/ sdist/ -var/ wheels/ *.egg-info/ .installed.cfg *.egg -# Installer logs -pip-log.txt -pip-delete-this-directory.txt - # Unit test / coverage reports -htmlcov/ -.tox/ .coverage .coverage.* .cache -nosetests.xml coverage.xml -*.cover -.hypothesis/ - -# Sphinx documentation -docs/_build/ - -# Jupyter Notebook -.ipynb_checkpoints - -# pyenv -.python-version -# dotenv -.env -# virtualenv -.venv -venv/ -ENV/ - -# mkdocs documentation -/site - -# mypy -.mypy_cache/ - -# PyCharm IDE -.idea/ +*.cover \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index f08acf140..38b74fc69 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,18 +1,23 @@ language: python + sudo: required + python: - '2.7' - '3.6' + install: - pip install -r requirements.txt - pip install -r tests/requirements.txt + cache: pip + script: - python setup.py check -m -s - python setup.py build_ext --inplace - coverage run --source keras_retinanet -m py.test keras_retinanet tests --doctest-modules --forked --flake8 - # ignore all actual PEP8 issues - # - flake8 . --max-line-length=100 --ignore=E201,E202,E203,E221,E241,E251,E402,E501,W504 + after_success: + - coverage xml - coverage report - - codecov \ No newline at end of file + - codecov From 4cec6f9571c91619f98d8937f3304786a3522888 Mon Sep 17 00:00:00 2001 From: Jiri BOROVEC Date: Wed, 4 Sep 2019 13:54:35 +0200 Subject: [PATCH 8/8] update git-ignore --- .gitignore | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 51f3274d9..0293450db 100644 --- a/.gitignore +++ b/.gitignore @@ -5,20 +5,19 @@ __pycache__/ # Distribution / packaging .Python -build/ -develop-eggs/ -dist/ -eggs/ +/build/ +/dist/ +/eggs/ +/*-eggs/ .eggs/ -sdist/ -wheels/ -*.egg-info/ +/sdist/ +/wheels/ +/*.egg-info/ .installed.cfg *.egg # Unit test / coverage reports .coverage .coverage.* -.cache coverage.xml *.cover \ No newline at end of file