Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Commit

Permalink
Merge pull request #12 from alviezhang/refresh
Browse files Browse the repository at this point in the history
Prepare for release
  • Loading branch information
jkzhang-aftership authored Feb 26, 2020
2 parents 186f222 + 7893c77 commit 642e76d
Show file tree
Hide file tree
Showing 11 changed files with 115 additions and 36 deletions.
7 changes: 4 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
language: python
install: "make"

python:
- "3.5"
- "3.6"
Expand All @@ -7,8 +9,7 @@ python:
- "pypy3"

install:
- pip install -r requirements.txt
- pip install .
- make install

script:
- py.test -v --capture=sys
- make test
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
include README.rst LICENSE VERSION requirements.txt
recursive-include tests *.py
recursive-include aftership
16 changes: 11 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
.PHONY: docs clean

install:
pip install -r requirements.txt
pip install --upgrade .
pip install -r requirements-dev.txt

test:
py.test
cd tests && py.test

record:
cd tests && py.test --vcr-record=new_episodes

flake8:
flake8
Expand All @@ -13,8 +17,10 @@ docs:
cd docs && make html
@echo "\033[95m\n\nBuild successful! View the docs homepage at docs/_build/html/index.html.\n\033[0m"

build:
python setup.py sdist --formats=gztar,zip
python setup.py sdist bdist_wheel

clean:
-rm -r docs/_build

record:
py.test --vcr-record=new_episodes
-rm -r build dist aftership.egg-info
2 changes: 1 addition & 1 deletion aftership/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@


with open(os.path.join(os.path.dirname(os.path.abspath(__file__)), '../VERSION')) as f:
__version__ = f.read()
__version__ = f.read().strip()


api_key = None
9 changes: 9 additions & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# For packaging
wheel
setuptools

# For testing
flake8
pytest
pytest-cov
pytest-vcr
9 changes: 0 additions & 9 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1 @@
wheel
setuptools

requests

# For testing
flake8
pytest
pytest-cov
pytest-vcr
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bdist_wheel]
universal = 1
universal = 0

[metadata]
license_file = LICENSE
license_file = LICENSE
21 changes: 13 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,29 @@
import os
from codecs import open # To use a consistent encoding
from os import path

from setuptools import setup

here = path.abspath(path.dirname(__file__))
here = os.path.abspath(os.path.dirname(__file__))

# Get the long description from the relevant file
with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
with open(os.path.join(here, 'README.rst'), encoding='utf-8') as f:
long_description = f.read()

with open(path.join(here, 'VERSION'), encoding='utf-8') as f:
version = f.read()
with open(os.path.join(here, 'requirements.txt'), encoding='utf-8') as f:
install_requires = f.read().split('\n')

with open(os.path.join(here, 'VERSION'), encoding='utf-8') as f:
__version__ = f.read().strip()

