Skip to content

Commit 39d6c4d

Browse files
committed
Cleaned up installation: pinned deps versions and added cli extra-requires
1 parent 419222c commit 39d6c4d

File tree

7 files changed

+39
-30
lines changed

7 files changed

+39
-30
lines changed

requirements-dev.txt

Lines changed: 0 additions & 10 deletions
This file was deleted.

requirements.txt

Lines changed: 0 additions & 4 deletions
This file was deleted.

requirements/cli.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
blessed==1.15.0

requirements/dev.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
-r main.txt
2+
-r cli.txt
3+
pprint==0.1
4+
sphinx==2.2.0
5+
sphinx-rtd-theme==0.4.3
6+
m2r==0.2.1
7+
pytest==5.1.1
8+
pylint==2.3.1

requirements/main.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
lxml==4.4.1
2+
aiohttp==3.6.1
3+
beautifulsoup4==4.8.0

search_engine_parser/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@
2626
from search_engine_parser.core import *
2727

2828
name = "search-engine-parser" #pylint: disable=invalid-name
29-
__version__ = "0.5.1"
29+
__version__ = "0.5.2"

setup.py

Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,33 @@
1-
import os
2-
import sys
1+
import re
32
import setuptools
4-
from setuptools.command.install import install
5-
from search_engine_parser import __version__ as VERSION
63

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+
99
requires = [line.strip('\n') for line in open(REQUIREMENTS).readlines()]
10+
requires_cli = [line.strip('\n') for line in open(CLI_REQUIREMENTS).readlines()]
1011

1112
with open("README.md", "r") as fh:
1213
long_description = fh.read()
1314

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+
1420
setuptools.setup(
1521
name="search-engine-parser",
1622
version=VERSION,
1723
author='Domnan Diretnan, Mmadu Manasseh',
1824
author_email="[email protected]",
1925
description="scrapes search engine pages for query titles, descriptions and links",
2026
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+
},
2131
packages=setuptools.find_packages(),
2232
install_requires=requires,
2333
long_description=long_description,
@@ -33,20 +43,21 @@
3343
yandex \
3444
stackoverflow \
3545
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=[
4451
"Programming Language :: Python :: 3",
4552
"License :: OSI Approved :: MIT License",
4653
"Operating System :: OS Independent",
47-
),
54+
],
4855
package_data={
4956
'': ['*.*'],
5057
},
5158
include_package_data=True,
59+
extras_require={
60+
'cli': requires_cli
61+
},
62+
python_requires='>={}.{}'.format(*REQUIRED_PYTHON),
5263
)

0 commit comments

Comments
 (0)