Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions keras_nlp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,4 @@
from keras_nlp import samplers
from keras_nlp import tokenizers
from keras_nlp import utils

# This is the global source of truth for the version number.
__version__ = "0.7.0"
from keras_nlp.version import __version__
23 changes: 23 additions & 0 deletions keras_nlp/version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright 2023 The KerasNLP Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from keras_nlp.api_export import keras_nlp_export

# Unique source of truth for the version number.
__version__ = "0.7.0"


@keras_nlp_export("keras_nlp.version")
def version():
return __version__
6 changes: 5 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ def get_version(rel_path):

HERE = pathlib.Path(__file__).parent
README = (HERE / "README.md").read_text()
if os.path.exists("keras_nlp/version.py"):
VERSION = get_version("keras_nlp/version.py")
else:
VERSION = get_version("keras_nlp/__init__.py")

setup(
name="keras-nlp",
Expand All @@ -45,7 +49,7 @@ def get_version(rel_path):
),
long_description=README,
long_description_content_type="text/markdown",
version=get_version("keras_nlp/__init__.py"),
version=VERSION,
url="https://github.com/keras-team/keras-nlp",
author="Keras team",
author_email="[email protected]",
Expand Down