Skip to content
This repository was archived by the owner on Nov 23, 2023. It is now read-only.

Commit bfca49d

Browse files
committed
Merge remote-tracking branch 'origin/python2'
2 parents 420005f + bd0f499 commit bfca49d

File tree

26 files changed

+524
-289
lines changed

26 files changed

+524
-289
lines changed

.travis.yml

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,26 @@ cache:
55
- $HOME/.m2
66
- $HOME/.cache/pip
77
- $HOME/conda
8-
# Verify step requires pandas and protobuf Python packages
9-
install: mvn package -B
108
matrix:
119
include:
1210
- os: linux
1311
jdk: oraclejdk8
1412
script: xvfb-run mvn verify -B
15-
env:
16-
- INSTALLER=Miniconda-latest-Linux-x86_64.sh
13+
before_install:
14+
- if [ ! -e $HOME/conda/bin/activate ]; then
15+
wget -nc https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh;
16+
bash Miniconda3-latest-Linux-x86_64.sh -f -b -p $HOME/conda;
17+
fi
1718
- os: osx
18-
osx_image: xcode8.2
19+
osx_image: xcode8.3
1920
script: Xvfb :5009 & export DISPLAY=:5009 && mvn verify -B
20-
env:
21-
- INSTALLER=Miniconda2-latest-MacOSX-x86_64.sh
22-
before_install:
23-
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then export JAVA_HOME=$(/usr/libexec/java_home); fi
24-
- if [ ! -e $HOME/conda/bin/activate ]; then
25-
wget -nc https://repo.continuum.io/miniconda/$INSTALLER;
26-
bash $INSTALLER -f -b -p $HOME/conda;
27-
fi
28-
- source $HOME/conda/bin/activate root
29-
- conda install -y -q pandas protobuf
21+
before_install:
22+
- if [ ! -e $HOME/conda/bin/activate ]; then
23+
wget -nc https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh;
24+
bash Miniconda3-latest-MacOSX-x86_64.sh -f -b -p $HOME/conda;
25+
fi
26+
- export JAVA_HOME=$(/usr/libexec/java_home)
27+
install:
28+
- source $HOME/conda/bin/activate root
29+
- conda install -y -q pandas protobuf
30+
- mvn package -B

README.md

Lines changed: 59 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1-
# Knime Python node archetype
1+
# KNIME Python node archetype
22

