Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
apache
Iotdb
提交
49976b0d
I
Iotdb
项目概览
apache
/
Iotdb
11 个月 前同步成功
通知
25
Star
3344
Fork
916
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
I
Iotdb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
49976b0d
编写于
11月 04, 2020
作者:
X
Xiangdong Huang
提交者:
GitHub
11月 04, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor the packaging structure of Python API module on Pypi (#1939)
上级
04d60f74
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
159 addition
and
107 deletion
+159
-107
client-py/pom.xml
client-py/pom.xml
+126
-0
client-py/pypi/README.md
client-py/pypi/README.md
+0
-0
client-py/pypi/setup.py
client-py/pypi/setup.py
+1
-1
client-py/readme.md
client-py/readme.md
+12
-1
client-py/src/Session.py
client-py/src/Session.py
+1
-2
client-py/src/__init__.py
client-py/src/__init__.py
+18
-0
pom.xml
pom.xml
+1
-0
thrift/pom.xml
thrift/pom.xml
+0
-103
未找到文件。
client-py/pom.xml
0 → 100644
浏览文件 @
49976b0d
<?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>
thrift/src
/pypi/README.md
→
client-py
/pypi/README.md
浏览文件 @
49976b0d
文件已移动
thrift/src
/pypi/setup.py
→
client-py
/pypi/setup.py
浏览文件 @
49976b0d
...
...
@@ -37,7 +37,7 @@ setuptools.setup(
description
=
"Apache IoTDB client API"
,
long_description
=
long_description
,
long_description_content_type
=
"text/markdown"
,
url
=
"https://github.com/apache/i
ncubator-i
otdb"
,
url
=
"https://github.com/apache/iotdb"
,
packages
=
setuptools
.
find_packages
(),
install_requires
=
[
'thrift>=0.13.0'
,
...
...
client-py/readme.md
浏览文件 @
49976b0d
...
...
@@ -47,4 +47,15 @@ to generate the python library.
## Session Client & Example
We packed up the Thrift interface in
`client-py/src/Session.py`
(similar with its Java counterpart), also provided
an example file
`client-py/src/SessionExample.py`
of how to use the session module. please read it carefully.
\ No newline at end of file
an example file
`client-py/src/SessionExample.py`
of how to use the session module. please read it carefully.
## How to Debug
To debug the python API module, run
`mvn generate-sources -pl thrift,client-py`
Then, go to target/pypi to get the complete projects.
But !BE CAUTIOUS!
All your modifications in target/pypi must be copied manually to src/ folder.
Otherwise once you run
`mvn clean`
, you will lose all your effort.
client-py/src/Session.py
浏览文件 @
49976b0d
...
...
@@ -20,8 +20,7 @@ import sys
import
struct
import
time
# 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
*
...
...
client-py/src/__init__.py
0 → 100644
浏览文件 @
49976b0d
# 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.
#
pom.xml
浏览文件 @
49976b0d
...
...
@@ -97,6 +97,7 @@
<module>
distribution
</module>
<module>
hive-connector
</module>
<module>
cross-tests
</module>
<module>
client-py
</module>
</modules>
<!-- Properties Management -->
<properties>
...
...
thrift/pom.xml
浏览文件 @
49976b0d
...
...
@@ -94,109 +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>
<profile>
<id>
only-eclipse
</id>
<activation>
<property>
<name>
m2e.version
</name>
</property>
</activation>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>
org.eclipse.m2e
</groupId>
<artifactId>
lifecycle-mapping
</artifactId>
<version>
1.0.0
</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-dependency-plugin
</artifactId>
<versionRange>
${maven-dependency-plugin.version}
</versionRange>
<goals>
<goal>
copy-dependencies
</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore/>
</action>
</pluginExecution>
<pluginExecution>
<pluginExecutionFilter>
<groupId>
org.apache.thrift.tools
</groupId>
<artifactId>
maven-thrift-plugin
</artifactId>
<versionRange>
[0.1.10,)
</versionRange>
<goals>
<goal>
compile
</goal>
</goals>
</pluginExecutionFilter>
<action>
<execute>
<runOnIncremental>
false
</runOnIncremental>
</execute>
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</profile>
</profiles>
</project>
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录