Test all supported python versions (#152)

Test all supported python versions
This commit is contained in:
Yonatan Most 2021-06-14 12:22:57 +03:00 коммит произвёл GitHub
Родитель e03b0bfdfe
Коммит 7d763dafb4
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 28 добавлений и 15 удалений

10
.github/workflows/runtests.yml поставляемый
Просмотреть файл

@ -13,19 +13,21 @@ jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ '3.6', '3.7', '3.8' ] # Make sure this matches the supported versions in setup.py
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
# TODO: test all relevant versions
python-version: 3.8
python-version: ${{ matrix.python-version }}
- name: Install dependencies
# According to the internet using 'python -m pip' instead of 'pip' can prevent some issues
run: |
python -m pip install --upgrade pip
# For some reason transitive dependencies are not installed properly, unless we first explictly install 'azure-kusto-data'. Hence this ugly hack.
# For some reason transitive dependencies are not installed properly, unless we first explicitly install 'azure-kusto-data'. Hence this ugly hack.
python -m pip install `grep -oP "azure-kusto-data==[^']+" setup.py`
python setup.py install
python -m pip freeze

Просмотреть файл

@ -1,7 +1,9 @@
import os
import sys
from setuptools import setup, find_packages
assert sys.version_info[0] == 3
__version__ = None
with open(os.path.join('.', 'pykusto', '__init__.py')) as f:
for line in f:
@ -10,6 +12,23 @@ with open(os.path.join('.', 'pykusto', '__init__.py')) as f:
__version__ = line.split(delim)[1]
assert __version__ is not None, 'Unable to determine version'
install_requires = [
# Release notes: https://github.com/Azure/azure-kusto-python/releases
'azure-kusto-data==2.1.1', # Earlier versions not supported because of: https://github.com/Azure/azure-kusto-python/issues/312
'redo==2.0.4',
]
# pandas release notes: https://pandas.pydata.org/docs/whatsnew/index.html
# Tests use DataFrame constructor options introduced in 0.25.0
if sys.version_info[1] <= 6:
# pandas support for Python 3.6 was dropped starting from version 1.2.0
install_requires.append('pandas>=0.25.0,<1.2.0')
# In numpy the support was dropped in 1.20.0, and also the transitive dependency in pandas is not correctly restricted
install_requires.append('numpy<1.20.0')
else:
install_requires.append('pandas>=0.25.0,<=1.2.4')
setup(
name='pykusto',
version=__version__,
@ -22,16 +41,7 @@ setup(
long_description=open("README.md", "r").read(),
long_description_content_type="text/markdown",
keywords="kusto azure-data-explorer client library query",
install_requires=[
# Release notes: https://github.com/Azure/azure-kusto-python/releases
'azure-kusto-data==2.1.1', # Earlier versions not supported because of: https://github.com/Azure/azure-kusto-python/issues/312
# Release notes: https://pandas.pydata.org/docs/whatsnew/index.html
# Note that starting from 1.2.0 support for Python 3.6 was dropped
'pandas>=0.25.0,<=1.2.4', # Tests use DataFrame constructor options introduced in 0.25.0
'redo==2.0.4',
],
install_requires=install_requires,
tests_require=[
'pytest',
'pytest-cov',
@ -41,9 +51,10 @@ setup(
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Topic :: Software Development",
"License :: OSI Approved :: MIT License",
# Make sure this list matches the tested versions in runtests.yml
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"License :: OSI Approved :: MIT License",
],
)