|
1 | | -import os |
2 | | -import sys |
| 1 | +import re |
3 | 2 | import setuptools |
4 | | -from setuptools.command.install import install |
5 | | -from search_engine_parser import __version__ as VERSION |
6 | 3 |
|
7 | | -CURRENT_DIR = os.getcwd() |
8 | | -REQUIREMENTS = 'requirements.txt' |
| 4 | +REQUIREMENTS = 'requirements/main.txt' |
| 5 | +CLI_REQUIREMENTS = 'requirements/cli.txt' |
| 6 | + |
| 7 | +REQUIRED_PYTHON = (3, 5) |
| 8 | + |
9 | 9 | requires = [line.strip('\n') for line in open(REQUIREMENTS).readlines()] |
| 10 | +requires_cli = [line.strip('\n') for line in open(CLI_REQUIREMENTS).readlines()] |
10 | 11 |
|
11 | 12 | with open("README.md", "r") as fh: |
12 | 13 | long_description = fh.read() |
13 | 14 |
|
| 15 | +# Trying to load version directly from `search-engine-parser` module attempts |
| 16 | +# to load __init__.py which will try to load other libraries not yet installed |
| 17 | +with open("search_engine_parser/__init__.py", "rt", encoding="utf8") as f: |
| 18 | + VERSION = re.search(r'__version__ = "(.*?)"', f.read(), re.M).group(1) |
| 19 | + |
14 | 20 | setuptools.setup( |
15 | 21 | name="search-engine-parser", |
16 | 22 | version=VERSION, |
17 | 23 | author='Domnan Diretnan, Mmadu Manasseh', |
18 | 24 | |
19 | 25 | description="scrapes search engine pages for query titles, descriptions and links", |
20 | 26 | url="https://github.com/bisoncorps/search-engine-parser", |
| 27 | + project_urls={ |
| 28 | + "documentation":"https://search-engine-parser.readthedocs.io/en/latest", |
| 29 | + "source": "https://github.com/bisoncorps/search-engine-parser", |
| 30 | + }, |
21 | 31 | packages=setuptools.find_packages(), |
22 | 32 | install_requires=requires, |
23 | 33 | long_description=long_description, |
|
33 | 43 | yandex \ |
34 | 44 | stackoverflow \ |
35 | 45 | github \ |
36 | | - baidu ' , |
37 | | - entry_points={ |
38 | | - 'console_scripts': |
39 | | - [ |
40 | | - 'pysearch=search_engine_parser.core.cli:runner' |
41 | | - ] |
42 | | - }, |
43 | | - classifiers=( |
| 46 | + baidu ', |
| 47 | + entry_points={'console_scripts': [ |
| 48 | + 'pysearch=search_engine_parser.core.cli:runner' |
| 49 | + ]}, |
| 50 | + classifiers=[ |
44 | 51 | "Programming Language :: Python :: 3", |
45 | 52 | "License :: OSI Approved :: MIT License", |
46 | 53 | "Operating System :: OS Independent", |
47 | | - ), |
| 54 | + ], |
48 | 55 | package_data={ |
49 | 56 | '': ['*.*'], |
50 | 57 | }, |
51 | 58 | include_package_data=True, |
| 59 | + extras_require={ |
| 60 | + 'cli': requires_cli |
| 61 | + }, |
| 62 | + python_requires='>={}.{}'.format(*REQUIRED_PYTHON), |
52 | 63 | ) |
0 commit comments