From 1bb4017ab809550cec7b6681e888fda7f6f0cb05 Mon Sep 17 00:00:00 2001 From: Yuqing Wei Date: Thu, 13 Oct 2022 12:00:37 +0800 Subject: [PATCH 1/4] unify python package version and enable env setting for scala version Signed-off-by: Yuqing Wei --- build.sbt | 2 +- feathr_project/feathr/__init__.py | 7 ++----- feathr_project/feathr/constants.py | 3 ++- feathr_project/feathr/version.py | 1 + feathr_project/setup.py | 14 +++++++++++++- 5 files changed, 19 insertions(+), 8 deletions(-) create mode 100644 feathr_project/feathr/version.py diff --git a/build.sbt b/build.sbt index 2919ddae6..763167535 100644 --- a/build.sbt +++ b/build.sbt @@ -2,7 +2,7 @@ import sbt.Keys.publishLocalConfiguration ThisBuild / resolvers += Resolver.mavenLocal ThisBuild / scalaVersion := "2.12.15" -ThisBuild / version := "0.8.0" +ThisBuild / version := sys.env.get("FEATHR_VERSION").get_or_else("0.8.2-rc") ThisBuild / organization := "com.linkedin.feathr" ThisBuild / organizationName := "linkedin" val sparkVersion = "3.1.3" diff --git a/feathr_project/feathr/__init__.py b/feathr_project/feathr/__init__.py index 9b0cf0a49..74809fd81 100644 --- a/feathr_project/feathr/__init__.py +++ b/feathr_project/feathr/__init__.py @@ -1,5 +1,3 @@ -import pkg_resources - from .client import FeathrClient from .spark_provider.feathr_configurations import SparkExecutionConfiguration from .definition.feature_derivations import * @@ -19,6 +17,7 @@ from .definition.settings import * from .utils.job_utils import * from .utils.feature_printer import * +from .version import __version__ # skipped class as they are internal methods: # RepoDefinitions, HoconConvertible, @@ -75,7 +74,5 @@ 'ObservationSettings', 'FeaturePrinter', 'SparkExecutionConfiguration', + __version__, ] - - -__version__ = pkg_resources.require("feathr")[0].version diff --git a/feathr_project/feathr/constants.py b/feathr_project/feathr/constants.py index 6686f14ac..1a61c85f6 100644 --- a/feathr_project/feathr/constants.py +++ b/feathr_project/feathr/constants.py @@ -28,7 +28,8 @@ TYPEDEF_ARRAY_DERIVED_FEATURE=f"array" TYPEDEF_ARRAY_ANCHOR_FEATURE=f"array" -FEATHR_MAVEN_ARTIFACT="com.linkedin.feathr:feathr_2.12:0.8.0" +from feathr.version import __version__ +FEATHR_MAVEN_ARTIFACT="com.linkedin.feathr:feathr_2.12:{__version__}" JOIN_CLASS_NAME="com.linkedin.feathr.offline.job.FeatureJoinJob" GEN_CLASS_NAME="com.linkedin.feathr.offline.job.FeatureGenJob" \ No newline at end of file diff --git a/feathr_project/feathr/version.py b/feathr_project/feathr/version.py new file mode 100644 index 000000000..4e98f6a4c --- /dev/null +++ b/feathr_project/feathr/version.py @@ -0,0 +1 @@ +__version__ = "0.8.2-rc" \ No newline at end of file diff --git a/feathr_project/setup.py b/feathr_project/setup.py index ce7ec14d6..22c895a34 100644 --- a/feathr_project/setup.py +++ b/feathr_project/setup.py @@ -1,3 +1,5 @@ +import sys +import os from setuptools import setup, find_packages from pathlib import Path @@ -5,9 +7,19 @@ root_path = Path(__file__).resolve().parent.parent long_description = (root_path / "docs/README.md").read_text(encoding="utf8") +try: + exec(open("feathr/version.py").read()) +except IOError: + print("Failed to load Feathr version file for packaging.", + file=sys.stderr) + sys.exit(-1) + +VERSION = __version__ # noqa +os.environ["FEATHR_VERSION"] = VERSION + setup( name='feathr', - version='0.8.0', + version=VERSION, long_description=long_description, long_description_content_type="text/markdown", author_email="feathr-technical-discuss@lists.lfaidata.foundation", From 6a45c1e1c9081ee7bf62a4b6e4edbe0909cfcc05 Mon Sep 17 00:00:00 2001 From: Yuqing Wei Date: Thu, 13 Oct 2022 14:49:42 +0800 Subject: [PATCH 2/4] update docs and decouple maven version Signed-off-by: Yuqing Wei --- build.sbt | 2 +- docs/dev_guide/feathr_overall_release_guide.md | 6 +++--- feathr_project/feathr/constants.py | 5 ++++- feathr_project/feathr/version.py | 2 +- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/build.sbt b/build.sbt index 763167535..f4944a38d 100644 --- a/build.sbt +++ b/build.sbt @@ -2,7 +2,7 @@ import sbt.Keys.publishLocalConfiguration ThisBuild / resolvers += Resolver.mavenLocal ThisBuild / scalaVersion := "2.12.15" -ThisBuild / version := sys.env.get("FEATHR_VERSION").get_or_else("0.8.2-rc") +ThisBuild / version := sys.env.get("FEATHR_MAVEN_VERSION").getOrElse("0.8.2rc0") ThisBuild / organization := "com.linkedin.feathr" ThisBuild / organizationName := "linkedin" val sparkVersion = "3.1.3" diff --git a/docs/dev_guide/feathr_overall_release_guide.md b/docs/dev_guide/feathr_overall_release_guide.md index 069f6edf4..0174c8dae 100644 --- a/docs/dev_guide/feathr_overall_release_guide.md +++ b/docs/dev_guide/feathr_overall_release_guide.md @@ -31,11 +31,11 @@ Read through the [commit log](https://github.com/feathr-ai/feathr/commits/main) ## Code Changes Before the release is made, the version needs to be updated in following places - [build.sbt](https://github.com/feathr-ai/feathr/blob/main/build.sbt#L3) - For Maven release version -- [setup.py](https://github.com/feathr-ai/feathr/blob/main/feathr_project/setup.py#L10) - For PyPi release version +- [version.py](https://github.com/feathr-ai/feathr/blob/main/feathr_project/feathr/version.py#L1) - For Feathr version - [conf.py](https://github.com/feathr-ai/feathr/blob/main/feathr_project/docs/conf.py#L27) - For documentation version -- [feathr_config.yaml](https://github.com/feathr-ai/feathr/blob/main/feathr_project/test/test_user_workspace/feathr_config.yaml#L84) - To set the spark runtime location for Azure Synapse and Azure Databricks used by test suite. -- [constants.py](https://github.com/feathr-ai/feathr/blob/73656fe4a57219e99ff6fede10d51a000ae90fa1/feathr_project/feathr/constants.py#L31) - To set the default maven artifact version +- [feathr_config.yaml](https://github.com/feathr-ai/feathr/blob/main/feathr_project/test/test_user_workspace/feathr_config.yaml#L84) - To set the spark runtime location for Azure Synapse and Azure Databricks used by test suite. Please update all .yaml files under this path. - [azure_resource_provision.json](https://github.com/feathr-ai/feathr/blob/main/docs/how-to-guides/azure_resource_provision.json#L114) - To set the deployment template to pull the latest release image. +- [constants.py](https://github.com/feathr-ai/feathr/blob/main/feathr_project/feathr/constants.py#L31) - To set the default maven artifact version (Only needed when maven version is **NOT** the same as python sdk version) ## Triggering automated release pipelines Our goal is to automate the release process as much as possible. So far, we have automated the following steps diff --git a/feathr_project/feathr/constants.py b/feathr_project/feathr/constants.py index 1a61c85f6..8c393972e 100644 --- a/feathr_project/feathr/constants.py +++ b/feathr_project/feathr/constants.py @@ -28,8 +28,11 @@ TYPEDEF_ARRAY_DERIVED_FEATURE=f"array" TYPEDEF_ARRAY_ANCHOR_FEATURE=f"array" +# Decouple Feathr MAVEN Version from Feathr Python SDK Version +import os from feathr.version import __version__ -FEATHR_MAVEN_ARTIFACT="com.linkedin.feathr:feathr_2.12:{__version__}" +FEATHR_MAVEN_VERSION = os.environ.get("FEATHR_MAVEN_VERSION", __version__) +FEATHR_MAVEN_ARTIFACT="com.linkedin.feathr:feathr_2.12:{FEATHR_MAVEN_VERSION}" JOIN_CLASS_NAME="com.linkedin.feathr.offline.job.FeatureJoinJob" GEN_CLASS_NAME="com.linkedin.feathr.offline.job.FeatureGenJob" \ No newline at end of file diff --git a/feathr_project/feathr/version.py b/feathr_project/feathr/version.py index 4e98f6a4c..bf4baa649 100644 --- a/feathr_project/feathr/version.py +++ b/feathr_project/feathr/version.py @@ -1 +1 @@ -__version__ = "0.8.2-rc" \ No newline at end of file +__version__ = "0.8.2rc0" \ No newline at end of file From 3db7b9d87cceffb0f11ff4a21a44e9983bef3b3b Mon Sep 17 00:00:00 2001 From: Yuqing Wei Date: Thu, 13 Oct 2022 15:00:29 +0800 Subject: [PATCH 3/4] change version back to 0.8.0 to avoid conflicts Signed-off-by: Yuqing Wei --- build.sbt | 2 +- feathr_project/feathr/version.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build.sbt b/build.sbt index f4944a38d..8eea307de 100644 --- a/build.sbt +++ b/build.sbt @@ -2,7 +2,7 @@ import sbt.Keys.publishLocalConfiguration ThisBuild / resolvers += Resolver.mavenLocal ThisBuild / scalaVersion := "2.12.15" -ThisBuild / version := sys.env.get("FEATHR_MAVEN_VERSION").getOrElse("0.8.2rc0") +ThisBuild / version := sys.env.get("FEATHR_MAVEN_VERSION").getOrElse("0.8.0") ThisBuild / organization := "com.linkedin.feathr" ThisBuild / organizationName := "linkedin" val sparkVersion = "3.1.3" diff --git a/feathr_project/feathr/version.py b/feathr_project/feathr/version.py index bf4baa649..807119de6 100644 --- a/feathr_project/feathr/version.py +++ b/feathr_project/feathr/version.py @@ -1 +1 @@ -__version__ = "0.8.2rc0" \ No newline at end of file +__version__ = "0.8.0" \ No newline at end of file From 5eb3e6e3e77215b241bc0d2a1bf468fe37c10548 Mon Sep 17 00:00:00 2001 From: Yuqing Wei Date: Thu, 13 Oct 2022 21:37:55 +0800 Subject: [PATCH 4/4] fix typo Signed-off-by: Yuqing Wei --- feathr_project/feathr/constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/feathr_project/feathr/constants.py b/feathr_project/feathr/constants.py index 8c393972e..b2222e2b6 100644 --- a/feathr_project/feathr/constants.py +++ b/feathr_project/feathr/constants.py @@ -32,7 +32,7 @@ import os from feathr.version import __version__ FEATHR_MAVEN_VERSION = os.environ.get("FEATHR_MAVEN_VERSION", __version__) -FEATHR_MAVEN_ARTIFACT="com.linkedin.feathr:feathr_2.12:{FEATHR_MAVEN_VERSION}" +FEATHR_MAVEN_ARTIFACT=f"com.linkedin.feathr:feathr_2.12:{FEATHR_MAVEN_VERSION}" JOIN_CLASS_NAME="com.linkedin.feathr.offline.job.FeatureJoinJob" GEN_CLASS_NAME="com.linkedin.feathr.offline.job.FeatureGenJob" \ No newline at end of file