Skip to content

Commit 3aab774

Browse files
committed
Cleaned up Docs and files to reflect cli installation usage
1 parent 39d6c4d commit 3aab774

File tree

10 files changed

+74
-29
lines changed

10 files changed

+74
-29
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

+2
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ If applicable, add screenshots to help explain your problem.
2626
**Desktop (please complete the following information):**
2727
- OS: [e.g. Windows]
2828
- Python Version [e.g. 3.6.5]
29+
- Search-engine-parser version [e.g. 0.5.1]
30+
2931

3032
**Additional context**
3133
Add any other context about the problem here.

.travis.yml

+12-9
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ python:
88

99
# Command to install dependencies.
1010
install:
11-
- pip install -r requirements-dev.txt
11+
- pip install -r requirements/dev.txt
1212

1313
# Build script (If successfully built - no errors)
1414
script:
@@ -19,14 +19,17 @@ script:
1919
after_success:
2020
- python setup.py --version
2121

22-
deploy:
23-
provider: pypi
24-
user: "deven96"
25-
password: $PYPI_PASSWORD
26-
on:
27-
branch: master
28-
condition: $TRAVIS_TAG =~ ^v[0-9]+\.[0-9]+\.[0-9]+
29-
skip_existing: true
22+
jobs:
23+
include:
24+
- stage: deploy
25+
python: 3.7
26+
deploy:
27+
provider: pypi
28+
user: "deven96"
29+
password: $PYPI_PASSWORD
30+
on:
31+
tags: true
32+
skip_existing: true
3033

3134
after_deploy:
3235
- ./scripts/post_deploy_test.sh

