Skip to content

Commit

Permalink
[GH-5695] Add pyproject.toml to python modules (#5714)
Browse files Browse the repository at this point in the history
* [GH-5695] Add pyproject.toml to python modules

* dynamic docs version
  • Loading branch information
krasinski committed Mar 20, 2024
1 parent 9aeb64c commit fb24c20
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 0 deletions.
2 changes: 2 additions & 0 deletions py-scoring/build.gradle
Expand Up @@ -77,12 +77,14 @@ def copyPySetup() {
copy {
from("$projectDir/src") {
include 'setup.py'
include 'pyproject.toml'
}
filter {
it.replaceAll("SUBST_SPARK_MAJOR_VERSION", sparkMajorVersion)
.replaceAll("SUBST_SPARK_VERSION", sparkVersion)
.replaceAll("SUBST_SW_VERSION", version.substring(0, version.lastIndexOf("-")).replace("-", ".post"))
.replaceAll("SUBST_SPARK_MAJOR_VERSION", sparkMajorVersion)
.replaceAll("SUBST_MIN_SUPPORTED_PYTHON", supportedPythonVersions.split(" ")[0])
.replaceAll("SUBST_PYTHON_VERSIONS", convertSupportedPythonVersionsToPyPiDefinitions(supportedPythonVersions))
}
from("$projectDir/src") {
Expand Down
37 changes: 37 additions & 0 deletions py-scoring/src/pyproject.toml
@@ -0,0 +1,37 @@
[build-system]
requires = ["setuptools >= 59.6.0"]
build-backend = "setuptools.build_meta"

[project]
name = "h2o_pysparkling_scoring_SUBST_SPARK_MAJOR_VERSION"
version = "SUBST_SW_VERSION"
description = "Sparkling Water integrates H2O's Fast Scalable Machine Learning with Spark"
readme = "README.rst"
requires-python = ">= SUBST_MIN_SUPPORTED_PYTHON"
license = { text = "Apache v2" }
dependencies = []
classifiers = [
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'Topic :: Software Development :: Build Tools',
'License :: OSI Approved :: Apache Software License',
SUBST_PYTHON_VERSIONS
]
keywords = ["machine learning", "data mining", "statistical analysis", "modeling", "big data", "distributed", "parallel", "scoring"]
authors = [
{name = "H2O", email = "support@h2o.ai"}
]

[project.urls]
Homepage = "https://h2o.ai/products/h2o-sparkling-water/"
Documentation = "https://docs.h2o.ai/sparkling-water/SUBST_SPARK_MAJOR_VERSION/latest-stable/doc/index.html"
Repository = "https://github.com/h2oai/sparkling-water/"
Issues = "https://github.com/h2oai/sparkling-water/issues/"
Changelog = "https://github.com/h2oai/sparkling-water/blob/master/doc/CHANGELOG.rst"

[tool.setuptools]
include-package-data = true

[tool.setuptools.package-data]
sparkling_water = ["*.jar"]
"ai.h2o.sparkling" = ["version.txt"]
2 changes: 2 additions & 0 deletions py/build.gradle
Expand Up @@ -130,12 +130,14 @@ def copyPySetup() {
copy {
from("$projectDir/src") {
include 'setup.py'
include 'pyproject.toml'
}
filter {
it.replaceAll("SUBST_SPARK_MAJOR_VERSION", sparkMajorVersion)
.replaceAll("SUBST_SPARK_VERSION", sparkVersion)
.replaceAll("SUBST_SW_VERSION", version.substring(0, version.lastIndexOf("-")).replace("-", ".post"))
.replaceAll("SUBST_SPARK_MAJOR_VERSION", sparkMajorVersion)
.replaceAll("SUBST_MIN_SUPPORTED_PYTHON", supportedPythonVersions.split(" ")[0])
.replaceAll("SUBST_PYTHON_VERSIONS", convertSupportedPythonVersionsToPyPiDefinitions(supportedPythonVersions))
}
from("$projectDir") {
Expand Down
41 changes: 41 additions & 0 deletions py/src/pyproject.toml
@@ -0,0 +1,41 @@
[build-system]
requires = ["setuptools >= 59.6.0"]
build-backend = "setuptools.build_meta"

[project]
name = "h2o_pysparkling_SUBST_SPARK_MAJOR_VERSION"
version = "SUBST_SW_VERSION"
description = "Sparkling Water integrates H2O's Fast Scalable Machine Learning with Spark"
readme = "README.rst"
requires-python = ">= SUBST_MIN_SUPPORTED_PYTHON"
license = { text = "Apache v2" }
dependencies = [
"requests",
"tabulate"
]
classifiers = [
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'Topic :: Software Development :: Build Tools',
'License :: OSI Approved :: Apache Software License',
SUBST_PYTHON_VERSIONS
]
keywords = ["machine learning", "data mining", "statistical analysis", "modeling", "big data", "distributed", "parallel"]
authors = [
{name = "H2O", email = "support@h2o.ai"}
]

[project.urls]
Homepage = "https://h2o.ai/products/h2o-sparkling-water/"
Documentation = "https://docs.h2o.ai/sparkling-water/SUBST_SPARK_MAJOR_VERSION/latest-stable/doc/index.html"
Repository = "https://github.com/h2oai/sparkling-water/"
Issues = "https://github.com/h2oai/sparkling-water/issues/"
Changelog = "https://github.com/h2oai/sparkling-water/blob/master/doc/CHANGELOG.rst"

[tool.setuptools]
include-package-data = true

[tool.setuptools.package-data]
sparkling_water = ["*.jar"]
h2o = ["version.txt", "buildinfo.txt"]
"ai.h2o.sparkling" = ["version.txt"]

0 comments on commit fb24c20

Please sign in to comment.