Skip to content

Commit

Permalink
Merge a8f5224 into 38e4999
Browse files Browse the repository at this point in the history
  • Loading branch information
discdiver committed Aug 10, 2019
2 parents 38e4999 + a8f5224 commit a03b17b
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 23 deletions.
8 changes: 7 additions & 1 deletion docs/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,10 @@ History
0.1.1 (2019-05-25)
------------------

* Remove subscribe extra print statements
* Remove subscribe extra print statements

0.1.2 (2019-07-09)
------------------

* Fix typo in two search functions
* Update dependencies
6 changes: 3 additions & 3 deletions docs/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ Pybraries

Pybraries is a Python wrapper for the libraries.io API.

You can use it to subscribe to and unsubscribe from updates
to open source packages.
You can use it to subscribe to email alerts for
new versions of open source packages.

You can also use it to find information about
many aspects of open source packages and repositories.
Expand Down Expand Up @@ -69,7 +69,7 @@ Import the pybraries package and use it to subscribe to a package.
s.subscribe("pypi", "pandas")
Now you're subscribed to updates to the *pandas* package.
Now you'll get an email update every time a new version of *pandas* is released.

Here's another example.
Search for projects with *visualization* as a keyword and *python* as a language.
Expand Down
15 changes: 11 additions & 4 deletions pybraries/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def project(self, manager: str, package: str) -> Any:

def project_dependencies(self, manager: str, package: str) -> Any:
"""
Get a list of dependencies for a version of a project.
Get dependencies for a version of a project.
Returns latest version info.
Expand All @@ -62,7 +62,7 @@ def project_dependents(self, manager: str, package: str) -> Any:
List of dicts package dependents from libraries.io.
"""

return search_api("pproject_dependendents", manager, package)
return search_api("pproject_dependents", manager, package)

def project_dependent_repositories(self, manager: str, package: str) -> Any:
"""
Expand All @@ -75,7 +75,7 @@ def project_dependent_repositories(self, manager: str, package: str) -> Any:
List of dicts of dependent repositories from libraries.io.
"""

return search_api("pproject_dependendent_repositories", manager, package)
return search_api("pproject_dependent_repositories", manager, package)

def project_contributors(self, manager: str, package: str) -> Any:
"""
Expand Down Expand Up @@ -259,7 +259,14 @@ def user_dependencies(self, host, user):
# manually testing actions
api = Search()

t = api.user("github", "discdiver")
# t = api.user("github", "discdiver")

x = api.project_dependents("pypi", "plotly")
print(x[0]["name"])

y = api.project_dependent_repositories("pypi", "yellowbrick")
print(y[0])
print(type(y))

# x = set_pages(1, 3)
# print(x)
Expand Down
4 changes: 2 additions & 2 deletions pybraries/search_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ def search_api(action, *args, **kwargs):
url_end_list.append("dependencies")

if action == "pproject_dependents":
url_end_list.append("dependendents")
url_end_list.append("dependents")

if action == "pproject_dependent_repositories":
url_end_list.append("dependendent_repositories")
url_end_list.append("dependent_repositories")

if action == "pproject_contributors":
url_end_list.append("contributors")
Expand Down
16 changes: 8 additions & 8 deletions requirements_dev.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
pip==19.1.1
pip==19.2.1
wheel==0.33.4
twine==1.13.0
pytest==4.4.2
pytest==5.0.1
pytest-cov==2.7.1
pytest-flake8==1.0.4
pytest-runner==4.4
pytest-runner==5.1
pytest-mock==1.10.4
coveralls==1.7.0
sphinx==2.0.1
coveralls==1.8.2
sphinx==2.1.2
sphinx_rtd_theme==0.4.3
bump2version==0.5.10
black==19.3b0
flake8==3.7.7
fire==0.1.3
pytype==2019.5.24
flake8==3.7.8
fire==0.2.1
pytype==2019.8.9
10 changes: 5 additions & 5 deletions tests/test_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ def test_project_dependencies():


def test_project_dependents():
"""returns a dict with correct package name """
"""returns a list of dicts with correct package name """
packer = search.project_dependents(mgr, pkg)
assert packer["name"] == "plotly"
assert packer[0]["name"] is not None


def test_project_dependent_repositories():
"""returns a dict with correct package name"""
pack = search.project_dependent_repositories(mgr, pkg)
assert pack["name"] == "plotly"
"""returns a list of dicts with a description"""
pack = search.project_dependent_repositories(mgr, pkg2)
assert pack[0]["description"] is not None


def test_project_contributors():
Expand Down

0 comments on commit a03b17b

Please sign in to comment.