MANIFEST.in

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
include *.txt
2+
include requirements/*.txt
23
include README.md
34
recursive-include search_engine_parser *.py
45
prune docs/
5-
prune scripts/
6+
prune scripts/

README.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ View all [supported engines](https://github.com/bisoncorps/search-engine-parser/
2626
- [Command line](#command-line)
2727
- [Code of Conduct](#code-of-conduct)
2828
- [Contribution](#contribution)
29-
- [License (MIT)](#license-mit)
30-
29+
- [License (MIT)](#license-mit)
3130
## Popular Supported Engines
3231

3332
Some of the popular search engines include:
@@ -45,6 +44,8 @@ View all [supported engines](https://github.com/bisoncorps/search-engine-parser/
4544

4645
```bash
4746
pip install search-engine-parser
47+
# Installs `pysearch` cli tool
48+
pip install "search-engine-parser[cli]"
4849
```
4950

5051
## Development
@@ -59,7 +60,7 @@ Create virtual environment and install requirements
5960

6061
```bash
6162
mkvirtualenv search_engine_parser
62-
pip install -r requirements-dev.txt
63+
pip install -r requirements/dev.txt
6364
```
6465

6566

docs/source/search_engine_parser.core.engines.rst

+16
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@ search\_engine\_parser.core.engines.aol module
1212
:undoc-members:
1313
:show-inheritance:
1414

15+
search\_engine\_parser.core.engines.ask module
16+
----------------------------------------------
17+
18+
.. automodule:: search_engine_parser.core.engines.ask
19+
:members:
20+
:undoc-members:
21+
:show-inheritance:
22+
1523
search\_engine\_parser.core.engines.baidu module
1624
------------------------------------------------
1725

@@ -52,6 +60,14 @@ search\_engine\_parser.core.engines.google module
5260
:undoc-members:
5361
:show-inheritance:
5462

63+
search\_engine\_parser.core.engines.myanimelist module
64+
------------------------------------------------------
65+
66+
.. automodule:: search_engine_parser.core.engines.myanimelist
67+
:members:
68+
:undoc-members:
69+
:show-inheritance:
70+
5571
search\_engine\_parser.core.engines.stackoverflow module
5672
--------------------------------------------------------
5773

docs/source/search_engine_parser.tests.rst

+8
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ search\_engine\_parser.tests package
44
Submodules
55
----------
66

7+
search\_engine\_parser.tests.base module
8+
----------------------------------------
9+
10+
.. automodule:: search_engine_parser.tests.base
11+
:members:
12+
:undoc-members:
13+
:show-inheritance:
14+
715
search\_engine\_parser.tests.test\_search module
816
------------------------------------------------
917

scripts/post_deploy_test.sh

+9-1
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,21 @@ echo "${VERSION}"
66

77
# install python package
88
pip install search-engine-parser=="${VERSION}"
9+
python -c "import search_engine_parser"
10+
11+
pip uninstall search-engine-parser
12+
13+
pip install search-engine-parser[pysearch]=="${VERSION}"
914

1015
# run the cli version to get a result
1116
python -m search_engine_parser.core.cli --engine bing search --query "Preaching to the choir" --type descriptions
1217

18+
# run cli with pysearch
19+
pysearch -e youtube search -q "NoCopyrightSounds"
20+
1321
if [ $? -eq 0 ]; then
1422
echo "Package works as expected"
1523
else
1624
echo "CLI handler of the package failed to execute"
1725
exit 1
18-
fi
26+
fi

search_engine_parser/__init__.py

+1-1
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.2"
29+
__version__ = "0.5.3.post2"

search_engine_parser/tests/test_search.py

+8-3
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ class BingEngineTest(EngineTestBase, EngineTests):
3838
class AolSearchTest(EngineTestBase, EngineTests):
3939
engine_class = AolSearch
4040

41+
def test_returned_results(self):
42+
self.assertTrue(len(self.results['titles']) >= 9)
43+
self.assertTrue(len(self.results['links']) >= 9)
44+
self.assertTrue(len(self.results['descriptions']) >= 9)
45+
4146

4247
class DuckDuckGoSearchTest(EngineTestBase, EngineTests):
4348
engine_class = DuckDuckGoSearch
@@ -65,9 +70,9 @@ class BaiduSearchTest(EngineTestBase, EngineTests):
6570
engine_class = BaiduSearch
6671

6772
def test_returned_results(self):
68-
self.assertTrue(len(self.results['titles']) >= 9)
69-
self.assertTrue(len(self.results['links']) >= 9)
70-
self.assertTrue(len(self.results['descriptions']) >= 9)
73+
self.assertTrue(len(self.results['titles']) >= 8)
74+
self.assertTrue(len(self.results['links']) >= 8)
75+
self.assertTrue(len(self.results['descriptions']) >= 8)
7176

7277

7378
class GithubSearchTest(EngineTestBase, EngineTests):

setup.py

+12-11
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
import re
22
import setuptools
33

4-
REQUIREMENTS = 'requirements/main.txt'
5-
CLI_REQUIREMENTS = 'requirements/cli.txt'
6-
74
REQUIRED_PYTHON = (3, 5)
85

9-
requires = [line.strip('\n') for line in open(REQUIREMENTS).readlines()]
10-
requires_cli = [line.strip('\n') for line in open(CLI_REQUIREMENTS).readlines()]
6+
# Load requirements
7+
REQUIREMENTS = 'requirements/main.txt'
8+
CLI_REQUIREMENTS = 'requirements/cli.txt'
9+
REQUIREMENTS = [line.strip('\n') for line in open(REQUIREMENTS).readlines()]
10+
CLI_REQUIREMENTS = [line.strip('\n') for line in open(CLI_REQUIREMENTS).readlines()]
1111

1212
with open("README.md", "r") as fh:
13-
long_description = fh.read()
13+
LONG_DESCRIPTION = fh.read()
1414

1515
# Trying to load version directly from `search-engine-parser` module attempts
1616
# to load __init__.py which will try to load other libraries not yet installed
@@ -25,12 +25,12 @@
2525
description="scrapes search engine pages for query titles, descriptions and links",
2626
url="https://github.com/bisoncorps/search-engine-parser",
2727
project_urls={
28-
"documentation":"https://search-engine-parser.readthedocs.io/en/latest",
29-
"source": "https://github.com/bisoncorps/search-engine-parser",
28+
"Documentation":"https://search-engine-parser.readthedocs.io/en/latest",
29+
"Source": "https://github.com/bisoncorps/search-engine-parser",
3030
},
3131
packages=setuptools.find_packages(),
32-
install_requires=requires,
33-
long_description=long_description,
32+
install_requires=REQUIREMENTS,
33+
long_description=LONG_DESCRIPTION,
3434
long_description_content_type="text/markdown",
3535
license="MIT",
3636
keywords='\
@@ -54,10 +54,11 @@
5454
],
5555
package_data={
5656
'': ['*.*'],
57+
'requirements': ['*.*'],
5758
},
5859
include_package_data=True,
5960
extras_require={
60-
'cli': requires_cli
61+
'cli': CLI_REQUIREMENTS
6162
},
6263
python_requires='>={}.{}'.format(*REQUIRED_PYTHON),
6364
)

0 commit comments

Comments
 (0)