Template for an ADS microservice project.
-
From the main template repository page, click the "Use This Template" button located above the file list. From the dropdown menu, select "Create a new repository".
-
Name the new repository and add a description. Change the new repository owner and/or permissions as necessary.
Naming convention: The repository name should end with
_service
, e.g.reference_service
,metrics_service
. -
Update this README file: remove this instructions section and update the contents:
- Replace instances of
<repo_name>
and<package_name>
, including within the CI status badge - Update stub text (e.g. microservice name, description, maintainers, etc.)
- Replace instances of
-
Rename the directory
package_name
.Naming convention: The package name should be a shortened form of the repository name.
-
Edit the
pyproject.toml
file:- Replace
<repo_name>
and<package_name>
- In the
[project]
section, replace fields as indicated (i.e. name, description, author info) - Dependencies go here, instead of in
requirements.txt
anddev-requirements.txt
files
- Replace
-
Microservice code goes into the
package_name
directory. There's atests
sub-directory in there for your unittests.
The new project will have these:
- Uses
pyproject.toml
for dependencies (note: older ADS microservices may still userequirements.txt
anddev-requirements.txt
for dependencies) - Provides
setup.py
- Testing with Pytest (locally and using Github actions)
- Follows the black style guide with flake8 and isort
- Style guide enforced on CI
Add a description of the project here.
Install this via pip (or your favourite package manager):
pip install package_name
Install locally into virtualenv.
virtualenv .venv
source .venv/bin/activate
pip install .[dev]
pip install .
pre-commit install
pre-commit install --hook-type commit-msg
Dev 1, dev 2