This package uses cookiecutter to facilitate the creation of MarketPlace applications. For more information on what applications are and other related concepts, refer to the MarketPlace documentation
Carry out the following steps to create your own application with MarketPlace:
First, install cookiecutter if it is not already in your system. We recommend using a virtual environment or a environment manager like conda.
pip install cookiecutterNow you can create the application without having to clone the repository
cookiecutter https://github.com/materials-marketplace/get-started-app.gitYou will be prompted to answer the questions needed to create the app.
The first step to create your own version of the app is to modify the app.py file to support the paths your app requires.
These capabilities should be matched in the openAPI.yml file, and mapped to a MarketPlace capability.
The application can now be deployed and registered. Refer to the application's README for a detailed explanation.
A basic pre-commit-config.yaml file for pre-commit has been created for the application.
You can use it to run sanity checks before each commit.
Set it up via:
pip install pre-commit
pre-commit installThe pre-commit hooks will now be automatically run before every commit. To run them explicitly, use the command:
pre-commit run --all-filesDepending on the chosen platform to host your code (e.g. GitHub or GitLab), your CI scripts will follow a different format.
However, we recommend to at least run the pre-commit hooks there, to ensure a minimum of consistence.
For GitHub, the job would look something like:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run pre-commit
run: |
pip install pre-commit
pre-commit install
pre-commit run --all-filesFor GitLab:
stages:
- code_analysis
pre-commit:
stage: code_analysis
script:
- pip install pre-commit
- pre-commit install
- pre-commit run --all-filesNote that these steps could be optimised if ran on a platform with pre-commit installed.