Template and Dependency Update

Template update

To update the project template, thanks to the update feature provided by Copier and the regex manager provided by Renovate, a pull request will be automatically created when a new version of the template is released. In most cases, Copier will update the project seamlessly. If conflicts arise, they can be resolved manually since everything is version-controlled by Git.

Tips to minimize potential conflicts

To minimize potential conflicts, consider the following suggestions:

  1. Avoid modifying the auto-generated files unless necessary.

  2. For template-related changes, consider proposing an issue or a pull request to the project template repository directly.

  3. For project-specific changes, adopt an inheritance or extension approach to minimize modifications to auto-generated content.

Dependency update

With the integration of Renovate, all dependencies, including those used for development and CI/CD, will be automatically updated via pull requests whenever a new version is released. This allows us to focus solely on testing to ensure the new versions do not break anything. Moreover, an issue titled “Dependency Dashboard” will be created, so that you can have an overview of the state of all dependencies.

Managed dependency types

The project template tracks the following dependencies:

  1. Supported managers other than regex:

    1. pep621: The lock file generated by PDM for both dependencies and development dependencies in pyproject.toml.

    2. github-actions: Actions, runners and containers in GitHub Actions.

    3. gitlabci: Containers in GitLab CI/CD.

    4. pre-commit: Pre-commit hooks.

  2. Regex manager:

    1. Python packages installed with pip/pipx, listed in the README, DevContainer Dockerfile, GitHub Actions, GitLab CI/CD, ReadTheDocs configuration, Renovate configuration and documentation.

    2. Debian packages installed in the DevContainer Dockerfile.

    3. PDM version specified in the pdm-project/setup-pdm GitHub action.

    4. PDM version specified in the renovate constraints.

    5. NPM packages used with npx.

    6. The project template itself.

Add new dependencies

When adding new dependencies that belong to the managed dependency type mentioned above, it is recommended to pin or lock their versions to ensure they are smoothly managed by Renovate.

When adding new types of dependencies, it is also recommended to manage them with Renovate.

  • If this follows a common pattern, consider creating an issue or even sending a pull request to project template directly.

  • If it is project-specific, you can extend the renovate configuration:

    • For supported managers other than regex, add them in the Renovate configuration using environment variable RENOVATE_ENABLED_MANAGERS in GitHub Actions or GitLab CI/CD and configure them in the renovaterc.json under the root directory if needed.

    • For regex managers, add new entries in the customManagers and configure packageRules if needed in the .renovaterc.json.

    Note

    This also adheres to the Tips to minimize potential conflicts.

Note

For the complete list of supported managers and their corresponding configurations, please refer to the Managers - Renovate Docs.