Skip to content

Commit

Permalink
Drop support for Python 2.7 (#652)
Browse files Browse the repository at this point in the history
  • Loading branch information
pietern committed Oct 4, 2023
1 parent 9a4081f commit 2553388
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 23 deletions.
10 changes: 3 additions & 7 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,13 @@ ARG NODE_VERSION="none"
RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi

RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& apt-get -y install --no-install-recommends tig python2.7 python2.7-dev
&& apt-get -y install --no-install-recommends tig

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 \
&& wget https://bootstrap.pypa.io/pip/2.7/get-pip.py \
&& python2.7 get-pip.py \
&& rm get-pip.py \
&& python2.7 -m pip install -r /tmp/pip-tmp/dev-requirements-py2.txt \
RUN pip3 --disable-pip-version-check --no-cache-dir install -r /tmp/pip-tmp/dev-requirements-py3.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 <your-package-here>" 2>&1
# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g <your-package-here>" 2>&1
6 changes: 2 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ Setting up the dev environment
To isolate dependencies from your global python installation, it is important to use a tool like
[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.
Another option would be to use docker directly, i.e.
```bash
docker run -it -v `echo $PWD`:/root python:3.6.8 bash
docker run -it -v `echo $PWD`:/root python:2.7.12 bash

```

Expand All @@ -28,7 +27,7 @@ Requirements:
Developing using Github CodeSpaces
----------------------------------

The same development container setup used for local VSCode also works with GitHub CodeSpaces. If you have CodeSpaces enabled in your Github account then can just create a CodeSpace from the repoand start coding.
The same development container setup used for local VSCode also works with GitHub CodeSpaces. If you have CodeSpaces enabled in your Github account then can just create a CodeSpace from the repoand start coding.

In order to test the CLI against a Databricks cluster you can define the these secrets for your CodeSpace so you don't have to run `databricks init` eacht time you open it:

Expand All @@ -41,4 +40,3 @@ https://docs.github.com/en/codespaces/managing-your-codespaces/managing-encrypte
Running Tests
----------------
- `tox`

4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
FROM python:2.7
FROM python:3.6

WORKDIR /usr/src/databricks-cli

COPY . .

RUN pip install --upgrade pip && \
pip install -r dev-requirements-py2.txt && \
pip install -r dev-requirements-py3.txt && \
pip list && \
./lint.sh && \
pip install . && \
Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Please leave bug reports as issues on our `GitHub project <https://github.com/da
Requirements
------------

- Python Version > 2.7.9 or > 3.6
- Python Version > 3.6

Installation
---------------
Expand Down Expand Up @@ -63,7 +63,7 @@ Using Docker
# run command in docker
docker run -it databricks-cli fs --help
Documentation
-------------

Expand Down
2 changes: 1 addition & 1 deletion databricks_cli/sdk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
Currently supports services including clusters, clusters policies and jobs.
Requires Python 2.7.9 or above.
Requires Python 3.6 or above.
To get started, below is an example usage of the Python API client.
Expand Down
6 changes: 0 additions & 6 deletions dev-requirements-py2.txt

This file was deleted.

1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
classifiers=[
'Intended Audience :: Developers',
'Intended Audience :: System Administrators',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.6',
'License :: OSI Approved :: Apache Software License',
],
Expand Down

0 comments on commit 2553388

Please sign in to comment.