This is an automated email from the ASF dual-hosted git repository.

haonan pushed a commit to branch pyproject.toml
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 42cb1d9e74b54062731baec64748c286c7404b31
Author: HTHou <[email protected]>
AuthorDate: Thu Jul 25 15:35:21 2024 +0800

    [PY-CLIENT] move setup.py tp pyproject.toml
---
 iotdb-client/client-py/README.md                   |  7 +--
 iotdb-client/client-py/pom.xml                     |  8 +--
 iotdb-client/client-py/pyproject.toml              | 43 ++++++++++++++-
 iotdb-client/client-py/release.sh                  |  6 +-
 .../client-py/{ => resources}/pyproject.toml       | 42 +++++++++++++-
 iotdb-client/client-py/resources/setup.py          | 64 ----------------------
 .../{release.sh => tests/integration/__init__.py}  | 24 --------
 .../tablet_performance_comparison.py               |  0
 .../{ => integration}/test_aligned_timeseries.py   |  0
 .../tests/{ => integration}/test_dataframe.py      |  0
 .../tests/{ => integration}/test_delete_data.py    |  0
 .../tests/{ => integration}/test_one_device.py     |  0
 .../tests/{ => integration}/test_session.py        |  0
 .../tests/{ => integration}/test_session_pool.py   |  0
 .../tests/{ => integration}/test_tablet.py         |  0
 .../client-py/tests/{ => integration}/test_todf.py |  0
 .../{release.sh => tests/unit/__init__.py}         | 24 --------
 .../tests/{ => unit}/test_numpy_tablet.py          |  0
 18 files changed, 92 insertions(+), 126 deletions(-)

diff --git a/iotdb-client/client-py/README.md b/iotdb-client/client-py/README.md
index cc23ebff2a3..beb17704a5d 100644
--- a/iotdb-client/client-py/README.md
+++ b/iotdb-client/client-py/README.md
@@ -21,7 +21,6 @@
 
 # Apache IoTDB
 
