Skip to content

Commit fe9aa18

Browse files
authored
Merge pull request #118 from EasyPost/gh-actions
replace travis-ci with github actions
2 parents d6db69c + c37e21d commit fe9aa18

File tree

8 files changed

+45
-31
lines changed

8 files changed

+45
-31
lines changed

.github/workflows/ci.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: 'CI'
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
8+
jobs:
9+
flake8:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
- name: set up python
14+
uses: actions/setup-python@v2
15+
with:
16+
python-version: 3.9
17+
- name: install dependencies
18+
run: python -m pip install flake8
19+
- name: lint with flake8
20+
run: flake8 --statistics easypost/ tests/ examples/
21+
run-tests:
22+
runs-on: ubuntu-latest
23+
strategy:
24+
matrix:
25+
pythonversion: ['2.7', '3.5', '3.6', '3.7', '3.8', '3.9', 'pypy-2.7', 'pypy-3.6']
26+
steps:
27+
- uses: actions/checkout@v2
28+
- name: set up python
29+
uses: actions/setup-python@v2
30+
with:
31+
python-version: ${{ matrix.pythonversion }}
32+
- name: install dependencies
33+
run: "python -m pip install -r requirements-tests.txt -e ."
34+
- name: test with pytest
35+
run: pytest --cov=easypost --cov-report=term-missing --vcr-record=none --cov-fail-under=60 tests/
36+
env:
37+
TEST_API_KEY: ${{ secrets.TEST_API_KEY }}
38+
PROD_API_KEY: ${{ secrets.PROD_API_KEY }}

.travis.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# EasyPost Python Client Library
22

3-
[![Build Status](https://travis-ci.com/EasyPost/easypost-python.svg?branch=master)](https://travis-ci.com/EasyPost/easypost-python)
3+
[![CI](https://github.com/EasyPost/easypost-python/workflows/CI/badge.svg)](https://github.com/EasyPost/easypost-python/actions?query=workflow%3ACI)
44
[![PyPI version](https://badge.fury.io/py/easypost.svg)](https://badge.fury.io/py/easypost)
55

66
EasyPost is the simple shipping API. You can sign up for an account at <https://easypost.com>.
@@ -157,5 +157,5 @@ To run tests:
157157
- Create a virtualenv for your version of Python (e.g., `python2.7 -m virtualenv venv`)
158158
- Install dependencies in that virtualenv (`./venv/bin/pip install requests six`)
159159
- Install test dependencies (`./venv/bin/pip install -r requirements-tests.txt`)
160-
- Export `$TEST_API_KEY` and `$PROD_API_KEY` appropriately (these are set by `.travis.yml` for CI)
160+
- Export `$TEST_API_KEY` and `$PROD_API_KEY` appropriately (these are set automatically for CI)
161161
- Run the tests with `py.test` (`./venv/bin/py.test -vs tests`)

examples/batch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
for shipment in batch.shipments:
6161
shipment.insure(amount=100)
6262

63-
###### below here should probably be in a seperate script so that there's no risk of re-running create_and_buy
63+
# WARNING: below here should probably be in a seperate script so that there's no risk of re-running create_and_buy
6464

6565
# # run this to check on the batch status after it's been created
6666
# # postage is purchased asyncronously, so you'll have to poll until it's done

examples/carrier_account_types.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
from __future__ import print_function
2+
13
import easypost
24
easypost.api_key = 'PRODUCTION API KEY'
35

46
types = easypost.CarrierAccount.types()
57

68
for carrier_type in types:
7-
print carrier_type.type
9+
print(carrier_type.type)

examples/example_single_request.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
customs_info=customs_info)
5555

5656
# Can also be done like so:
57-
#shipment = easypost.Shipment.create(
57+
# shipment = easypost.Shipment.create(
5858
# {"to_address": to_address,
5959
# "from_address": from_address,
6060
# "parcel": parcel,

setup.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
'Docs': 'https://www.easypost.com/docs/api',
3737
'Tracker': 'https://github.com/EasyPost/easypost-python/issues',
3838
'Source': 'https://github.com/EasyPost/easypost-python',
39-
'CI': 'https://travis-ci.com/EasyPost/easypost-python',
4039
},
4140
python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, <4',
4241
classifiers=[

tests/conftest.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# setup for py.test
22

3-
import datetime
4-
import random
53
import os
64

75
import easypost

0 commit comments

Comments
 (0)