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

CI: use versioneer to have PEP440 versions #10370

Merged
merged 1 commit into from
Jul 16, 2015
Merged
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
32 changes: 11 additions & 21 deletions .binstar.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
package: pandas
user: jreback

platform:
#- osx-64
#- linux-32
- linux-64
- win-64
#- win-32

engine:
#- python=2.6
- python=2.7
#- python=3.3
#- python=3.4
install:
- conda config --add channels pandas

before_script:
- python -V

platform:
- linux-64
#- linux-32
- osx-64
#- win-32
- win-64
engine:
- python=2.7
#- python=3.4
script:
- conda build conda.recipe --quiet

@@ -27,12 +26,3 @@ build_targets: conda
notifications:
email:
recipients: ['jeff@reback.net']

---
platform: win-32
engine: python=2.6
exclude: true
---
platform: win-64
engine: python=2.6
exclude: true
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -13,3 +13,4 @@
*.dta binary
*.xls binary
*.xlsx binary
pandas/_version.py export-subst
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -78,10 +78,6 @@ scikits
*.c
*.cpp

# Things specific to this project #
###################################
pandas/version.py

# Documentation generated files #
#################################
doc/source/generated
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -24,3 +24,5 @@ global-exclude *.png
# recursive-include doc/source *
# recursive-include doc/sphinxext *
# recursive-include LICENSES *
include versioneer.py
include pandas/_version.py
5 changes: 4 additions & 1 deletion conda.recipe/bld.bat
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
@echo off
%PYTHON% setup.py install --quiet

conda remove jinja2 --quiet
conda install jinja2 --quiet
%PYTHON% setup.py install
5 changes: 3 additions & 2 deletions conda.recipe/build.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
#!/bin/bash
$PYTHON setup.py install --quiet
#!/bin/sh

$PYTHON setup.py install
7 changes: 3 additions & 4 deletions conda.recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package:
name: pandas
version: {{ environ.get('GIT_DESCRIBE_TAG', '') }}
name: pandas
version: {{ environ.get('GIT_DESCRIBE_TAG', '').replace('.dev', 'dev') }}

build:
number: {{ environ.get('GIT_DESCRIBE_NUMBER', 0) }}
@@ -28,10 +28,9 @@ requirements:
test:
requires:
- nose
- coverage

commands:
- python -c "import pandas"
- nosetests --exe -A "not slow and not network and not disabled" pandas

about:
home: http://pandas.pydata.org
1 change: 1 addition & 0 deletions doc/source/whatsnew/v0.17.0.txt
Original file line number Diff line number Diff line change
@@ -14,6 +14,7 @@ users upgrade to this version.
Highlights include:

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

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

6 changes: 5 additions & 1 deletion pandas/__init__.py
Original file line number Diff line number Diff line change
@@ -29,7 +29,6 @@
_np_version_under1p9 = LooseVersion(_np_version) < '1.9'


from pandas.version import version as __version__
from pandas.info import __doc__


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

# use the closest tagged version if possible
from ._version import get_versions
v = get_versions()
__version__ = v.get('closest-tag',v['version'])
del get_versions, v
460 changes: 460 additions & 0 deletions pandas/_version.py

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

# See the docstring in versioneer.py for instructions. Note that you must
# re-run 'versioneer.py setup' after changing this section, and commit the
# resulting files.

[versioneer]
VCS = git
style = pep440
versionfile_source = pandas/_version.py
versionfile_build = pandas/_version.py
tag_prefix = v
parentdir_prefix = pandas-
92 changes: 14 additions & 78 deletions setup.py
Original file line number Diff line number Diff line change
@@ -13,6 +13,10 @@
import re
from distutils.version import LooseVersion

# versioning
import versioneer
cmdclass = versioneer.get_cmdclass()

# may need to work around setuptools bug by providing a fake Pyrex
min_cython_ver = '0.19.1'
try:
@@ -74,7 +78,6 @@

from distutils.extension import Extension
from distutils.command.build import build
from distutils.command.sdist import sdist
from distutils.command.build_ext import build_ext as _build_ext

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

MAJOR = 0
MINOR = 16
MICRO = 2
ISRELEASED = False
VERSION = '%d.%d.%d' % (MAJOR, MINOR, MICRO)
QUALIFIER = ''

FULLVERSION = VERSION
write_version = True

if not ISRELEASED:
import subprocess
FULLVERSION += '.dev'

pipe = None
for cmd in ['git','git.cmd']:
try:
pipe = subprocess.Popen([cmd, "describe", "--always", "--match", "v[0-9]*"],
stdout=subprocess.PIPE)
(so,serr) = pipe.communicate()
if pipe.returncode == 0:
break
except:
pass

if pipe is None or pipe.returncode != 0:
# no git, or not in git dir
if os.path.exists('pandas/version.py'):
warnings.warn("WARNING: Couldn't get git revision, using existing pandas/version.py")
write_version = False
else:
warnings.warn("WARNING: Couldn't get git revision, using generic version string")
else:
# have git, in git dir, but may have used a shallow clone (travis does this)
rev = so.strip()
# makes distutils blow up on Python 2.7
if sys.version_info[0] >= 3:
rev = rev.decode('ascii')

if not rev.startswith('v') and re.match("[a-zA-Z0-9]{7,9}",rev):
# partial clone, manually construct version string
# this is the format before we started using git-describe
# to get an ordering on dev version strings.
rev ="v%s.dev-%s" % (VERSION, rev)

# Strip leading v from tags format "vx.y.z" to get th version string
FULLVERSION = rev.lstrip('v')

else:
FULLVERSION += QUALIFIER


def write_version_py(filename=None):
cnt = """\
version = '%s'
short_version = '%s'
"""
if not filename:
filename = os.path.join(
os.path.dirname(__file__), 'pandas', 'version.py')

a = open(filename, 'w')
try:
a.write(cnt % (FULLVERSION, VERSION))
finally:
a.close()

if write_version:
write_version_py()

class CleanCommand(Command):
"""Custom distutils command to clean the .so and .pyc files."""

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


class CheckSDist(sdist):
# we need to inherit from the versioneer
# class as it encodes the version info
sdist_class = cmdclass['sdist']

class CheckSDist(sdist_class):
"""Custom sdist that ensures Cython has compiled all pyx files to c."""

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

def initialize_options(self):
sdist.initialize_options(self)
sdist_class.initialize_options(self)

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


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

cmdclass = {'clean': CleanCommand,
'build': build,
'sdist': CheckSDist}
cmdclass.update({'clean': CleanCommand,
'build': build})

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

setup(name=DISTNAME,
version=FULLVERSION,
maintainer=AUTHOR,
version=versioneer.get_version(),
packages=['pandas',
'pandas.compat',
'pandas.computation',
1,699 changes: 1,699 additions & 0 deletions versioneer.py

Large diffs are not rendered by default.