oracle / oracle/graalpython

Consider a more Gradle-native syntax to specify Python dependencies in the Gradle plugin

Offen
#461 1 Kommentar 0 Reaktionen 1 zugewiesene Person Auf GitHub ansehen

@steve-s arbeitet bereits daran.

Seit 23.12.2024.

Vorherrschende Sprache
Python
Sterne
1.6k
Forks
155
Ø Merge
9 Std. 42 Min.
Gemergte PRs (30 T.)
36

Beschreibung

Currently, specifying Python dependencies from Gradle seems to work like:

plugins {
    id("org.graalvm.python") version "24.1.1"
}

graalPy {
    packages = setOf("pyfiglet==1.0.2")
}

As a Gradle user, I'd expect a syntax that is more "native" to Gradle, e.g. via a graalPy Gradle configuration:

plugins {
    id("org.graalvm.python") version "24.1.1"
}

dependencies {
    graalPy("pyfiglet:1.0.2")
}

While I haven't tested this, I assume that as the configuration will be resolved by the plugin, the dependency notation can omit the usual group name. If for whatever reason a group name would be syntactically required, a dummy name like "python" could be added.

Background: I'm inspired by how the JRuby Gradle plugin does it (note that this is still Groovy instead of Kotlin DSL syntax):

dependencies {
    /* Using the built-in `jrubyJar` configuration to describe the
     * dependencies our jrubyJar task will need, so the gem is properly
     * included in the resulting .jar file
     */
    jrubyJar "rubygems:colorize:0.7.7+"
    jrubyJar 'org.slf4j:slf4j-simple:1.7.12'
}

Following this approach consistently across all Gradle plugins for GraalVM languages would make a great Gradle user experience IMO, and maybe all Gradle plugins could even share some common code (to create those language-specific configurations etc.).

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.