Skip to content

Commit b586ad6

Browse files
author
y-p
committed
BLD/DOC: explain how to print_versions() sans repo in CONTRIBUTING.md
1 parent 58ee1fb commit b586ad6

File tree

2 files changed

+25
-20
lines changed

2 files changed

+25
-20
lines changed

CONTRIBUTING.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,13 @@ looking for a quick way to help out.
1818

1919
```
2020

21-
- Specify the pandas version used and those of it's dependencies. You can simply include the output of
22-
[`ci/print_versions.py`](https://github.com/pydata/pandas/blob/master/ci/print_versions.py).
21+
- Include the full version string of pandas and it's dependencies:
22+
23+
```python
24+
>>> from pandas.util.print_versions import show_versions
25+
>>> show_versions()
26+
```
27+
2328
- Explain what the expected behavior was, and what you saw instead.
2429

2530
#### Pull Requests

pandas/util/print_versions.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,26 @@
88
def get_sys_info():
99
"Returns system information as a dict"
1010

11+
blob = []
12+
1113
# get full commit hash
1214
commit = None
13-
try:
14-
pipe = subprocess.Popen('git log --format="%H" -n 1'.split(" "),
15-
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
16-
so, serr = pipe.communicate()
17-
except:
18-
pass
19-
else:
20-
if pipe.returncode == 0:
21-
commit = so
22-
try:
23-
commit = so.decode('utf-8')
24-
except ValueError:
25-
pass
26-
commit = commit.strip().strip('"')
27-
28-
# list of tuples over dict because OrderedDict not in 2.6, least
29-
# resistance.
30-
blob = []
15+
if os.path.isdir(".git") and os.path.isdir("pandas"):
16+
try:
17+
pipe = subprocess.Popen('git log --format="%H" -n 1'.split(" "),
18+
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
19+
so, serr = pipe.communicate()
20+
except:
21+
pass
22+
else:
23+
if pipe.returncode == 0:
24+
commit = so
25+
try:
26+
commit = so.decode('utf-8')
27+
except ValueError:
28+
pass
29+
commit = commit.strip().strip('"')
30+
3131
blob.append(('commit', commit))
3232

3333
try:

0 commit comments

Comments
 (0)