From 17572871f39abf91bfe53c5340ef8bf20cf8a2a1 Mon Sep 17 00:00:00 2001 From: Tobias Raabe Date: Mon, 7 Feb 2022 17:41:03 +0100 Subject: [PATCH 1/4] Deprecate Python 3.6. Committed via https://github.com/asottile/all-repos --- .pre-commit-config.yaml | 3 ++- setup.cfg | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ee239b5..277c4b8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -32,11 +32,12 @@ repos: rev: v2.31.0 hooks: - id: pyupgrade - args: [--py36-plus] + args: [--py37-plus] - repo: https://github.com/asottile/reorder_python_imports rev: v2.7.1 hooks: - id: reorder-python-imports + args: [--py37-plus, --add-import, 'from __future__ import annotations'] - repo: https://github.com/asottile/setup-cfg-fmt rev: v1.20.0 hooks: diff --git a/setup.cfg b/setup.cfg index 1867a7f..9f25ebc 100644 --- a/setup.cfg +++ b/setup.cfg @@ -31,7 +31,7 @@ packages = find: install_requires = click pytask>=0.1.0 -python_requires = >=3.6 +python_requires = >=3.7 include_package_data = True package_dir = =src zip_safe = False From 9f169ee86823835cb4d8ec96d15170f900b91361 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 7 Feb 2022 16:42:34 +0000 Subject: [PATCH 2/4] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- setup.cfg | 2 +- setup.py | 2 ++ src/pytask_stata/__init__.py | 2 ++ src/pytask_stata/cli.py | 2 ++ src/pytask_stata/collect.py | 2 ++ src/pytask_stata/config.py | 2 ++ src/pytask_stata/execute.py | 2 ++ src/pytask_stata/parametrize.py | 2 ++ src/pytask_stata/plugin.py | 2 ++ src/pytask_stata/shared.py | 2 ++ tests/conftest.py | 2 ++ tests/test_collect.py | 2 ++ tests/test_config.py | 2 ++ tests/test_execute.py | 2 ++ tests/test_normal_execution_w_plugin.py | 2 ++ tests/test_parallel.py | 2 ++ tests/test_parametrize.py | 2 ++ 17 files changed, 33 insertions(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 9f25ebc..1867a7f 100644 --- a/setup.cfg +++ b/setup.cfg @@ -31,7 +31,7 @@ packages = find: install_requires = click pytask>=0.1.0 -python_requires = >=3.7 +python_requires = >=3.6 include_package_data = True package_dir = =src zip_safe = False diff --git a/setup.py b/setup.py index 26e08e4..c21a9ee 100644 --- a/setup.py +++ b/setup.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from setuptools import setup diff --git a/src/pytask_stata/__init__.py b/src/pytask_stata/__init__.py index 165802c..f493641 100644 --- a/src/pytask_stata/__init__.py +++ b/src/pytask_stata/__init__.py @@ -1,3 +1,5 @@ +from __future__ import annotations + try: from ._version import version as __version__ except ImportError: diff --git a/src/pytask_stata/cli.py b/src/pytask_stata/cli.py index f7a1878..5ceda23 100644 --- a/src/pytask_stata/cli.py +++ b/src/pytask_stata/cli.py @@ -1,4 +1,6 @@ """Everything related to the CLI.""" +from __future__ import annotations + import click from _pytask.config import hookimpl diff --git a/src/pytask_stata/collect.py b/src/pytask_stata/collect.py index 5ae5b7a..defe8d1 100644 --- a/src/pytask_stata/collect.py +++ b/src/pytask_stata/collect.py @@ -1,4 +1,6 @@ """Collect tasks.""" +from __future__ import annotations + import copy import functools import subprocess diff --git a/src/pytask_stata/config.py b/src/pytask_stata/config.py index 44a57e3..cbc5935 100644 --- a/src/pytask_stata/config.py +++ b/src/pytask_stata/config.py @@ -1,4 +1,6 @@ """Configure pytask.""" +from __future__ import annotations + import shutil import sys diff --git a/src/pytask_stata/execute.py b/src/pytask_stata/execute.py index 0fc84bb..cf7ebb7 100644 --- a/src/pytask_stata/execute.py +++ b/src/pytask_stata/execute.py @@ -1,4 +1,6 @@ """Execute tasks.""" +from __future__ import annotations + import re from _pytask.config import hookimpl diff --git a/src/pytask_stata/parametrize.py b/src/pytask_stata/parametrize.py index 8494ac3..6d73abd 100644 --- a/src/pytask_stata/parametrize.py +++ b/src/pytask_stata/parametrize.py @@ -1,4 +1,6 @@ """Parametrize tasks.""" +from __future__ import annotations + from _pytask.config import hookimpl from _pytask.mark import MARK_GEN as mark # noqa: N811 diff --git a/src/pytask_stata/plugin.py b/src/pytask_stata/plugin.py index c3d7ab7..686e412 100644 --- a/src/pytask_stata/plugin.py +++ b/src/pytask_stata/plugin.py @@ -1,4 +1,6 @@ """Register hook specifications and implementations.""" +from __future__ import annotations + from _pytask.config import hookimpl from pytask_stata import cli from pytask_stata import collect diff --git a/src/pytask_stata/shared.py b/src/pytask_stata/shared.py index 2272904..49ef00e 100644 --- a/src/pytask_stata/shared.py +++ b/src/pytask_stata/shared.py @@ -1,4 +1,6 @@ """Shared functions and variables.""" +from __future__ import annotations + import sys diff --git a/tests/conftest.py b/tests/conftest.py index 364aedf..2cb9a8c 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import shutil import pytest diff --git a/tests/test_collect.py b/tests/test_collect.py index 0343936..e0920b3 100644 --- a/tests/test_collect.py +++ b/tests/test_collect.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from contextlib import ExitStack as does_not_raise # noqa: N813 from pathlib import Path diff --git a/tests/test_config.py b/tests/test_config.py index 1121c10..19d9be7 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import pytest from pytask import main from pytask_stata.config import _nonnegative_nonzero_integer diff --git a/tests/test_execute.py b/tests/test_execute.py index 163f7b5..2d8025d 100644 --- a/tests/test_execute.py +++ b/tests/test_execute.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import sys import textwrap from contextlib import ExitStack as does_not_raise # noqa: N813 diff --git a/tests/test_normal_execution_w_plugin.py b/tests/test_normal_execution_w_plugin.py index 7e06201..ee19252 100644 --- a/tests/test_normal_execution_w_plugin.py +++ b/tests/test_normal_execution_w_plugin.py @@ -1,4 +1,6 @@ """Contains tests which do not require the plugin and ensure normal execution.""" +from __future__ import annotations + import textwrap import pytest diff --git a/tests/test_parallel.py b/tests/test_parallel.py index f3212b1..5344b53 100644 --- a/tests/test_parallel.py +++ b/tests/test_parallel.py @@ -1,4 +1,6 @@ """Contains test which ensure that the plugin works with pytask-parallel.""" +from __future__ import annotations + import textwrap import time diff --git a/tests/test_parametrize.py b/tests/test_parametrize.py index 27dab52..ca34019 100644 --- a/tests/test_parametrize.py +++ b/tests/test_parametrize.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import sys import textwrap From c51de26777949f3d9835e3e963149660e116be63 Mon Sep 17 00:00:00 2001 From: Tobias Raabe Date: Mon, 7 Feb 2022 22:50:04 +0100 Subject: [PATCH 3/4] Fix types. --- CHANGES.rst | 7 +++++++ src/pytask_stata/collect.py | 4 +--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 9478ac9..8ced206 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -7,6 +7,13 @@ all releases are available on `PyPI `_ an `Anaconda.org `_. +0.1.1 - 2022-02-07 +------------------ + +- :gh:`16` skips concurrent CI builds. +- :gh:`17` deprecates Python 3.6 and adds support for Python 3.10. + + 0.1.0 - 2021-07-21 ------------------ diff --git a/src/pytask_stata/collect.py b/src/pytask_stata/collect.py index defe8d1..337f1a1 100644 --- a/src/pytask_stata/collect.py +++ b/src/pytask_stata/collect.py @@ -5,9 +5,7 @@ import functools import subprocess from typing import Iterable -from typing import Optional from typing import Sequence -from typing import Union from _pytask.config import hookimpl from _pytask.mark_utils import get_specific_markers_from_task @@ -19,7 +17,7 @@ from pytask_stata.shared import get_node_from_dictionary -def stata(options: Optional[Union[str, Iterable[str]]] = None): +def stata(options: str | Iterable[str] | None = None): """Specify command line options for Stata. Parameters From 8efdb31edf52fb41f6f078d4de90d8a1356d15f2 Mon Sep 17 00:00:00 2001 From: Tobias Raabe Date: Mon, 7 Feb 2022 22:50:52 +0100 Subject: [PATCH 4/4] support py310 in ci. --- .github/workflows/continuous-integration-workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/continuous-integration-workflow.yml b/.github/workflows/continuous-integration-workflow.yml index 9cbd896..7c27728 100644 --- a/.github/workflows/continuous-integration-workflow.yml +++ b/.github/workflows/continuous-integration-workflow.yml @@ -18,7 +18,7 @@ jobs: fail-fast: false matrix: os: ['ubuntu-latest', 'macos-latest', 'windows-latest'] - python-version: ['3.7', '3.8', '3.9'] + python-version: ['3.7', '3.8', '3.9', '3.10'] steps: - uses: actions/checkout@v2