33
[![Build Status](https://travis-ci.org/3D-e-Chem/knime-python-node-archetype.svg?branch=master)](https://travis-ci.org/3D-e-Chem/knime-python-node-archetype)
44
[![Build status](https://ci.appveyor.com/api/projects/status/5dory9qjycepcmcn/branch/master?svg=true)](https://ci.appveyor.com/project/3D-e-Chem/knime-python-node-archetype/branch/master)
55
[![Download](https://api.bintray.com/packages/nlesc/knime-python-node-archetype/knime-python-node-archetype/images/download.svg) ](https://bintray.com/nlesc/knime-python-node-archetype/knime-python-node-archetype/_latestVersion)
66

7-
Generates [Knime](http://www.knime.org) workflow node skeleton repository with sample code.
7+
Generates [KNIME](http://www.knime.org) workflow node skeleton repository with sample code.
88
The node executes a Python script which is included in the skeleton.
99
The script uses dictionary for dialog options and [Pandas](http://pandas.pydata.org/) DataFrames as input and output.
1010

11-
This archetype was made because the instructions to create Knime nodes at https://tech.knime.org/developer-guide, requires interaction with Eclipse wizards. We wanted a way to start and perform node development from the command line and headless.
12-
Knime nodes are Eclipse plugins. The [Tycho](https://eclipse.org/tycho/) Maven plugin is used to build and handle dependencies of Eclipse plugins, so we use Tycho for Knime node building.
11+
This archetype was made because the instructions to create KNIME nodes at https://tech.knime.org/developer-guide, requires interaction with Eclipse wizards. We wanted a way to start and perform node development from the command line and headless.
12+
KNIME nodes are Eclipse plugins. The [Tycho](https://eclipse.org/tycho/) Maven plugin is used to build and handle dependencies of Eclipse plugins, so we use Tycho for KNIME node building.
1313

1414
The [Maven archetype](https://maven.apache.org/guides/introduction/introduction-to-archetypes.html) will generate a multi-module project with the following structure:
1515

1616
* / - parent Maven project
17-
* /plugin/ - code for Knime node
18-
* /tests/ - tests of Knime node
17+
* /plugin/ - code for KNIME node
18+
* /tests/ - tests of KNIME node
1919
* /feature/ - eclipse feature
2020
* /p2/ - eclipse update site
2121

22-
The Knime node will execute a Python script called `/plugin/src/<package>/<python script file name>.py`.
22+
The KNIME node will execute a Python script called `/plugin/src/<package>/<python script file name>.py`.
2323

2424
See https://github.com/3D-e-Chem/knime-python-wrapper for more information how the Python Wrapper node works.
2525

@@ -28,33 +28,69 @@ See https://github.com/3D-e-Chem/knime-python-wrapper for more information how t
2828
* Java >=1.8
2929
* Maven >=3.0
3030

31+
The archetype is hosted on a BinTray repository. Maven does not resolve to this BinTray repository by default so it must be added.
32+
33+
The ~/.m2/settings.xml should contain the following profile:
34+
35+
```xml
36+
<?xml version="1.0" encoding="UTF-8" ?>
37+
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
38+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
39+
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
40+
https://maven.apache.org/xsd/settings-1.0.0.xsd">
41+
<profiles>
42+
<profile>
43+
<id>knimearchetype</id>
44+
<repositories>
45+
<repository>
46+
<id>python-knime-archetype</id>
47+
<url>https://dl.bintray.com/nlesc/knime-python-node-archetype</url>
48+
</repository>
49+
</repositories>
50+
</profile>
51+
</profiles>
52+
</settings>
53+
```
54+
3155
## Generate
3256

33-
1. Execute
34-
```
57+
The following command will generate a skeleton project
58+
59+
```sh
3560
mvn archetype:generate -DarchetypeGroupId=nl.esciencecenter \
36-
-DarchetypeArtifactId=knime-python-node-archetype \
37-
-DarchetypeVersion=1.3.0 \
38-
-DarchetypeRepository=https://dl.bintray.com/nlesc/knime-python-node-archetype
61+
-DarchetypeArtifactId=knime-python-node-archetype \
62+
-DarchetypeVersion=1.3.0 \
63+
-P knimearchetype
3964
```
40-
2. Enter the groupId
41-
3. Enter the artifactId
42-
4. Enter the name of the package under which your code will be created
43-
5. Enter the version of your project
44-
6. Enter the Github organization name or Github username
45-
7. Enter the Github repository name
46-
8. Enter the Knime node name
47-
9. Enter the Python script file name (must be given without .py extension)
48-
10. Enter the required Python package name
49-
11. Confirm
50-
12. Change directory to generated code.
65+
66+
The command will ask the following questions:
67+
68+
1. Enter the groupId
69+
2. Enter the artifactId
70+
3. Enter the name of the package under which your code will be created
71+
4. Enter the version of your project, use `x.y.z-SNAPSHOT` format (for example `1.2.3-SNAPSHOT`), where x.y.z is [semantic versioning](http://semver.org/).
72+
5. Enter the GitHub organization name or GitHub username
73+
6. Enter the GitHub repository name
74+
7. Enter the KNIME node name
75+
8. Enter the Python script file name (must be given without .py extension)
76+
9. Enter the required Python package name (The presence of this Python package will be checked before executing the node)
77+
10. Confirm
78+
79+
The skeleton has been generated in a sub-directory named after the artifactId in the current working directory.
80+
81+
The following steps are needed to get a ready to use project.
82+
83+
11. Change directory to generated code.
84+
12. Make skeleton git aware, by running `git init`.
5185
13. Fill in all placeholders (`[Enter ... here.]`) in
5286

5387
* plugin/META-INF/MANIFEST.MF
5488
* plugin/src/**/*.xml
5589
* feature/feature.xml
5690
* p2/category.xml
5791

92+
14. Commit all changes and push to GitHub
93+
15. Optionally, setup Continuous Integration as described in the project README.md file.
5894

5995
Further instructions about generated project can be found in it's README.md file.
6096

appveyor.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@ version: 1.0.{build}
22
cache: C:\Users\appveyor\.m2
33
environment:
44
matrix:
5-
- PYTHON_VERSION: 2.7
6-
MINICONDA: C:\Miniconda-x64
5+
- PYTHON_VERSION: 3.6
6+
MINICONDA: C:\Miniconda3-x64
77
init:
88
- mvn --version
99
- "ECHO %PYTHON_VERSION% %MINICONDA%"
1010
install:
1111
- "set PATH=%MINICONDA%;%MINICONDA%\\Scripts;%PATH%"
1212
- conda install -y -q -c conda-forge pandas protobuf
13+
# KNIME defaults to python3 as executable, but conda only has python.exe, create python3 so tests can use it
14+
- copy /Y %MINICONDA%\python.exe %MINICONDA%\python3.exe
1315
build_script:
1416
- cmd: mvn package -B
1517
test_script:

pom.xml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<groupId>nl.esciencecenter</groupId>
44
<artifactId>knime-python-node-archetype</artifactId>
55
<version>1.3.0</version>
6-
<name>Archetype - Knime Python node</name>
6+
<name>Archetype - KNIME Python node</name>
77
<packaging>maven-archetype</packaging>
88
<licenses>
99
<license>
@@ -62,6 +62,15 @@
6262
<tagNameFormat>v@{project.version}</tagNameFormat>
6363
</configuration>
6464
</plugin>
65+
<plugin>
66+
<groupId>org.apache.maven.plugins</groupId>
67+
<artifactId>maven-resources-plugin</artifactId>
68+
<version>3.0.2</version>
69+
<configuration>
70+
<!-- Required so that .gitignore gets included in archetypes; see https://issues.apache.org/jira/browse/MRESOURCES-190 -->
71+
<addDefaultExcludes>false</addDefaultExcludes>
72+
</configuration>
73+
</plugin>
6574
</plugins>
6675
</pluginManagement>
6776
</build>

0 commit comments

Comments
 (0)