Skip to content

Commit

Permalink
Merge pull request #1804 from Avaiga/feat/#1748-stop-python3.8-support
Browse files Browse the repository at this point in the history
Feature/#1748 - Stop supporting python 3.8
  • Loading branch information
trgiangdo authored Sep 21, 2024
2 parents 8f8237d + 0b53b0c commit 4d7a5c0
Show file tree
Hide file tree
Showing 28 changed files with 25 additions and 876 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/dependencies-management.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
timeout-minutes: 20
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
python-version: ['3.9', '3.10', '3.11', '3.12']
os: [ubuntu-latest]
permissions:
contents: write
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/overall-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
python-version: ['3.9', '3.10', '3.11', '3.12']
os: [ubuntu-latest, windows-latest, macos-13]
pipfile-version: ['min', 'max']
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -80,7 +80,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
python-version: ['3.9', '3.10', '3.11', '3.12']
os: [ubuntu-latest, windows-latest, macos-13]
orchestrator: ['orchestrator_dispatcher', 'standalone']
pipfile-version: ['min', 'max']
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/packaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
timeout-minutes: 30
strategy:
matrix:
python-versions: [ '3.8', '3.9', '3.10', '3.11', '3.12']
python-versions: ['3.9', '3.10', '3.11', '3.12']
os: [ubuntu-latest, macos-13, windows-latest]

