Skip to content

Commit c4a0147

Browse files
committedJul 6, 2015
CI: use versioneer, for PEP440 version strings pandas-dev#9518
use binstar build OSX stack testing, pandas-dev#7127
1 parent bfe5a7f commit c4a0147

13 files changed

+2215
-111
lines changed
 

‎.binstar.yml

+11-21
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
11
package: pandas
22
user: jreback
33

4-
platform:
5-
#- osx-64
6-
#- linux-32
7-
- linux-64
8-
- win-64
9-
#- win-32
10-
11-
engine:
12-
#- python=2.6
13-
- python=2.7
14-
#- python=3.3
15-
#- python=3.4
4+
install:
5+
- conda config --add channels pandas
166

177
before_script:
188
- python -V
199

10+
platform:
11+
- linux-64
12+
#- linux-32
13+
- osx-64
14+
#- win-32
15+
- win-64
16+
engine:
17+
- python=2.7
18+
#- python=3.4
2019
script:
2120
- conda build conda.recipe --quiet
2221

@@ -27,12 +26,3 @@ build_targets: conda
2726
notifications:
2827
email:
2928
recipients: ['jeff@reback.net']
30-
31-
---
32-
platform: win-32
33-
engine: python=2.6
34-
exclude: true
35-
---
36-
platform: win-64
37-
engine: python=2.6
38-
exclude: true

‎.gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@
1313
*.dta binary
1414
*.xls binary
1515
*.xlsx binary
16+
pandas/_version.py export-subst

‎.gitignore

-4
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,6 @@ scikits
7878
*.c
7979
*.cpp
8080

81-
# Things specific to this project #
82-
###################################
83-
pandas/version.py
84-
8581
# Documentation generated files #
8682
#################################
8783
doc/source/generated

‎MANIFEST.in

+2
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,5 @@ global-exclude *.png
2424
# recursive-include doc/source *
2525
# recursive-include doc/sphinxext *
2626
# recursive-include LICENSES *
27+
include versioneer.py
28+
include pandas/_version.py

‎conda.recipe/bld.bat

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
@echo off
2-
%PYTHON% setup.py install --quiet
2+
3+
conda remove jinja2 --quiet
4+
conda install jinja2 --quiet
5+
%PYTHON% setup.py install

‎conda.recipe/build.sh

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
#!/bin/bash
2-
$PYTHON setup.py install --quiet
1+
#!/bin/sh
2+
3+
$PYTHON setup.py install

‎conda.recipe/meta.yaml

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package:
2-
name: pandas
3-
version: {{ environ.get('GIT_DESCRIBE_TAG', '') }}
2+
name: pandas
3+
version: {{ environ.get('GIT_DESCRIBE_TAG', '').replace('.dev', 'dev') }}
44

55
build:
66
number: {{ environ.get('GIT_DESCRIBE_NUMBER', 0) }}
@@ -28,10 +28,9 @@ requirements:
2828
test:
2929
requires:
3030
- nose
31-
- coverage
3231

3332
commands:
34-
- python -c "import pandas"
33+
- nosetests --exe -A "not slow and not network and not disabled" pandas
3534

3635
about:
3736
home: http://pandas.pydata.org

‎doc/source/whatsnew/v0.17.0.txt

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ users upgrade to this version.
1414
Highlights include:
1515

1616
- Release the Global Interpreter Lock (GIL) on some cython operations, see :ref:`here <whatsnew_0170.gil>`
17+
- Development installed versions of pandas will now have ``PEP440`` compliant version strings (:issue:`9518`)
1718

1819
Check the :ref:`API Changes <whatsnew_0170.api>` and :ref:`deprecations <whatsnew_0170.deprecations>` before updating.
1920

‎pandas/__init__.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
_np_version_under1p9 = LooseVersion(_np_version) < '1.9'
3030

3131

32-
from pandas.version import version as __version__
3332
from pandas.info import __doc__
3433

3534

@@ -57,3 +56,8 @@
5756
from pandas.util.print_versions import show_versions
5857
import pandas.util.testing
5958

59+
# use the closest tagged version if possible
60+
from ._version import get_versions
61+
v = get_versions()
62+
__version__ = v.get('closest-tag',v['version'])
63+
del get_versions, v

‎pandas/_version.py

+460
Large diffs are not rendered by default.

‎setup.cfg

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
2+
# See the docstring in versioneer.py for instructions. Note that you must
3+
# re-run 'versioneer.py setup' after changing this section, and commit the
4+
# resulting files.
5+
6+
[versioneer]
7+
VCS = git
8+
style = pep440
9+
versionfile_source = pandas/_version.py
10+
versionfile_build = pandas/_version.py
11+
tag_prefix = v
12+
parentdir_prefix = pandas-

‎setup.py

+14-78
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
import re
1414
from distutils.version import LooseVersion
1515

