Skip to content

Commit 4f6f35f

Browse files
authored
Merge pull request #7 from turekj/ship_v0.1
Ship v0.1
2 parents e7f15d2 + 5568c6f commit 4f6f35f

File tree

1 file changed

+41
-19
lines changed

1 file changed

+41
-19
lines changed

Diff for: README.md

+41-19
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,29 @@
1+
[![PyPI](https://img.shields.io/pypi/v/danger-python)](https://pypi.org/project/danger-python/)
2+
![Python versions](https://img.shields.io/pypi/pyversions/danger-python)
3+
[![Build Status](https://travis-ci.org/danger/python.svg?branch=master)](https://travis-ci.org/danger/python)
4+
15
# python
26

37
Write your Dangerfiles in Python.
48

59
### Requirements
610

11+
:warning: `danger-python` is currently work in progress. Breaking changes may occur.
12+
713
Running `danger-python` requires:
814

915
* Python 3.7 (tested under Python 3.7.5)
1016
* danger-js 9.2 (tested under danger-js 9.2.10)
1117

1218
### Installation
1319

14-
:warning: The script is currently work in progress. Installation requires:
15-
16-
* Poetry 1.0.2
17-
1820
In order to test the script please run the following commands:
1921

2022
```sh
21-
# install danger
23+
# install danger-js
2224
npm install -g danger
23-
# install poetry
24-
pip install poetry
25-
# install project dependencies
26-
poetry install --no-dev
27-
# activate virtual environment
28-
poetry shell
25+
# install danger-python
26+
pip install danger-python
2927
# run danger-python
3028
danger-python pr https://github.com/microsoft/TypeScript/pull/34806
3129
```
@@ -69,9 +67,38 @@ jobs:
6967
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7068
```
7169
70+
### Using as a CI step (Travis)
71+
72+
1. Create a `dangerfile.py` in the root directory of your repository.
73+
2. Set up the CI to execute the `danger-python` script after the test suite.
74+
75+
Example `.travis.yml` configuration:
76+
77+
```yaml
78+
language: python
79+
python:
80+
- "3.7"
81+
cache:
82+
yarn: true
83+
pip: true
84+
directories:
85+
- node_modules
86+
install:
87+
- pip install poetry
88+
- poetry install
89+
script:
90+
- poetry run pytest
91+
after_script:
92+
- nvm install 10.16.0
93+
- nvm use 10.16.0
94+
- yarn global add danger
95+
- pip install danger-python
96+
- danger-python ci -v
97+
```
98+
7299
### Development
73100

74-
To develop the code, clone the repository and run the following commands:
101+
To develop the `danger-python`, clone the repository and run the following commands:
75102

76103
```sh
77104
# install danger
@@ -95,6 +122,8 @@ python generate_scheme.py
95122

96123
This should update the `danger_python/models.py` file.
97124

125+
: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.
126+
98127
### Building plugins
99128

100129
To build a plugin, add a `danger-python` as a dependency and subclass the `DangerPlugin` class:
@@ -116,10 +145,3 @@ import example_plugin
116145
# calls hello_world method from the plugin class
117146
example_plugin.hello_world()
118147
```
119-
120-
### TODOs
121-
122-
- [x] Parse complete Danger DSL
123-
- [x] Plugin infrastructure
124-
- [ ] Release the initial version of the package
125-

0 commit comments

Comments
 (0)