You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: contributing.md
+16-16Lines changed: 16 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
1
The bottom line. Follow your Nose, or our Nose. Write-run-love tests :fist:.
2
2
3
-
##Setup
3
+
##Setup
4
4
5
-
###Fork, Clone, Setup Your Version of the Plotly Python API
5
+
###Fork, Clone, Setup Your Version of the Plotly Python API
6
6
7
7
First, you'll need to *get* our project. This is the appropriate *clone* command (if you're unfamiliar with this process, https://help.github.com/articles/fork-a-repo):
8
8
@@ -12,7 +12,7 @@ First, you'll need to *get* our project. This is the appropriate *clone* command
Second, this project uses git submodules! They're both helpful and, at times, difficult to work with. The good news is you probably don't need to think about them! Just run the following shell command to make sure that your local repo is wired properly:
18
18
@@ -35,7 +35,7 @@ Additionally, there are some project shortcuts that live in the `makefile` file.
35
35
make readme
36
36
```
37
37
38
-
###Making a Development Branch
38
+
###Making a Development Branch
39
39
40
40
Third, *don't* work in the `master` branch. As soon as you get your master branch ready, run:
41
41
@@ -46,22 +46,22 @@ git checkout -b my-dev-branch
46
46
47
47
... where you should give your branch a more descriptive name than `my-dev-branch`
48
48
49
-
###Pull Request When Ready
49
+
###Pull Request When Ready
50
50
51
51
Once you've made your changes (and hopefully written some tests...), make that pull request!
52
52
53
-
##Suggestions
53
+
##Suggestions
54
54
55
-
###Local Python
55
+
###Local Python
56
56
Setting up Python versions that *don't* require you to use `sudo` is a good idea. In addition, the core Python on your machine may not be the Python that we've developed in! Here are some nice guides for Mac, Windows, and Linux:
Virtualenv is a way to create Python environments on your machine that know nothing about one another. This is really helpful for ironing out dependency-problems arising from different versions of packages. Here's a nice guide on how to do this: http://docs.python-guide.org/en/latest/dev/virtualenvs/
63
63
64
-
###Alter Your PYTHONPATH
64
+
###Alter Your PYTHONPATH
65
65
The PYTHONPATH variable in your shell tells Python where to look for modules. Since you'll be developing, it'll be a pain to need to *install* Python every time you need to test some functionality (or at least ensure you're running code from the right directory...). You can easily make this change from a shell:
Note, that's non-permanent. When you close the shell, that variable definition disappears. Also, `path/to/local/repo` is *your* specific repository path (e.g., `/Users/andrew/projects/python-api`).
72
72
73
-
###Why?
73
+
###Why?
74
74
75
75
Now you can run the following code and be guaranteed to have a working development version that you can make changes to on-the-fly, test, and be confident will not break on other's machines!
There's a short list of core dependencies you'll need installed in your Python environment to have any sort of fun with Plotly's Python API (see `requirements.txt`). Additionally, you're likely to have even more fun if you install some other requirements (see `optional-requirements.txt`).
86
86
87
-
###Dependencies and Virtualenv
87
+
###Dependencies and Virtualenv
88
88
89
89
If you decided to follow the suggestion about about the Virtualenv *and* you've run `source bin/activate` within your new virtualenv directory to activate it--you can run the following to install the core dependencies:
90
90
@@ -98,14 +98,14 @@ To install the optional dependencies:
98
98
pip install -r optional-requirements.txt
99
99
```
100
100
101
-
##Testing
101
+
##Testing
102
102
103
103
We take advantage of two tools to run tests:
104
104
105
105
*[`tox`](https://tox.readthedocs.io/en/latest/), which is both a virtualenv management and test tool.
106
106
*[`nose`](https://nose.readthedocs.org/en/latest/), which is is an extension of Python's unittest
107
107
108
-
###Running Tests with `nose`
108
+
###Running Tests with `nose`
109
109
110
110
Since our tests cover *all* the functionality, to prevent tons of errors from showing up and having to parse through a messy output, you'll need to install `optional-requirements.txt` as explained above.
0 commit comments