@@ -20,52 +20,73 @@ slack](https://bit.ly/join-vega-slack).
20
20
21
21
### Setting Up Your Environment
22
22
23
- Install the latest version of Altair locally using
24
- ```
25
- $ pip install git+https://github.com/altair-viz/altair/
26
- ```
27
- Next step is to fork the repository on GitHub and clone the fork to you local
23
+ Fork the Altair repository on GitHub and clone the fork to you local
28
24
machine. For more details on forking see the [ GitHub
29
25
Documentation] ( https://help.github.com/en/articles/fork-a-repo ) .
30
26
```
31
27
$ git clone https://github.com/YOUR-USERNAME/altair.git
32
28
```
33
- You can have a single clone of the repository that points to both your fork and
34
- the main package repository. These pointers to GitHub are called "remotes" .
35
- On your local clone you should run:
29
+
30
+ To keep your fork up to date with changes in the this repo,
31
+ you can [ use the fetch upstream button on GitHub] ( https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork ) .
32
+
33
+ Now you can install the latest version of Altair locally using ` pip ` .
34
+ The ` -e ` flag indicates that your local changes will be reflected
35
+ every time you open a new Python interpreter
36
+ (instead of having to reinstall the package each time).
37
+ ```
38
+ $ cd altair/
39
+ $ python -m pip install -e .
40
+ ```
41
+
42
+ You can now install the development requirements using
36
43
```
37
- $ git remote add upstream https://github.com/altair-viz/altair.git
38
- $ git checkout master
39
- $ git pull upstream master
44
+ $ python -m pip install -r requirement_dev.txt
40
45
```
41
- And then you'll have all the updates in the master branch of your local fork.
42
- Note that git will complain if you've committed changes to your local master
43
- branch that are not on upstream (this is one reason it's good practice to ** never**
44
- work directly on your master branch).
46
+
45
47
46
48
### Creating a Branch
47
49
48
- Once your local environment is up-to-date, you can create a new git branch which will
49
- contain your contribution:
50
+ Once your local environment is up-to-date, you can create a new git branch
51
+ which will contain your contribution
52
+ (always create a new branch instead of making changes to the master branch):
50
53
```
51
- $ git checkout -b <branch-name>
54
+ $ git switch -c <branch-name>
52
55
```
53
56
With this branch checked-out, make the desired changes to the package.
57
+
54
58
Note that Altair code uses the [ black] ( https://black.readthedocs.io/ )
55
- code formatter, which you can apply to your modifications by installing
56
- and running black on the local directory :
59
+ code formatter and [ flake8 ] ( https://flake8.pycqa.org/en/latest/ ) linter
60
+ which you can apply to your modifications by running :
57
61
```
58
- $ pip install black
59
- $ black .
62
+ $ black --diff . # View changes
63
+ $ black . # Apply changes
64
+ $ flake8 . --statistics # View changes (fix manually)
65
+ ```
66
+
67
+ ### Testing your Changes
68
+
69
+ Before suggesting your contributing your changing to the main Altair repository,
70
+ it is recommended that you run the Altair test suite,
71
+ which includes a number of tests to validate the correctness of your code:
72
+
60
73
```
74
+ $ make test
75
+ ```
76
+
77
+ Study the output of any failed tests and try to fix the issues
78
+ before proceeding to the next section.
79
+
80
+ ### Creating a Pull Request
81
+
61
82
When you are happy with your changes, you can commit them to your branch by running
62
83
```
63
84
$ git add <modified-file>
64
85
$ git commit -m "Some descriptive message about your change"
65
86
$ git push origin <branch-name>
66
87
```
67
- Finally you will need to submit a pull request (PR) on GitHub asking to merge
68
- your example branch into Altair master . For details on creating a PR see GitHub
88
+ You will then need to submit a pull request (PR) on GitHub asking to merge
89
+ your example branch into the main Altair repository . For details on creating a PR see GitHub
69
90
documentation [ Creating a pull
70
91
request] ( https://help.github.com/en/articles/creating-a-pull-request ) . You can
71
92
add more details about your example in the PR such as motivation for the
@@ -77,20 +98,6 @@ automatically shown in the PR.
77
98
Hopefully your PR will be answered in a timely manner and your contribution will
78
99
help others in the future.
79
100
80
- ### Testing your Changes
81
-
82
- When you submit a pull request, Altair's continuous integration test suite will
83
- run a number of tests to validate the correctness of your code. It can be helpful
84
- when debugging to run those tests locally; to do this first install Altair's
85
- development requirements:
86
- ```
87
- $ pip install -r requirements_dev.txt
88
- ```
89
- and then run the test suite with:
90
- ```
91
- $ make test
92
- ```
93
-
94
101
## Adding Examples
95
102
96
103
We are always interested in new examples contributed from the community. These
0 commit comments