You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by hx...@apache.org on 2020/11/03 19:49:01 UTC

[iotdb] 01/05: fix pypi

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

hxd pushed a commit to branch fix_pypi
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 1aa771e786c6cb05ef398dbdd557249122b9b5a0
Author: xiangdong huang <sa...@gmail.com>
AuthorDate: Wed Nov 4 03:26:26 2020 +0800

    fix pypi
---
 client-py/pom.xml         | 126 ++++++++++++++++++++++++++++++++++++++++++++++
 client-py/pypi/README.md  |  65 ++++++++++++++++++++++++
 client-py/pypi/setup.py   |  55 ++++++++++++++++++++
 client-py/src/Session.py  |   3 +-
 client-py/src/__init__.py |  18 +++++++
 pom.xml                   |   1 +
 thrift/pom.xml            |  48 ------------------
 7 files changed, 266 insertions(+), 50 deletions(-)

diff --git a/client-py/pom.xml b/client-py/pom.xml
new file mode 100644
index 0000000..8e060b6
--- /dev/null
+++ b/client-py/pom.xml
@@ -0,0 +1,126 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    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.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.iotdb</groupId>
+        <artifactId>iotdb-parent</artifactId>
+        <version>0.11.0-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+    <artifactId>iotdb-python-api</artifactId>
+    <name>python-api</name>
+    <description>Python API of IoTDB.</description>
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.iotdb</groupId>
+            <artifactId>iotdb-thrift</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+    </dependencies>
+    <build>
+        <plugins>
+            <!-- for pypi distribution -->
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-resources-plugin</artifactId>
+                <version>2.4.3</version>
+                <configuration>
+                    <encoding>${project.build.sourceEncoding}</encoding>
+                </configuration>
+                <executions>
+                    <execution>
+                        <id>copy-thrift-python-resources</id>
+                        <!-- here the phase you need -->
+                        <phase>generate-sources</phase>
+                        <goals>
+                            <goal>copy-resources</goal>
+                        </goals>
+                        <configuration>
+                            <encoding>utf-8</encoding>
+                            <outputDirectory>${project.build.directory}/pypi/iotdb_session</outputDirectory>
+                            <resources>
+                                <resource>
+                                    <directory>${basedir}/../thrift/target/generated-sources-python</directory>
+                                </resource>
+                            </resources>
+                        </configuration>
+                    </execution>
+                    <execution>
+                        <id>copy-license-resources</id>
+                        <!-- here the phase you need -->
+                        <phase>generate-sources</phase>
+                        <goals>
+                            <goal>copy-resources</goal>
+                        </goals>
+                        <configuration>
+                            <encoding>utf-8</encoding>
+                            <outputDirectory>${project.build.directory}/pypi</outputDirectory>
+                            <resources>
+                                <resource>
+                                    <directory>${basedir}/../</directory>
+                                    <includes>
+                                        <include>LICENSE</include>
+                                    </includes>
+                                </resource>
+                            </resources>
+                        </configuration>
+                    </execution>
+                    <execution>
+                        <id>copy-python-file-resources</id>
+                        <!-- here the phase you need -->
+                        <phase>generate-sources</phase>
+                        <goals>
+                            <goal>copy-resources</goal>
+                        </goals>
+                        <configuration>
+                            <encoding>utf-8</encoding>
+                            <outputDirectory>${project.build.directory}/pypi//iotdb_session/</outputDirectory>
+                            <resources>
+                                <resource>
+                                    <directory>${basedir}/src/</directory>
+                                </resource>
+                            </resources>
+                        </configuration>
+                    </execution>
+                    <execution>
+                        <id>copy-pypi-file-resources</id>
+                        <!-- here the phase you need -->
+                        <phase>generate-sources</phase>
+                        <goals>
+                            <goal>copy-resources</goal>
+                        </goals>
+                        <configuration>
+                            <encoding>utf-8</encoding>
+                            <outputDirectory>${project.build.directory}/pypi</outputDirectory>
+                            <resources>
+                                <resource>
+                                    <directory>${basedir}/pypi</directory>
+                                </resource>
+                            </resources>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+</project>
diff --git a/client-py/pypi/README.md b/client-py/pypi/README.md
new file mode 100644
index 0000000..710fc76
--- /dev/null
+++ b/client-py/pypi/README.md
@@ -0,0 +1,65 @@
+<!--
+
+    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.
+
+-->
+
+# Apache IoTDB
+
+[![Build Status](https://www.travis-ci.org/apache/incubator-iotdb.svg?branch=master)](https://www.travis-ci.org/apache/incubator-iotdb)
+[![codecov](https://codecov.io/gh/thulab/incubator-iotdb/branch/master/graph/badge.svg)](https://codecov.io/gh/thulab/incubator-iotdb)
+[![GitHub release](https://img.shields.io/github/release/apache/incubator-iotdb.svg)](https://github.com/apache/incubator-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/incubator-iotdb.svg)
+![](https://img.shields.io/github/downloads/apache/incubator-iotdb/total.svg)
+![](https://img.shields.io/badge/platform-win10%20%7C%20macox%20%7C%20linux-yellow.svg)
+![](https://img.shields.io/badge/java--language-1.8-blue.svg)
+[![IoTDB Website](https://img.shields.io/website-up-down-green-red/https/shields.io.svg?label=iotdb-website)](https://iotdb.apache.org/)
+
+
+Apache IoTDB (incubating) (Database for Internet of Things) is an integrated data management engine designed for
+timeseries data. It provides users with services for data collection, storage and analysis. Due to its light-weight
+architecture, high performance and rich feature set together with its deep integration with Apache Hadoop and Spark,
+Apache IoTDB (incubating) can meet the requirements of massive data storage, high-speed data ingestion and complex data
+analysis in the IoT industrial fields.
+
+
+# Apache IoTDB Python Client API
+
+Using the package, you can write data to IoTDB, read data from IoTDB and maintain the schema of IoTDB.
+
+## Requirements
+
+You have to install thrift (>=0.13) before using the package.
+
+## How to use (Example)
+
+First, download the package: `pip3 install apache-iotdb`
+
+You can get an example of using the package to read and write data at here: [Example](https://github.com/apache/incubator-iotdb/blob/rel/0.10/client-py/src/SessionExample.py)
+
+(you need to add `import iotdb` in the head of the file)
+
+# DISCLAIMER
+
+Apache IoTDB is an effort undergoing incubation at The Apache Software Foundation (ASF).
+Incubation is required of all newly accepted projects until a further review indicates that the
+infrastructure, communications, and decision making process have stabilized in a manner consistent
+with other successful ASF projects. While incubation status is not necessarily a reflection of the
+completeness or stability of the code, it does indicate that the project has yet to be fully
+endorsed by the ASF.
\ No newline at end of file
diff --git a/client-py/pypi/setup.py b/client-py/pypi/setup.py
new file mode 100644
index 0000000..1223ff9
--- /dev/null
+++ b/client-py/pypi/setup.py
@@ -0,0 +1,55 @@
+#  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="0.11.0",
+    author=" Apache Software Foundation",
+    author_email="dev@iotdb.apache.org",
+    description="Apache IoTDB client API",
+    long_description=long_description,
+    long_description_content_type="text/markdown",
+    url="https://github.com/apache/incubator-iotdb",
+    packages=setuptools.find_packages(),
+    install_requires=[
+              'thrift>=0.13.0',
+          ],
+    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.7',
+    license='Apache License, Version 2.0',
+    website='https://iotdb.apache.org',
+)
diff --git a/client-py/src/Session.py b/client-py/src/Session.py
index f9ee8f0..9fcc2f9 100644
--- a/client-py/src/Session.py
+++ b/client-py/src/Session.py
@@ -19,8 +19,7 @@
 import sys
 import struct
 
-# sys.path.append("../target")
-sys.path.append("../../thrift/target/generated-sources-python")
+#sys.path.append("../../thrift/target/generated-sources-python")
 sys.path.append("./utils")
 
 from IoTDBConstants import *
diff --git a/client-py/src/__init__.py b/client-py/src/__init__.py
new file mode 100644
index 0000000..a4797b6
--- /dev/null
+++ b/client-py/src/__init__.py
@@ -0,0 +1,18 @@
+# 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.
+#
+
diff --git a/pom.xml b/pom.xml
index e77198e..86daaca 100644
--- a/pom.xml
+++ b/pom.xml
@@ -97,6 +97,7 @@
         <module>distribution</module>
         <module>hive-connector</module>
         <module>cross-tests</module>
+        <module>client-py</module>
     </modules>
     <!-- Properties Management -->
     <properties>
diff --git a/thrift/pom.xml b/thrift/pom.xml
index 718b884..5444971 100644
--- a/thrift/pom.xml
+++ b/thrift/pom.xml
@@ -94,54 +94,6 @@
                     </execution>
                 </executions>
             </plugin>
-            <!-- for pypi distribution -->
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-resources-plugin</artifactId>
-                <version>2.4.3</version>
-                <configuration>
-                    <encoding>${project.build.sourceEncoding}</encoding>
-                </configuration>
-                <executions>
-                    <execution>
-                        <id>copy-pypi-resources</id>
-                        <!-- here the phase you need -->
-                        <phase>generate-sources</phase>
-                        <goals>
-                            <goal>copy-resources</goal>
-                        </goals>
-                        <configuration>
-                            <encoding>utf-8</encoding>
-                            <outputDirectory>${project.build.directory}/generated-sources-python</outputDirectory>
-                            <resources>
-                                <resource>
-                                    <directory>${basedir}/src/pypi</directory>
-                                </resource>
-                            </resources>
-                        </configuration>
-                    </execution>
-                    <execution>
-                        <id>copy-license-resources</id>
-                        <!-- here the phase you need -->
-                        <phase>generate-sources</phase>
-                        <goals>
-                            <goal>copy-resources</goal>
-                        </goals>
-                        <configuration>
-                            <encoding>utf-8</encoding>
-                            <outputDirectory>${project.build.directory}/generated-sources-python</outputDirectory>
-                            <resources>
-                                <resource>
-                                    <directory>${basedir}/../</directory>
-                                    <includes>
-                                        <include>LICENSE</include>
-                                    </includes>
-                                </resource>
-                            </resources>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
         </plugins>
     </build>
     <profiles>