-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ct 2183/setup tools distro info (#561)
* unpin dev requirements * remove duplicated downstream dependencies to reduce version conflicts * add docker image for development purposes * add tox to the image * add py3.9 and py3.8 containers to research broken test
- Loading branch information
1 parent
93303d4
commit 626bf16
Showing
6 changed files
with
98 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
* | ||
!docker_dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
.DEFAULT_GOAL:=help | ||
|
||
.PHONY: dev | ||
dev: ## Installs adapter in develop mode along with development dependencies | ||
@\ | ||
pip install -e . -r dev-requirements.txt && pre-commit install | ||
|
||
.PHONY: ubuntu-py311 | ||
ubuntu-py311: ## Builds and runs an Ubuntu Python 3.11 development container | ||
docker build -f docker_dev/ubuntu.Dockerfile -t dbt-bigquery-ubuntu-py311 . | ||
docker run --rm -it --name dbt-bigquery-ubuntu-py311 -v $(shell pwd):/opt/code dbt-bigquery-ubuntu-py311 | ||
|
||
.PHONY: ubuntu-py39 | ||
ubuntu-py39: ## Builds and runs an Ubuntu Python 3.9 development container | ||
docker build -f docker_dev/ubuntu.Dockerfile -t dbt-bigquery-ubuntu-py39 . --build-arg version=3.9 | ||
docker run --rm -it --name dbt-bigquery-ubuntu-py39 -v $(shell pwd):/opt/code dbt-bigquery-ubuntu-py39 | ||
|
||
.PHONY: ubuntu-py38 | ||
ubuntu-py38: ## Builds and runs an Ubuntu Python 3.8 development container | ||
docker build -f docker_dev/ubuntu.Dockerfile -t dbt-bigquery-ubuntu-py38 . --build-arg version=3.8 | ||
docker run --rm -it --name dbt-bigquery-ubuntu-py38 -v $(shell pwd):/opt/code dbt-bigquery-ubuntu-py38 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Docker Dev Images | ||
|
||
These images are solely for development purposes. They are | ||
saved here for convenience. There should be no expectation | ||
of stability or maintenance. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
FROM ubuntu:latest | ||
|
||
# default to py3.11, this can be overridden at build, e.g. `docker build ... --build-arg version=3.10` | ||
ARG version=3.11 | ||
|
||
# prevent python installation from asking for time zone region | ||
ARG DEBIAN_FRONTEND=noninteractive | ||
|
||
# get add-apt-repository | ||
RUN apt-get update && \ | ||
apt-get install -y software-properties-common | ||
|
||
# add the python repository | ||
RUN apt-get update && \ | ||
add-apt-repository -y ppa:deadsnakes/ppa | ||
|
||
# install python and git (for installing dbt-core) | ||
RUN apt-get update && \ | ||
apt-get install -y --no-install-recommends \ | ||
python$version \ | ||
python$version-dev \ | ||
python$version-distutils \ | ||
python$version-venv \ | ||
python3-pip \ | ||
python3-wheel \ | ||
build-essential \ | ||
git-all | ||
|
||
# clean up | ||
RUN apt-get clean && \ | ||
rm -rf \ | ||
/var/lib/apt/lists/* \ | ||
/tmp/* \ | ||
/var/tmp/* | ||
|
||
# update the default system interpreter to the newly installed version | ||
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python$version 1 | ||
|
||
# setup mount for our code | ||
WORKDIR /opt/code | ||
VOLUME /opt/code | ||
|
||
# install tox in the system interpreter (it creates it's own virtual environments) | ||
RUN pip install tox | ||
|
||
# explicitly create a virtual environment as well for interactive testing | ||
RUN python3 -m venv /opt/venv | ||
|
||
# send stdout/stderr to terminal | ||
ENV PYTHONUNBUFFERED=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters