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.pyand import it in a similar fashion to__init__.py) - Move your
teststotestsfolder (given they usepytest) - Copy whole
.githubfolder as-is (keep in mind you might have to perform a few manual adjustments depending on your project) - Copy
pyproject.tomland specify your dependencies/optional dependencies in appropriate sections under[tool.poetry.dependencies]and commitpoetry.lockafter you do that! - Copy
gen_ref_pages.pyto/docsfolder (automated documentation creation) - Copy
renovate.jsonand 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!