|
| 1 | +# Copyright 2024 The KerasHub Authors |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# https://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | + |
| 15 | +"""Setup script.""" |
| 16 | + |
| 17 | +import os |
| 18 | +import pathlib |
| 19 | + |
| 20 | +from setuptools import find_packages |
| 21 | +from setuptools import setup |
| 22 | + |
| 23 | + |
| 24 | +def read(rel_path): |
| 25 | + here = os.path.abspath(os.path.dirname(__file__)) |
| 26 | + with open(os.path.join(here, rel_path)) as fp: |
| 27 | + return fp.read() |
| 28 | + |
| 29 | + |
| 30 | +def get_version(rel_path): |
| 31 | + for line in read(rel_path).splitlines(): |
| 32 | + if line.startswith("__version__"): |
| 33 | + delim = '"' if '"' in line else "'" |
| 34 | + return line.split(delim)[1] |
| 35 | + raise RuntimeError("Unable to find version string.") |
| 36 | + |
| 37 | + |
| 38 | +HERE = pathlib.Path(__file__).parent |
| 39 | +README = (HERE / "README.md").read_text() |
| 40 | +PARENT = HERE.parent |
| 41 | +VERSION = get_version(PARENT / "keras_hub" / "src" / "version_utils.py") |
| 42 | + |
| 43 | +setup( |
| 44 | + name="keras-nlp", |
| 45 | + description=( |
| 46 | + "Industry-strength Natural Language Processing extensions for Keras." |
| 47 | + ), |
| 48 | + long_description=README, |
| 49 | + long_description_content_type="text/markdown", |
| 50 | + version=VERSION, |
| 51 | + url="https://github.com/keras-team/keras-nlp", |
| 52 | + author="Keras team", |
| 53 | + |
| 54 | + license="Apache License 2.0", |
| 55 | + install_requires=[ |
| 56 | + f"keras-hub=={VERSION}", |
| 57 | + ], |
| 58 | + # Supported Python versions |
| 59 | + python_requires=">=3.9", |
| 60 | + classifiers=[ |
| 61 | + "Development Status :: 3 - Alpha", |
| 62 | + "Programming Language :: Python :: 3", |
| 63 | + "Programming Language :: Python :: 3.9", |
| 64 | + "Programming Language :: Python :: 3.10", |
| 65 | + "Programming Language :: Python :: 3.11", |
| 66 | + "Programming Language :: Python :: 3 :: Only", |
| 67 | + "Operating System :: Unix", |
| 68 | + "Operating System :: Microsoft :: Windows", |
| 69 | + "Operating System :: MacOS", |
| 70 | + "Intended Audience :: Science/Research", |
| 71 | + "Topic :: Scientific/Engineering", |
| 72 | + "Topic :: Software Development", |
| 73 | + ], |
| 74 | + packages=find_packages(exclude=("*_test.py",)), |
| 75 | +) |
0 commit comments