Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added: warning, Python 3.6 support will be dropped in future versions #257

Merged
merged 4 commits into from
Aug 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
76 changes: 72 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,11 @@ jobs:
esac
pdm run test -e "${python_test_env}"

- name: Cache coverage
if: startsWith(matrix.python-version, '3.10')
- name: Cache coverage ${{ matrix.python-version }}
uses: actions/cache@v3
with:
path: ./.tox/py310/coverage
key: cache_coverage_${{ github.run_id }}
path: .coverage/env/.coverage.${{ matrix.python-version }}
key: cache_coverage_${{ matrix.python-version }}_${{ github.run_id }}

test_ubuntu20:
runs-on: ubuntu-20.04
Expand Down Expand Up @@ -187,3 +186,72 @@ jobs:
run: |
source .venv/bin/activate
tox -e py36 --installpkg dist/*.whl

- name: Cache coverage ${{ matrix.python-version }}
uses: actions/cache@v3
with:
path: .coverage/env/.coverage.${{ matrix.python-version }}
key: cache_coverage_${{ matrix.python-version }}_${{ github.run_id }}

test_coverage:
runs-on: ubuntu-22.04
needs: [test_ubuntu20, test_ubuntu22]

steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
fetch-depth: 1

- name: Cache dev-py environment
uses: actions/cache@v3
with:
path: .venv
key: cache_dev_py_ubuntu22_${{ hashFiles('pdm.lock') }}

- name: Cache coverage 3.6
uses: actions/cache@v3
with:
path: .coverage/env/.coverage.3.6
key: cache_coverage_3.6_${{ github.run_id }}

- name: Cache coverage 3.7
uses: actions/cache@v3
with:
path: .coverage/env/.coverage.3.7
key: cache_coverage_3.7_${{ github.run_id }}

- name: Cache coverage 3.8
uses: actions/cache@v3
with:
path: .coverage/env/.coverage.3.8
key: cache_coverage_3.8_${{ github.run_id }}

- name: Cache coverage 3.9
uses: actions/cache@v3
with:
path: .coverage/env/.coverage.3.9
key: cache_coverage_3.9_${{ github.run_id }}

- name: Cache coverage 3.10
uses: actions/cache@v3
with:
path: .coverage/env/.coverage.3.10
key: cache_coverage_3.10_${{ github.run_id }}

- name: Cache coverage 3.11
uses: actions/cache@v3
with:
path: .coverage/env/.coverage.3.11
key: cache_coverage_3.11_${{ github.run_id }}

- name: Report coverage
run: |
source .venv/bin/activate
tox -e coverage

- name: Cache coverage
uses: actions/cache@v3
with:
path: .coverage/html
key: cache_coverage_${{ github.run_id }}
4 changes: 2 additions & 2 deletions .github/workflows/doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
- name: Cache coverage
uses: actions/cache@v3
with:
path: ./.tox/py310/coverage
path: .coverage/html
key: cache_coverage_${{ github.run_id }}

- name: Install package
Expand Down Expand Up @@ -113,7 +113,7 @@ jobs:
- name: Cache coverage
uses: actions/cache@v3
with:
path: ./.tox/py310/coverage
path: .coverage/html
key: cache_coverage_${{ github.run_id }}

- name: Install package
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ vizzu-lib
.venv
.pdm-python
.tox
.coverage

site
.chromium
Expand Down
44 changes: 21 additions & 23 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -138,43 +138,38 @@ pkg_release = {composite = ["pkg_build", "pkg_check", "python ./tools/ci/version
[tool.tox]
legacy_tox_ini = """
[tox]
envlist = py{36,37,38,39,310,311}

[testenv]
deps =
envlist =
py{36,37,38,39,310,311}
coverage
openpyxl

[testenv:py{36}]
[testenv]
setenv =
COVERAGE_FILE = .tox/py36/.coverage
COVERAGE_FILE = .coverage/env/.coverage.{envname}
deps =
coverage[toml]
extras =
pandas
numpy
commands =
python -m coverage run --branch --source ipyvizzu -m unittest discover tests
python -m coverage report -m --fail-under=100 --omit .tox/py36/lib/python3.6/site-packages/ipyvizzu/integrations/fugue.py
python -m coverage report -m
python -c "import os; pyenv='{envname}'; os.rename('.coverage/env/.coverage.' + pyenv, '.coverage/env/.coverage.3.' + pyenv[3:])"

[testenv:py{37,38,39,311}]
[testenv:py{37,38,39,310,311}]
package = editable
deps =
{[testenv]deps}
openpyxl
extras =
pandas
numpy
{[testenv]extras}
fugue
commands =
python -m coverage run --data-file .tox/{envname}/.coverage --branch --source ipyvizzu -m unittest discover tests
python -m coverage report --data-file .tox/{envname}/.coverage -m --fail-under=100

[testenv:py{310}]
package = editable
extras =
pandas
numpy
fugue
[testenv:coverage]
skip_install = True
commands =
python -m coverage run --data-file .tox/{envname}/.coverage --branch --source ipyvizzu -m unittest discover tests
python -m coverage html --data-file .tox/{envname}/.coverage -d .tox/{envname}/coverage
python -m coverage report --data-file .tox/{envname}/.coverage -m --fail-under=100
python -m coverage combine --keep --data-file .coverage/.coverage .coverage/env/
python -m coverage html --data-file .coverage/.coverage -d .coverage/html
python -m coverage report --data-file .coverage/.coverage -m --fail-under=100
"""

[tool.pdm.dev-dependencies]
Expand Down Expand Up @@ -244,3 +239,6 @@ path = "src/ipyvizzu/__version__.py"
[tool.pylint.messages-control]
disable = ["fixme"]
good-names= ["i", "df"]

[tool.coverage.paths]
source = ["src/", ".tox/py*/lib/python*/site-packages/"]
14 changes: 14 additions & 0 deletions src/ipyvizzu/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@
* [DisplayTemplate][ipyvizzu.template.DisplayTemplate]
"""

import sys
import warnings

from .chart import Chart
from .animation import (
AbstractAnimation,
Expand Down Expand Up @@ -98,3 +101,14 @@
"DisplayTarget",
"DisplayTemplate",
]


if sys.version_info >= (3, 7):
veghdev marked this conversation as resolved.
Show resolved Hide resolved
pass
else:
# TODO: remove once support for Python 3.6 is dropped
warnings.warn(
"Python 3.6 support will be dropped in future versions.",
FutureWarning,
stacklevel=2,
)
2 changes: 1 addition & 1 deletion tools/docs/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ plugins:
- style/gen_style_reference.py
- coverage:
page_name: coverage
html_report_dir: .tox/py310/coverage
html_report_dir: .coverage/html
- literate-nav:
implicit_index: true

Expand Down