Skip to content
Closed
Show file tree
Hide file tree
Changes from 4 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
1 change: 1 addition & 0 deletions pandas/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
from ._version import get_versions
v = get_versions()
__version__ = v.get('closest-tag', v['version'])
__git_version__ = v.get('full-revisionid')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this what dask does? this will be None in the built version I think

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a way I can create a built version locally and test it out? @jreback

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

python setup.py bdist_wheel, and then install that wheel in a new env.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created wheel from above command (https://www.dropbox.com/s/3ieyl07ctcsja9u/pandas-0.24.0.dev0%2B373.g942172546-cp36-cp36m-macosx_10_7_x86_64.whl?dl=0) and it showed git_version correctly

>>> import pandas as pd
>>> pd.__version__
'0.24.0.dev0+373.g942172546'
>>> pd.__git_version__
'9421725461061b55bc84e388d3952957d9b0cd83'

del get_versions, v

# module level doc-string
Expand Down
8 changes: 8 additions & 0 deletions pandas/tests/test_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import pytest
import os
import collections
import string
from functools import partial

import numpy as np
Expand All @@ -13,6 +14,7 @@
from pandas.core import ops
from pandas.io.common import _get_handle
import pandas.util.testing as tm
import pandas as pd


def test_mut_exclusive():
Expand Down Expand Up @@ -262,3 +264,9 @@ def test_compression_warning(compression_only):
check_stacklevel=False):
with f:
df.to_csv(f, compression=compression_only)


def test_git_version():
git_version = pd.__git_version__
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can u add the issue number here

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will fail when built (which we test on pandas-ci), as the git_version will be None.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this actually run when pandas is installed after tagging?
iow need to tag (locally) then build a release and install and pd.test()

Copy link
Member

@alimcmaster1 alimcmaster1 Sep 18, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like it will, I ran:
python setup.py bdist_wheel
and installed that wheel in a fresh virtual env.
pd.__git_version__ then return the git sha of commit

assert len(git_version) == 40
assert all(c in string.hexdigits for c in git_version)