runs-on: ${{ matrix.os }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/partial-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
python-version: ['3.9', '3.10', '3.11', '3.12']
os: [ubuntu-latest, windows-latest, macos-13]
runs-on: ${{ matrix.os }}
steps:
Expand Down Expand Up @@ -143,7 +143,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
python-version: ['3.9', '3.10', '3.11', '3.12']
os: [ubuntu-latest, windows-latest, macos-13]
runs-on: ${{ matrix.os }}
steps:
Expand Down Expand Up @@ -186,7 +186,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
python-version: ['3.9', '3.10', '3.11', '3.12']
os: [ubuntu-latest, windows-latest, macos-13]
runs-on: ${{ matrix.os }}
steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: 3.9

- name: Extract Github Tag Version
id: vars
Expand Down Expand Up @@ -104,7 +104,7 @@ jobs:
timeout-minutes: 30
strategy:
matrix:
python-versions: ['3.8','3.9','3.10', '3.11', '3.12']
python-versions: ['3.9','3.10', '3.11', '3.12']
os: [ubuntu-latest,windows-latest,macos-13]
runs-on: ${{ matrix.os }}
steps:
Expand Down
2 changes: 1 addition & 1 deletion INSTALLATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ There are different ways to install Taipy, depending on how you plan to use it.
If your goal is to look into the code, modify and improve it, go straight
to the [source installation](#installing-for-development) section.

Taipy needs your system to have Python 3.8 or above installed.
Taipy needs your system to have Python 3.9 or above installed.

## Installing from PyPI

Expand Down
1 change: 0 additions & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ name = "pypi"
[packages]
apispec = {extras = ["yaml"], version = "==6.3"}
apispec-webframeworks = "==0.5.2"
"backports.zoneinfo" = {version="==0.2.1", markers="python_version < '3.9'", extras=["tzdata"]}
cookiecutter = "==2.1.1"
deepdiff = "==6.7.1"
flask = "==3.0.0"
Expand Down
2 changes: 1 addition & 1 deletion doc/gui/extension/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ This section explains how to build the custom extension library.

To complete the build of the extension library, we need the following tools:

- Python 3.8 or higher;
- Python 3.9 or higher;
- Taipy GUI 2.2 or higher;
- [Node.js](https://nodejs.org/en/) 18.0 or higher: a JavaScript runtime.<br/>
This embeds [npm](https://www.npmjs.com/), the Node Package Manager.
Expand Down
3 changes: 1 addition & 2 deletions doc/gui/extension/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@ version = "1.0.0"
authors = [ { name = "Taipy" } ]
description = "A Taipy GUI extension library example."
readme = { file = "README.md", content-type = "text/markdown" }
requires-python = ">=3.8"
requires-python = ">=3.9"
keywords = [ "taipy" ]
license = { text = "Apache License 2.0" }
classifiers = [
"Intended Audience :: Developers",
# "License :: OSI Approved :: Apache Software License",
"Natural Language :: English",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
Expand Down
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
name = "taipy"
description = "A 360° open-source platform from Python pilots to production-ready web apps."
readme = "package_desc.md"
requires-python = ">=3.8"
requires-python = ">=3.9"
license = {text = "Apache License 2.0"}
authors = [{name = "Avaiga", email = "[email protected]"}]
keywords = ["taipy"]
Expand All @@ -15,7 +15,6 @@ classifiers = [
"License :: OSI Approved :: Apache Software License",
"Natural Language :: English",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
Expand Down
3 changes: 1 addition & 2 deletions taipy/config/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
name = "taipy-config"
description = "A Taipy package dedicated to easily configure a Taipy application."
readme = "package_desc.md"
requires-python = ">=3.8"
requires-python = ">=3.9"
license = {text = "Apache License 2.0"}
authors = [{name = "Avaiga", email = "[email protected]"}]
keywords = ["taipy-config"]
Expand All @@ -15,7 +15,6 @@ classifiers = [
"License :: OSI Approved :: Apache Software License",
"Natural Language :: English",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
Expand Down
12 changes: 2 additions & 10 deletions taipy/core/_entity/_dag.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
# an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.

import math
from functools import reduce
from typing import Any, Dict, List, Tuple

import networkx as nx
Expand Down Expand Up @@ -60,7 +60,7 @@ def __compute_grid_size(self) -> Tuple[int, int]:
if self._width == 1:
grd_wdt = 1
else:
grd_wdt = self.__lcm(*[len(i) + 1 if len(i) != self._width else len(i) - 1 for i in self._sorted_nodes]) + 1
grd_wdt = math.lcm(*[len(i) + 1 if len(i) != self._width else len(i) - 1 for i in self._sorted_nodes]) + 1
return len(self._sorted_nodes), grd_wdt

def __compute_nodes(self) -> Dict[str, _Node]:
Expand All @@ -81,11 +81,3 @@ def __compute_nodes(self) -> Dict[str, _Node]:

def __compute_edges(self, dag) -> List[_Edge]:
return [_Edge(self.nodes[edge[0].id], self.nodes[edge[1].id]) for edge in dag.edges()]

@staticmethod
def __lcm(*integers) -> int:
# Function math.lcm is only implemented for Python 3.9+
# For compatibility with Python 3.8 it has been re implemented.
if 0 in integers:
return 0
return reduce(lambda x, y: (x * y) // math.gcd(x, y), integers)
3 changes: 1 addition & 2 deletions taipy/core/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
name = "taipy-core"
description = "A Python library to build powerful and customized data-driven back-end applications."
readme = "package_desc.md"
requires-python = ">=3.8"
requires-python = ">=3.9"
license = {text = "Apache License 2.0"}
authors = [{name = "Avaiga", email = "[email protected]"}]
keywords = ["taipy-core"]
Expand All @@ -15,7 +15,6 @@ classifiers = [
"License :: OSI Approved :: Apache Software License",
"Natural Language :: English",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
Expand Down
2 changes: 1 addition & 1 deletion taipy/gui/INSTALLATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ you plan to use it:
- [Debugging the JavaScript bundle](#debugging-the-javascript-bundle)
- [Running the tests](#running-the-tests)

Taipy GUI needs your system to have **Python 3.8** or above installed.
Taipy GUI needs your system to have **Python 3.9** or above installed.

## Installing the latest release

Expand Down
13 changes: 1 addition & 12 deletions taipy/gui/builder/_element.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@
import ast
import copy
import inspect
import io
import re
import sys
import typing as t
import uuid
from abc import ABC, abstractmethod
Expand All @@ -25,9 +23,6 @@

from .._warnings import _warn
from ..utils import _getscopeattr

if sys.version_info < (3, 9):
from ..utils.unparse import _Unparser
from ._context_manager import _BuilderContextManager
from ._factory import _BuilderFactory
from ._utils import _LambdaByName, _python_builtins, _TransformVarToValue
Expand Down Expand Up @@ -129,13 +124,7 @@ def __parse_lambda_property(self, key: str, value: t.Any) -> t.Any:
]
tree = _TransformVarToValue(self.__calling_frame, args + targets + _python_builtins).visit(lambda_fn)
ast.fix_missing_locations(tree)
if sys.version_info < (3, 9): # python 3.8 ast has no unparse
string_fd = io.StringIO()
_Unparser(tree, string_fd)
string_fd.seek(0)
lambda_text = string_fd.read()
else:
lambda_text = ast.unparse(tree)
lambda_text = ast.unparse(tree)
lambda_name = f"__lambda_{uuid.uuid4().hex}"
self._lambdas[lambda_name] = lambda_text
return f'{{{lambda_name}({", ".join(args)})}}'
Expand Down
2 changes: 1 addition & 1 deletion taipy/gui/package_desc.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ you plan to use it:
- [Debugging the JavaScript bundle](#debugging-the-javascript-bundle)
- [Running the tests](#running-the-tests)

Taipy GUI needs your system to have **Python 3.8** or above installed.
Taipy GUI needs your system to have **Python 3.9** or above installed.

### Installing the latest release

Expand Down
3 changes: 1 addition & 2 deletions taipy/gui/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
name = "taipy-gui"
description = "Low-code library to create graphical user interfaces on the Web for your Python applications."
readme = "package_desc.md"
requires-python = ">=3.8"
requires-python = ">=3.9"
license = {text = "Apache License 2.0"}
authors = [{name = "Avaiga", email = "[email protected]"}]
keywords = ["taipy-gui"]
Expand All @@ -15,7 +15,6 @@ classifiers = [
"License :: OSI Approved :: Apache Software License",
"Natural Language :: English",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
Expand Down
Loading

0 comments on commit 4d7a5c0

Please sign in to comment.