Skip to content

Commit 682dc6f

Browse files
authored
Require Python 3.7 or later (#674)
* Require Python 3.7 or later * Upgrade to actions/setup-python@v4 * Remove Python 3.12 builds for this PR * Make dev container work
1 parent f5d7cf9 commit 682dc6f

File tree

12 files changed

+55
-54
lines changed

12 files changed

+55
-54
lines changed

.devcontainer/Dockerfile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.231.3/containers/python-3/.devcontainer/base.Dockerfile
22

3-
# [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
3+
# [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
44
ARG VARIANT="3.10-bullseye"
55
FROM mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT}
66

@@ -13,9 +13,8 @@ RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
1313

1414
RUN /usr/local/bin/python3 -m pip install --upgrade pip
1515
COPY requirements.txt /tmp/pip-tmp/
16-
COPY dev-requirements*.txt /tmp/pip-tmp/
17-
RUN pip3 --disable-pip-version-check --no-cache-dir install -r /tmp/pip-tmp/dev-requirements-py3.txt
18-
&& rm -rf /tmp/pip-tmp
16+
COPY dev-requirements.txt /tmp/pip-tmp/
17+
RUN pip3 --disable-pip-version-check --no-cache-dir install -r /tmp/pip-tmp/dev-requirements.txt && rm -rf /tmp/pip-tmp
1918

2019
# [Optional] Uncomment this line to install global node packages.
2120
# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g <your-package-here>" 2>&1

