X Tutup
Skip to content

Latest commit

 

History

History
84 lines (59 loc) · 3.15 KB

File metadata and controls

84 lines (59 loc) · 3.15 KB

You can use Docker to easily try out or test sendgrid-python.

Quickstart

  1. Install Docker on your machine.
  2. Run docker run -it sendgrid/sendgrid-python.

Info

This Docker image contains

  • sendgrid-python and python-http-client
  • Stoplight's Prism, which lets you try out the API without actually sending email
  • tox and all supported Python versions, set up to test sendgrid-python or your own fork

Run it in interactive mode with -it.

You can mount repositories in the /mnt/sendgrid-python and /mnt/python-http-client directories to use them instead of the default SendGrid libraries. Read on for more info.

Options

Using an old version

The easiest way to use an old version is to use an old tag.

$ docker run -it sendgrid/sendgrid-python:v3.6.1

Tags from before this Docker image was created might not exist yet. You may manually download old versions in order to use them.

Specifying specific versions

To use different versions of sendgrid-python or python-http-client - for instance, to replicate your production setup - mount them with the -v <host_dir>:<container_dir> option. When you put either repository under /mnt, the container will automatically detect it and make the proper symlinks. You can edit these files from the host machine while the container is running.

For instance, to install sendgrid-python 3.6.1 and use the current python-http-client:

$ git clone https://github.com/sendgrid/sendgrid-python.git --branch v3.6.1
$ realpath sendgrid-python
/path/to/sendgrid-python
$ docker run -it -v /path/to/sendgrid-python:/mnt/sendgrid-python sendgrid/sendgrid-python

To install sendgrid-python v3.6.1 and use an older version of python-http-client:

$ git clone https://github.com/sendgrid/sendgrid-python.git --branch v3.6.1
$ realpath sendgrid-python
/path/to/sendgrid-python
$ git clone https://github.com/sendgrid/python-http-client.git --branch v1.2.4
$ realpath python-http-client
/path/to/python-http-client
$ docker run -it -v /path/to/sendgrid-python:/mnt/sendgrid-python \
>                -v /path/to/python-http-client:/mnt/python-http-client \
>                sendgrid/sendgrid-python

Specifying your own fork:

$ git clone https://github.com/you/cool-sendgrid-python.git
$ realpath cool-sendgrid-python
/path/to/cool-sendgrid-python
$ docker run -it -v /path/to/cool-sendgrid-python:/mnt/sendgrid-python sendgrid/sendgrid-python

Note that the paths you specify in -v must be absolute.

Testing

Testing is easy! Run the container, cd sendgrid, and run tox.

About

sendgrid-python is guided and supported by the SendGrid Developer Experience Team.

sendgrid-python is maintained and funded by SendGrid, Inc. The names and logos for sendgrid-python are trademarks of SendGrid, Inc.

SendGrid Logo

X Tutup