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
-[Creating a Pull Request<aname="creating-a-pull-request"></a>](#creating-a-pull-requesta-name%22creating-a-pull-request%22a)
17
+
-[Creating a Pull Request](#creating-a-pull-request)
26
18
-[Code Reviews](#code-reviews)
27
19
28
20
<aname="roadmap"></a>
29
21
We use [Milestones](https://github.com/sendgrid/sendgrid-python/milestones) to help define current roadmaps, please feel free to grab an issue from the current milestone. Please indicate that you have begun work on it to avoid collisions. Once a PR is made, community reviews, comments, suggestions, and additional PRs are welcomed and encouraged.
30
22
31
23
There are a few ways to contribute, which we'll enumerate below:
32
24
33
-
<aname="feature-request"></a>
34
25
## Feature Request
35
26
36
27
If you'd like to make a feature request, please read this section.
@@ -40,7 +31,6 @@ The GitHub issue tracker is the preferred channel for library feature requests,
40
31
- Please **search for existing issues** in order to ensure we don't have duplicate bugs/feature requests.
41
32
- Please be respectful and considerate of others when commenting on issues
42
33
43
-
<aname="submit-a-bug-report"></a>
44
34
## Submit a Bug Report
45
35
46
36
Note: DO NOT include your credentials in ANY code examples, descriptions, or media you make public.
@@ -57,34 +47,28 @@ Before you decide to create a new issue, please try the following:
57
47
58
48
In order to make the process easier, we've included a [sample bug report template](ISSUE_TEMPLATE.md).
59
49
60
-
<aname="improvements-to-the-codebase"></a>
61
50
## Improvements to the Codebase
62
51
63
52
We welcome direct contributions to the sendgrid-python code base. Thank you!
64
53
65
-
### Development Environment ###
66
-
#### There are two ways to get set up: ####
67
-
#### 1. Using Docker ####
68
-
This is usually the easiest and fastest way to get set up.
69
-
You can use our Docker image to avoid setting up the development environment yourself. See [USAGE.md](https://github.com/sendgrid/sendgrid-python/blob/master/docker/USAGE.md).
First, get your free Twilio SendGrid account [here](https://sendgrid.com/free?source=sendgrid-python).
90
74
@@ -101,78 +85,31 @@ Then edit `.env` and insert your API key.
101
85
source .env
102
86
```
103
87
104
-
#####Execute: #####
88
+
#### Execute
105
89
106
90
See the [examples folder](https://github.com/sendgrid/sendgrid-python/tree/master/examples) to get started quickly.
107
91
108
92
If testing from the root directory of this repo, create a new file (e.g. test.py) and replace `import sendgrid` with `from sendgrid import *`
109
93
110
-
<aname="understanding-the-codebase"></a>
111
94
## Understanding the Code Base
112
95
113
-
**/examples**
114
-
115
-
Working examples that demonstrate usage.
116
-
117
-
**/tests**
118
-
119
-
Currently, we have unit and profiling tests.
96
+
-**/examples**
97
+
- Working examples that demonstrate usage.
98
+
-**/tests**
99
+
- Currently, we have unit and profiling tests.
100
+
-**/sendgrid**
101
+
- The Web API v3 client is `sendgrid.py`, the other files are legacy code for our mail send v2 endpoint.
120
102
121
-
**/sendgrid**
122
-
123
-
The Web API v3 client is `sendgrid.py`, the other files are legacy code for our mail send v2 endpoint.
124
-
125
-
<aname="testing"></a>
126
103
## Testing
127
104
128
105
The PR must pass all the tests before it is reviewed.
129
106
130
-
All test files are in the [`test`](https://github.com/sendgrid/sendgrid-python/test) directory.
131
-
132
-
For the purposes of contributing to this repo, please update the [`test_sendgrid.py`](https://github.com/sendgrid/sendgrid-python/tree/master/test/test_sendgrid.py) file with unit tests as you modify the code.
133
-
134
-
`python -m unittest discover -v`
135
-
136
-
### Testing Multiple Versions of Python
137
-
138
-
The PR must pass all the tests before it is reviewed.
139
-
140
-
#### Prerequisites: ####
141
-
142
-
The above local "Initial setup" is complete
107
+
All test files are in the [`test`](https://github.com/sendgrid/sendgrid-python/test) directory. For the purposes of contributing to this repo, please update the [`test_sendgrid.py`](https://github.com/sendgrid/sendgrid-python/tree/master/test/test_sendgrid.py) file with unit tests as you modify the code.
*[prism](https://github.com/stoplightio/prism) v0.6 - It should be available in your PATH, but unittest script
147
-
will try to install it locally if not found. Apart from PATH env variable it will check in `~/bin` and `/usr/local/bin`.
148
-
You can install it by yourself in user dir by calling `source test/prism.sh`.
109
+
The integration tests require a Twilio SendGrid mock API in order to execute. We've simplified setting this up using Docker to run the tests. You will just need [Docker Desktop](https://docs.docker.com/get-docker/) and `make`.
149
110
150
-
#### Initial setup: ####
151
-
152
-
Add ```eval "$(pyenv init -)"``` to your shell environment (.profile, .bashrc, etc) after installing tox, you only need to do this once.
153
-
154
-
```
155
-
pyenv install 2.7.11
156
-
pyenv install 3.4.3
157
-
pyenv install 3.5.0
158
-
```
159
-
Make sure to change the current working directory to your local version of the repo before running the following command:
160
-
```
161
-
python setup.py install
162
-
```
163
-
```
164
-
pyenv local 3.5.0 3.4.3 2.7.11
165
-
pyenv rehash
166
-
```
167
-
168
-
#### Execute: ####
169
-
170
-
```
171
-
source venv/bin/activate
172
-
tox
173
-
```
111
+
Once these are available, simply execute the Docker test target to run all tests: `make test-docker`. This command can also be used to open an interactive shell into the container where this library is installed. To start a *bash* shell for example, use this command: `command=bash make test-docker`.
Generally, we follow the style guidelines as suggested by the official language. However, we ask that you conform to the styles that already exist in the library. If you wish to deviate, please explain your reasoning.
@@ -185,7 +122,7 @@ Please run your code through:
185
122
-[pylint](https://www.pylint.org/)
186
123
-[pep8](https://pypi.python.org/pypi/pep8)
187
124
188
-
## Creating a Pull Request<aname="creating-a-pull-request"></a>
125
+
## Creating a Pull Request
189
126
190
127
1.[Fork](https://help.github.com/fork-a-repo/) the project, clone your fork,
191
128
and configure the remotes:
@@ -240,6 +177,5 @@ Please run your code through:
240
177
7.[Open a Pull Request](https://help.github.com/articles/using-pull-requests/)
241
178
with a clear title and description against the `master` branch. All tests must be passing before we will review the PR.
242
179
243
-
<aname="code-reviews"></a>
244
180
## Code Reviews
245
181
If you can, please look at open PRs and review them. Give feedback and help us merge these PRs much faster! If you don't know how, GitHub has some great [information on how to review a Pull Request](https://help.github.com/articles/about-pull-request-reviews/).
0 commit comments