.devcontainer/devcontainer.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
"build": {
66
"dockerfile": "Dockerfile",
77
"context": "..",
8-
"args": {
9-
// Update 'VARIANT' to pick a Python version: 3, 3.10, 3.9, 3.8, 3.7, 3.6
8+
"args": {
9+
// Update 'VARIANT' to pick a Python version: 3, 3.10, 3.9, 3.8, 3.7
1010
// Append -bullseye or -buster to pin to an OS version.
1111
// Use -bullseye variants on local on arm64/Apple Silicon.
12-
"VARIANT": "3.6-bullseye",
12+
"VARIANT": "3.7-bullseye",
1313
// Options
1414
"NODE_VERSION": "lts/*"
1515
}
@@ -19,9 +19,9 @@
1919
// mount databricks config
2020
"source=${localEnv:HOME}/.databrickscfg,target=/home/vscode/.databrickscfg,type=bind,consistency=cached"
2121
],
22-
22+
2323
// Set *default* container specific settings.json values on container create.
24-
"settings": {
24+
"settings": {
2525
"python.defaultInterpreterPath": "/usr/local/bin/python",
2626
"python.linting.enabled": true,
2727
"python.linting.pylintEnabled": true,

.github/workflows/push.yml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,37 +7,32 @@ on:
77

88
jobs:
99
test:
10-
runs-on: ${{ matrix.os }}
10+
runs-on: ubuntu-22.04
1111
strategy:
1212
matrix:
1313
python-version:
1414
- '3.7'
1515
- '3.8'
1616
- '3.9'
1717
- '3.10'
18-
os: [ ubuntu-20.04 ]
18+
- '3.11'
19+
1920
env:
20-
OS: ${{ matrix.os }}
2121
PYTHON_VERSION: ${{ matrix.python-version }}
2222
steps:
2323
- name: Checkout
2424
uses: actions/checkout@v2
2525

2626
- name: Set up Python ${{ matrix.python-version }}
27-
uses: actions/setup-python@v1
27+
uses: actions/setup-python@v4
2828
with:
2929
python-version: ${{ matrix.python-version }}
3030

3131
- name: Install pip
3232
run: pip install --upgrade pip
3333

34-
- name: Install development dependencies (Python 2)
35-
if: ${{ startsWith(matrix.python-version, '2.') }}
36-
run: pip install --upgrade -r dev-requirements-py2.txt
37-
38-
- name: Install development dependencies (Python 3)
39-
if: ${{ startsWith(matrix.python-version, '3.') }}
40-
run: pip install --upgrade -r dev-requirements-py3.txt
34+
- name: Install development dependencies
35+
run: pip install --upgrade -r dev-requirements.txt
4136

4237
- name: Log package versions
4338
run: pip freeze
@@ -54,22 +49,27 @@ jobs:
5449
- name: Upload coverage to Codecov
5550
uses: codecov/codecov-action@v2
5651
with:
57-
env_vars: OS,PYTHON_VERSION
52+
env_vars: PYTHON_VERSION
5853

5954
build:
60-
runs-on: ubuntu-20.04
55+
runs-on: ubuntu-22.04
6156
strategy:
6257
matrix:
6358
python-version:
6459
- '3.7'
60+
- '3.8'
61+
- '3.9'
62+
- '3.10'
63+
- '3.11'
64+
6565
env:
6666
PYTHON_VERSION: ${{ matrix.python-version }}
6767
steps:
6868
- name: Checkout
6969
uses: actions/checkout@v2
7070

7171
- name: Set up Python ${{ matrix.python-version }}
72-
uses: actions/setup-python@v1
72+
uses: actions/setup-python@v4
7373
with:
7474
python-version: ${{ matrix.python-version }}
7575

@@ -121,7 +121,7 @@ jobs:
121121
122122
compat:
123123
name: Public API compatibility
124-
runs-on: ubuntu-20.04
124+
runs-on: ubuntu-22.04
125125
steps:
126126
- name: Checkout
127127
uses: actions/checkout@v2
@@ -133,13 +133,13 @@ jobs:
133133
path: databricks-cli-main
134134

135135
- name: Set up Python
136-
uses: actions/setup-python@v1
136+
uses: actions/setup-python@v4
137137

138138
- name: Install pip
139139
run: pip install --upgrade pip
140140

141-
- name: Install development dependencies (Python 3)
142-
run: pip install --upgrade -r dev-requirements-py3.txt
141+
- name: Install development dependencies
142+
run: pip install --upgrade -r dev-requirements.txt
143143

144144
- name: Run compatibility test
145145
run: |

CONTRIBUTING.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ To isolate dependencies from your global python installation, it is important to
44
[virtualenv](https://virtualenv.pypa.io/en/stable/). With `virtualenv` you can install the dev environment by doing the following.
55

66
Another option would be to use docker directly, i.e.
7-
```bash
8-
docker run -it -v `echo $PWD`:/root python:3.6.8 bash
97

8+
```bash
9+
docker run -it -v `echo $PWD`:/root python:3.7 bash
1010
```
1111

1212
- `pip install -e .`
13-
- `pip install -r dev-requirements-py3.txt`
13+
- `pip install -r dev-requirements.txt`
1414

15-
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__"`.
15+
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__)"`.
1616

1717
Developing using VSCode dev containers
1818
--------------------------------------

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
FROM python:3.6
1+
FROM python:3.7
22

33
WORKDIR /usr/src/databricks-cli
44

55
COPY . .
66

77
RUN pip install --upgrade pip && \
8-
pip install -r dev-requirements-py3.txt && \
8+
pip install -r dev-requirements.txt && \
99
pip list && \
1010
./lint.sh && \
1111
pip install . && \

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Please leave bug reports as issues on our `GitHub project <https://github.com/da
2323
Requirements
2424
------------
2525

26-
- Python Version > 3.6
26+
- Python Version >= 3.7
2727

2828
Installation
2929
---------------

databricks_cli/sdk/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
2727
Currently supports services including clusters, clusters policies and jobs.
2828
29-
Requires Python 3.6 or above.
29+
Requires Python 3.7 or above.
3030
3131
To get started, below is an example usage of the Python API client.
3232

dev-requirements-py3.txt

Lines changed: 0 additions & 13 deletions
This file was deleted.

dev-requirements.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,15 @@ mock
55
decorator
66
requests_mock
77
rstcheck
8+
prospector[with_pyroma]
9+
10+
# More recent versions of these linters introduce rules that make it fail.
11+
# Pin these versions to keep the ruleset fixed.
12+
dodgy==0.2.1
13+
flake8==4.0.1
14+
flake8-polyfill==1.0.2
15+
mccabe==0.6.1
16+
prospector==1.7.7
17+
pycodestyle==2.8.0
18+
pyflakes==2.4.0
19+
pylint==2.13.9

requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,4 @@ oauthlib>=3.1.0
55
requests>=2.17.3
66
tabulate>=0.7.7
77
six>=1.10.0
8-
configparser>=0.3.5;python_version < "3.6"
98
urllib3>=1.26.7,<3

0 commit comments

Comments
 (0)