Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix move package version to main script #444

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions surprise/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from pkg_resources import get_distribution

from . import dump, model_selection
from .builtin_datasets import get_dataset_dir

Expand Down Expand Up @@ -46,5 +44,3 @@
"get_dataset_dir",
"model_selection",
]

__version__ = get_distribution("scikit-surprise").version
9 changes: 7 additions & 2 deletions surprise/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
import shutil
import sys

from pkg_resources import get_distribution
import numpy as np

import surprise.dataset as dataset
from surprise import __version__
from surprise.builtin_datasets import get_dataset_dir
from surprise.dataset import Dataset
from surprise.model_selection import cross_validate, KFold, PredefinedKFold
Expand Down Expand Up @@ -175,7 +175,12 @@ def error(self, message):
help="Remove the " + get_dataset_dir() + " directory and exit.",
)

parser.add_argument("-v", "--version", action="version", version=__version__)
parser.add_argument(
"-v",
"--version",
action="version",
version=get_distribution("scikit-surprise").version,
)

args = parser.parse_args()

Expand Down