kyuubi/python/setup.py
camper42 96d8b8e2de
[KYUUBI #6445] Normalize extra name for optional Python distribution dependencies
…pendencies

# 🔍 Description
## Issue References 🔗

This pull request fixes #6445

## Describe Your Solution 🔧

use `hive-pure-sasl` instead of `hive_pure_sasl` for extra name for optional distribution dependencies.

this avoid potential `WARNING: pyhive x.y.z does not provide the extra 'hive-pure-sasl'` and missing dependencies when a package depends on `pyhive[hive_pure_sasl]` and python build system choose to normalize it to `pyhive[hive-pure-saal]`.

## Types of changes 🔖

- [ ] Bugfix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)

## Test Plan 🧪

#### Behavior Without This Pull Request ⚰️

a package depends on `pyhive[hive_pure_sasl]` may complain `WARNING: pyhive x.y.z does not provide the extra 'hive-pure-sasl'` and missing dependencies to support hive feature.

#### Behavior With This Pull Request 🎉

based on my test on our internal pypi, users use `pyhive[hive_pure_sasl]` are not affected by this change. But we should update README when we release a new version of pyhive.

#### Related Unit Tests

---

# Checklist 📝

- [x] This patch was not authored or co-authored using [Generative Tooling](https://www.apache.org/legal/generative-tooling.html)

**Be nice. Be informative.**

Closes #6454 from camper42/python.

Closes #6445

d82e5cae9 [camper42] [KYUUBI #6445] use normalized extra name for optional distribution dependencies

Authored-by: camper42 <camper.xlii@gmail.com>
Signed-off-by: Cheng Pan <chengpan@apache.org>
2024-06-06 15:06:37 +08:00

79 lines
2.2 KiB
Python
Executable File

#!/usr/bin/env python
from setuptools import setup
from setuptools.command.test import test as TestCommand
import pyhive
import sys
class PyTest(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
self.test_suite = True
def run_tests(self):
# import here, cause outside the eggs aren't loaded
import pytest
errno = pytest.main(self.test_args)
sys.exit(errno)
with open('README.rst') as readme:
long_description = readme.read()
setup(
name="PyHive",
version=pyhive.__version__,
description="Python interface to Hive",
long_description=long_description,
url='https://github.com/dropbox/PyHive',
author="Jing Wang",
author_email="jing@dropbox.com",
license="Apache License, Version 2.0",
packages=['pyhive', 'TCLIService'],
classifiers=[
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Topic :: Database :: Front-Ends",
],
install_requires=[
'future',
'python-dateutil',
],
extras_require={
'presto': ['requests>=1.0.0'],
'trino': ['requests>=1.0.0'],
'hive': ['sasl>=0.2.1', 'thrift>=0.10.0', 'thrift_sasl>=0.1.0'],
'hive-pure-sasl': ['pure-sasl>=0.6.2', 'thrift>=0.10.0', 'thrift_sasl>=0.1.0'],
'sqlalchemy': ['sqlalchemy>=1.3.0'],
'kerberos': ['requests_kerberos>=0.12.0'],
},
tests_require=[
'mock>=1.0.0',
'pytest',
'pytest-cov',
'requests>=1.0.0',
'requests_kerberos>=0.12.0',
'sasl>=0.2.1',
'pure-sasl>=0.6.2',
'kerberos>=1.3.0',
'sqlalchemy>=1.3.0',
'thrift>=0.10.0',
],
cmdclass={'test': PyTest},
package_data={
'': ['*.rst'],
},
entry_points={
'sqlalchemy.dialects': [
'hive = pyhive.sqlalchemy_hive:HiveDialect',
"hive.http = pyhive.sqlalchemy_hive:HiveHTTPDialect",
"hive.https = pyhive.sqlalchemy_hive:HiveHTTPSDialect",
'presto = pyhive.sqlalchemy_presto:PrestoDialect',
'trino.pyhive = pyhive.sqlalchemy_trino:TrinoDialect',
],
}
)