From 170de0c6591bff3c891589c1a5daa4eb10d217b9 Mon Sep 17 00:00:00 2001 From: Karthik Nadig Date: Mon, 1 Oct 2018 18:16:04 -0700 Subject: [PATCH] Updating contribution details (#860) * Add codeofconduct and contributing md files * Updating contribution details * Addressing comments. * Some tweaks --- CODE_OF_CONDUCT.md | 6 ++++ CONTRIBUTING.md | 67 +++++++++++++++++++++++++++++++++++++++++++ README.md | 16 ++--------- test_requirements.txt | 7 +++++ 4 files changed, 82 insertions(+), 14 deletions(-) create mode 100644 CODE_OF_CONDUCT.md create mode 100644 CONTRIBUTING.md create mode 100644 test_requirements.txt diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 00000000..18873b3c --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,6 @@ +This project has adopted the [Microsoft Open Source Code of +Conduct](https://opensource.microsoft.com/codeofconduct/). +For more information see the [Code of Conduct +FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or +contact [opencode@microsoft.com](mailto:opencode@microsoft.com) +with any additional questions or comments. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..e10d37b8 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,67 @@ +# Contributing to `ptvsd` + +[![Build Status](https://ptvsd.visualstudio.com/_apis/public/build/definitions/557bd35a-f98d-4c49-9bc9-c7d548f78e4d/1/badge)](https://ptvsd.visualstudio.com/ptvsd/ptvsd%20Team/_build/index?definitionId=1) +[![Build Status](https://travis-ci.org/Microsoft/ptvsd.svg?branch=master)](https://travis-ci.org/Microsoft/ptvsd) +[![GitHub](https://img.shields.io/badge/license-MIT-brightgreen.svg)](https://raw.githubusercontent.com/Microsoft/ptvsd/master/LICENSE) +[![PyPI](https://img.shields.io/pypi/v/ptvsd.svg)](https://pypi.org/project/ptvsd/) + + +## Contributing a pull request +This project welcomes contributions and suggestions. Most contributions require you to agree to a +Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us +the rights to use your contribution. For details, visit https://cla.microsoft.com. + +When you submit a pull request, a CLA-bot will automatically determine whether you need to provide +a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions +provided by the bot. You will only need to do this once across all repos using our CLA. + +### Prerequisites +Use [test_requirements.txt](test_requirements.txt) file to install the packages needed to run tests: +```console +pip install -r test_requirements.txt +``` + +### Linting +We use `flake8` for linting, and the settings can be found here [flake8](flake8) + +### Formatting +This is optional. Use the following settings for `autopep8` or equivalent settings with the formatter of your choice: +VSC Python settings for formating: +```json +"python.formatting.provider": "autopep8", +"python.formatting.autopep8Args": [ + "--ignore", "E24,E121,E123,E125,E126,E221,E226,E266,E704,E265,E722,E501,E731,E306,E401,E302,E222" +], +``` + +### Running Tests +Set `PYTHONPATH` environment variable to the ptvsd root directory. In this example, we `git clone` ptvsd and use the directory to run tests +#### Windows +``` +C:\> git clone https://github.com/Microsoft/ptvsd +C:\> cd ptvsd +C:\ptvsd> py -3.7 -m tests -v +``` +#### Linux\Mac +``` +~: git clone https://github.com/Microsoft/ptvsd +~: cd ptvsd +~/ptvsd: python3 -m tests -v +``` + +### Debug in VSC using development version +Set `PYTHONPATH` to point to cloned version of ptvsd, in `launch.json`, to debug any python project to test the debugger you are working on: +```json +{ + "name": "Terminal (integrated)", + "type": "python", + "request": "launch", + "pythonPath": "${config:python.pythonPath}", + "program": "${file}", + "cwd": "${workspaceFolder}", + "console": "integratedTerminal", + "env": {"PYTHONPATH":"C:\\GIT\\ptvsd"}, + "envFile": "${workspaceFolder}/.env", + "internalConsoleOptions": "neverOpen", +}, +``` diff --git a/README.md b/README.md index 765e8760..b57cde0b 100644 --- a/README.md +++ b/README.md @@ -2,20 +2,8 @@ [![Build Status](https://ptvsd.visualstudio.com/_apis/public/build/definitions/557bd35a-f98d-4c49-9bc9-c7d548f78e4d/1/badge)](https://ptvsd.visualstudio.com/ptvsd/ptvsd%20Team/_build/index?definitionId=1) [![Build Status](https://travis-ci.org/Microsoft/ptvsd.svg?branch=master)](https://travis-ci.org/Microsoft/ptvsd) - -## Contributing - -This project welcomes contributions and suggestions. Most contributions require you to agree to a -Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us -the rights to use your contribution. For details, visit https://cla.microsoft.com. - -When you submit a pull request, a CLA-bot will automatically determine whether you need to provide -a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions -provided by the bot. You will only need to do this once across all repos using our CLA. - -This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). -For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or -contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. +[![GitHub](https://img.shields.io/badge/license-MIT-brightgreen.svg)](https://raw.githubusercontent.com/Microsoft/ptvsd/master/LICENSE) +[![PyPI](https://img.shields.io/pypi/v/ptvsd.svg)](https://pypi.org/project/ptvsd/) ## `ptvsd` CLI Usage ### Debug a script file diff --git a/test_requirements.txt b/test_requirements.txt new file mode 100644 index 00000000..79b5b545 --- /dev/null +++ b/test_requirements.txt @@ -0,0 +1,7 @@ +setuptools +coverage +requests +flask +django +pytest +pytest-timeout