Skip to content

Commit

Permalink
Merge pull request #113 from robmarkcole/use-docker
Browse files Browse the repository at this point in the history
Use docker
  • Loading branch information
robmarkcole authored Jan 1, 2020
2 parents 650e402 + 564900b commit da331fb
Show file tree
Hide file tree
Showing 9 changed files with 141 additions and 685 deletions.
19 changes: 19 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

FROM python:3.7

COPY requirements.txt requirements_test.txt /tmp/pip-tmp/

# Configure apt and install packages
RUN apt-get update \
&& apt-get -y install --no-install-recommends apt-utils dialog 2>&1 \
#
# Verify git, process tools, lsb-release (common in install instructions for CLIs) installed
&& apt-get -y install git iproute2 procps lsb-release \
#
# Install pylint
&& pip --disable-pip-version-check --no-cache-dir install pylint \
#
# Update Python environment based on requirements.txt
&& pip --disable-pip-version-check --no-cache-dir install -r /tmp/pip-tmp/requirements.txt \
&& pip --disable-pip-version-check --no-cache-dir install -r /tmp/pip-tmp/requirements_test.txt \
&& rm -rf /tmp/pip-tmp \
33 changes: 33 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// For format details, see https://aka.ms/vscode-remote/devcontainer.json or the definition README at
// https://github.com/microsoft/vscode-dev-containers/tree/master/containers/python-3
{
"name": "Python 3",
"context": "..",
"dockerFile": "Dockerfile",
// Use 'settings' to set *default* container specific settings.json values on container create.
// You can edit these settings after create using File > Preferences > Settings > Remote.
"settings": {
"terminal.integrated.shell.linux": "/bin/bash",
"python.pythonPath": "/usr/local/bin/python",
"python.linting.enabled": true,
"python.linting.pylintEnabled": true,
"python.formatting.provider": "black",
"editor.formatOnPaste": false,
"editor.formatOnSave": true,
"editor.formatOnType": true,
"files.trimTrailingWhitespace": true
},
// Use 'appPort' to create a container with published ports. If the port isn't working, be sure
// your server accepts connections from all interfaces (0.0.0.0 or '*'), not just localhost.
// "appPort": [],
// Uncomment the next line to run commands after the container is created.
"postCreateCommand": "pip install -r requirements.txt && pip3 install -e .",
// Uncomment the next line to have VS Code connect as an existing non-root user in the container.
// On Linux, by default, the container user's UID/GID will be updated to match your local user. See
// https://aka.ms/vscode-remote/containers/non-root for details on adding a non-root user if none exist.
// "remoteUser": "vscode",
// Add the IDs of extensions you want installed when the container is created in the array below.
"extensions": [
"ms-python.python"
]
}
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ language: python
# sudo false implies containerized builds
#sudo: false
python:
- "3.6"
- "3.7"
before_install:
- pip install pytest pytest-cov
- pip install coveralls
install:
- pip install -r requirements.txt
- pip install -r requirements_test.txt
# command to run tests
script:
Expand Down
Loading

0 comments on commit da331fb

Please sign in to comment.