Skip to content

Commit e993dac

Browse files
authored
Merge pull request #47 from m-dzianishchyts/pip-setup
Configure `pip` setup
2 parents 4b69272 + 5ec1669 commit e993dac

File tree

10 files changed

+140
-7
lines changed

10 files changed

+140
-7
lines changed

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,10 @@ target/
44
.project
55
.settings
66
*.iml
7+
8+
# pip
9+
build/
10+
dist/
11+
.egg/
12+
*.egg-info/
13+
kernelspec/**/*.jar

DEV-GUIDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Installing the latest snapshot version of the Kernel
44

5-
On macOS (and possibly on Linux) you could just run `snapshot-install.sh` script
5+
On macOS (and possibly on Linux) you could just run `install-snapshot.sh` script
66
to build and install current snapshot version of the JJava kernel.
77

88
Alternatively, you could just build it and install as with any release version:

snapshot-install.sh renamed to install-snapshot.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# This script just eases the installation process of the JJava for the development purposes.
44
# Essentially it's just an automated `maven package && unzip && jupyter kernelspec install` cycle.
55
#
6-
# Usage: to install SNAPSHOT version of the Kernel just run `./snapshot-install.sh`
6+
# Usage: to install SNAPSHOT version of the Kernel just run `./install-snapshot.sh`
77
#
88

99
BUILD_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)

jjava-launcher/pom.xml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,45 @@
3939
</execution>
4040
</executions>
4141
</plugin>
42+
<plugin>
43+
<groupId>org.apache.maven.plugins</groupId>
44+
<artifactId>maven-dependency-plugin</artifactId>
45+
<executions>
46+
<execution>
47+
<id>copy-artifacts</id>
48+
<phase>package</phase>
49+
<goals>
50+
<goal>copy</goal>
51+
</goals>
52+
<configuration>
53+
<artifactItems>
54+
<artifactItem>
55+
<groupId>${project.groupId}</groupId>
56+
<artifactId>${project.artifactId}</artifactId>
57+
<version>${project.version}</version>
58+
<type>${project.packaging}</type>
59+
<outputDirectory>../kernelspec/java</outputDirectory>
60+
<destFileName>jjava-launcher.jar</destFileName>
61+
</artifactItem>
62+
</artifactItems>
63+
</configuration>
64+
</execution>
65+
</executions>
66+
</plugin>
67+
<plugin>
68+
<groupId>org.apache.maven.plugins</groupId>
69+
<artifactId>maven-clean-plugin</artifactId>
70+
<configuration>
71+
<filesets>
72+
<fileset>
73+
<directory>../kernelspec/java</directory>
74+
<includes>
75+
<include>jjava-launcher.jar</include>
76+
</includes>
77+
</fileset>
78+
</filesets>
79+
</configuration>
80+
</plugin>
4281
</plugins>
4382
</build>
4483

jjava/assembly/zip/zip.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,14 @@
99
<files>
1010
<file>
1111
<source>${project.build.directory}/jjava-${project.version}.jar</source>
12+
<destName>jjava.jar</destName>
1213
</file>
1314
<file>
1415
<source>../jjava-launcher/${project.build.directory}/jjava-launcher-${project.version}.jar</source>
16+
<destName>jjava-launcher.jar</destName>
1517
</file>
1618
<file>
17-
<source>assembly/zip/kernel.json</source>
18-
<filtered>true</filtered>
19+
<source>../kernelspec/java/kernel.json</source>
1920
</file>
2021
</files>
2122
</assembly>

