From 00ae4d3f6e993b06b808cf08e0441fcbacff4f16 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Sun, 11 Dec 2016 17:50:46 +0100 Subject: [PATCH] fix version sourcing in setup.py --- mitmproxy/__init__.py | 2 +- setup.py | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/mitmproxy/__init__.py b/mitmproxy/__init__.py index 0b06c276b..9697de878 100644 --- a/mitmproxy/__init__.py +++ b/mitmproxy/__init__.py @@ -1,3 +1,3 @@ # https://github.com/mitmproxy/mitmproxy/issues/1809 # import script here so that pyinstaller registers it. -from . import script +from . import script # noqa diff --git a/setup.py b/setup.py index 4f4d5c7d4..e8aea2d6f 100644 --- a/setup.py +++ b/setup.py @@ -1,8 +1,8 @@ -from setuptools import setup, find_packages -from codecs import open import os +import runpy +from codecs import open -from mitmproxy import version +from setuptools import setup, find_packages # Based on https://github.com/pypa/sampleproject/blob/master/setup.py # and https://python-packaging-user-guide.readthedocs.org/ @@ -12,9 +12,11 @@ here = os.path.abspath(os.path.dirname(__file__)) with open(os.path.join(here, 'README.rst'), encoding='utf-8') as f: long_description = f.read() +VERSION = runpy.run_path(os.path.join(here, "mitmproxy", "version.py"))["VERSION"] + setup( name="mitmproxy", - version=version.VERSION, + version=VERSION, description="An interactive, SSL-capable, man-in-the-middle HTTP proxy for penetration testers and software developers.", long_description=long_description, url="http://mitmproxy.org",