From 1400935a778ac75534764b49a230f70cc0ee9f17 Mon Sep 17 00:00:00 2001 From: Jakub Turek Date: Fri, 14 Feb 2020 11:20:49 +0100 Subject: [PATCH 1/4] Update the README --- README.md | 56 ++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 37 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index a41c4db..9be45df 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +[![Build Status](https://travis-ci.org/danger/python.svg?branch=master)](https://travis-ci.org/danger/python) + # python Write your Dangerfiles in Python. @@ -11,21 +13,13 @@ Running `danger-python` requires: ### Installation -:warning: The script is currently work in progress. Installation requires: - -* Poetry 1.0.2 - In order to test the script please run the following commands: ```sh -# install danger +# install danger-js npm install -g danger -# install poetry -pip install poetry -# install project dependencies -poetry install --no-dev -# activate virtual environment -poetry shell +# install danger-python +pip install danger-python # run danger-python danger-python pr https://github.com/microsoft/TypeScript/pull/34806 ``` @@ -69,9 +63,38 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} ``` +### Using as a CI step (Travis) + +1. Create a `dangerfile.py` in the root directory of your repository. +2. Set up the CI to execute the `danger-python` script after the test suite. + +Example `.travis.yml` configuration: + +```yaml +language: python +python: + - "3.7" +cache: + yarn: true + pip: true + directories: + - node_modules +install: + - pip install poetry + - poetry install +script: + - poetry run pytest +after_script: + - nvm install 10.16.0 + - nvm use 10.16.0 + - yarn global add danger + - pip install danger-python + - danger-python ci -v +``` + ### Development -To develop the code, clone the repository and run the following commands: +To develop the `danger-python`, clone the repository and run the following commands: ```sh # install danger @@ -95,6 +118,8 @@ python generate_scheme.py This should update the `danger_python/models.py` file. +:warning: Please, be careful with the generation script since the `master` branch contains the hand edits to the schema. They are all covered by the test suite, though. + ### Building plugins To build a plugin, add a `danger-python` as a dependency and subclass the `DangerPlugin` class: @@ -116,10 +141,3 @@ import example_plugin # calls hello_world method from the plugin class example_plugin.hello_world() ``` - -### TODOs - -- [x] Parse complete Danger DSL -- [x] Plugin infrastructure -- [ ] Release the initial version of the package - From bba164a45d4f6a61c45119a35ab004802e19684d Mon Sep 17 00:00:00 2001 From: Jakub Turek Date: Fri, 14 Feb 2020 11:26:41 +0100 Subject: [PATCH 2/4] Add WIP note --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 9be45df..aa851ad 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,8 @@ Write your Dangerfiles in Python. ### Requirements +:warning: `danger-python` is currently work in progress. Breaking changes may occur. + Running `danger-python` requires: * Python 3.7 (tested under Python 3.7.5) From 26911af7809d00211074f8405bd0043ed4de4136 Mon Sep 17 00:00:00 2001 From: Jakub Turek Date: Fri, 14 Feb 2020 11:29:52 +0100 Subject: [PATCH 3/4] Add PyPI badge --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index aa851ad..495085b 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ +[![PyPI version](https://badge.fury.io/py/danger-python.svg)](https://pypi.org/project/danger-python/) [![Build Status](https://travis-ci.org/danger/python.svg?branch=master)](https://travis-ci.org/danger/python) # python From 5568c6f0209fecea64aad31763250c9c0e1923a3 Mon Sep 17 00:00:00 2001 From: Jakub Turek Date: Fri, 14 Feb 2020 11:32:33 +0100 Subject: [PATCH 4/4] Update badges --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 495085b..e6a9590 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ -[![PyPI version](https://badge.fury.io/py/danger-python.svg)](https://pypi.org/project/danger-python/) +[![PyPI](https://img.shields.io/pypi/v/danger-python)](https://pypi.org/project/danger-python/) +![Python versions](https://img.shields.io/pypi/pyversions/danger-python) [![Build Status](https://travis-ci.org/danger/python.svg?branch=master)](https://travis-ci.org/danger/python) # python