diff --git a/MANIFEST.in b/MANIFEST.in index 1d1c3c2..894af4c 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,3 +1,3 @@ -include README.md LICENSE AUTHORS test_httpbin.py +include httpbin/VERSION README.md LICENSE AUTHORS test_httpbin.py recursive-include httpbin/templates * recursive-include httpbin/static * diff --git a/httpbin/VERSION b/httpbin/VERSION new file mode 100644 index 0000000..ac39a10 --- /dev/null +++ b/httpbin/VERSION @@ -0,0 +1 @@ +0.9.0 diff --git a/httpbin/core.py b/httpbin/core.py index ea870a5..fdee126 100644 --- a/httpbin/core.py +++ b/httpbin/core.py @@ -30,6 +30,9 @@ from .helpers import get_headers, status_code, get_dict, get_request_range, chec from .utils import weighted_choice from .structures import CaseInsensitiveDict +with open(os.path.join(os.path.realpath(os.path.dirname(__file__)), 'VERSION')) as version_file: + version = version_file.read().strip() + ENV_COOKIES = ( '_gauges_unique', '_gauges_unique_year', @@ -79,7 +82,7 @@ template = { "url": "https://kennethreitz.org", }, # "termsOfService": "http://me.com/terms", - "version": "0.9.0" + "version": version }, "host": "httpbin.org", # overrides localhost:5000 "basePath": "/", # base bash for blueprint registration diff --git a/setup.py b/setup.py index 7e973ae..8f9ebc5 100644 --- a/setup.py +++ b/setup.py @@ -5,9 +5,12 @@ import io # long_description = io.open( # os.path.join(os.path.dirname(__file__), 'README.rst'), encoding='utf-8').read() +with open(os.path.join(os.path.realpath(os.path.dirname(__file__)), 'httpbin', 'VERSION')) as version_file: + version = version_file.read().strip() + setup( name="httpbin", - version="0.9.0", + version=version, description="HTTP Request and Response Service", # long_description=long_description,