|
| 1 | +Migrating Legacy Projects |
| 2 | +========================= |
| 3 | + |
| 4 | +Migrating old projects to a new project setup and the :code:`python-toolbox` can be tedious and annoying. This guide will try to provide some basic steps and guidance to simplify this process. |
| 5 | + |
| 6 | +.. _before_you_migrate: |
| 7 | + |
| 8 | +What a Project Should Have Before You Migrate |
| 9 | ++++++++++++++++++++++++++++++++++++++++++++++ |
| 10 | + |
| 11 | +* The project configuration should be :code:`pyproject.toml` based. **[Required]** |
| 12 | +* The project should be :code:`poetry` based. **[Required]** |
| 13 | +* Dependencies should point only to officially published dependencies on PyPI (no git references or similar) **[Required]**. |
| 14 | +* The project documentation should be :code:`sphinx` based **[Required]**. |
| 15 | +* Automated tasks within the project should be available as Python code or `Nox`_ tasks. **[Helpful]** |
| 16 | + |
| 17 | + |
| 18 | +Iterative Migration Guide |
| 19 | +++++++++++++++++++++++++++ |
| 20 | + |
| 21 | +Ensure you comply with the basic requirements for your project. Follow these steps for a smooth migration process. |
| 22 | + |
| 23 | +1. Introduce Nox |
| 24 | +---------------- |
| 25 | +As a first step, it is generally advisable to introduce `Nox`_ as a task runner if it is not already in use. Since the :code:`python-toolbox` uses `Nox`_ as its foundation, this simplifies the migration to the toolbox and enhances the user's understanding of `Nox`_. |
| 26 | + |
| 27 | +2. Introduce Python-Toolbox Nox Tasks |
| 28 | +------------------------------------- |
| 29 | +This can be done incrementally for different checks of your project, such as linting, typing, documentation, and other tasks. |
| 30 | + |
| 31 | +.. note:: |
| 32 | + If test execution isn't performed in the standard way (e.g., :code:`pytest test/unit`, :code:`pytest test/integration`, :code:`pytest test`), you will need to overwrite the test-specific Nox tasks and will not be able to use the default ones. |
| 33 | + |
| 34 | +3. Establish a Baseline |
| 35 | +----------------------- |
| 36 | +Configure code quality and settings in the :code:`pyproject.toml` and establish a baseline for your project. If necessary, create tickets for further improvements, especially if major parts of your code need suppression, e.g., in the mypy configuration. |
| 37 | + |
| 38 | +4. Introduce GitHub Workflows |
| 39 | +----------------------------- |
| 40 | +Install the GitHub workflow provided by the :code:`python-toolbox` for futher details refer to the section :ref:`GitHub Workflows`. |
| 41 | + |
| 42 | +.. attention:: |
| 43 | + This is just guidance. If you have a good understanding of the standard project setup, technologies, and tools used, feel free to diverge at any point or exercise your own judgment. |
| 44 | + |
| 45 | +.. _Nox: https://github.com/exasol/python-toolbox/pull/289 |
0 commit comments