-[![Python 
Client](https://github.com/apache/iotdb/actions/workflows/client-python.yml/badge.svg?branch=master)](https://github.com/apache/iotdb/actions/workflows/client-python.yml)
 [![GitHub 
release](https://img.shields.io/github/release/apache/iotdb.svg)](https://github.com/apache/iotdb/releases)
 
[![License](https://img.shields.io/badge/license-Apache%202-4EB1BA.svg)](https://www.apache.org/licenses/LICENSE-2.0.html)
 ![](https://github-size-badge.herokuapp.com/apache/iotdb.svg)
@@ -40,7 +39,7 @@ high-speed data ingestion and complex data analysis in the 
IoT industrial fields
 
 ### Requirements
 
-You have to install thrift (>=0.13) before using the package.
+You have to install thrift (>=0.14.1) before using the package.
 
 
 
@@ -48,8 +47,6 @@ You have to install thrift (>=0.13) before using the package.
 
 First, download the latest package: `pip3 install apache-iotdb`
 
-*Notice: If you are installing Python API v0.13.0, DO NOT install by `pip 
install apache-iotdb==0.13.0`, use `pip install apache-iotdb==0.13.0.post1` 
instead!* 
-
 You can get an example of using the package to read and write data at here: 
[Example](https://github.com/apache/iotdb/blob/master/client-py/SessionExample.py)
 
 An example of aligned timeseries: [Aligned Timeseries Session 
Example](https://github.com/apache/iotdb/blob/master/client-py/SessionAlignedTimeseriesExample.py)
@@ -689,7 +686,7 @@ Namely, these are
 
 * Remove all transient directories from last release (if exists)
 * (Re-)generate all generated sources via mvn
-* Run Linting (flake8)
+* Run Linting
 * Run Tests via pytest
 * Build
 * Release to pypi
diff --git a/iotdb-client/client-py/pom.xml b/iotdb-client/client-py/pom.xml
index 1ce573da3c7..0d942986ac8 100644
--- a/iotdb-client/client-py/pom.xml
+++ b/iotdb-client/client-py/pom.xml
@@ -50,7 +50,7 @@
                 <filtering>true</filtering>
                 <directory>${basedir}/resources</directory>
                 <includes>
-                    <include>setup.py</include>
+                    <include>pyproject.toml</include>
                 </includes>
             </resource>
         </resources>
@@ -159,7 +159,7 @@
                                 <resource>
                                     
<directory>${basedir}/target/classes</directory>
                                     <includes>
-                                        <include>setup.py</include>
+                                        <include>pyproject.toml</include>
                                     </includes>
                                 </resource>
                             </resources>
@@ -172,13 +172,13 @@
                 <artifactId>build-helper-maven-plugin</artifactId>
                 <executions>
                     <execution>
-                        <id>write-python-version</id>
+                        <id>write-iotdb-version</id>
                         <goals>
                             <goal>regex-property</goal>
                         </goals>
                         <phase>generate-resources</phase>
                         <configuration>
-                            <name>python_version</name>
+                            <name>iotdb_version</name>
                             <regex>-SNAPSHOT</regex>
                             <value>${project.version}</value>
                             <replacement>\.dev0</replacement>
diff --git a/iotdb-client/client-py/pyproject.toml 
b/iotdb-client/client-py/pyproject.toml
index 389b729d095..6d2cf934a00 100644
--- a/iotdb-client/client-py/pyproject.toml
+++ b/iotdb-client/client-py/pyproject.toml
@@ -16,9 +16,49 @@
 # under the License.
 #
 
+[build-system]
+requires = ["setuptools>=42", "wheel"]
+build-backend = "setuptools.build_meta"
+
+[project]
+name = "apache-iotdb"
+version = "1.3.3.dev0"
+description = "Apache IoTDB client API"
+readme = "README.md"
+authors = [
+    { name = "Apache IoTDB", email = "[email protected]" }
+]
+license = { text = "Apache License, Version 2.0" }
+keywords = ["iotdb", "apache", "client", "API"]
+classifiers = [
+    "Programming Language :: Python :: 3",
+    "License :: OSI Approved :: Apache Software License",
+    "Operating System :: OS Independent",
+    "Topic :: Software Development :: Libraries",
+    "Topic :: Software Development :: Libraries :: Python Modules"
+]
+requires-python = ">=3.6"
+dependencies = [
+    "thrift>=0.14.1",
+    "pandas>=1.0.0",
+    "numpy>=1.0.0",
+    "sqlalchemy<1.5,>=1.4",
+    "sqlalchemy-utils>=0.37.8"
+]
+
+[project.urls]
+Homepage = "https://iotdb.apache.org";
+Documentation = "https://github.com/apache/iotdb";
+
+[project.entry-points."sqlalchemy.dialects"]
+iotdb = "iotdb.sqlalchemy.IoTDBDialect:IoTDBDialect"
+
+[tool.setuptools]
+packages = ["iotdb"]
+
 [tool.black]
 line-length = 88
-target-version = ['py37']
+target-version = ['py36', 'py37', 'py38', 'py39', 'py310', 'py311', 'py312']
 include = '\.pyi?$'
 exclude = '''
 
@@ -36,7 +76,6 @@ exclude = '''
     | build
     | dist
     | migrations
-    | test
     | iotdb/thrift
   )/
   | foo.py           # also separately exclude a file named foo.py in
diff --git a/iotdb-client/client-py/release.sh 
b/iotdb-client/client-py/release.sh
index 4a3175d42a3..e62d115f671 100755
--- a/iotdb-client/client-py/release.sh
+++ b/iotdb-client/client-py/release.sh
@@ -29,13 +29,17 @@ rm -Rf iotdb_session.egg_info
 # (Re-)build generated code
 (cd ../..; mvn clean package -pl iotdb-client/client-py -am)
 
+# Run Linting
+black .
+
 # Run unit tests
 if [ "$1" == "test" ]; then
   pytest .
 fi
 
 # See https://packaging.python.org/tutorials/packaging-projects/
-python3 setup.py sdist bdist_wheel
+#python3 setup.py sdist bdist_wheel
+python3 -m build
 if [ "$1" == "release" ]; then
   python3 -m twine upload  dist/*
 fi
diff --git a/iotdb-client/client-py/pyproject.toml 
b/iotdb-client/client-py/resources/pyproject.toml
similarity index 50%
copy from iotdb-client/client-py/pyproject.toml
copy to iotdb-client/client-py/resources/pyproject.toml
index 389b729d095..dcde7a7ed4f 100644
--- a/iotdb-client/client-py/pyproject.toml
+++ b/iotdb-client/client-py/resources/pyproject.toml
@@ -16,9 +16,48 @@
 # under the License.
 #
 
+[build-system]
+requires = ["setuptools>=42", "wheel"]
+build-backend = "setuptools.build_meta"
+
+[project]
+name = "apache-iotdb"
+version = "${iotdb_version}"
+description = "Apache IoTDB client API"
+readme = "README.md"
+readme-content-type = "text/markdown"
+authors = [
+    { name = "Apache IoTDB", email = "[email protected]" }
+]
+license = { text = "Apache License, Version 2.0", file = "LICENSE" }
+homepage = "https://github.com/apache/iotdb";
+keywords = ["iotdb", "apache", "client", "API"]
+classifiers = [
+    "Programming Language :: Python :: 3",
+    "License :: OSI Approved :: Apache Software License",
+    "Operating System :: OS Independent",
+    "Topic :: Software Development :: Libraries",
+    "Topic :: Software Development :: Libraries :: Python Modules"
+]
+requires-python = ">=3.6"
+dependencies = [
+    "thrift>=0.14.1",
+    "pandas>=1.0.0",
+    "numpy>=1.0.0",
+    "sqlalchemy<1.5,>=1.4",
+    "sqlalchemy-utils>=0.37.8"
+]
+
+[project.urls]
+Homepage = "https://iotdb.apache.org";
+Documentation = "https://github.com/apache/iotdb";
+
+[project.entry-points."sqlalchemy.dialects"]
+iotdb = "iotdb.sqlalchemy.IoTDBDialect:IoTDBDialect"
+
 [tool.black]
 line-length = 88
-target-version = ['py37']
+target-version = ['py36', 'py37', 'py38', 'py39', 'py310', 'py311', 'py312']
 include = '\.pyi?$'
 exclude = '''
 
@@ -36,7 +75,6 @@ exclude = '''
     | build
     | dist
     | migrations
-    | test
     | iotdb/thrift
   )/
   | foo.py           # also separately exclude a file named foo.py in
diff --git a/iotdb-client/client-py/resources/setup.py 
b/iotdb-client/client-py/resources/setup.py
deleted file mode 100644
index 202507af804..00000000000
--- a/iotdb-client/client-py/resources/setup.py
+++ /dev/null
@@ -1,64 +0,0 @@
-#  Licensed to the Apache Software Foundation (ASF) under one
-#  or more contributor license agreements.  See the NOTICE file
-#  distributed with this work for additional information
-#  regarding copyright ownership.  The ASF licenses this file
-#  to you under the Apache License, Version 2.0 (the
-#  "License"); you may not use this file except in compliance
-#  with the License.  You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-#  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 setuptools
-import io
-
-
-try:
-    with io.open("README.md", encoding="utf-8") as f:
-        long_description = f.read()
-except FileNotFoundError:
-    long_description = ""
-
-
-print(long_description)
-
-setuptools.setup(
-    name="apache-iotdb",  # Replace with your own username
-    version="${python_version}",
-    author=" Apache Software Foundation",
-    author_email="[email protected]",
-    description="Apache IoTDB client API",
-    long_description=long_description,
-    long_description_content_type="text/markdown",
-    url="https://github.com/apache/iotdb";,
-    packages=setuptools.find_packages(),
-    install_requires=[
-        "thrift>=0.14.1",
-        "pandas>=1.0.0",
-        "numpy>=1.0.0",
-        "sqlalchemy<1.5,>=1.4",
-        "sqlalchemy-utils>=0.37.8",
-    ],
-    classifiers=[
-        "Programming Language :: Python :: 3",
-        "License :: OSI Approved :: Apache Software License",
-        "Operating System :: OS Independent",
-        "Topic :: Software Development :: Libraries",
-        "Topic :: Software Development :: Libraries :: Python Modules",
-    ],
-    python_requires=">=3.6",
-    license="Apache License, Version 2.0",
-    website="https://iotdb.apache.org";,
-    entry_points={
-        "sqlalchemy.dialects": [
-            "iotdb = iotdb.sqlalchemy.IoTDBDialect:IoTDBDialect",
-        ],
-    },
-)
diff --git a/iotdb-client/client-py/release.sh 
b/iotdb-client/client-py/tests/integration/__init__.py
old mode 100755
new mode 100644
similarity index 63%
copy from iotdb-client/client-py/release.sh
copy to iotdb-client/client-py/tests/integration/__init__.py
index 4a3175d42a3..2a1e720805f
--- a/iotdb-client/client-py/release.sh
+++ b/iotdb-client/client-py/tests/integration/__init__.py
@@ -1,6 +1,3 @@
-#!/bin/bash
-#
-#
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
 # distributed with this work for additional information
@@ -18,24 +15,3 @@
 # specific language governing permissions and limitations
 # under the License.
 #
-
-# the python version must be python3.
-python3 --version
-
-rm -Rf build
-rm -Rf dist
-rm -Rf iotdb_session.egg_info
-
-# (Re-)build generated code
-(cd ../..; mvn clean package -pl iotdb-client/client-py -am)
-
-# Run unit tests
-if [ "$1" == "test" ]; then
-  pytest .
-fi
-
-# See https://packaging.python.org/tutorials/packaging-projects/
-python3 setup.py sdist bdist_wheel
-if [ "$1" == "release" ]; then
-  python3 -m twine upload  dist/*
-fi
diff --git a/iotdb-client/client-py/tests/tablet_performance_comparison.py 
b/iotdb-client/client-py/tests/integration/tablet_performance_comparison.py
similarity index 100%
rename from iotdb-client/client-py/tests/tablet_performance_comparison.py
rename to 
iotdb-client/client-py/tests/integration/tablet_performance_comparison.py
diff --git a/iotdb-client/client-py/tests/test_aligned_timeseries.py 
b/iotdb-client/client-py/tests/integration/test_aligned_timeseries.py
similarity index 100%
rename from iotdb-client/client-py/tests/test_aligned_timeseries.py
rename to iotdb-client/client-py/tests/integration/test_aligned_timeseries.py
diff --git a/iotdb-client/client-py/tests/test_dataframe.py 
b/iotdb-client/client-py/tests/integration/test_dataframe.py
similarity index 100%
rename from iotdb-client/client-py/tests/test_dataframe.py
rename to iotdb-client/client-py/tests/integration/test_dataframe.py
diff --git a/iotdb-client/client-py/tests/test_delete_data.py 
b/iotdb-client/client-py/tests/integration/test_delete_data.py
similarity index 100%
rename from iotdb-client/client-py/tests/test_delete_data.py
rename to iotdb-client/client-py/tests/integration/test_delete_data.py
diff --git a/iotdb-client/client-py/tests/test_one_device.py 
b/iotdb-client/client-py/tests/integration/test_one_device.py
similarity index 100%
rename from iotdb-client/client-py/tests/test_one_device.py
rename to iotdb-client/client-py/tests/integration/test_one_device.py
diff --git a/iotdb-client/client-py/tests/test_session.py 
b/iotdb-client/client-py/tests/integration/test_session.py
similarity index 100%
rename from iotdb-client/client-py/tests/test_session.py
rename to iotdb-client/client-py/tests/integration/test_session.py
diff --git a/iotdb-client/client-py/tests/test_session_pool.py 
b/iotdb-client/client-py/tests/integration/test_session_pool.py
similarity index 100%
rename from iotdb-client/client-py/tests/test_session_pool.py
rename to iotdb-client/client-py/tests/integration/test_session_pool.py
diff --git a/iotdb-client/client-py/tests/test_tablet.py 
b/iotdb-client/client-py/tests/integration/test_tablet.py
similarity index 100%
rename from iotdb-client/client-py/tests/test_tablet.py
rename to iotdb-client/client-py/tests/integration/test_tablet.py
diff --git a/iotdb-client/client-py/tests/test_todf.py 
b/iotdb-client/client-py/tests/integration/test_todf.py
similarity index 100%
rename from iotdb-client/client-py/tests/test_todf.py
rename to iotdb-client/client-py/tests/integration/test_todf.py
diff --git a/iotdb-client/client-py/release.sh 
b/iotdb-client/client-py/tests/unit/__init__.py
old mode 100755
new mode 100644
similarity index 63%
copy from iotdb-client/client-py/release.sh
copy to iotdb-client/client-py/tests/unit/__init__.py
index 4a3175d42a3..2a1e720805f
--- a/iotdb-client/client-py/release.sh
+++ b/iotdb-client/client-py/tests/unit/__init__.py
@@ -1,6 +1,3 @@
-#!/bin/bash
-#
-#
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
 # distributed with this work for additional information
@@ -18,24 +15,3 @@
 # specific language governing permissions and limitations
 # under the License.
 #
-
-# the python version must be python3.
-python3 --version
-
-rm -Rf build
-rm -Rf dist
-rm -Rf iotdb_session.egg_info
-
-# (Re-)build generated code
-(cd ../..; mvn clean package -pl iotdb-client/client-py -am)
-
-# Run unit tests
-if [ "$1" == "test" ]; then
-  pytest .
-fi
-
-# See https://packaging.python.org/tutorials/packaging-projects/
-python3 setup.py sdist bdist_wheel
-if [ "$1" == "release" ]; then
-  python3 -m twine upload  dist/*
-fi
diff --git a/iotdb-client/client-py/tests/test_numpy_tablet.py 
b/iotdb-client/client-py/tests/unit/test_numpy_tablet.py
similarity index 100%
rename from iotdb-client/client-py/tests/test_numpy_tablet.py
rename to iotdb-client/client-py/tests/unit/test_numpy_tablet.py

Reply via email to