mirror of
https://github.com/apache/arrow.git
synced 2026-10-29 00:56:31 +08:00
ARROW-379: Use setuptools_scm for Python versioning
Change-Id: I5e2c8e332b689fd75b6d1880f9b152f08b0655eb
This commit is contained in:
1 parent
b5de9e56db
commit
aa9bd49344
6 files changed
+15
-26
No files matched your search
@@ -43,9 +43,4 @@ mvn release:prepare -Dtag=${tag} -DreleaseVersion=${version} -DautoVersionSubmod
|
||||
|
||||
cd -
|
||||
|
||||
cd "${SOURCE_DIR}/../../python"
|
||||
sed -i "s/VERSION = '[^']*'/VERSION = '${version}'/g" setup.py
|
||||
sed -i "s/ISRELEASED = False/ISRELEASED = True/g" setup.py
|
||||
cd -
|
||||
|
||||
echo "Finish staging binary artifacts by running: sh dev/release/01-perform.sh"
|
||||
@@ -0,0 +1 @@
|
||||
ref-names: $Format:%D$
|
||||
@@ -0,0 +1 @@
|
||||
.git_archival.txt export-subst
|
||||
@@ -17,6 +17,14 @@
|
||||
|
||||
# flake8: noqa
|
||||
|
||||
from pkg_resources import get_distribution, DistributionNotFound
|
||||
try:
|
||||
__version__ = get_distribution(__name__).version
|
||||
except DistributionNotFound:
|
||||
# package is not installed
|
||||
pass
|
||||
|
||||
|
||||
import pyarrow.config
|
||||
|
||||
from pyarrow.array import (Array,
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
[build_sphinx]
|
||||
source-dir = doc/
|
||||
build-dir = doc/_build
|
||||
+2
-21
@@ -42,27 +42,9 @@ is_64_bit = sys.maxsize > 2**32
|
||||
if Cython.__version__ < '0.19.1':
|
||||
raise Exception('Please upgrade to Cython 0.19.1 or newer')
|
||||
|
||||
VERSION = '0.1.0'
|
||||
ISRELEASED = False
|
||||
|
||||
if not ISRELEASED:
|
||||
VERSION += '.dev'
|
||||
|
||||
setup_dir = os.path.abspath(os.path.dirname(__file__))
|
||||
|
||||
|
||||
def write_version_py(filename=os.path.join(setup_dir, 'pyarrow/version.py')):
|
||||
a = open(filename, 'w')
|
||||
file_content = "\n".join(["",
|
||||
"# THIS FILE IS GENERATED FROM SETUP.PY",
|
||||
"version = '%(version)s'",
|
||||
"isrelease = '%(isrelease)s'"])
|
||||
|
||||
a.write(file_content % {'version': VERSION,
|
||||
'isrelease': str(ISRELEASED)})
|
||||
a.close()
|
||||
|
||||
|
||||
class clean(_clean):
|
||||
|
||||
def run(self):
|
||||
@@ -261,15 +243,12 @@ class build_ext(_build_ext):
|
||||
return [self._get_cmake_ext_path(name)
|
||||
for name in self.get_names()]
|
||||
|
||||
write_version_py()
|
||||
|
||||
DESC = """\
|
||||
Python library for Apache Arrow"""
|
||||
|
||||
setup(
|
||||
name="pyarrow",
|
||||
packages=['pyarrow', 'pyarrow.tests'],
|
||||
version=VERSION,
|
||||
zip_safe=False,
|
||||
package_data={'pyarrow': ['*.pxd', '*.pyx']},
|
||||
# Dummy extension to trigger build_ext
|
||||
@@ -279,6 +258,8 @@ setup(
|
||||
'clean': clean,
|
||||
'build_ext': build_ext
|
||||
},
|
||||
use_scm_version = {"root": "..", "relative_to": __file__},
|
||||
setup_requires=['setuptools_scm', 'setuptools_scm_git_archive'],
|
||||
install_requires=['cython >= 0.23', 'numpy >= 1.9', 'six >= 1.0.0'],
|
||||
description=DESC,
|
||||
license='Apache License, Version 2.0',
|
||||
|
||||
Reference in new issue
Block a user