Skip to content

Commit d88171b

Browse files
committed
Add codespaces
1 parent 4d1c827 commit d88171b

4 files changed

Lines changed: 80 additions & 3 deletions

File tree

.devcontainer/Dockerfile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# [Choice] Python version: 3, 3.8, 3.7, 3.6
2+
ARG VARIANT=3
3+
FROM ghcr.io/zjkmxy/nfd-codespace:0.7.0
4+
5+
# [Optional] If your pip requirements rarely change, uncomment this section to add them to the image.
6+
# COPY requirements.txt /tmp/pip-tmp/
7+
# RUN pip3 --disable-pip-version-check --no-cache-dir install -r /tmp/pip-tmp/requirements.txt \
8+
# && rm -rf /tmp/pip-tmp
9+
10+
# [Optional] Uncomment this section to install additional OS packages.
11+
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
12+
# && apt-get -y install --no-install-recommends <your-package-list-here>
13+
14+
# [Optional] Uncomment this line to install global node packages.
15+
# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g <your-package-here>" 2>&1
16+
17+
RUN pip3 --disable-pip-version-check --no-cache-dir install rstcheck sphinx-rtd-theme sphinx-autodoc-typehints \
18+
&& rm -rf /tmp/pip-tmp
19+
20+
RUN ndnsec-keygen /test | ndnsec-install-cert -

.devcontainer/devcontainer.json

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
{
2+
"name": "Python 3",
3+
"build": {
4+
"dockerfile": "Dockerfile",
5+
"context": "..",
6+
"args": {
7+
// Update 'VARIANT' to pick a Python version: 3, 3.6, 3.7, 3.8
8+
"VARIANT": "3",
9+
// Options
10+
"INSTALL_NODE": "true",
11+
"NODE_VERSION": "lts/*"
12+
}
13+
},
14+
15+
// Set *default* container specific settings.json values on container create.
16+
"settings": {
17+
"terminal.integrated.shell.linux": "/bin/zsh",
18+
"python.pythonPath": "/usr/local/bin/python",
19+
"python.linting.enabled": true,
20+
"python.linting.pylintEnabled": true,
21+
"python.formatting.autopep8Path": "/usr/local/py-utils/bin/autopep8",
22+
"python.formatting.blackPath": "/usr/local/py-utils/bin/black",
23+
"python.formatting.yapfPath": "/usr/local/py-utils/bin/yapf",
24+
"python.linting.banditPath": "/usr/local/py-utils/bin/bandit",
25+
"python.linting.flake8Path": "/usr/local/py-utils/bin/flake8",
26+
"python.linting.mypyPath": "/usr/local/py-utils/bin/mypy",
27+
"python.linting.pycodestylePath": "/usr/local/py-utils/bin/pycodestyle",
28+
"python.linting.pydocstylePath": "/usr/local/py-utils/bin/pydocstyle",
29+
"python.linting.pylintPath": "/usr/local/py-utils/bin/pylint",
30+
31+
"restructuredtext.confPath": "${workspaceFolder}/docs",
32+
"python.testing.pytestArgs": [
33+
"tests"
34+
],
35+
"python.testing.unittestEnabled": false,
36+
"python.testing.nosetestsEnabled": false,
37+
"python.testing.pytestEnabled": true
38+
},
39+
40+
// Add the IDs of extensions you want installed when the container is created.
41+
"extensions": [
42+
"ms-python.python",
43+
"lextudio.restructuredtext"
44+
],
45+
46+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
47+
// "forwardPorts": [],
48+
49+
// Use 'postCreateCommand' to run commands after the container is created.
50+
"postCreateCommand": "pip3 install --user -e .[dev]"
51+
52+
// Uncomment to connect as a non-root user. See https://aka.ms/vscode-remote/containers/non-root.
53+
// "remoteUser": "vscode"
54+
}

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
test:
2-
venv/bin/pytest tests
2+
pytest tests
33

44
test-cov:
5-
venv/bin/pytest tests --cov=src --cov-report term-missing
5+
pytest tests --cov=src --cov-report term-missing
66

77
upload:
88
rm -rf dist

setup.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,8 @@
4646
package_dir={'': 'src'},
4747

4848
install_requires=requirements,
49-
python_requires=">=3.6"
49+
python_requires=">=3.6",
50+
extras_require={
51+
"dev": ["pytest>=5.3.5", "pytest-cov>=2.8.1"],
52+
}
5053
)

0 commit comments

Comments
 (0)