from os import path from pathlib import Path from typing import List, Tuple from setuptools import find_packages, setup PACKAGE_NAME = path.basename(Path.cwd()) # To avoid errors, skip commented and service lines. COMMENT_LINE_CHARS: Tuple[str, ...] = ('#', '--') install_requires: List[str] = [] with open('./requirements/base.pip', 'r') as f: for x in f.readlines(): line = x.strip() if line and not line.startswith(COMMENT_LINE_CHARS): install_requires.append(line) tests_require: List[str] = [] with open('./requirements/test.pip', 'r') as f: for x in f.readlines(): line = x.strip() if line and not line.startswith(COMMENT_LINE_CHARS): tests_require.append(line) with open('./VERSION', 'r') as f: version = f.read() config = { 'version': version, 'name': PACKAGE_NAME, 'description': 'Download Spotify entities from the public API', 'tests_require': tests_require, 'install_requires': install_requires, 'packages': find_packages(), 'include_package_data': True, 'zip_safe': False, 'entry_points': { 'console_scripts': [ 'scrape=dapd_public_api_scraper.run:run', ] } } setup(**config)