diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000..9bf4d40d --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,39 @@ +// For format details, see https://containers.dev/implementors/json_reference/ +{ + "name": "Python 3 Developer Container", + "build": { + "dockerfile": "../Dockerfile", + "target": "developer" + }, + "remoteEnv": { + // Allow X11 apps to run inside the container + "DISPLAY": "${localEnv:DISPLAY}", + }, + "customizations": { + "vscode": { + // Add the IDs of extensions you want installed when the container is created. + "extensions": [ + "ms-python.python", + "github.vscode-github-actions", + "tamasfe.even-better-toml", + "redhat.vscode-yaml", + ] + } + }, + "features": { + // Some default things like git config + "ghcr.io/devcontainers/features/common-utils:2": { + "upgradePackages": false + } + }, + "runArgs": [ + // Allow the container to access the host X11 display and EPICS CA + "--net=host", + // Make sure SELinux does not disable with access to host filesystems like tmp + "--security-opt=label=disable" + ], + // Mount the parent as /workspaces so we can pip install peers as editable + "workspaceMount": "source=${localWorkspaceFolder}/..,target=/workspaces,type=bind", + // After the container is created, install the python project in editable form + "postCreateCommand": "pip install -c dev-requirements.txt -e '.[dev]'" +} \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..38092471 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,4 @@ +ARG PYTHON_VERSION=3.11 +FROM python:${PYTHON_VERSION} as developer +RUN python -m venv /venv +ENV PATH=/venv/bin:$PATH \ No newline at end of file diff --git a/ctt.toml b/ctt.toml new file mode 100644 index 00000000..00606579 --- /dev/null +++ b/ctt.toml @@ -0,0 +1,12 @@ +[output."example"] +package_name = "python_copier_template_example" +description = "An expanded python-copier-template with all the options" +git_platform = "github.com" +github_org = "DiamondLightSource" +repo_name = "python-copier-template-example" +distribution_name = "dls-python-copier-template-example" +author_name = "Tom Cobb" +author_email = "tom.cobb@diamond.ac.uk" +component_owner = "group:default/sscc" +docker = true +docs_type = sphinx diff --git a/dev-requirements.txt b/dev-requirements.txt index f1bcb8fb..087ca135 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -1,12 +1,14 @@ # -# This file is autogenerated by pip-compile with Python 3.9 +# This file is autogenerated by pip-compile with Python 3.11 # by the following command: # # pip-compile --extra=dev --no-annotate --output-file=dev-requirements.txt --strip-extras # accessible-pygments==0.0.4 alabaster==0.7.16 +annotated-types==0.6.0 babel==2.14.0 +beartype==0.16.4 beautifulsoup4==4.12.3 build==1.0.3 certifi==2023.11.17 @@ -14,14 +16,20 @@ cfgv==3.4.0 charset-normalizer==3.3.2 click==8.1.7 colorama==0.4.6 +copier==9.1.1 +copier-template-tester==2.1.1 +corallium==0.3.3 +decorator==5.1.1 distlib==0.3.8 docutils==0.20.1 +dunamai==1.19.0 filelock==3.13.1 +funcy==2.0 identify==2.5.33 idna==3.6 imagesize==1.4.1 -importlib-metadata==7.0.1 jinja2==3.1.3 +jinja2-ansible-filters==1.3.2 livereload==2.6.3 markdown-it-py==3.0.0 markupsafe==2.1.4 @@ -31,16 +39,24 @@ myst-parser==2.0.0 nodeenv==1.8.0 packaging==23.2 pathlib2==2.3.7.post1 +pathspec==0.12.1 pip-tools==7.3.0 platformdirs==4.1.0 pluggy==1.3.0 +plumbum==1.8.2 pre-commit==3.6.0 +prompt-toolkit==3.0.36 py==1.11.0 +pydantic==2.5.3 +pydantic-core==2.14.6 pydata-sphinx-theme==0.15.2 pygments==2.17.2 pyproject-hooks==1.0.0 pyyaml==6.0.1 +pyyaml-include==1.3.2 +questionary==2.0.1 requests==2.31.0 +rich==13.7.0 six==1.16.0 snowballstemmer==2.2.0 soupsieve==2.5 @@ -54,15 +70,14 @@ sphinxcontrib-htmlhelp==2.0.5 sphinxcontrib-jsmath==1.0.1 sphinxcontrib-qthelp==1.0.7 sphinxcontrib-serializinghtml==1.1.10 -tomli==2.0.1 tornado==6.4 tox==3.28.0 tox-direct==0.4 typing-extensions==4.9.0 urllib3==2.1.0 virtualenv==20.25.0 +wcwidth==0.2.13 wheel==0.42.0 -zipp==3.17.0 # The following packages are considered to be unsafe in a requirements file: # pip diff --git a/pyproject.toml b/pyproject.toml index 3f78ddfe..05c3c203 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,6 +4,7 @@ version = "0.0" [project.optional-dependencies] dev = [ + "copier-template-tester", "myst-parser", "pip-tools", "pre-commit", @@ -42,4 +43,4 @@ quiet = true # Make output suitable for use as a constraints file strip-extras = true # Remove annotations as coverage source seems to make false positive in CI -no-annotate = true +annotate = false