Skip to content

Commit

Permalink
Merge pull request #132 from davet2001/devcontainer
Browse files Browse the repository at this point in the history
Add support for devcontainer development
  • Loading branch information
davet2001 committed Dec 19, 2023
2 parents 63e48f9 + 441ab31 commit eda310d
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .devcontainer/Dockerfile
@@ -0,0 +1,5 @@
FROM mcr.microsoft.com/devcontainers/base:alpine-3.18

RUN apk add --no-cache \
libusb=1.0.26-r2 \
py3-pip=23.1.2-r0
28 changes: 28 additions & 0 deletions .devcontainer/devcontainer.json
@@ -0,0 +1,28 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/alpine
{
"name": "Python Alpine",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"build": {
"dockerfile": "Dockerfile",
"context": ".."
},

// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "pip3 install --user -r requirements.txt -r requirements_test.txt",

// Priviledged mode is necessary to get access to usb
"runArgs": ["--privileged"]

// Configure tool-specific properties.
// "customizations": {},

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
//"remoteUser": "root"
}
10 changes: 10 additions & 0 deletions .vscode/settings.json
@@ -0,0 +1,10 @@
{
"python.envFile": "${workspaceFolder}/.env",
"python.testing.pytestArgs": [
"tests"
],
"python.testing.unittestEnabled": false,
"python.testing.nosetestsEnabled": false,
"python.testing.pytestEnabled": true,
"python.pythonPath": "/usr/local/bin/python",
}
1 change: 1 addition & 0 deletions requirements.txt
@@ -0,0 +1 @@
pyusb==1.2.1
5 changes: 3 additions & 2 deletions requirements_test.txt
@@ -1,3 +1,4 @@
# Dependencies for running tests.
pytest
pyusb
pyusb==1.2.1
pytest==7.4.3

Empty file added tests/__init__.py
Empty file.

0 comments on commit eda310d

Please sign in to comment.