From 5e5a62a7a41270677f2c5f50f37a1057c1745fd2 Mon Sep 17 00:00:00 2001 From: Juarez Rudsatz Date: Mon, 31 Jan 2022 19:06:52 -0300 Subject: [PATCH 1/7] ci: run full doctests from python 3.6 to 3.10 --- .github/workflows/test-changes.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/test-changes.yml b/.github/workflows/test-changes.yml index dc921e42..7b626662 100644 --- a/.github/workflows/test-changes.yml +++ b/.github/workflows/test-changes.yml @@ -37,8 +37,7 @@ jobs: steps: - name: Determine what scope of testing is available on ${{ matrix.os }} if: | - matrix.python >= '3.6' && matrix.python != '3.9' && matrix.python != '3.10' && - (matrix.os != 'windows-latest' || matrix.python == '3.8') + matrix.python >= '3.6' && (matrix.os != 'windows-latest' || matrix.python >= '3.8') run: | echo 'testing=full' >> $GITHUB_ENV From e84fe4872fafd5fc52f924ac044dc98a58162b59 Mon Sep 17 00:00:00 2001 From: Juarez Rudsatz Date: Mon, 31 Jan 2022 20:53:23 -0300 Subject: [PATCH 2/7] pytest: fix pandas for python > 3.9 --- requirements-formats.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements-formats.txt b/requirements-formats.txt index 4480827d..767d87ea 100644 --- a/requirements-formats.txt +++ b/requirements-formats.txt @@ -5,6 +5,7 @@ intervaltree==3.0.2 lxml==4.6.5 openpyxl==2.6.2 pandas<=1.1.2,>=0.24.2 ; python_version < '3.9' +pandas ; python_version >= '3.9' tables Whoosh==2.7.4 xlrd==2.0.1 From 41a6b25f25e5439e28a0c358efcc1d8a082c9b55 Mon Sep 17 00:00:00 2001 From: Juarez Rudsatz Date: Mon, 31 Jan 2022 20:54:25 -0300 Subject: [PATCH 3/7] pytest: fix options for python2 doctests --- pytest.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/pytest.ini b/pytest.ini index a8ca65f4..f9f044da 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,2 +1,3 @@ [pytest] log_level=DEBUG +doctest_optionflags = NORMALIZE_WHITESPACE ALLOW_UNICODE From 0a2b49565002826f93984550cb89422d3209d521 Mon Sep 17 00:00:00 2001 From: Juarez Rudsatz Date: Mon, 31 Jan 2022 20:56:33 -0300 Subject: [PATCH 4/7] pytest: migration missed doctests --- .github/workflows/test-changes.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-changes.yml b/.github/workflows/test-changes.yml index 7b626662..5d535b23 100644 --- a/.github/workflows/test-changes.yml +++ b/.github/workflows/test-changes.yml @@ -118,10 +118,10 @@ jobs: if: env.testing == 'full' run: | echo "::group::Install extra packages test dependencies" - python -m pip install -r requirements-formats.txt + python -m pip install --prefer-binary -r requirements-formats.txt echo "::endgroup::" echo "::group::Perform doc test execution with coverage" - pytest --cov=petl petl + pytest --doctest-modules --ignore-glob='*_py2.py' --cov=petl petl echo "::endgroup::" - name: Coveralls From 2804b040be410948d01c97d9d2b7976b67fa7d04 Mon Sep 17 00:00:00 2001 From: Juarez Rudsatz Date: Mon, 31 Jan 2022 23:57:16 -0300 Subject: [PATCH 5/7] pytest: re-enable doctest on python 3.x, linux, macos --- .github/workflows/test-changes.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-changes.yml b/.github/workflows/test-changes.yml index 5d535b23..151f822d 100644 --- a/.github/workflows/test-changes.yml +++ b/.github/workflows/test-changes.yml @@ -37,7 +37,7 @@ jobs: steps: - name: Determine what scope of testing is available on ${{ matrix.os }} if: | - matrix.python >= '3.6' && (matrix.os != 'windows-latest' || matrix.python >= '3.8') + (matrix.python >= '3.' ) && ( matrix.os != 'windows-latest' ) run: | echo 'testing=full' >> $GITHUB_ENV @@ -120,7 +120,7 @@ jobs: echo "::group::Install extra packages test dependencies" python -m pip install --prefer-binary -r requirements-formats.txt echo "::endgroup::" - echo "::group::Perform doc test execution with coverage" + echo "::group::Perform doctest-modules execution with coverage" pytest --doctest-modules --ignore-glob='*_py2.py' --cov=petl petl echo "::endgroup::" From 63e5c864ce43382f2ed2d2c6b1f4addfdffb2e8c Mon Sep 17 00:00:00 2001 From: Juarez Rudsatz Date: Tue, 1 Feb 2022 00:43:27 -0300 Subject: [PATCH 6/7] pytest: ignore doctests for petl/io/db.py --- .github/workflows/test-changes.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-changes.yml b/.github/workflows/test-changes.yml index 151f822d..5f1c06a3 100644 --- a/.github/workflows/test-changes.yml +++ b/.github/workflows/test-changes.yml @@ -121,7 +121,7 @@ jobs: python -m pip install --prefer-binary -r requirements-formats.txt echo "::endgroup::" echo "::group::Perform doctest-modules execution with coverage" - pytest --doctest-modules --ignore-glob='*_py2.py' --cov=petl petl + pytest --doctest-modules --ignore-glob='*_py2.py' --ignore-glob='petl/io/db.py' --cov=petl petl echo "::endgroup::" - name: Coveralls From 6d09fbce30a2c8f8b3c8c5052c1eca3b2ac288fb Mon Sep 17 00:00:00 2001 From: Juarez Rudsatz Date: Tue, 1 Feb 2022 00:44:18 -0300 Subject: [PATCH 7/7] ci: speed up with pip install --prefer-binary --- .github/workflows/test-changes.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-changes.yml b/.github/workflows/test-changes.yml index 5f1c06a3..802dbceb 100644 --- a/.github/workflows/test-changes.yml +++ b/.github/workflows/test-changes.yml @@ -58,7 +58,7 @@ jobs: - name: Install test dependencies run: | python -m pip install --upgrade pip - python -m pip install -r requirements-tests.txt + python -m pip install --prefer-binary -r requirements-tests.txt - name: Setup environment variables for remote filesystem testing if: matrix.os == 'ubuntu-latest' && matrix.python == '3.8' @@ -68,7 +68,7 @@ jobs: echo "Setup SFTP environment variable to trigger testing in Petl" echo 'PETL_TEST_SFTP=sftp://petl:test@localhost:2244/public/' >> $GITHUB_ENV echo "::group::Install remote test dependencies" - python -m pip install -r requirements-remote.txt + python -m pip install --prefer-binary -r requirements-remote.txt echo "::endgroup::" - name: Install optinal test dependencies for mode ${{ env.testing }} @@ -104,7 +104,7 @@ jobs: docker run -it --name postgres -p 5432:5432 -e POSTGRES_DB=petl -e POSTGRES_USER=petl -e POSTGRES_PASSWORD=test -d postgres:latest echo "::endgroup::" echo "::group::Install database test dependencies" - python -m pip install -r requirements-database.txt + python -m pip install --prefer-binary -r requirements-database.txt echo "::endgroup::" - name: Setup petl package @@ -153,7 +153,7 @@ jobs: - name: Install doc generation dependencies run: | - python -m pip install -r requirements-docs.txt + python -m pip install --prefer-binary -r requirements-docs.txt - name: Setup petl package run: python setup.py build