16+
# versioning
17+
import versioneer
18+
cmdclass = versioneer.get_cmdclass()
19+
1620
# may need to work around setuptools bug by providing a fake Pyrex
1721
min_cython_ver = '0.19.1'
1822
try:
@@ -74,7 +78,6 @@
7478

7579
from distutils.extension import Extension
7680
from distutils.command.build import build
77-
from distutils.command.sdist import sdist
7881
from distutils.command.build_ext import build_ext as _build_ext
7982

8083
try:
@@ -191,76 +194,6 @@ def build_extensions(self):
191194
'Topic :: Scientific/Engineering',
192195
]
193196

194-
MAJOR = 0
195-
MINOR = 16
196-
MICRO = 2
197-
ISRELEASED = False
198-
VERSION = '%d.%d.%d' % (MAJOR, MINOR, MICRO)
199-
QUALIFIER = ''
200-
201-
FULLVERSION = VERSION
202-
write_version = True
203-
204-
if not ISRELEASED:
205-
import subprocess
206-
FULLVERSION += '.dev'
207-
208-
pipe = None
209-
for cmd in ['git','git.cmd']:
210-
try:
211-
pipe = subprocess.Popen([cmd, "describe", "--always", "--match", "v[0-9]*"],
212-
stdout=subprocess.PIPE)
213-
(so,serr) = pipe.communicate()
214-
if pipe.returncode == 0:
215-
break
216-
except:
217-
pass
218-
219-
if pipe is None or pipe.returncode != 0:
220-
# no git, or not in git dir
221-
if os.path.exists('pandas/version.py'):
222-
warnings.warn("WARNING: Couldn't get git revision, using existing pandas/version.py")
223-
write_version = False
224-
else:
225-
warnings.warn("WARNING: Couldn't get git revision, using generic version string")
226-
else:
227-
# have git, in git dir, but may have used a shallow clone (travis does this)
228-
rev = so.strip()
229-
# makes distutils blow up on Python 2.7
230-
if sys.version_info[0] >= 3:
231-
rev = rev.decode('ascii')
232-
233-
if not rev.startswith('v') and re.match("[a-zA-Z0-9]{7,9}",rev):
234-
# partial clone, manually construct version string
235-
# this is the format before we started using git-describe
236-
# to get an ordering on dev version strings.
237-
rev ="v%s.dev-%s" % (VERSION, rev)
238-
239-
# Strip leading v from tags format "vx.y.z" to get th version string
240-
FULLVERSION = rev.lstrip('v')
241-
242-
else:
243-
FULLVERSION += QUALIFIER
244-
245-
246-
def write_version_py(filename=None):
247-
cnt = """\
248-
version = '%s'
249-
short_version = '%s'
250-
"""
251-
if not filename:
252-
filename = os.path.join(
253-
os.path.dirname(__file__), 'pandas', 'version.py')
254-
255-
a = open(filename, 'w')
256-
try:
257-
a.write(cnt % (FULLVERSION, VERSION))
258-
finally:
259-
a.close()
260-
261-
if write_version:
262-
write_version_py()
263-
264197
class CleanCommand(Command):
265198
"""Custom distutils command to clean the .so and .pyc files."""
266199

@@ -323,7 +256,11 @@ def run(self):
323256
pass
324257

325258

326-
class CheckSDist(sdist):
259+
# we need to inherit from the versioneer
260+
# class as it encodes the version info
261+
sdist_class = cmdclass['sdist']
262+
263+
class CheckSDist(sdist_class):
327264
"""Custom sdist that ensures Cython has compiled all pyx files to c."""
328265

329266
_pyxfiles = ['pandas/lib.pyx',
@@ -336,7 +273,7 @@ class CheckSDist(sdist):
336273
'pandas/src/testing.pyx']
337274

338275
def initialize_options(self):
339-
sdist.initialize_options(self)
276+
sdist_class.initialize_options(self)
340277

341278
'''
342279
self._pyxfiles = []
@@ -355,7 +292,7 @@ def run(self):
355292
msg = "C-source file '%s' not found." % (cfile) +\
356293
" Run 'setup.py cython' before sdist."
357294
assert os.path.isfile(cfile), msg
358-
sdist.run(self)
295+
sdist_class.run(self)
359296

360297

361298
class CheckingBuildExt(build_ext):
@@ -397,9 +334,8 @@ def finalize_options(self):
397334
def run(self):
398335
pass
399336

400-
cmdclass = {'clean': CleanCommand,
401-
'build': build,
402-
'sdist': CheckSDist}
337+
cmdclass.update({'clean': CleanCommand,
338+
'build': build})
403339

404340
try:
405341
from wheel.bdist_wheel import bdist_wheel
@@ -575,8 +511,8 @@ def pxd(name):
575511
# if you change something, be careful.
576512

577513
setup(name=DISTNAME,
578-
version=FULLVERSION,
579514
maintainer=AUTHOR,
515+
version=versioneer.get_version(),
580516
packages=['pandas',
581517
'pandas.compat',
582518
'pandas.computation',

‎versioneer.py

+1,699
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)
Please sign in to comment.