towhee
/
setup.py
79 строк · 3.1 Кб
1# Copyright 2021 Zilliz. All rights reserved.
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# http://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
15import sys16import unittest17from pathlib import Path18from typing import List19
20from setuptools import find_packages, setup21from setuptools.command.install import install22
23
24def test_suite():25test_loader = unittest.TestLoader()26test_suite = test_loader.discover('towhee/tests', pattern='test_*.py')27return test_suite28
29
30def parse_requirements(file_name: str) -> List[str]:31with open(file_name) as f:32return [33require.strip() for require in f34if require.strip() and not require.startswith('#')35]36
37if '--models' in sys.argv:38sys.argv.remove('--models')39setup(name='towhee.models',40version='1.1.3',41description='',42author='Towhee Team',43author_email='towhee-team@zilliz.com',44use_scm_version={'local_scheme': 'no-local-version'},45setup_requires=['setuptools_scm'],46url='https://github.com/towhee-io/towhee',47test_suite='setup.test_suite',48install_requires=parse_requirements('requirements.txt'),49extras_require={':python_version<\'3.7\'': 'importlib-resources'},50tests_require=parse_requirements('test_requirements.txt'),51packages=find_packages(include=['towhee.models*']),#['towhee.models'],52package_data={'towhee.tests.test_util': ['*.yaml']},53namespace_package = ['towhee'],54include_package_data=True,55license='http://www.apache.org/licenses/LICENSE-2.0',56entry_points={57'console_scripts': ['towhee=towhee.command.cmdline:main'],58},59long_description_content_type='text/markdown'60)61else:62setup(use_scm_version={'local_scheme': 'no-local-version'},63setup_requires=['setuptools_scm'],64test_suite='setup.test_suite',65install_requires=parse_requirements('requirements.txt'),66extras_require={':python_version<\'3.7\'': 'importlib-resources'},67tests_require=parse_requirements('test_requirements.txt'),68packages=find_packages(exclude=['*test*', 'towhee.models*']),69namespace_package=['towhee'],70package_data={'towhee.tests.test_util': ['*.yaml'], 'towhee.serve.triton.dockerfiles': ['*']},71license='http://www.apache.org/licenses/LICENSE-2.0',72entry_points={73'console_scripts': [74'towhee=towhee.command.cmdline:main',75'triton_builder=towhee.serve.triton.pipeline_builder:main',76],77},78long_description_content_type='text/markdown'79)80