BC Registries authentication and authorization services.
Follow the instructions of the Development Readme to setup your local development environment.
- Python, Flask
- Postgres - SQLAlchemy, psycopg2-binary & 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 true
Install the dependencies
poetry install
Configure the .env
poetry shell
flask db upgrade
flask db migrate
To prepare your local database:
- In the root project folder:
docker-compose up -d
- In your environment:
poetry run flask db upgrade
orflask 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 -v
command 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 flake8
orflake8 src/auth_api tests
. - Run
make pylint
orpylint --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
pytest
command. - Next run
make coverage
to 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.