Skip to content

Commit 7cfafa9

Browse files
committed
put SDK version in a common place
1 parent 74f7ec5 commit 7cfafa9

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

ipinfo/handler_utils.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,17 @@
66
import os
77
import sys
88

9+
from .version import SDK_VERSION
10+
911
API_URL = "https://ipinfo.io"
1012
COUNTRY_FILE_DEFAULT = "countries.json"
1113

1214
def get_headers(access_token):
1315
"""Build headers for request to IPinfo API."""
1416
headers = {
15-
"user-agent": "IPinfoClient/Python{version}/4.0.0".format(
16-
version=sys.version_info[0]
17+
"user-agent": "IPinfoClient/Python{version}/{sdk_version}".format(
18+
version=sys.version_info[0],
19+
sdk_version=SDK_VERSION
1720
),
1821
"accept": "application/json",
1922
}

ipinfo/version.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
SDK_VERSION = '4.1.0'

setup.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
from setuptools import setup
22

3+
from ipinfo.version import SDK_VERSION
4+
35
long_description = """
46
The official Python library for IPinfo.
57
@@ -10,7 +12,7 @@
1012

1113
setup(
1214
name="ipinfo",
13-
version="4.0.0",
15+
version=SDK_VERSION,
1416
description="Official Python library for IPInfo",
1517
long_description=long_description,
1618
url="https://github.com/ipinfo/python",

0 commit comments

Comments
 (0)