setup(
name='aftership',

python_requires='>3.5.0',

# Versions should comply with PEP440. For a discussion on single-sourcing
# the version across setup.py and the project code, see
# http://packaging.python.org/en/latest/tutorial.html#version
version=version,
version=__version__,

description='Python SDK of AfterShip API',
long_description=long_description,
Expand All @@ -27,7 +32,7 @@
url='https://github.com/AfterShip/aftership-python',

# Download path
download_url='https://github.com/AfterShip/aftership-python/tarball/{}'.format(version),
download_url='https://github.com/AfterShip/aftership-python/tarball/{}'.format(__version__),

# Author details
author='AfterShip',
Expand Down Expand Up @@ -68,5 +73,5 @@
# You can just specify the packages manually here if your project is
# simple. Or you can use find_packages().
packages=['aftership'],
install_requires=[],
install_requires=install_requires,
)
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
@pytest.fixture(scope='session')
def vcr_config():
return {
'cassette_library_dir': 'tests/fixtures/cassettes',
'cassette_library_dir': 'fixtures/cassettes',
'serializer': 'yaml',
'filter_headers': [('aftership-api-key', 'YOUR_API_KEY_IS_HERE')],
'record_mode': 'none',
Expand Down
73 changes: 73 additions & 0 deletions tests/fixtures/cassettes/TrackingTestCase.test_list_trackings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,77 @@ interactions:
status:
code: 200
message: OK
- request:
body: null
headers:
Accept:
- '*/*'
Accept-Encoding:
- gzip, deflate
Connection:
- keep-alive
User-Agent:
- python-requests/2.23.0
aftership-api-key:
- YOUR_API_KEY_IS_HERE
method: GET
uri: https://api.aftership.com/v4/trackings?slug=4px&limit=1
response:
body:
string: !!binary |
H4sIAAAAAAAAA4VUy27bMBD8F15rA5RcO7G+IMceegsCgqbWMiu+ykdjw/C/d/W0ZLkpoAM1uyRn
Z2d5JRoiJ8WVCFsCKXJKbytS8g5zvEIsWxEltYztSthkcJXvt3S/W5EaLp/Wl6QgZEWCShWuvrsz
/lgvK2lI8f6B50GI0vAobQ9EXnVbjhJUGbq18MAjlIxHppudJKfZfp1l6/z1J90U2x1+3ygtKH1I
5uc2Oadrmq/z3TJZ8RBZcmW/gxQmKbUiHmLyhkXLApgSfMcNK/QSPJuQZm3V/sJksJu+As9FLU2F
3N+vRDYKOE1hczydf202oqxf8gDRXWi+nbF9yjQbmU5Jfpm4KOnL7IEtM0kfmkLJ21u2z3f0NXt5
bBwXUf7BtkefAP9M6W1TXitNCtFqNjStU7EDUTDDNQxgCQoPQcWinIL/UrQ/6b/Kd3mguVShowRn
B6LRYLhxSJK2zzA2jgzQqnh+U878nzkeT3ewce7Tm8NJOg0mYr6ocThYPw6PUSnq5FjTnEVsVOZp
NF7cEvwEWZ2Wt3QwS0beY7IyqMVhVCHoAL0OAdUVeDjhTpJhBH+g8dEXjQfSYQYxSrMRZhpCaB+D
yY4oo4JHK7VOQwq9MLR3qpYK2OjCkJyzHrs20FTcVKk9v/vHmn4n3GBraB6CEpwH0Vi9maUTiNpZ
aeJQWDoE4eUBb52We0enflnO/JGrAIMVnLdahomdZm26u3rSpr7Zyor+gZvBU/eN9XPRyjNO40N4
bsBF+Ml4LHLwXV5gzobIFese+odYY6pZqfdIHNHbx+32FyJiU6ExBgAA
headers:
Access-Control-Allow-Credentials:
- 'true'
Access-Control-Allow-Headers:
- Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,aftership-api-key
Access-Control-Allow-Methods:
- GET,OPTIONS
Access-Control-Allow-Origin:
- '*'
Cache-Control:
- no-store, no-cache, must-revalidate, proxy-revalidate
Connection:
- keep-alive
Content-Encoding:
- gzip
Content-Type:
- application/json; charset=utf-8
Date:
- Wed, 26 Feb 2020 03:56:56 GMT
Expires:
- '0'
Pragma:
- no-cache
Server:
- nginx
Surrogate-Control:
- no-store
Vary:
- Accept-Encoding
X-RateLimit-Limit:
- '10000'
X-RateLimit-Remaining:
- '9992'
X-RateLimit-Reset:
- '1582689439'
X-Response-Time:
- 244.104ms
p3p:
- 'CP="AfterShip does not have a P3P policy. Learn why here: https://www.aftership.com/p3p"'
transfer-encoding:
- chunked
status:
code: 200
message: OK
version: 1
6 changes: 0 additions & 6 deletions tox.ini

This file was deleted.

0 comments on commit 642e76d

Please sign in to comment.