Files
zeekay 073c1bf61e rename: zero ClickHouse — datastore_driver speaks X-Datastore-*
The wire protocol was the last holdout and it was not cosmetic: the Hanzo
Datastore server reads X-Datastore-User, and answers a request bearing
X-ClickHouse-User with 401. Verified against the live server, both directions.
So a client still sending the old headers is not merely off-brand, it cannot
authenticate over HTTP.

Everything else follows: types, dialects, error modules, docstrings and doc
links now name Datastore, and doc URLs point at docs.hanzo.ai/datastore rather
than the upstream vendor's site. Zero occurrences of the old name remain.

Still cut from the pinned upstream version, so behaviour is unchanged.
2026-07-26 11:06:05 -07:00

140 lines
3.8 KiB
Python

import os
import re
from codecs import open
from setuptools import setup, find_packages
from distutils.extension import Extension
try:
from Cython.Build import cythonize
except ImportError:
USE_CYTHON = False
else:
USE_CYTHON = True
CYTHON_TRACE = bool(os.getenv('CYTHON_TRACE', False))
here = os.path.abspath(os.path.dirname(__file__))
def read_version():
regexp = re.compile(r'^VERSION\W*=\W*\(([^\(\)]*)\)')
init_py = os.path.join(here, 'datastore_driver', '__init__.py')
with open(init_py, encoding='utf-8') as f:
for line in f:
match = regexp.match(line)
if match is not None:
return match.group(1).replace(', ', '.')
else:
raise RuntimeError(
'Cannot find version in datastore_driver/__init__.py'
)
with open(os.path.join(here, 'README.rst'), encoding='utf-8') as f:
long_description = f.read()
# Prepare extensions.
ext = '.pyx' if USE_CYTHON else '.c'
extensions = [
Extension(
'datastore_driver.bufferedreader',
['datastore_driver/bufferedreader' + ext]
),
Extension(
'datastore_driver.bufferedwriter',
['datastore_driver/bufferedwriter' + ext]
),
Extension(
'datastore_driver.columns.largeint',
['datastore_driver/columns/largeint' + ext]
),
Extension(
'datastore_driver.varint',
['datastore_driver/varint' + ext]
)
]
if USE_CYTHON:
compiler_directives = {'language_level': '3'}
if CYTHON_TRACE:
compiler_directives['linetrace'] = True
extensions = cythonize(extensions, compiler_directives=compiler_directives)
github_url = 'https://github.com/mymarilyn/datastore-driver'
setup(
name='datastore-driver',
version=read_version(),
description='Python driver with native interface for Datastore',
long_description=long_description,
url=github_url,
author='Konstantin Lebedev',
author_email='[email protected]',
license='MIT',
classifiers=[
'Development Status :: 4 - Beta',
'Environment :: Console',
'Intended Audience :: Developers',
'Intended Audience :: Information Technology',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: SQL',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: Implementation :: PyPy',
'Topic :: Database',
'Topic :: Software Development',
'Topic :: Software Development :: Libraries',
'Topic :: Software Development :: Libraries :: Application Frameworks',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: Scientific/Engineering :: Information Analysis'
],
keywords='Datastore db database cloud analytics',
project_urls={
'Documentation': 'https://datastore-driver.readthedocs.io',
'Changes': github_url + '/blob/master/CHANGELOG.md'
},
packages=find_packages('.', exclude=['tests*']),
python_requires='>=3.7, <4',
install_requires=[
'pytz',
'tzlocal'
],
ext_modules=extensions,
extras_require={
'lz4': [
'lz4<=3.0.1; implementation_name=="pypy"',
'lz4; implementation_name!="pypy"',
'datastore-cityhash>=1.0.2.1'
],
'zstd': ['zstd', 'datastore-cityhash>=1.0.2.1'],
'numpy': ['numpy>=1.12.0', 'pandas>=0.24.0']
},
test_suite='pytest'
)