From 756475d3dad717515be00d9cf2509309aef8f501 Mon Sep 17 00:00:00 2001 From: Jake VanderPlas Date: Mon, 15 Nov 2021 06:36:48 -0800 Subject: [PATCH 1/4] MAINT: drop Python 3.6; add 3.9 & 3.10 --- .github/workflows/build.yml | 2 +- .github/workflows/lint.yml | 4 ++-- pyproject.toml | 2 +- setup.py | 3 ++- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 650dd06..5ca7e0d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [ '3.6', '3.7', '3.8' ] + python-version: [ '3.7', '3.8', '3.9', '3.10' ] name: Python ${{ matrix.python-version }} steps: - uses: actions/checkout@v1 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index cd09259..4f5f332 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -8,10 +8,10 @@ jobs: name: flake8-black-mypy steps: - uses: actions/checkout@v1 - - name: Set up Python 3.8 + - name: Set up Python 3.10 uses: actions/setup-python@v1 with: - python-version: 3.8 + python-version: "3.10" - name: Lint with flake8 run: | pip install flake8 diff --git a/pyproject.toml b/pyproject.toml index 60e748f..3583668 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.black] line-length = 88 -target-version = ['py36', 'py37', 'py38'] +target-version = ['py37', 'py38', 'py39'] include = '\.pyi?$' exclude = ''' /( diff --git a/setup.py b/setup.py index d00f8eb..0683efe 100644 --- a/setup.py +++ b/setup.py @@ -77,8 +77,9 @@ def find_packages(top=HERE): "Intended Audience :: Science/Research", "License :: OSI Approved :: BSD License", "Natural Language :: English", - "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", ], ) From 82224e4dcbac943105bc132ecbec21d0f00423dc Mon Sep 17 00:00:00 2001 From: Jake VanderPlas Date: Mon, 15 Nov 2021 06:37:00 -0800 Subject: [PATCH 2/4] Fix black formatting --- altair_saver/savers/_selenium.py | 9 +++++++-- altair_saver/savers/tests/test_html.py | 4 +++- altair_saver/savers/tests/test_node.py | 4 +++- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/altair_saver/savers/_selenium.py b/altair_saver/savers/_selenium.py index 0ac3208..6839000 100644 --- a/altair_saver/savers/_selenium.py +++ b/altair_saver/savers/_selenium.py @@ -215,11 +215,16 @@ def _serve(cls, content: str, js_resources: Dict[str, str]) -> str: if cls._provider is None: cls._provider = Provider() resource = cls._provider.create( - content=content, route="", headers={"Access-Control-Allow-Origin": "*"}, + content=content, + route="", + headers={"Access-Control-Allow-Origin": "*"}, ) cls._resources[resource.url] = resource for route, content in js_resources.items(): - cls._resources[route] = cls._provider.create(content=content, route=route,) + cls._resources[route] = cls._provider.create( + content=content, + route=route, + ) return resource.url @classmethod diff --git a/altair_saver/savers/tests/test_html.py b/altair_saver/savers/tests/test_html.py index 6899fec..b3c2183 100644 --- a/altair_saver/savers/tests/test_html.py +++ b/altair_saver/savers/tests/test_html.py @@ -75,7 +75,9 @@ def test_html_save( @pytest.mark.parametrize("embed_options", [None, {"theme": "dark"}]) @pytest.mark.parametrize("case, data", get_testcases()) def test_html_mimebundle( - case: str, data: Dict[str, Any], embed_options: Optional[dict], + case: str, + data: Dict[str, Any], + embed_options: Optional[dict], ) -> None: saver = HTMLSaver(data["vega-lite"], embed_options=embed_options) bundle = saver.mimebundle("html") diff --git a/altair_saver/savers/tests/test_node.py b/altair_saver/savers/tests/test_node.py index 568d4bc..997794d 100644 --- a/altair_saver/savers/tests/test_node.py +++ b/altair_saver/savers/tests/test_node.py @@ -112,7 +112,9 @@ def exec_path(name: str) -> str: @pytest.mark.parametrize("suppress_warnings", [True, False]) def test_stderr_suppression( - interactive_spec: JSONDict, suppress_warnings: bool, capsys: SysCapture, + interactive_spec: JSONDict, + suppress_warnings: bool, + capsys: SysCapture, ) -> None: message = "WARN Can not resolve event source: window" From edf6abcf8f64242de07eafe9c2a8c0648a62f89d Mon Sep 17 00:00:00 2001 From: Jake VanderPlas Date: Mon, 15 Nov 2021 06:51:10 -0800 Subject: [PATCH 3/4] Fix node version --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5ca7e0d..d13a2b9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,7 +18,7 @@ jobs: - name: Set Up Node uses: actions/setup-node@v1 with: - node-version: '10.x' + node-version: '17.x' - name: Set Up Chromedriver run: | sudo apt-get update @@ -33,7 +33,7 @@ jobs: pip install pillow pypdf2 # optional test requirements pip install . - name: Test with pytest - run: | + run: | pip install pytest pytest --doctest-modules altair_saver \ No newline at end of file From b467eaa9065fc00fff1610d94231fd80a5cb0a42 Mon Sep 17 00:00:00 2001 From: Jake VanderPlas Date: Mon, 15 Nov 2021 07:52:23 -0800 Subject: [PATCH 4/4] try node 14 --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d13a2b9..c408b0d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,9 +16,9 @@ jobs: with: python-version: ${{ matrix.python-version }} - name: Set Up Node - uses: actions/setup-node@v1 + uses: actions/setup-node@v2 with: - node-version: '17.x' + node-version: '14' - name: Set Up Chromedriver run: | sudo apt-get update