jjava/pom.xml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,45 @@
127127
</execution>
128128
</executions>
129129
</plugin>
130+
<plugin>
131+
<groupId>org.apache.maven.plugins</groupId>
132+
<artifactId>maven-dependency-plugin</artifactId>
133+
<executions>
134+
<execution>
135+
<id>copy-artifacts</id>
136+
<phase>package</phase>
137+
<goals>
138+
<goal>copy</goal>
139+
</goals>
140+
<configuration>
141+
<artifactItems>
142+
<artifactItem>
143+
<groupId>${project.groupId}</groupId>
144+
<artifactId>${project.artifactId}</artifactId>
145+
<version>${project.version}</version>
146+
<type>${project.packaging}</type>
147+
<outputDirectory>../kernelspec/java</outputDirectory>
148+
<destFileName>jjava.jar</destFileName>
149+
</artifactItem>
150+
</artifactItems>
151+
</configuration>
152+
</execution>
153+
</executions>
154+
</plugin>
155+
<plugin>
156+
<groupId>org.apache.maven.plugins</groupId>
157+
<artifactId>maven-clean-plugin</artifactId>
158+
<configuration>
159+
<filesets>
160+
<fileset>
161+
<directory>../kernelspec/java</directory>
162+
<includes>
163+
<include>jjava.jar</include>
164+
</includes>
165+
</fileset>
166+
</filesets>
167+
</configuration>
168+
</plugin>
130169
</plugins>
131170
</build>
132171

jjava/assembly/zip/kernel.json renamed to kernelspec/java/kernel.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
"argv": [
33
"java",
44
"-jar",
5-
"{resource_dir}/jjava-launcher-${project.version}.jar",
6-
"{resource_dir}/jjava-${project.version}.jar",
5+
"{resource_dir}/jjava-launcher.jar",
6+
"{resource_dir}/jjava.jar",
77
"{connection_file}"
88
],
9-
"display_name": "Java",
9+
"display_name": "Java (jjava)",
1010
"language": "java",
1111
"interrupt_mode": "message",
1212
"env": {

pip/jjava/__init__.py

Whitespace-only changes.

pom.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,16 @@
152152
<artifactId>maven-assembly-plugin</artifactId>
153153
<version>3.7.1</version>
154154
</plugin>
155+
<plugin>
156+
<groupId>org.apache.maven.plugins</groupId>
157+
<artifactId>maven-dependency-plugin</artifactId>
158+
<version>3.7.1</version>
159+
</plugin>
160+
<plugin>
161+
<groupId>org.apache.maven.plugins</groupId>
162+
<artifactId>maven-clean-plugin</artifactId>
163+
<version>3.4.0</version>
164+
</plugin>
155165
<plugin>
156166
<groupId>org.apache.maven.plugins</groupId>
157167
<artifactId>maven-release-plugin</artifactId>

pyproject.toml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
[build-system]
2+
requires = ["setuptools", "setuptools-scm"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "jjava"
7+
version = "1.0+SNAPSHOT"
8+
requires-python = ">=3.8"
9+
description = "A Jupyter kernel for Java notebooks"
10+
authors = [
11+
{ name = "Andrus Adamchik", email = "andrus@objectstyle.com" }
12+
]
13+
readme = "README.md"
14+
license = { file = "LICENSE" }
15+
keywords = ["windows", "macos", "linux", "jupyter", "java", "jupyter-kernels", "pip"]
16+
classifiers = [
17+
"Programming Language :: Python :: 3",
18+
"Programming Language :: Java",
19+
"License :: OSI Approved :: MIT License",
20+
"Operating System :: MacOS",
21+
"Operating System :: POSIX :: Linux",
22+
"Operating System :: Microsoft :: Windows"
23+
]
24+
25+
[project.urls]
26+
Documentation = "https://dflib.org/jjava/docs/1.x/"
27+
Repository = "https://github.com/dflib/jjava"
28+
Download = "https://github.com/dflib/jjava/releases"
29+
Issues = "https://github.com/dflib/jjava/issues"
30+
Changelog = "https://github.com/dflib/jjava/blob/main/RELEASE-NOTES.md"
31+
32+
[tool.setuptools.packages.find]
33+
where = ["pip"]
34+
include = ["jjava"]
35+
36+
[tool.setuptools.data-files]
37+
"share/jupyter/kernels/java" = ["kernelspec/java/*"]

0 commit comments

Comments
 (0)