See the package documentation for detail on what the package is and how to use it.
If you are migrating a service to DBT PaaS, GOV.UK PaaS to DBT PaaS Migration will also be relevant for you.
-
Clone the repository:
git clone https://github.com/uktrade/copilot-tools.git && cd copilot-tools -
Install the required dependencies:
pip install poetry && poetry install && poetry run pre-commit install
Run poetry run pytest in the root directory to run all tests.
Or, run poetry run tox in the root directory to run all tests for multiple Python versions. See the tox configuration file.
This Dockerfile is used to create a Docker image that supports multiple versions of Python runtimes via pyenv. The tox configuration file determines the Python versions to be tested against.
Add the Python version(s) to Dockerfile.test and tox.ini.
Run docker build -f Dockerfile.test -t alpine/python . to build the image.
For Platform developers, the push commands can be found in AWS ECR.
To publish the Python package dbt-copilot-tools, you will need an API token.
- Acquire API token from Passman.
- Request access from the SRE team.
- Note: You will need access to the
platformgroup in Passman.
- Run
poetry config pypi-token.pypi <token>to add the token to your Poetry configuration.
Update the version, as the same version cannot be published to PyPi.
poetry version patch
More options for the version command can be found in the Poetry documentation. For example, for a minor version bump: poetry version minor.
Build the Python package.
poetry build
Publish the Python package.
Note: Make sure your Pull Request (PR) is approved and contains the version upgrade in pyproject.toml before publishing the package.
poetry publish
Check the PyPi Release history to make sure the package has been updated.
For an optional manual check, install the package locally and test everything works as expected.