Skip to content

Integration with existing projects

Make sure you went over features section before diving right in!

While py-template is best suited as a base for new projects, you can also integrate with existing ones (unfortunately not as easily).

General guidelines

Steps below should be performed in addition to setup steps!

You might want to initialize an empty "dummy" repo to have initialized elements to choose from

While the steps are not as straightforward, a rough guideline could be summarized as:

  • Move your code to /src/<project_name> (keep _version.py and import it in a similar fashion to __init__.py )
  • Move your tests to tests folder (given they use pytest)
  • Copy whole .github folder as-is (keep in mind you might have to perform a few manual adjustments depending on your project)
  • Copy pyproject.toml and specify your dependencies/optional dependencies in appropriate sections under [tool.poetry.dependencies] and commit poetry.lock after you do that!
  • Copy gen_ref_pages.py to /docs folder (automated documentation creation)
  • Copy renovate.json and enable renovate bot (unless you have one already setup)
  • Copy .yamllint.yml (unless you have one already setup)
  • Copy .gitignore (unless you have one already setup)
  • Copy .editorconfig (unless you have one already setup)

Feel free to open an Issue with your repository and a short description of desired effect and we will try to help you with the adjustment process!