Skip to content

Commit bae6503

Browse files
committed
Load version from the file rather than by importing the module (which is subject to variance based on sys.path). Fixes #43.
1 parent 6cd0dbf commit bae6503

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

CHANGES.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22
CHANGES
33
=======
44

5+
-----
6+
0.9.4
7+
-----
8+
9+
* Issue #43: Fix issue (introduced in 0.9.1) with version resolution when
10+
upgrading over other releases of Setuptools.
11+
512
-----
613
0.9.3
714
-----

setup.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@
1919

2020
SETUP_COMMANDS = command_ns['__all__']
2121

22+
main_ns = {}
23+
init_path = convert_path('setuptools/__init__.py')
24+
init_file = open(init_path)
25+
exec(init_file.read(), main_ns)
26+
init_file.close()
27+
2228
import setuptools
2329
from setuptools.command.build_py import build_py as _build_py
2430
from setuptools.command.test import test as _test
@@ -93,7 +99,7 @@ def run(self):
9399

94100
setup_params = dict(
95101
name="setuptools",
96-
version=setuptools.__version__,
102+
version=main_ns['__version__'],
97103
description="Easily download, build, install, upgrade, and uninstall "
98104
"Python packages",
99105
author="The fellowship of the packaging",

0 commit comments

Comments
 (0)