diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 89c1175e..b3711729 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,6 +1,6 @@ # See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.231.3/containers/python-3/.devcontainer/base.Dockerfile -# [Choice] Python version (use -bullseye variants on local arm64/Apple Silicon): 3, 3.10, 3.9, 3.8, 3.7, 3.6, 3-bullseye, 3.10-bullseye, 3.9-bullseye, 3.8-bullseye, 3.7-bullseye, 3.6-bullseye, 3-buster, 3.10-buster, 3.9-buster, 3.8-buster, 3.7-buster, 3.6-buster +# [Choice] Python version (use -bullseye variants on local arm64/Apple Silicon): 3, 3.10, 3.9, 3.8, 3.7, 3-bullseye, 3.10-bullseye, 3.9-bullseye, 3.8-bullseye, 3.7-bullseye, 3-buster, 3.10-buster, 3.9-buster, 3.8-buster, 3.7-buster ARG VARIANT="3.10-bullseye" FROM mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT} @@ -13,9 +13,8 @@ RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ RUN /usr/local/bin/python3 -m pip install --upgrade pip COPY requirements.txt /tmp/pip-tmp/ -COPY dev-requirements*.txt /tmp/pip-tmp/ -RUN pip3 --disable-pip-version-check --no-cache-dir install -r /tmp/pip-tmp/dev-requirements-py3.txt - && rm -rf /tmp/pip-tmp +COPY dev-requirements.txt /tmp/pip-tmp/ +RUN pip3 --disable-pip-version-check --no-cache-dir install -r /tmp/pip-tmp/dev-requirements.txt && rm -rf /tmp/pip-tmp # [Optional] Uncomment this line to install global node packages. # RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g " 2>&1 diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 9b3ed211..8b78600a 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -5,11 +5,11 @@ "build": { "dockerfile": "Dockerfile", "context": "..", - "args": { - // Update 'VARIANT' to pick a Python version: 3, 3.10, 3.9, 3.8, 3.7, 3.6 + "args": { + // Update 'VARIANT' to pick a Python version: 3, 3.10, 3.9, 3.8, 3.7 // Append -bullseye or -buster to pin to an OS version. // Use -bullseye variants on local on arm64/Apple Silicon. - "VARIANT": "3.6-bullseye", + "VARIANT": "3.7-bullseye", // Options "NODE_VERSION": "lts/*" } @@ -19,9 +19,9 @@ // mount databricks config "source=${localEnv:HOME}/.databrickscfg,target=/home/vscode/.databrickscfg,type=bind,consistency=cached" ], - + // Set *default* container specific settings.json values on container create. - "settings": { + "settings": { "python.defaultInterpreterPath": "/usr/local/bin/python", "python.linting.enabled": true, "python.linting.pylintEnabled": true, diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index cdaa217b..87f1272e 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -7,7 +7,7 @@ on: jobs: test: - runs-on: ${{ matrix.os }} + runs-on: ubuntu-22.04 strategy: matrix: python-version: @@ -15,29 +15,24 @@ jobs: - '3.8' - '3.9' - '3.10' - os: [ ubuntu-20.04 ] + - '3.11' + env: - OS: ${{ matrix.os }} PYTHON_VERSION: ${{ matrix.python-version }} steps: - name: Checkout uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - name: Install pip run: pip install --upgrade pip - - name: Install development dependencies (Python 2) - if: ${{ startsWith(matrix.python-version, '2.') }} - run: pip install --upgrade -r dev-requirements-py2.txt - - - name: Install development dependencies (Python 3) - if: ${{ startsWith(matrix.python-version, '3.') }} - run: pip install --upgrade -r dev-requirements-py3.txt + - name: Install development dependencies + run: pip install --upgrade -r dev-requirements.txt - name: Log package versions run: pip freeze @@ -54,14 +49,19 @@ jobs: - name: Upload coverage to Codecov uses: codecov/codecov-action@v2 with: - env_vars: OS,PYTHON_VERSION + env_vars: PYTHON_VERSION build: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 strategy: matrix: python-version: - '3.7' + - '3.8' + - '3.9' + - '3.10' + - '3.11' + env: PYTHON_VERSION: ${{ matrix.python-version }} steps: @@ -69,7 +69,7 @@ jobs: uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} @@ -121,7 +121,7 @@ jobs: compat: name: Public API compatibility - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - name: Checkout uses: actions/checkout@v2 @@ -133,13 +133,13 @@ jobs: path: databricks-cli-main - name: Set up Python - uses: actions/setup-python@v1 + uses: actions/setup-python@v4 - name: Install pip run: pip install --upgrade pip - - name: Install development dependencies (Python 3) - run: pip install --upgrade -r dev-requirements-py3.txt + - name: Install development dependencies + run: pip install --upgrade -r dev-requirements.txt - name: Run compatibility test run: | diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7b1c9f38..edeb0c2d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,15 +4,15 @@ To isolate dependencies from your global python installation, it is important to [virtualenv](https://virtualenv.pypa.io/en/stable/). With `virtualenv` you can install the dev environment by doing the following. Another option would be to use docker directly, i.e. -```bash -docker run -it -v `echo $PWD`:/root python:3.6.8 bash +```bash +docker run -it -v `echo $PWD`:/root python:3.7 bash ``` - `pip install -e .` -- `pip install -r dev-requirements-py3.txt` +- `pip install -r dev-requirements.txt` -To verify that the installation of `databricks-cli` is the one checked out from VCS, you can check by doing `python -c "import databricks_cli; print databricks_cli.__file__"`. +To verify that the installation of `databricks-cli` is the one checked out from VCS, you can check by doing `python -c "import databricks_cli; print(databricks_cli.__file__)"`. Developing using VSCode dev containers -------------------------------------- diff --git a/Dockerfile b/Dockerfile index ae5bb406..63ceca2c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,11 @@ -FROM python:3.6 +FROM python:3.7 WORKDIR /usr/src/databricks-cli COPY . . RUN pip install --upgrade pip && \ - pip install -r dev-requirements-py3.txt && \ + pip install -r dev-requirements.txt && \ pip list && \ ./lint.sh && \ pip install . && \ diff --git a/README.rst b/README.rst index 1a296f8c..27e3048c 100644 --- a/README.rst +++ b/README.rst @@ -23,7 +23,7 @@ Please leave bug reports as issues on our `GitHub project 3.6 +- Python Version >= 3.7 Installation --------------- diff --git a/databricks_cli/sdk/__init__.py b/databricks_cli/sdk/__init__.py index b57fc29f..9025b6f1 100644 --- a/databricks_cli/sdk/__init__.py +++ b/databricks_cli/sdk/__init__.py @@ -26,7 +26,7 @@ Currently supports services including clusters, clusters policies and jobs. -Requires Python 3.6 or above. +Requires Python 3.7 or above. To get started, below is an example usage of the Python API client. diff --git a/dev-requirements-py3.txt b/dev-requirements-py3.txt deleted file mode 100644 index 1d86d4da..00000000 --- a/dev-requirements-py3.txt +++ /dev/null @@ -1,13 +0,0 @@ --r ./dev-requirements.txt -prospector[with_pyroma] - -# More recent versions of these linters introduce rules that make it fail. -# Pin these versions to keep the ruleset fixed. -dodgy==0.2.1 -flake8==4.0.1 -flake8-polyfill==1.0.2 -mccabe==0.6.1 -prospector==1.7.7 -pycodestyle==2.8.0 -pyflakes==2.4.0 -pylint==2.13.9 diff --git a/dev-requirements.txt b/dev-requirements.txt index 6c11c6ad..7919d6c2 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -5,3 +5,15 @@ mock decorator requests_mock rstcheck +prospector[with_pyroma] + +# More recent versions of these linters introduce rules that make it fail. +# Pin these versions to keep the ruleset fixed. +dodgy==0.2.1 +flake8==4.0.1 +flake8-polyfill==1.0.2 +mccabe==0.6.1 +prospector==1.7.7 +pycodestyle==2.8.0 +pyflakes==2.4.0 +pylint==2.13.9 diff --git a/requirements.txt b/requirements.txt index 7b840cad..843143a5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,5 +5,4 @@ oauthlib>=3.1.0 requests>=2.17.3 tabulate>=0.7.7 six>=1.10.0 -configparser>=0.3.5;python_version < "3.6" urllib3>=1.26.7,<3 diff --git a/setup.py b/setup.py index 8e32a013..66596101 100644 --- a/setup.py +++ b/setup.py @@ -33,6 +33,7 @@ name='databricks-cli', version=version, packages=find_packages(include=['databricks_cli*']), + python_requires=">=3.7", install_requires=[ # Note: please keep this in sync with `requirements.txt`. 'click>=7.0', @@ -41,7 +42,6 @@ 'requests>=2.17.3', 'tabulate>=0.7.7', 'six>=1.10.0', - 'configparser>=0.3.5;python_version < "3.6"', 'urllib3>=1.26.7,<3' ], entry_points=''' @@ -58,8 +58,13 @@ classifiers=[ 'Intended Audience :: Developers', 'Intended Audience :: System Administrators', - 'Programming Language :: Python :: 3.6', 'License :: OSI Approved :: Apache Software License', + "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", ], keywords='databricks cli', url='https://github.com/databricks/databricks-cli' diff --git a/tox.ini b/tox.ini index e0c5a23f..aa6d931d 100644 --- a/tox.ini +++ b/tox.ini @@ -1,10 +1,9 @@ [tox] -envlist = py27, py36 +envlist = py37 [testenv] deps = - py27: -rdev-requirements-py2.txt - py36: -rdev-requirements-py3.txt + py37: -rdev-requirements.txt commands = pytest tests --cov=./ ./lint.sh