Commit 3736fee0 authored by Lennart Regebro's avatar Lennart Regebro

Works with zope.interface now.

--HG--
branch : distribute
extra : rebase_source : c8cd9fd837bbac96c8949f0015d84051bd8ab5c7
parent 55413ad5
[distutils.commands] [distutils.commands]
bdist_rpm = setuptools.command.bdist_rpm:bdist_rpm bdist_rpm = setuptools.command.bdist_rpm:bdist_rpm
install_scripts = setuptools.command.install_scripts:install_scripts
rotate = setuptools.command.rotate:rotate rotate = setuptools.command.rotate:rotate
develop = setuptools.command.develop:develop develop = setuptools.command.develop:develop
setopt = setuptools.command.setopt:setopt setopt = setuptools.command.setopt:setopt
...@@ -11,10 +10,11 @@ register = setuptools.command.register:register ...@@ -11,10 +10,11 @@ register = setuptools.command.register:register
install_egg_info = setuptools.command.install_egg_info:install_egg_info install_egg_info = setuptools.command.install_egg_info:install_egg_info
alias = setuptools.command.alias:alias alias = setuptools.command.alias:alias
easy_install = setuptools.command.easy_install:easy_install easy_install = setuptools.command.easy_install:easy_install
test = setuptools.command.test:test install_scripts = setuptools.command.install_scripts:install_scripts
bdist_wininst = setuptools.command.bdist_wininst:bdist_wininst bdist_wininst = setuptools.command.bdist_wininst:bdist_wininst
bdist_egg = setuptools.command.bdist_egg:bdist_egg bdist_egg = setuptools.command.bdist_egg:bdist_egg
install = setuptools.command.install:install install = setuptools.command.install:install
test = setuptools.command.test:test
install_lib = setuptools.command.install_lib:install_lib install_lib = setuptools.command.install_lib:install_lib
build_ext = setuptools.command.build_ext:build_ext build_ext = setuptools.command.build_ext:build_ext
sdist = setuptools.command.sdist:sdist sdist = setuptools.command.sdist:sdist
...@@ -31,15 +31,17 @@ depends.txt = setuptools.command.egg_info:warn_depends_obsolete ...@@ -31,15 +31,17 @@ depends.txt = setuptools.command.egg_info:warn_depends_obsolete
[console_scripts] [console_scripts]
easy_install = setuptools.command.easy_install:main easy_install = setuptools.command.easy_install:main
easy_install-2.6 = setuptools.command.easy_install:main easy_install-3.1 = setuptools.command.easy_install:main
[setuptools.file_finders] [setuptools.file_finders]
svn_cvs = setuptools.command.sdist:_default_revctrl svn_cvs = setuptools.command.sdist:_default_revctrl
[distutils.setup_keywords] [distutils.setup_keywords]
additional_2to3_fixers = setuptools.dist:assert_string_list
dependency_links = setuptools.dist:assert_string_list dependency_links = setuptools.dist:assert_string_list
entry_points = setuptools.dist:check_entry_points entry_points = setuptools.dist:check_entry_points
extras_require = setuptools.dist:check_extras extras_require = setuptools.dist:check_extras
run_2to3 = setuptools.dist:assert_bool
package_data = setuptools.dist:check_package_data package_data = setuptools.dist:check_package_data
install_requires = setuptools.dist:check_requirements install_requires = setuptools.dist:check_requirements
include_package_data = setuptools.dist:assert_bool include_package_data = setuptools.dist:assert_bool
...@@ -49,6 +51,7 @@ test_suite = setuptools.dist:check_test_suite ...@@ -49,6 +51,7 @@ test_suite = setuptools.dist:check_test_suite
eager_resources = setuptools.dist:assert_string_list eager_resources = setuptools.dist:assert_string_list
zip_safe = setuptools.dist:assert_bool zip_safe = setuptools.dist:assert_bool
test_loader = setuptools.dist:check_importable test_loader = setuptools.dist:check_importable
convert_doctests_2to3 = setuptools.dist:assert_string_list
tests_require = setuptools.dist:check_requirements tests_require = setuptools.dist:check_requirements
[setuptools.installation] [setuptools.installation]
......
...@@ -97,7 +97,9 @@ dist = setup( ...@@ -97,7 +97,9 @@ dist = setup(
"include_package_data = setuptools.dist:assert_bool", "include_package_data = setuptools.dist:assert_bool",
"dependency_links = setuptools.dist:assert_string_list", "dependency_links = setuptools.dist:assert_string_list",
"test_loader = setuptools.dist:check_importable", "test_loader = setuptools.dist:check_importable",
"convert_doctests_2to3= setuptools.dist:assert_string_list" "run_2to3 = setuptools.dist:assert_bool",
"convert_doctests_2to3 = setuptools.dist:assert_string_list",
"additional_2to3_fixers = setuptools.dist:assert_string_list",
], ],
"egg_info.writers": [ "egg_info.writers": [
......
...@@ -27,7 +27,7 @@ bootstrap_install_from = None ...@@ -27,7 +27,7 @@ bootstrap_install_from = None
# Should we run 2to3 on all Python files, in Python 3.x? # Should we run 2to3 on all Python files, in Python 3.x?
# Default: no; assume that a distribution installed for 3.x is already # Default: no; assume that a distribution installed for 3.x is already
# written in 3.x # written in 3.x
run_2to3 = False run_2to3 = False # Default value if run_2to3 argument not given.
# If we run 2to3 on .py files, should we also convert docstrings? # If we run 2to3 on .py files, should we also convert docstrings?
# Default: yes; assume that we can detect doctests reliably # Default: yes; assume that we can detect doctests reliably
run_2to3_on_doctests = True run_2to3_on_doctests = True
......
...@@ -21,7 +21,9 @@ try: ...@@ -21,7 +21,9 @@ try:
class Mixin2to3(_Mixin2to3): class Mixin2to3(_Mixin2to3):
def run_2to3(self, files, doctests = False): def run_2to3(self, files, doctests = False):
if not setuptools.run_2to3: # See of the distribution option has been set, otherwise check the
# setuptools default.
if self.distribution.run_2to3 is not True and setuptools.run_2to3 is False:
return return
if not files: if not files:
return return
...@@ -30,6 +32,8 @@ try: ...@@ -30,6 +32,8 @@ try:
self.fixer_names = [] self.fixer_names = []
for p in setuptools.lib2to3_fixer_packages: for p in setuptools.lib2to3_fixer_packages:
self.fixer_names.extend(get_fixers_from_package(p)) self.fixer_names.extend(get_fixers_from_package(p))
for p in self.distribution.additional_2to3_fixers:
self.fixer_names.extend(get_fixers_from_package(p))
if doctests: if doctests:
if setuptools.run_2to3_on_doctests: if setuptools.run_2to3_on_doctests:
r = DistutilsRefactoringTool(self.fixer_names) r = DistutilsRefactoringTool(self.fixer_names)
......
from setuptools import Command from setuptools import Command, run_2to3
from distutils.errors import DistutilsOptionError from distutils.errors import DistutilsOptionError
import sys import sys
from pkg_resources import * from pkg_resources import *
...@@ -81,7 +81,23 @@ class test(Command): ...@@ -81,7 +81,23 @@ class test(Command):
def with_project_on_sys_path(self, func): def with_project_on_sys_path(self, func):
if getattr(self.distribution, 'run_2to3', run_2to3):
# If we run 2to3 we can not do this inplace:
# Ensure metadata is up-to-date # Ensure metadata is up-to-date
self.reinitialize_command('build_py', inplace=0)
self.run_command('build_py')
bpy_cmd = self.get_finalized_command("build_py")
build_path = normalize_path(bpy_cmd.build_lib)
# Build extensions
self.reinitialize_command('egg_info', egg_base=build_path)
self.run_command('egg_info')
self.reinitialize_command('build_ext', inplace=0)
self.run_command('build_ext')
else:
# Without 2to3 inplace works fine:
self.run_command('egg_info') self.run_command('egg_info')
# Build extensions in-place # Build extensions in-place
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment