Przeglądaj źródła

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 rok temu
rodzic
commit
cbf5b61a23

+ 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.
 Here is a quick guide to how the run Reflex repo locally so you can start contributing to the project.
 
 
 **Prerequisites:**
 **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).
 - 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
 ## ⚙️ Installation
 
 
-Open a terminal and run (Requires Python 3.7+):
+Open a terminal and run (Requires Python 3.8+):
 
 
 ```bash
 ```bash
 pip install reflex
 pip install reflex

+ 1 - 1
docs/in/README.md

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

+ 2 - 2
docs/it/README.md

@@ -23,7 +23,7 @@
 
 
 ## ⚙️ Installazione
 ## ⚙️ Installazione
 
 
-Apri un terminale ed esegui (Richiede Python 3.7+):
+Apri un terminale ed esegui (Richiede Python 3.8+):
 
 
 ```bash
 ```bash
 pip install reflex
 pip install reflex
@@ -230,4 +230,4 @@ Stiamo attivamente cercando collaboratori, indipendentemente dal tuo livello di
 
 
 ## Licenza
 ## 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
 ## ⚙️ Instalação
 
 
-Abra um terminal e execute (Requer Python 3.7+):
+Abra um terminal e execute (Requer Python 3.8+):
 
 
 ```bash
 ```bash
 pip install reflex
 pip install reflex

+ 1 - 1
docs/tr/README.md

@@ -21,7 +21,7 @@
 ---
 ---
 ## ⚙️ İndirme
 ## ⚙️ İ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
 ```bash
 pip install reflex
 pip install reflex

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

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

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

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

Plik diff jest za duży
+ 369 - 446
poetry.lock


+ 2 - 4
pyproject.toml

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

+ 1 - 6
tests/test_app.py

@@ -2,17 +2,12 @@ from __future__ import annotations
 
 
 import io
 import io
 import os.path
 import os.path
-import sys
 import unittest.mock
 import unittest.mock
 import uuid
 import uuid
 from pathlib import Path
 from pathlib import Path
 from typing import Generator, List, Tuple, Type
 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 pytest
 import sqlmodel
 import sqlmodel
 from fastapi import UploadFile
 from fastapi import UploadFile

Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików