diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..a2df70ee --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,10 @@ +repos: +- repo: https://github.com/psf/black + rev: 22.3.0 # Use the latest stable version of Black + hooks: + - id: black + args: [--line-length=88] # Adjust line length as needed +- repo: https://github.com/pycqa/flake8 + rev: 7.2.0 # pick a git hash / tag to point to + hooks: + - id: flake8 \ No newline at end of file diff --git a/dev_dependencies.txt b/dev_dependencies.txt index a90a4dcd..f1e775ef 100644 --- a/dev_dependencies.txt +++ b/dev_dependencies.txt @@ -1,3 +1,4 @@ pytest pytest-asyncio -pytest-mock \ No newline at end of file +pytest-mock +pre-commit \ No newline at end of file diff --git a/scripts/README.md b/scripts/README.md new file mode 100644 index 00000000..9b60c37c --- /dev/null +++ b/scripts/README.md @@ -0,0 +1,63 @@ +# Scripts + +This folder contains helpful scripts for development. + +## Development Setup Scripts + +Both of these scripts will create a Python environment based on the default version of `python` in your PATH. Ensure the version is at least 3.9 by running: + +```bash +python --version +``` + +The virtual environment, by default, will created as a directory named `venv` that will be placed at the root of this project. + +### Windows + +Powershell needs to be set to allow running of scripts. Do this by opening PowerShell in admin mode and running: + +```bash +Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser +``` + +Then, from the root directory, run: + +```bash +. ./scripts/dev_setup.ps1 +``` + +From the root of the project, you can activate the environment: + +```bash +. ./venv/Scripts/activate +``` + +To deactivate: + +```bash +deactivate +``` + +### Linux and macOS + +From the root directory, run: + +```bash +. ./scripts/dev_setup.sh +``` + +From the root of the project, you can activate the environment: + +```bash +. ./venv/bin/activate +``` + +To deactivate: + +```bash +deactivate +``` + +## Troubleshooting + +If you encounter any issues, please create an issue on GitHub. \ No newline at end of file diff --git a/scripts/dev_setup.ps1 b/scripts/dev_setup.ps1 new file mode 100644 index 00000000..bd603070 --- /dev/null +++ b/scripts/dev_setup.ps1 @@ -0,0 +1,16 @@ +python -m venv venv + +. .\venv\Scripts\Activate.ps1 + +pip install -e ./libraries/microsoft-agents-activity/ --config-settings editable_mode=compat +pip install -e ./libraries/microsoft-agents-authentication-msal/ --config-settings editable_mode=compat +pip install -e ./libraries/microsoft-agents-copilotstudio-client/ --config-settings editable_mode=compat +pip install -e ./libraries/microsoft-agents-hosting-aiohttp/ --config-settings editable_mode=compat +pip install -e ./libraries/microsoft-agents-hosting-core/ --config-settings editable_mode=compat +pip install -e ./libraries/microsoft-agents-hosting-teams/ --config-settings editable_mode=compat +pip install -e ./libraries/microsoft-agents-storage-blob/ --config-settings editable_mode=compat +pip install -e ./libraries/microsoft-agents-storage-cosmos/ --config-settings editable_mode=compat + +pip install -r dev_dependencies.txt + +pre-commit install \ No newline at end of file diff --git a/scripts/dev_setup.sh b/scripts/dev_setup.sh new file mode 100644 index 00000000..8d08fc20 --- /dev/null +++ b/scripts/dev_setup.sh @@ -0,0 +1,16 @@ +python -m venv venv + +. .\venv\bin\activate + +pip install -e ./libraries/microsoft-agents-activity/ --config-settings editable_mode=compat +pip install -e ./libraries/microsoft-agents-authentication-msal/ --config-settings editable_mode=compat +pip install -e ./libraries/microsoft-agents-copilotstudio-client/ --config-settings editable_mode=compat +pip install -e ./libraries/microsoft-agents-hosting-aiohttp/ --config-settings editable_mode=compat +pip install -e ./libraries/microsoft-agents-hosting-core/ --config-settings editable_mode=compat +pip install -e ./libraries/microsoft-agents-hosting-teams/ --config-settings editable_mode=compat +pip install -e ./libraries/microsoft-agents-storage-blob/ --config-settings editable_mode=compat +pip install -e ./libraries/microsoft-agents-storage-cosmos/ --config-settings editable_mode=compat + +pip install -r dev_dependencies.txt + +pre-commit install \ No newline at end of file