This repository contains the Pano Data Tool. This tool allows you to create & maintain your Panoramic data models. It is built with Python 3.7+ and can be installed via PyPI or other similar tools.
To install the CLI, use pip
or pipenv
:
$ pip install -U pano
Once you install the tool, you can call it using pano
on the command line. For more information, run pano
with no commands to see the help information:
Usage: pano [OPTIONS] COMMAND [ARGS]...
Options:
--debug Enables debug mode
--version Show the version and exit.
-h, --help Show this message and exit.
Commands:
detect-joins Detect joins under a dataset
field Commands on local field files.
init Initialize metadata repository
scan Scan remote database and generates models for found objects
validate Validate local files
See docs folder for more extensive documentation.
To release a new version of the library, follow these steps:
- In your PR, update version in __version__.py and add entry to CHANGELOG.md
- After merge, tag the commit with version number from setup.py. For example
git tag v0.1.1
. - Once the tag is pushed, it will trigger a build with GitHub Actions, which will publish the new version on PyPI and create a release on GitHub.
Add python virtual environment using python venv (adds .venv
inside current directory):
> python3 -m venv .venv
Then, you can switch to it from command-line using following command:
> source .venv/bin/activate
Alternatively if you use pyenv and pyenv-virtualenv, you can create virtual environment using:
> pyenv virtualenv pano-cli
And use the created virtual environment:
> pyenv local pano-cli
Use following command to install dependencies (make sure you have correct python environment active):
> make install
Now you should have pano
package available. First create config. You need to ask friendly SRE Team Member for OAuth credentials for yourself.
> pano configure
And finally you are ready to use pano
. You can find all commands in help:
> pano -h
Use following command to run all tests:
> make test
Use following command to run all other checks:
> make lint
Capture expectations for tests by setting environment variable APP_WRITE_EXPECTATIONS=true
.
You can install pre-commit. It is useful to avoid commiting code that doesn't pass the linter. It installs git hooks that run pre-commit.
> make pre-commit-install
Documentation under docs folder can be generated by running
> make docs
You can use following debug config to run pano cli using VSCode debugger:
{
"name": "Python: Pano CLI Scan",
"type": "python",
"request": "launch",
"module": "panoramic.cli",
"args": ["scan", "testsource"]
}