You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by cd...@apache.org on 2019/05/01 08:38:51 UTC
[plc4x] branch develop updated: - Added a first trivial setup.py
that gets the important parts from loading the pom.xml in the same
directory.
This is an automated email from the ASF dual-hosted git repository.
cdutz pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/plc4x.git
The following commit(s) were added to refs/heads/develop by this push:
new 174afb5 - Added a first trivial setup.py that gets the important parts from loading the pom.xml in the same directory.
174afb5 is described below
commit 174afb5e9562878c4e78559d3b5ec1cd199d7b54
Author: Christofer Dutz <ch...@c-ware.de>
AuthorDate: Wed May 1 10:38:44 2019 +0200
- Added a first trivial setup.py that gets the important parts from loading the pom.xml in the same directory.
---
plc4py/setup.py | 64 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 64 insertions(+)
diff --git a/plc4py/setup.py b/plc4py/setup.py
new file mode 100644
index 0000000..7f947b8
--- /dev/null
+++ b/plc4py/setup.py
@@ -0,0 +1,64 @@
+"""
+
+ 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 xml.etree.ElementTree as ET
+from io import open
+from os import path
+
+from setuptools import setup, find_packages
+
+# Remember the location of this file.
+here = path.abspath(path.dirname(__file__))
+
+# Read the entire README.md and save it's content in the "long_description" variable.
+with open(path.join(here, 'README.md'), encoding='utf-8') as f:
+ long_description = f.read()
+
+# Register the maven namespace.
+ns = {'mvn': 'http://maven.apache.org/POM/4.0.0'}
+# Load the pom.xml and extract some of it's information from it.
+mavenPomRoot = ET.parse('pom.xml')
+print("Root", mavenPomRoot)
+mvnArtifactId = mavenPomRoot.find("mvn:artifactId", ns).text
+print("ArtifactId", mvnArtifactId)
+mvnVersion = mavenPomRoot.find("mvn:parent/mvn:version", ns).text
+print(mvnVersion)
+mvnDescription = mavenPomRoot.find("mvn:description", ns).text
+print(mvnDescription)
+
+setup(
+ name=mvnArtifactId,
+ version=mvnVersion,
+ description=mvnDescription,
+ long_description=long_description,
+ long_description_content_type='text/markdown',
+ url='https://plc4x.apache.org',
+ author_email='dev@plc4x.apache.org',
+
+ packages=find_packages(exclude=['target', 'src/test']),
+
+ python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, <4',
+
+ data_files=[('lib', ['src/main/resources/lib/log4j2.xml'])],
+
+ project_urls={
+ 'Bug Reports': 'https://issues.apache.org/jira/projects/PLC4X',
+ 'Source': 'https://gitbox.apache.org/repos/asf/plc4x.git',
+ },
+)
\ No newline at end of file