Skip to content

Commit

Permalink
add jars to the project workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
sagarlakshmipathy committed Dec 5, 2023
1 parent a0ef5db commit ca1e5d0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@ jobs:
java-version: '11'
distribution: 'adopt'
- name: Build with Maven
run: mvn -B package --file pom.xml
- name: Download py4j jar
run: |
mkdir -p py4j_example
curl -L -o py4j_example/py4j-0.10.9.7.jar https://repo1.maven.org/maven2/net/sf/py4j/py4j/0.10.9.7/py4j-0.10.9.7.jar
mvn clean package
mkdir -p py4j_example/jars
cp target/Py4J-1.0-SNAPSHOT.jar py4j_example/jars/
- name: Download py4j jar
run: curl -L -o py4j_example/jars/py4j-0.10.9.7.jar https://repo1.maven.org/maven2/net/sf/py4j/py4j/0.10.9.7/py4j-0.10.9.7.jar
- name: Set up Python
uses: actions/setup-python@v2
with:
Expand Down
4 changes: 2 additions & 2 deletions py4j_example/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ class ApplicationWrapper:
"""
def __init__(self):
py4j_jar_path = pkg_resources.resource_filename('py4j_example', 'py4j-0.10.9.7.jar')
application_jar_path = pkg_resources.resource_filename('py4j_example', 'Py4J-1.0-SNAPSHOT.jar')
py4j_jar_path = pkg_resources.resource_filename('py4j_example', 'jars/py4j-0.10.9.7.jar')
application_jar_path = pkg_resources.resource_filename('py4j_example', 'jars/Py4J-1.0-SNAPSHOT.jar')
classpath = f"{py4j_jar_path}:{application_jar_path}"

# Start the Java Gateway server
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
name="py4j-example",
version=VERSION,
packages=find_packages(),
package_data={"py4j_example": ["*.jar"]}, # Include JAR files in the package
package_data={"py4j_example": ["jars/*.jar"]}, # Include JAR files in the package
include_package_data=True,
long_description=long_description,
long_description_content_type="text/markdown",
Expand Down

0 comments on commit ca1e5d0

Please sign in to comment.