BC Registries authentication and authorization services.
Follow the instructions of the Development Readme to setup your local development environment.
- Python, Flask
- Postgres - SQLAlchemy, pg8000 & alembic
Fork the repo and submitted a PR with accompanning tests.
Set to use the local repo for the virtual environment
poetry config virtualenvs.in-project trueInstall the dependencies
poetry installConfigure the .env
poetry shellflask db upgradeflask db migrateTo prepare your local database:
- In the root project folder:
docker-compose up -d - In your environment:
poetry run flask db upgradeorflask db upgrade
Note:
[Windows Users] If using WSL, may need to change the host from localhost -> .local EX. in config.py and .env.
[Mac Users] : You might get an error regarding the SSL certificate verification failed. follow the steps to resolve that issue:
- Open the terminal window, and run
python3 -vcommand to check the version of python. - run the following command:
pip install certifi /Applications/Python\ <version of your python>/Install\ Certificates.command
eg: if your python version is 3.7, then, run
pip install certifi /Applications/Python\ 3.7/Install\ Certificates.command
- Start the flask server with
(poetry run flask run) - View the OpenAPI Docs.
- Run
make flake8orflake8 src/auth_api tests. - Run
make pylintorpylint --rcfile=setup.cfg --disable=C0301,W0511 src/auth_api test
- Tests are run from the Status bar at the bottom of the workbench in VS Code or
pytestcommand. - Next run
make coverageto generate the coverage report, which appears in the htmlcov directory.
- Start your local application(s).
- Open postman applicaiton.
- Import the Integration tests environment configrations and fill the values to match your applicaiton.
- Import the integration tests collection.
- Run the collection.
View the document.