Skip to content

CI: allow print_versions to work without pandas install #4901

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

Merged
merged 1 commit into from
Sep 20, 2013
Merged
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
21 changes: 19 additions & 2 deletions ci/print_versions.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
#!/usr/bin/env python

from pandas.util.print_versions import show_versions

show_versions()
try:
from pandas.util.print_versions import show_versions
except Exception as e:

print("Failed to import pandas: %s" % e)

def show_versions():
import subprocess
import os
fn = __file__
this_dir = os.path.dirname(fn)
pandas_dir = os.path.dirname(this_dir)
sv_path = os.path.join(pandas_dir, 'pandas', 'util',
'print_versions.py')
return subprocess.check_call(['python', sv_path])


if __name__ == '__main__':
show_versions()
19 changes: 14 additions & 5 deletions pandas/util/print_versions.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,29 @@
import os
import sys


def show_versions():
print("\nINSTALLED VERSIONS")
print("------------------")
print("Python: %d.%d.%d.%s.%s" % sys.version_info[:])

try:
(sysname, nodename, release, version, machine) = os.uname()
print("OS: %s %s %s %s" % (sysname, release, version,machine))
sysname, nodename, release, version, machine = os.uname()
print("OS: %s %s %s %s" % (sysname, release, version, machine))
print("byteorder: %s" % sys.byteorder)
print("LC_ALL: %s" % os.environ.get('LC_ALL',"None"))
print("LANG: %s" % os.environ.get('LANG',"None"))
print("LC_ALL: %s" % os.environ.get('LC_ALL', "None"))
print("LANG: %s" % os.environ.get('LANG', "None"))
except:
pass

print("")

try:
import pandas
print("pandas: %s" % pandas.__version__)
except:
print("pandas: Not installed")

try:
import Cython
print("Cython: %s" % Cython.__version__)
Expand Down Expand Up @@ -129,7 +138,7 @@ def show_versions():
except:
print("html5lib: Not installed")

print("\n")


if __name__ == "__main__":
show_versions()