Skip to content

Build meta: fixes and cleanups #1175

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from Nov 14, 2017
Merged
Show file tree
Hide file tree
Changes from 6 commits
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
6 changes: 5 additions & 1 deletion setuptools/build_meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
import setuptools
import distutils

from pkg_resources import _initialize_master_working_set


class SetupRequirementsError(BaseException):
def __init__(self, specifiers):
Expand Down Expand Up @@ -64,11 +66,13 @@ def patch(cls):
def _run_setup(setup_script='setup.py'):
# Note that we can reuse our build directory between calls
# Correctness comes first, then optimization later
_initialize_master_working_set()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not necessary anymore, no?

__file__ = setup_script
__name__ = '__main__'
f = getattr(tokenize, 'open', open)(__file__)
code = f.read().replace('\\r\\n', '\\n')
f.close()
exec(compile(code, __file__, 'exec'))
exec(compile(code, __file__, 'exec'), locals())


def _fix_config(config_settings):
Expand Down
8 changes: 2 additions & 6 deletions setuptools/command/dist_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"""

import os
import shutil

from distutils.core import Command
from distutils import log
Expand All @@ -27,14 +26,11 @@ def finalize_options(self):

def run(self):
egg_info = self.get_finalized_command('egg_info')
egg_info.egg_base = self.egg_base
egg_info.finalize_options()
egg_info.run()
dist_info_dir = egg_info.egg_info[:-len('.egg-info')] + '.dist-info'
log.info("creating '{}'".format(os.path.abspath(dist_info_dir)))

bdist_wheel = self.get_finalized_command('bdist_wheel')
bdist_wheel.egg2dist(egg_info.egg_info, dist_info_dir)

if self.egg_base:
destination = os.path.join(self.egg_base, dist_info_dir)
log.info("creating '{}'".format(os.path.abspath(destination)))
shutil.move(dist_info_dir, destination)