Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the Python package to automatically provision a Java runtime for the Scala-based compiler core (via install-jdk), and correspondingly simplifies the setup/getting-started documentation while bumping the package version.
Changes:
- Add
install-jdkas a runtime dependency and use it to auto-install a JRE before launching the compiler JAR. - Remove/trim documentation that required manual Java installation; keep installation instructions to
pip install edg. - Bump package version from
0.5.0to0.5.1.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| setup.md | Removes the dedicated setup document (including manual Java/JDK instructions). |
| README.md | Simplifies “Getting Started” to pip install edg and removes Java requirements mention. |
| pyproject.toml | Version bump; add install-jdk; add mypy override for jdk module. |
| getting-started.md | Simplifies setup section and adjusts IDE guidance/links. |
| edg/core/ScalaCompilerInterface.py | Auto-installs a JRE and uses it to start the Scala compiler process. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
135
to
137
| self.process = subprocess.Popen( | ||
| ["java", "-jar", jar_path], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE | ||
| [str(java_bin), "-jar", jar_path], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE | ||
| ) |
Comment on lines
+103
to
+116
| if self.kInstallJrePath.exists(): | ||
| items = [ | ||
| item | ||
| for item in self.kInstallJrePath.iterdir() | ||
| if item.is_dir() and ("jre" in item.name or "jdk" in item.name) | ||
| ] | ||
| if len(items) > 0: | ||
| if len(items) != 1: | ||
| raise RuntimeError(f"Expected one JRE in {self.kInstallJrePath}, delete extras and re-run.") | ||
| java_bin_path = items[0] / "bin" | ||
| if not java_bin_path.exists(): | ||
| raise RuntimeError(f"Expected JRE bin folder {java_bin_path} to exist.") | ||
| java_bin = java_bin_path / "java" # can't test this since it has os-specific extensions | ||
|
|
Comment on lines
+122
to
+123
| jdk.install("25", path=str(self.kInstallJrePath), jre=True) | ||
| installed = True |
| pip install edg | ||
| ``` | ||
|
|
||
| Then, work through building a mechanical keyboard (including subcircuit layout replication) in the [getting started tutorial](getting-started.md). |
| ``` | ||
| pip install edg | ||
| ``` | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uses install-jdk to automatically fetch a JRE of the right version. Removes Java version issues from the setup docs. Bumps version.
Contributor License Agreement
By submitting this pull request, I agree to dual-license this contribution under both BSD 3-clause and Apache License, Version 2.0.