You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

env.rst 3.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. Setting Up a Build/Development Environment
  2. ##########################################
  3. While ``dds`` is able to build itself, several aspects of build infrastructure
  4. are controlled via Python scripts. You will need Python 3.6 or later available
  5. on your system to get started.
  6. .. _Poetry: python-poetry.org
  7. Getting Started with *Poetry*
  8. *****************************
  9. ``dds`` CI runs atop `Poetry`_, a Python project management tool. While designed
  10. for Python projects, it serves our purposes well.
  11. Installing Poetry
  12. =================
  13. If you do not have Poetry already installed, it can be obtained easily for most
  14. any platform.
  15. `Refer to the Poetry "Installation" documentation to learn how to get Poetry on your platform <https://python-poetry.org/docs/#installation>`_.
  16. The remainder of this documentation will assume you are able to execute
  17. ``poetry`` on your command-line.
  18. Setting Up the Environment
  19. ==========================
  20. To set up the scripts and Python dependencies required for CI and development,
  21. simply execute the following command from within the root directory of the
  22. project::
  23. $ poetry install
  24. Poetry will then create a Python virtual environment that contains the Python
  25. scripts and tools required for building and developing ``dds``.
  26. The Python virtual environment that Poetry created can be inspected using
  27. ``poetry env info``, and can be deleted from the system using
  28. ``poetry env remove``. Refer to
  29. `the Poetry documentation <https://python-poetry.org/docs>`_ for more
  30. information about using Poetry.
  31. Using the Poetry Environment
  32. ****************************
  33. Once the ``poetry install`` command has been executed, you will now be ready to
  34. run the ``dds`` CI scripts and tools.
  35. The scripts are installed into the virtual environment, and need not be globally
  36. installed anywhere else on the system. You can only access these scripts by
  37. going through Poetry. To run any individual command within the virtual
  38. environment, use ``poetry run``::
  39. $ poetry run <some-command>
  40. This will load the virtual environment, execute ``<some-command>``, then exit
  41. the environment. This is useful for running CI scripts from outside of the
  42. virtualenv.
  43. **Alternatively**, the environment can be loaded persistently into a shell
  44. session by using ``poetry shell``::
  45. $ poetry shell
  46. This will spawn a new interactive shell process with the virtual environment
  47. loaded, and you can now run any CI or development script without needing to
  48. prefix them with ``poetry run``.
  49. Going forward, the documentation will assume you have the environment loaded
  50. as-if by ``poetry shell``, but any ``dds``-CI-specific command can also be
  51. executed by prefixing the command with ``poetry run``.
  52. Working With an MSVC Environment in VSCode
  53. ==========================================
  54. If you use Visual Studio Code as your editor and MSVC as your C++ toolchain,
  55. you'll need to load the MSVC environment as part of your build task. ``dds`` CI
  56. has a script designed for this purpose. To use it, first load up a shell within
  57. the Visual C++ environment, then, from within the previously create Poetry
  58. environment, run ``gen-msvs-vsc-task``. This program will emit a Visual Studio
  59. Code JSON build task that builds ``dds`` and also contains the environment
  60. variables required for the MSVC toolchain to compile and link programs. You can
  61. save this JSON task into ``.vscode/tasks.json`` to use as your primary build
  62. task while hacking on ``dds``.