diff --git a/hasher-matcher-actioner/.devcontainer/devcontainer.json b/hasher-matcher-actioner/.devcontainer/devcontainer.json index cfede72ec..635a8172a 100644 --- a/hasher-matcher-actioner/.devcontainer/devcontainer.json +++ b/hasher-matcher-actioner/.devcontainer/devcontainer.json @@ -43,10 +43,10 @@ } }, "remoteUser": "vscode", - "postCreateCommand": "pip install --editable .[all]", "mounts": [ "source=python-threatexchange-cmdhistory,target=/commandhistory,type=volume", "source=${localEnv:HOME}${localEnv:USERPROFILE},target=/host-home-folder,type=bind,consistency=cached" ], + "postCreateCommand": "/workspace/.devcontainer/postcreate.sh", "postAttachCommand": "/workspace/.devcontainer/startup.sh" } \ No newline at end of file diff --git a/hasher-matcher-actioner/.devcontainer/postcreate.sh b/hasher-matcher-actioner/.devcontainer/postcreate.sh new file mode 100755 index 000000000..ad6b20069 --- /dev/null +++ b/hasher-matcher-actioner/.devcontainer/postcreate.sh @@ -0,0 +1,11 @@ +#!/bin/bash +set -e + +pip install --editable .[all] + +# Find Python packages in opt and install them +for setup_script in "$(find /workspace/opt -name setup.py)" +do + module_dir="$(dirname "$setup_script")" + pip install --editable "$module_dir" +done diff --git a/hasher-matcher-actioner/extensions/.gitignore b/hasher-matcher-actioner/extensions/.gitignore new file mode 100644 index 000000000..72e8ffc0d --- /dev/null +++ b/hasher-matcher-actioner/extensions/.gitignore @@ -0,0 +1 @@ +* diff --git a/hasher-matcher-actioner/extensions/README.md b/hasher-matcher-actioner/extensions/README.md new file mode 100644 index 000000000..533f7a452 --- /dev/null +++ b/hasher-matcher-actioner/extensions/README.md @@ -0,0 +1,3 @@ +# Optional Packages + +Drop any Python packages here which you need to be installed to the container but which can not be added to the `pyproject.toml`, e.g. proprietary extensions.