feat(python): add native distribution and release infrastructure

- add the Rust-backed Python API with PyStemmer compatibility
- distribute standard compiled models as a separate Python package
- generate model artifacts during builds instead of storing them in Git
- add GitHub release and Pages-backed package index workflows
- add Python tests, benchmarks, documentation, and Gradle integration
- refresh the documentation site, branding, and language benchmarks
This commit is contained in:
2026-08-10 22:34:32 +02:00
parent b45e143c84
commit 5e3d3c7c7d
139 changed files with 11420 additions and 747 deletions

View File

@@ -1,7 +1,10 @@
import org.gradle.plugins.ide.eclipse.model.SourceFolder
import java.security.MessageDigest
def snowballVersion = '3.0.1'
def snowballVersion = '3.1.0'
def snowballArchiveSha256 = '5dab34d491f55f47b6e971569ffe6aadf5991512c648ddfe5d331b494cf6d655'
def snowballArchiveName = "libstemmer_java-${snowballVersion}.tar.gz"
def snowballDistributionDirectoryName = "libstemmer_java-${snowballVersion}"
def snowballRootRelativePath = 'third-party/snowball'
@@ -73,11 +76,32 @@ tasks.register('downloadSnowballJava') {
}
}
tasks.register('verifySnowballJava') {
group = 'verification'
description = 'Verifies the official Snowball Java source distribution checksum.'
dependsOn(tasks.named('downloadSnowballJava'))
inputs.file(snowballDownloadFile)
inputs.property('expectedSha256', snowballArchiveSha256)
doLast {
final File archive = snowballDownloadFile.get().asFile
final String actualSha256 = MessageDigest.getInstance('SHA-256')
.digest(archive.bytes)
.encodeHex()
.toString()
if (actualSha256 != snowballArchiveSha256) {
throw new GradleException("Snowball ${snowballVersion} archive SHA-256 mismatch: "
+ "expected ${snowballArchiveSha256}, found ${actualSha256}.")
}
}
}
tasks.register('extractSnowballJava', Copy) {
group = 'build setup'
description = 'Extracts the official Snowball Java source distribution.'
dependsOn(tasks.named('downloadSnowballJava'))
dependsOn(tasks.named('verifySnowballJava'))
from(tarTree(resources.gzip(snowballDownloadFile)))
into(snowballExtractDirectory)