Browse Source

Drop python3.7 support (#2003)

* Drop python3.7 support

* poetry.lock: relock without py3.7

* Update README/CONTRIBUTING to say 3.8+
Masen Furer 1 year ago
parent
commit
cbf5b61a23
12 changed files with 382 additions and 472 deletions
  1. 1 1
      CONTRIBUTING.md
  2. 1 1
      README.md
  3. 1 1
      docs/in/README.md
  4. 2 2
      docs/it/README.md
  5. 1 1
      docs/pt/pt_br/README.md
  6. 1 1
      docs/tr/README.md
  7. 1 1
      docs/zh/zh_cn/README.md
  8. 1 1
      docs/zh/zh_tw/README.md
  9. 369 446
      poetry.lock
  10. 2 4
      pyproject.toml
  11. 1 7
      reflex/constants/base.py
  12. 1 6
      tests/test_app.py

+ 1 - 1
CONTRIBUTING.md

@@ -8,7 +8,7 @@ For an extensive guide on the different ways to contribute to Reflex see our [Co
 Here is a quick guide to how the run Reflex repo locally so you can start contributing to the project.
 
 **Prerequisites:**
-- Python >= 3.7
+- Python >= 3.8
 - Poetry version >= 1.4.0 and add it to your path (see [Poetry Docs](https://python-poetry.org/docs/#installation) for more info).
 
 

+ 1 - 1
README.md

@@ -21,7 +21,7 @@
 ---
 ## ⚙️ Installation
 
-Open a terminal and run (Requires Python 3.7+):
+Open a terminal and run (Requires Python 3.8+):
 
 ```bash
 pip install reflex

+ 1 - 1
docs/in/README.md

@@ -21,7 +21,7 @@ Pynecone की तलाश हैं? आप सही रेपो में
 
 ## ⚙️ इंस्टॉलेशन 
 
-एक टर्मिनल खोलें और चलाएं (Python 3.7+ की आवश्यकता है):
+एक टर्मिनल खोलें और चलाएं (Python 3.8+ की आवश्यकता है):
 
 ```bash
 pip install reflex

+ 2 - 2
docs/it/README.md

@@ -23,7 +23,7 @@
 
 ## ⚙️ Installazione
 
-Apri un terminale ed esegui (Richiede Python 3.7+):
+Apri un terminale ed esegui (Richiede Python 3.8+):
 
 ```bash
 pip install reflex
@@ -230,4 +230,4 @@ Stiamo attivamente cercando collaboratori, indipendentemente dal tuo livello di
 
 ## Licenza
 
-Reflex è open-source e rilasciato sotto la [Licenza Apache 2.0](LICENSE).
+Reflex è open-source e rilasciato sotto la [Licenza Apache 2.0](LICENSE).

+ 1 - 1
docs/pt/pt_br/README.md

@@ -21,7 +21,7 @@
 ---
 ## ⚙️ Instalação
 
-Abra um terminal e execute (Requer Python 3.7+):
+Abra um terminal e execute (Requer Python 3.8+):
 
 ```bash
 pip install reflex

+ 1 - 1
docs/tr/README.md

@@ -21,7 +21,7 @@
 ---
 ## ⚙️ İndirme
 
-Bir terminal açın ve çalıştırın (Python 3.7+ gerekir):
+Bir terminal açın ve çalıştırın (Python 3.8+ gerekir):
 
 ```bash
 pip install reflex

+ 1 - 1
docs/zh/zh_cn/README.md

@@ -24,7 +24,7 @@
 ---
 ## ⚙️ 安装
 
-打开一个终端并且运行(要求Python3.7+):
+打开一个终端并且运行(要求Python3.8+):
 
 ```
 pip install reflex

+ 1 - 1
docs/zh/zh_tw/README.md

@@ -22,7 +22,7 @@
 ---
 ## ⚙️ 安裝
 
-開啟一個終端機並且執行 (需要 Python 3.7+):
+開啟一個終端機並且執行 (需要 Python 3.8+):
 
 ```bash
 pip install reflex

File diff suppressed because it is too large
+ 369 - 446
poetry.lock


+ 2 - 4
pyproject.toml

@@ -26,7 +26,7 @@ packages = [
 ]
 
 [tool.poetry.dependencies]
-python = "^3.7"
+python = "^3.8"
 cloudpickle = "^2.2.1"
 fastapi = "^0.96.0"
 gunicorn = "^20.1.0"
@@ -45,7 +45,6 @@ watchdog = "^2.3.1"
 watchfiles = "^0.19.0"
 websockets = "^10.4"
 starlette-admin = "^0.9.0"
-importlib-metadata = {version = "^6.7.0", python = ">=3.7, <3.8"}
 alembic = "^1.11.1"
 platformdirs = "^3.10.0"
 distro = {version = "^1.8.0", platform = "linux"}
@@ -65,7 +64,6 @@ black = "^22.10.0"
 ruff = "^0.0.244"
 pandas = [
     {version = "^1.5.3", python = ">=3.8,<4.0"},
-    {version = "^1.1", python = ">=3.7, <3.8"}
 ]
 pillow = [
     {version = "^10.0.0", python = ">=3.8,<4.0"}
@@ -97,4 +95,4 @@ target-version = "py37"
 "__init__.py" = ["F401"]
 "tests/*.py" = ["D100", "D103", "D104"]
 "reflex/.templates/*.py" = ["D100", "D103", "D104"]
-"*.pyi" = ["ALL"]
+"*.pyi" = ["ALL"]

+ 1 - 7
reflex/constants/base.py

@@ -5,17 +5,11 @@ from __future__ import annotations
 import os
 import platform
 from enum import Enum
+from importlib import metadata
 from types import SimpleNamespace
 
 from platformdirs import PlatformDirs
 
-# importlib is only available for Python 3.8+ so we need the backport for Python 3.7
-try:
-    from importlib import metadata
-except ImportError:
-    import importlib_metadata as metadata  # pyright: ignore[reportMissingImports]
-
-
 IS_WINDOWS = platform.system() == "Windows"
 
 

+ 1 - 6
tests/test_app.py

@@ -2,17 +2,12 @@ from __future__ import annotations
 
 import io
 import os.path
-import sys
 import unittest.mock
 import uuid
 from pathlib import Path
 from typing import Generator, List, Tuple, Type
+from unittest.mock import AsyncMock
 
-if sys.version_info.major >= 3 and sys.version_info.minor > 7:
-    from unittest.mock import AsyncMock  # type: ignore
-else:
-    # python 3.7 doesn't ship with unittest.mock
-    from asynctest import CoroutineMock as AsyncMock
 import pytest
 import sqlmodel
 from fastapi import UploadFile

Some files were not shown because too many files changed in this diff