Skip to content

Commit eda310d

Browse files
authored
Merge pull request #132 from davet2001/devcontainer
Add support for devcontainer development
2 parents 63e48f9 + 441ab31 commit eda310d

File tree

6 files changed

+47
-2
lines changed

6 files changed

+47
-2
lines changed

.devcontainer/Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
FROM mcr.microsoft.com/devcontainers/base:alpine-3.18
2+
3+
RUN apk add --no-cache \
4+
libusb=1.0.26-r2 \
5+
py3-pip=23.1.2-r0

.devcontainer/devcontainer.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/alpine
3+
{
4+
"name": "Python Alpine",
5+
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6+
"build": {
7+
"dockerfile": "Dockerfile",
8+
"context": ".."
9+
},
10+
11+
// Features to add to the dev container. More info: https://containers.dev/features.
12+
// "features": {},
13+
14+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
15+
// "forwardPorts": [],
16+
17+
// Use 'postCreateCommand' to run commands after the container is created.
18+
"postCreateCommand": "pip3 install --user -r requirements.txt -r requirements_test.txt",
19+
20+
// Priviledged mode is necessary to get access to usb
21+
"runArgs": ["--privileged"]
22+
23+
// Configure tool-specific properties.
24+
// "customizations": {},
25+
26+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
27+
//"remoteUser": "root"
28+
}

.vscode/settings.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"python.envFile": "${workspaceFolder}/.env",
3+
"python.testing.pytestArgs": [
4+
"tests"
5+
],
6+
"python.testing.unittestEnabled": false,
7+
"python.testing.nosetestsEnabled": false,
8+
"python.testing.pytestEnabled": true,
9+
"python.pythonPath": "/usr/local/bin/python",
10+
}

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pyusb==1.2.1

requirements_test.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
# Dependencies for running tests.
2-
pytest
3-
pyusb
2+
pyusb==1.2.1
3+
pytest==7.4.3
4+

tests/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)