diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index e0d0e2e..2c41d41 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,39 +1,24 @@ // For format details, see https://aka.ms/devcontainer.json. For config options, see the // README at: https://github.com/devcontainers/templates/tree/main/src/python { - "name": "Python 3", + "name": "speckle-automate-basic-clash-demo", // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile - "image": "mcr.microsoft.com/devcontainers/python:1-3.11-bullseye", - "features": { - "ghcr.io/devcontainers-contrib/features/poetry:2": {} - }, - - "remoteEnv": { - "SPECKLE_TOKEN": "foobar" - }, - "containerEnv": { - "SPECKLE_TOKEN": "asdfasdf" - }, - - // 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": [], + "dockerFile": "../Dockerfile", // Use 'postCreateCommand' to run commands after the container is created. - "postCreateCommand": "cp .env.example .env && POETRY_VIRTUALENVS_IN_PROJECT=true poetry install --no-root", + // "postCreateCommand": "poetry install --no-root", // Configure tool-specific properties. "customizations": { "vscode": { // Add the IDs of extensions you want installed when the container is created. "extensions": [ - "ms-python.vscode-pylance", "ms-python.python", - "ms-python.black-formatter", + "mikestead.dotenv", "streetsidesoftware.code-spell-checker", - "mikestead.dotenv" + "ms-python.vscode-pylance", + "ms-python.black-formatter", + "charliermarsh.ruff" ] } } diff --git a/.env.example b/.env.example deleted file mode 100644 index 49ec7c6..0000000 --- a/.env.example +++ /dev/null @@ -1 +0,0 @@ -SPECKLE_TOKEN=mytoken \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index ff7ca25..42f456d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,16 +1,10 @@ -# We use the official Python 3.11 image as our base image and will add our code to it. For more details, see https://hub.docker.com/_/python -FROM python:3.11-slim +# We use a pymesh base image build with an acceptable python and will add our code to it. For more details, see https://hub.docker.com/_/python +FROM topologicalhurt/pymesh-3.10:v1.1 # We install poetry to generate a list of dependencies which will be required by our application RUN pip install poetry -# We set the working directory to be the /home/speckle directory; all of our files will be copied here. -WORKDIR /home/speckle - -# Copy all of our code and assets from the local directory into the /home/speckle directory of the container. -# We also ensure that the user 'speckle' owns these files, so it can access them -# This assumes that the Dockerfile is in the same directory as the rest of the code -COPY . /home/speckle +COPY . . # Using poetry, we generate a list of requirements, save them to requirements.txt, and then use pip to install them -RUN poetry export --format requirements.txt --output /home/speckle/requirements.txt && pip install --requirement /home/speckle/requirements.txt +RUN poetry install diff --git a/pyproject.toml b/pyproject.toml index 91ad19a..2a2fe65 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,13 +1,12 @@ [tool.poetry] -name = "speckle-automate-py" +name = "speckle-automate-basic-clash-demo" version = "0.1.0" -description = "Example function for Speckle Automate using specklepy" -authors = ["GergΕ‘ Jedlicska "] +description = "Example function for Speckle Automate using specklepy and PyMesh" +authors = ["Jonathon Broughton "] readme = "README.md" -packages = [{include = "src/speckle_automate_py"}] [tool.poetry.dependencies] -python = "^3.11" +python = "^3.10" specklepy = "2.17.8" [tool.poetry.group.dev.dependencies] @@ -15,7 +14,6 @@ black = "^23.3.0" mypy = "^1.3.0" ruff = "^0.0.271" pytest = "^7.4.2" -# specklepy = {path = "../specklepy", develop = true} [build-system] requires = ["poetry-core"] diff --git a/speckle-automate-basic-clash-demo.code-workspace b/speckle-automate-basic-clash-demo.code-workspace new file mode 100644 index 0000000..d0b6d11 --- /dev/null +++ b/speckle-automate-basic-clash-demo.code-workspace @@ -0,0 +1,25 @@ +{ + "folders": [ + { + "path": ".", + "name": "πŸ§‘πŸ»β€πŸ’» src", + "workspaceFolder": true + }, + { + "name": "🐍 PyMesh Docs", + "path": "../../root/PyMesh/docs" + } + ], + "settings": { + "cSpell.words": [ + "charliermarsh", + "mikestead", + "pydantic", + "pylance", + "Pymesh", + "recolorized", + "Revit", + "specklepy" + ] + } +} \ No newline at end of file diff --git a/tests/conftest.py b/tests/conftest.py new file mode 100644 index 0000000..e69de29