From 808ae824c6952f67a7cd729c8fac4c70f4e66282 Mon Sep 17 00:00:00 2001 From: Soledad Galli Date: Wed, 21 Sep 2022 09:16:36 +0200 Subject: [PATCH 01/11] add coverage to test req --- test_requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/test_requirements.txt b/test_requirements.txt index 13086c26b..2bcd47f9d 100644 --- a/test_requirements.txt +++ b/test_requirements.txt @@ -3,6 +3,7 @@ pytest>=5.4.1 # repo maintenance tooling black>=21.5b1 +coverage>=6.4.4 flake8>=3.9.2 mypy>=0.740 isort>=5.8.0 From f3fd22b9b51befe72fcd03c612ad768ac398261d Mon Sep 17 00:00:00 2001 From: Soledad Galli Date: Wed, 21 Sep 2022 09:44:04 +0200 Subject: [PATCH 02/11] add github action for coverage --- .github/workflow/workflow.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/workflow/workflow.yml diff --git a/.github/workflow/workflow.yml b/.github/workflow/workflow.yml new file mode 100644 index 000000000..7dccbadc9 --- /dev/null +++ b/.github/workflow/workflow.yml @@ -0,0 +1,23 @@ +name: CodeCov +on: [push, pull_request] +jobs: + run: + runs-on: ubuntu-latest + env: + OS: ubuntu-latest + PYTHON: '3.9' + steps: + - uses: checkout@v2 + with: + fetch-depth: ‘2’ + + - name: Setup Python + uses: actions/setup-python@master + with: + python-version: 3.7 + - name: Generate Report + run: | + pip install coverage + coverage run -m pytest + - name: Upload Coverage to Codecov + uses: codecov/codecov-action@v2 \ No newline at end of file From a0f129215bc04b97daa14b448c78c2db8c34b1c4 Mon Sep 17 00:00:00 2001 From: Soledad Galli Date: Wed, 21 Sep 2022 09:47:57 +0200 Subject: [PATCH 03/11] add codecov --- codecov.yml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 codecov.yml diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 000000000..a1945bfe1 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,4 @@ +ignore: + - "*/tests/*" + - "*/docs/*" + - "*/paper/*" From c5a6f317aedcd1d9f3978adc7814d2b06c86feae Mon Sep 17 00:00:00 2001 From: Soledad Galli Date: Wed, 21 Sep 2022 09:57:05 +0200 Subject: [PATCH 04/11] add coveragerc --- .coveragerc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .coveragerc diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 000000000..fe137b32d --- /dev/null +++ b/.coveragerc @@ -0,0 +1,15 @@ +# configuration for coverage.py + +[run] +branch = True +source = feature_engine +include = */feature_engine/* +omit = + */setup.py + + +[report] +exclude_lines = + pragma: no cover + +show_missing = True \ No newline at end of file From a4fec90ee993335e9e480f40498bb4d97b965a28 Mon Sep 17 00:00:00 2001 From: Soledad Galli Date: Wed, 21 Sep 2022 10:03:36 +0200 Subject: [PATCH 05/11] remove codecov --- codecov.yml | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 codecov.yml diff --git a/codecov.yml b/codecov.yml deleted file mode 100644 index a1945bfe1..000000000 --- a/codecov.yml +++ /dev/null @@ -1,4 +0,0 @@ -ignore: - - "*/tests/*" - - "*/docs/*" - - "*/paper/*" From f1d771cf1e84fc7268991fb42a4b5a3c3337d1d7 Mon Sep 17 00:00:00 2001 From: Soledad Galli Date: Wed, 21 Sep 2022 11:59:33 +0200 Subject: [PATCH 06/11] add coverage to tox --- .circleci/config.yml | 17 ++++++++++++++++- tox.ini | 12 +++++++++++- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c14af2dfc..3e2a530ac 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,4 +1,6 @@ -version: 2 +version: 2.1 +orbs: + codecov: codecov/codecov@3.2.3 defaults: &defaults docker: @@ -61,6 +63,19 @@ jobs: command: | tox -e py310 + test_codedov: + docker: + - image: circleci/python:3.9.0 + working_directory: ~/project + steps: + - checkout: + path: ~/project + - *prepare_tox + - run: + name: Run codecoverage + command: | + tox -e codecov + test_style: docker: - image: circleci/python:3.9.0 diff --git a/tox.ini b/tox.ini index caec17dba..627cdc297 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py38, py39, py310, docs, stylechecks, typechecks +envlist = py38, py39, py310, codecov, docs, stylechecks, typechecks skipsdist = true [testenv] @@ -8,6 +8,7 @@ envdir = {toxworkdir}/unit_tests setenv = PYTHONPATH=. + COVERAGE_RCFILE = {envtmpdir}/coveragerc commands = pytest tests @@ -25,6 +26,15 @@ deps = deps = -rtest_requirements.txt +[testenv:codecov] +deps = + -rtest_requirements.txt +commands_pre = + {envpython} -c 'from pathlib import Path; Path(r"{env:COVERAGE_RCFILE}").write_text(Path(".coveragerc").read_text())' +commands = + coverage run -m pytest -v + coverage report + [testenv:docs] deps = -r docs/requirements.txt From 04466882de3f7928875b1ae2d8a101c3fd40bdd0 Mon Sep 17 00:00:00 2001 From: Soledad Galli Date: Wed, 21 Sep 2022 12:43:17 +0200 Subject: [PATCH 07/11] remove github actions --- .github/workflow/workflow.yml | 23 ----------------------- 1 file changed, 23 deletions(-) delete mode 100644 .github/workflow/workflow.yml diff --git a/.github/workflow/workflow.yml b/.github/workflow/workflow.yml deleted file mode 100644 index 7dccbadc9..000000000 --- a/.github/workflow/workflow.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: CodeCov -on: [push, pull_request] -jobs: - run: - runs-on: ubuntu-latest - env: - OS: ubuntu-latest - PYTHON: '3.9' - steps: - - uses: checkout@v2 - with: - fetch-depth: ‘2’ - - - name: Setup Python - uses: actions/setup-python@master - with: - python-version: 3.7 - - name: Generate Report - run: | - pip install coverage - coverage run -m pytest - - name: Upload Coverage to Codecov - uses: codecov/codecov-action@v2 \ No newline at end of file From 80194d969bb065caa02ed39663ff507efac54bd8 Mon Sep 17 00:00:00 2001 From: Soledad Galli Date: Wed, 21 Sep 2022 14:14:32 +0200 Subject: [PATCH 08/11] modify circle config --- .circleci/config.yml | 32 +++++++++++++++++++------------- test_requirements.txt | 3 ++- 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3e2a530ac..93c70b5a3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -63,19 +63,6 @@ jobs: command: | tox -e py310 - test_codedov: - docker: - - image: circleci/python:3.9.0 - working_directory: ~/project - steps: - - checkout: - path: ~/project - - *prepare_tox - - run: - name: Run codecoverage - command: | - tox -e codecov - test_style: docker: - image: circleci/python:3.9.0 @@ -115,6 +102,24 @@ jobs: command: | tox -e typechecks + upload_codedov: + docker: + - image: circleci/python:3.9.0 + working_directory: ~/project + steps: + - checkout: + path: ~/project + - run: + name: Install dependencies + command: | + pip install --upgrade pip + pip install -r requirements.txt + pip install -r test_requirements.txt + - run: + name: Run tests and collect coverage + command: pytest --cov feature_engine + - codecov/upload + package_and_upload_to_pypi: <<: *defaults steps: @@ -142,6 +147,7 @@ workflows: - test_style - test_docs - test_type + - upload_codedov - package_and_upload_to_pypi: requires: - test_feature_engine_py38 diff --git a/test_requirements.txt b/test_requirements.txt index 2bcd47f9d..a4c03f8e7 100644 --- a/test_requirements.txt +++ b/test_requirements.txt @@ -5,5 +5,6 @@ pytest>=5.4.1 black>=21.5b1 coverage>=6.4.4 flake8>=3.9.2 -mypy>=0.740 isort>=5.8.0 +mypy>=0.740 +pytest-cov>=3.0.0 From 563f3d7690f5c6814543e0771a5f28cde328bbeb Mon Sep 17 00:00:00 2001 From: Soledad Galli Date: Wed, 21 Sep 2022 14:19:42 +0200 Subject: [PATCH 09/11] update config --- .circleci/config.yml | 9 ++++----- test_requirements.txt | 1 - 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 93c70b5a3..287ae2bd3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -102,7 +102,7 @@ jobs: command: | tox -e typechecks - upload_codedov: + upload_codecov: docker: - image: circleci/python:3.9.0 working_directory: ~/project @@ -110,14 +110,13 @@ jobs: - checkout: path: ~/project - run: - name: Install dependencies + name: Run tests and collect coverage command: | pip install --upgrade pip pip install -r requirements.txt pip install -r test_requirements.txt - - run: - name: Run tests and collect coverage - command: pytest --cov feature_engine + coverage run -m pytest -v + coverage report - codecov/upload package_and_upload_to_pypi: diff --git a/test_requirements.txt b/test_requirements.txt index a4c03f8e7..42ebfeb9b 100644 --- a/test_requirements.txt +++ b/test_requirements.txt @@ -7,4 +7,3 @@ coverage>=6.4.4 flake8>=3.9.2 isort>=5.8.0 mypy>=0.740 -pytest-cov>=3.0.0 From de37ce9ac1c88922023c226113fa7fd2436beda1 Mon Sep 17 00:00:00 2001 From: Soledad Galli Date: Wed, 21 Sep 2022 14:21:19 +0200 Subject: [PATCH 10/11] fix typo --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 287ae2bd3..fe86da366 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -146,7 +146,7 @@ workflows: - test_style - test_docs - test_type - - upload_codedov + - upload_codecov - package_and_upload_to_pypi: requires: - test_feature_engine_py38 From 7b1c3b0417106d10233afdcad524468ed13272f5 Mon Sep 17 00:00:00 2001 From: Soledad Galli Date: Wed, 21 Sep 2022 17:52:54 +0200 Subject: [PATCH 11/11] add badge to readme --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 49e749111..046177544 100644 --- a/README.md +++ b/README.md @@ -5,14 +5,15 @@ [![PyPI version](https://badge.fury.io/py/feature-engine.svg)](https://badge.fury.io/py/feature-engine) [![Conda https://anaconda.org/conda-forge/feature_engine](https://anaconda.org/conda-forge/feature_engine/badges/installer/conda.svg)](https://anaconda.org/conda-forge/feature_engine) [![CircleCI https://app.circleci.com/pipelines/github/feature-engine/feature_engine](https://img.shields.io/circleci/build/github/feature-engine/feature_engine/main)](https://app.circleci.com/pipelines/github/feature-engine/feature_engine?) +[![codecov](https://codecov.io/github/feature-engine/feature_engine/branch/master/graph/badge.svg?token=ZBKKSN6ERL)](https://codecov.io/github/feature-engine/feature_engine) [![Documentation Status https://feature-engine.readthedocs.io/en/latest/index.html](https://readthedocs.org/projects/feature-engine/badge/?version=latest)](https://feature-engine.readthedocs.io/en/latest/index.html) [![Join the chat at https://gitter.im/feature_engine/community](https://badges.gitter.im/feature_engine/community.svg)](https://gitter.im/feature_engine/community) -[![Sponsorship https://www.trainindata.com/](https://img.shields.io/badge/Powered%20By-TrainInData-orange.svg)](https://www.trainindata.com/) [![Downloads](https://pepy.tech/badge/feature-engine)](https://pepy.tech/project/feature-engine) [![Downloads](https://pepy.tech/badge/feature-engine/month)](https://pepy.tech/project/feature-engine) [![DOI](https://zenodo.org/badge/163630824.svg)](https://zenodo.org/badge/latestdoi/163630824) [![DOI](https://joss.theoj.org/papers/10.21105/joss.03642/status.svg)](https://doi.org/10.21105/joss.03642) [![first-timers-only](https://img.shields.io/badge/first--timers--only-friendly-blue.svg?style=flat-square)](https://www.firsttimersonly.com/) +[![Sponsorship https://www.trainindata.com/](https://img.shields.io/badge/Powered%20By-TrainInData-orange.svg)](https://www.trainindata.com/) [](http://feature-engine.readthedocs.io)