typeddjango / pytest-mypy-plugins

pytest plugin for testing mypy types, stubs, and plugins
https://pypi.org/project/pytest-mypy-plugins/
MIT License
102 stars 24 forks source link

Drop Python 3.6 support #70

Closed zero323 closed 1 year ago

zero323 commented 3 years ago

Python 3.6 is going to reach the end of its lifespan in 2021-12, so it is probably time to drop it from supported versions.

diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index af29a97..5787a03 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -13,7 +13,7 @@ jobs:

     strategy:
       matrix:
-        python-version: [3.6, 3.7, 3.8, 3.9]
+        python-version: [3.7, 3.8, 3.9]

     steps:
     - uses: actions/checkout@v2
diff --git a/setup.py b/setup.py
index 1c021aa..e058e7e 100644
--- a/setup.py
+++ b/setup.py
@@ -10,7 +10,6 @@ dependencies = [
     "pyyaml",
     "chevron",
     "regex",
-    "dataclasses ; python_version<'3.7'",
 ]

 setup(
@@ -27,11 +26,10 @@ setup(
     # the following makes a plugin available to pytest
     entry_points={"pytest11": ["pytest-mypy-plugins = pytest_mypy_plugins.collect"]},
     install_requires=dependencies,
-    python_requires=">=3.6",
+    python_requires=">=3.7",
     classifiers=[
         "Development Status :: 3 - Alpha",
         "License :: OSI Approved :: MIT License",
-        "Programming Language :: Python :: 3.6",
         "Programming Language :: Python :: 3.7",
         "Programming Language :: Python :: 3.8",
         "Programming Language :: Python :: 3.9",
sobolevn commented 3 years ago

I think that we should do it quite after the end-of-life. Because we are a testing tool. Other people might still support it in their projects.

Moreover, typing in 3.6 is completely different (not inference, but internals). Which might also be really important for our not-so-big userbase 🙂

zero323 commented 3 years ago

Makes sense. Let's leave it open anyway ‒ its time will come one day!

zero323 commented 3 years ago

BTW Do you think it is OK to add Python 3.10 to test matrix?

sobolevn commented 3 years ago

Yes, totally! But, I think there might be issues with black.

zero323 commented 3 years ago

Yes, totally! But, I think there might be issues with black.

At first glance

FROM python:3.10.0-buster

RUN useradd dev \
    && mkdir /home/dev \
    && chown dev:dev /home/dev

RUN apt update \
    && apt install -y git python3-pip \
    && rm -rf /var/cache/apt/*

USER dev

WORKDIR /home/dev

RUN python3 -m venv .venv

ENV PATH /home/dev/.venv/bin/:${PATH}

RUN git clone https://github.com/typeddjango/pytest-mypy-plugins.git

WORKDIR /home/dev/pytest-mypy-plugins

RUN pip3 install --upgrade pip \
    && pip3 install -r dev-requirements.txt \
    && pip3 install setuptools wheel

CMD pip install -e . \
    && pytest \
    && mypy . \
    && black --check pytest_mypy_plugins setup.py \
    && isort --check --diff .

things look OK (I've opened #71 to handle distutils deprecation).

============================= test session starts ==============================
platform linux -- Python 3.10.0, pytest-6.2.5, py-1.10.0, pluggy-1.0.0
rootdir: /home/dev/pytest-mypy-plugins, configfile: pytest.ini
plugins: mypy-plugins-1.9.0
collected 37 items

pytest_mypy_plugins/tests/test-extension.yml .
pytest_mypy_plugins/tests/test-parametrized.yml ......
pytest_mypy_plugins/tests/test-paths-from-env.yml ...
pytest_mypy_plugins/tests/test-regex_assertions.yml ......
pytest_mypy_plugins/tests/test-simple-cases.yml ..........
pytest_mypy_plugins/tests/test_utils.py ...........

=============================== warnings summary ===============================
pytest_mypy_plugins/tests/test-extension.yml::reveal_type_extension_is_loaded
  /home/dev/pytest-mypy-plugins/pytest_mypy_plugins/item.py:199: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
    import distutils.spawn

-- Docs: https://docs.pytest.org/en/stable/warnings.html
======================== 37 passed, 1 warning in 52.37s ========================
Success: no issues found in 8 source files
All done! ✨ 🍰 ✨
8 files would be left unchanged.
Skipped 2 files
sobolevn commented 3 years ago

Awesome! 🎉