Skip to content
This repository has been archived by the owner on May 5, 2023. It is now read-only.

Commit

Permalink
XXX: Debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
hexagonrecursion committed Mar 6, 2022
1 parent e8ad85b commit 6376ad1
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions setuptools/command/easy_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,42 @@ def _render_version():
raise SystemExit()

def finalize_options(self): # noqa: C901 # is too complex (25) # FIXME
print(sysconfig._INSTALL_SCHEMES)
print(f'{os.name}_user')

def global_trace(frame, event, arg):
pass

import sys

sys.settrace(global_trace)

XXX = [set()]

def trace(frame, event, arg):
config_vars = getattr(self, 'config_vars', {})
o = {
('USER_BASE', site.USER_BASE),
('USER_SITE', site.USER_SITE),
('install_dir', self.install_dir),
('install_userbase', self.install_userbase),
('install_usersite', self.install_usersite),
('install_purelib', self.install_purelib),
('install_scripts', self.install_scripts),
('userbase', config_vars.get('userbase')),
('usersite', config_vars.get('usersite')),
}
if XXX[0] - o:
print('-', XXX[0] - o)
if o - XXX[0]:
print('+', o - XXX[0])
XXX[0] = o
lines, start = inspect.getsourcelines(frame)
print(frame.f_lineno, lines[frame.f_lineno - start])

import inspect
inspect.currentframe().f_trace = trace

self.version and self._render_version()

py_version = sys.version.split()[0]
Expand Down Expand Up @@ -459,6 +495,7 @@ def check_site_dir(self): # noqa: C901 # is too complex (12) # FIXME
instdir = normalize_path(self.install_dir)
pth_file = os.path.join(instdir, 'easy-install.pth')

print('XXX', instdir, os.path.exists(instdir))
if not os.path.exists(instdir):
try:
os.makedirs(instdir)
Expand Down

0 comments on commit 6376ad1

Please sign in to comment.