|
| 1 | +.. _local-development-environment: |
| 2 | + |
| 3 | +=============================== |
| 4 | + Local Development Environment |
| 5 | +=============================== |
| 6 | + |
| 7 | +:Release: |version| |
| 8 | +:Date: |today| |
| 9 | + |
| 10 | +.. contents:: |
| 11 | + :local: |
| 12 | + :depth: 2 |
| 13 | + |
| 14 | +Cloning the Repository |
| 15 | +====================== |
| 16 | + |
| 17 | +Clone the repository from GitHub: https://github.com/celery/pytest-celery |
| 18 | + |
| 19 | +**Https**:: |
| 20 | + |
| 21 | + https://github.com/celery/pytest-celery.git |
| 22 | + |
| 23 | +**SSH**:: |
| 24 | + |
| 25 | + [email protected]:celery/pytest-celery.git |
| 26 | + |
| 27 | +**GitHub CLI**:: |
| 28 | + |
| 29 | + gh repo clone celery/pytest-celery |
| 30 | + |
| 31 | +Using Poetry |
| 32 | +============ |
| 33 | + |
| 34 | +The plugin uses `Poetry <https://python-poetry.org/>`_ for dependency management. |
| 35 | + |
| 36 | +To install the development dependencies, run the following command in your desired virtual environment:: |
| 37 | + |
| 38 | + poetry install -E "all" --with test,dev,ci,docs |
| 39 | + |
| 40 | +.. tip:: |
| 41 | + |
| 42 | + During development of the dependencies themselves, you can use the following snippet for easy cleanup & reinstallation of the dependencies:: |
| 43 | + |
| 44 | + pip uninstall pytest-celery celery -y && pip freeze | cut -d "@" -f1 | xargs pip uninstall -y;\ |
| 45 | + pip install -U pip ipython;\ |
| 46 | + poetry install -E "all" --with test,dev,ci,docs |
| 47 | + |
| 48 | +Debugging with VSCode |
| 49 | +===================== |
| 50 | + |
| 51 | +Create a ``.vscode`` directory with the following ``launch.json`` file that can be used to for debugging. |
| 52 | + |
| 53 | +.. note:: |
| 54 | + |
| 55 | + Take note of ``"justMyCode": false`` |
| 56 | + |
| 57 | +.. code-block:: json |
| 58 | +
|
| 59 | + { |
| 60 | + // Use IntelliSense to learn about possible attributes. |
| 61 | + // Hover to view descriptions of existing attributes. |
| 62 | + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 |
| 63 | + "version": "0.2.0", |
| 64 | + "configurations": [ |
| 65 | + { |
| 66 | + "name": "Python: Debug Tests", |
| 67 | + "type": "python", |
| 68 | + "request": "launch", |
| 69 | + "program": "${file}", |
| 70 | + "purpose": [ |
| 71 | + "debug-test", |
| 72 | + ], |
| 73 | + "console": "integratedTerminal", |
| 74 | + "justMyCode": false, |
| 75 | + "presentation": { |
| 76 | + "hidden": true |
| 77 | + }, |
| 78 | + // Disable cov to allow breakpoints when launched from VS Code Python |
| 79 | + "env": { |
| 80 | + "PYTHONUNBUFFERED": "1", |
| 81 | + "PYTHONDONTWRITEBYTECODE": "1", |
| 82 | + "PYTEST_ADDOPTS": "--no-cov --exitfirst" |
| 83 | + }, |
| 84 | + "stopOnEntry": false, |
| 85 | + "showReturnValue": true, |
| 86 | + "redirectOutput": true |
| 87 | + } |
| 88 | + ] |
| 89 | + } |
0 commit comments