Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
put SDK version in a common place
  • Loading branch information
UmanShahzad committed Dec 16, 2020
commit 7cfafa9f7bb27abfeb131f977e0c48e28c8388ce
7 changes: 5 additions & 2 deletions ipinfo/handler_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,17 @@
import os
import sys

from .version import SDK_VERSION

API_URL = "https://ipinfo.io"
COUNTRY_FILE_DEFAULT = "countries.json"

def get_headers(access_token):
"""Build headers for request to IPinfo API."""
headers = {
"user-agent": "IPinfoClient/Python{version}/4.0.0".format(
version=sys.version_info[0]
"user-agent": "IPinfoClient/Python{version}/{sdk_version}".format(
version=sys.version_info[0],
sdk_version=SDK_VERSION
),
"accept": "application/json",
}
Expand Down
1 change: 1 addition & 0 deletions ipinfo/version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SDK_VERSION = '4.1.0'
4 changes: 3 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from setuptools import setup

from ipinfo.version import SDK_VERSION

long_description = """
The official Python library for IPinfo.

Expand All @@ -10,7 +12,7 @@

setup(
name="ipinfo",
version="4.0.0",
version=SDK_VERSION,
description="Official Python library for IPInfo",
long_description=long_description,
url="https://github.com/ipinfo/python",
Expand Down