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:
Avoid modifying the auto-generated files unless necessary.
For template-related changes, consider proposing an issue or a pull request to the project template repository directly.
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:
Supported managers other than
regex
:pep621: The lock file generated by PDM for both dependencies and development dependencies in
pyproject.toml
.github-actions: Actions, runners and containers in GitHub Actions.
gitlabci: Containers in GitLab CI/CD.
pre-commit: Pre-commit hooks.
Regex manager:
Python packages installed with pip, pipx and asdf, listed in the README, DevContainer Dockerfile, GitHub Actions, GitLab CI/CD, ReadTheDocs configuration, Renovate configuration and documentation.
Debian packages installed in the DevContainer Dockerfile.
PDM version specified in the
pdm-project/setup-pdm
GitHub action.NPM packages used with npx.
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 variableRENOVATE_ENABLED_MANAGERS
in GitHub Actions or GitLab CI/CD and configure them in therenovaterc.json
under the root directory if needed.For
regex
managers, add new entries in thecustomManagers
and configurepackageRules
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.