From 21163e3a950737df99799fa1d6c2d5de3b2cfc7a Mon Sep 17 00:00:00 2001 From: Naymul Islam <68547750+ai-naymul@users.noreply.github.com> Date: Mon, 18 Sep 2023 18:31:45 +0600 Subject: [PATCH] refactor the hardcoded constant and close opened file (#57) there are some constant that are hardcoded into the code before in this commit those are at the top of the file for better code readability and there is a opened file that didn't close before in this commit that is closed --- setup.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/setup.py b/setup.py index 686e939..be63a0a 100644 --- a/setup.py +++ b/setup.py @@ -1,10 +1,15 @@ from setuptools import setup, find_packages from os import path - +AUTHOR = 'Jina AI' +AUTHOR_EMAIL = 'hello@jina.ai' +LICENSE = 'Apache 2.0' +GITHUB_URL = 'https://github.com/jina-ai/vectordb/' +DOWNLOAD_URL = 'https://github.com/jina-ai/vectordb/tags' try: pkg_name = 'vectordb' libinfo_py = path.join(pkg_name, '__init__.py') - libinfo_content = open(libinfo_py, 'r', encoding='utf-8').readlines() + with open(libinfo_py, 'r', encoding='utf-8') as f: + libinfo_content = f.readlines() version_line = [l.strip() for l in libinfo_content if l.startswith('__version__')][ 0 ] @@ -29,11 +34,11 @@ description='The Python VectorDB. Build your vector database from working as a library to scaling as a database in the cloud', long_description=_long_description, long_description_content_type='text/markdown', - author='Jina AI', - author_email='hello@jina.ai', - license='Apache 2.0', - url='https://github.com/jina-ai/vectordb/', - download_url='https://github.com/jina-ai/vectordb/tags', + author= AUTHOR, + author_email=AUTHOR_EMAIL, + license=LICENSE, + url=GITHUB_URL, + download_url=DOWNLOAD_URL, packages=find_packages(), classifiers=[ 'Development Status :: 5 - Production/Stable',