Skip to content

Commit

Permalink
Initial python recommendation implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
fridex committed Aug 8, 2018
1 parent 8f02720 commit 760a7cb
Show file tree
Hide file tree
Showing 26 changed files with 2,869 additions and 81 deletions.
2 changes: 1 addition & 1 deletion .coafile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ files = **.py
language = Python
max_line_length = 120
editor = vim
ignore = setup.py
ignore = setup.py, tests/**
file_naming_convention = snake

[all.yaml]
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
__pycache__
*.pyc
.cache
thoth_adviser.egg-info/
*.eggs/
6 changes: 6 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ thoth-storages = "*"
click = "<6.7"
thoth-analyzer = "*"
thoth-common = "*"
thoth-solver = "*"
pip = "<10"
toml = "*"
attrs = "*"
requests = "*"
beautifulsoup4 = "*"

[dev-packages]
coala-bears = "*"
224 changes: 168 additions & 56 deletions Pipfile.lock

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions openshift/pod-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ objects:
containers:
- name: adviser
image: adviser
command: ['thoth-adviser', 'pypi']
livenessProbe:
# Give analyzer 10 minutes to compute results, kill it if it was not able result anything.
tcpSocket:
Expand Down
12 changes: 6 additions & 6 deletions thoth/adviser/pypi.py → tests/base.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# thoth-adviser
# Copyright(C) 2018 Fridolin Pokorny
#
Expand All @@ -16,11 +15,12 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

"""Compute advises on PyPI ecosystem."""
"""Core logic for adviser test suite."""

import typing
import os


def advise_pypi(requirements: typing.List[str], packages_only: bool) -> dict:
"""Compute advises on PyPI ecosystem."""
return {}
class AdviserTestCase:
"""A base class for adviser test cases."""

data_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'data')
25 changes: 25 additions & 0 deletions tests/data/Pipfile_test1
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[[source]]
url = "https://pypi.python.org/simple"
verify_ssl = true
name = "pypi"

[[source]]
url = "https://index-aicoe.a3c1.starter-us-west-1.openshiftapps.com/fedora28/1.9/jemalloc"
verify_ssl = true
name = "redhat-aicoe-experiments"

[packages]
attrs = "*"
beautifulsoup4 = "*"
click = "<6.7"
pip = "<10"
requests = "*"
tensorflow = {version="==1.9.0rc0", index="redhat-aicoe-experiments"}
thoth-analyzer = "*"
thoth-common = "*"
thoth-solver = "*"
thoth-storages = "*"
toml = "*"

[dev-packages]
coala-bears = "*"

0 comments on commit 760a7cb

Please sign in to comment.