Skip to content

PyPy compatibility preparation step4 #973

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 1 commit into from
Apr 22, 2021
Merged
Show file tree
Hide file tree
Changes from all 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
16 changes: 15 additions & 1 deletion make.py
Original file line number Diff line number Diff line change
Expand Up @@ -2219,6 +2219,7 @@ def make_all(
source_dirs=None,
toolsdirs=None,
docsdirs=None,
python_target_release=None, # 37101 for 3.7.10
):
"""Make WinPython distribution, for a given base directory and
architecture:
Expand Down Expand Up @@ -2298,7 +2299,20 @@ def make_all(
)
while not my_x.isdigit() and len(my_x) > 0:
my_x = my_x[:-1]
my_winpydir = (

# simplify for PyPy
if not python_target_release == None :
my_winpydir = (
'WPy'
+ ('%s' % architecture)
+ '-'
+ python_target_release
+ ''
+ ('%s' % build_number)
) + release_level
# + flavor
else:
my_winpydir = (
'WPy'
+ ('%s' % architecture)
+ '-'
Expand Down
29 changes: 15 additions & 14 deletions winpython/wppm.py
Original file line number Diff line number Diff line change
Expand Up @@ -521,18 +521,20 @@ def patch_standard_packages(
"""patch Winpython packages in need"""
import filecmp

# Adpating to PyPy
if 'pypy3' in osp.basename(utils.get_python_executable(self.target)):
site_package_place="\\site-packages\\"
else:
site_package_place="\\Lib\\site-packages\\"


# 'pywin32' minimal post-install (pywin32_postinstall.py do too much)
if (
package_name.lower() == "pywin32"
or package_name == ''
):
origin = self.target + (
r"\Lib\site-packages\pywin32_system32"
)
if 'pypy3' in sys.executable:
origin = self.target + (
r"\site-packages\pywin32_system32"
)
origin = self.target + site_package_place + "pywin32_system32"

destin = self.target
if osp.isdir(origin):
for name in os.listdir(origin):
Expand All @@ -556,10 +558,9 @@ def patch_standard_packages(
sheb_fix = " executable = get_executable()"
sheb_mov1 = " executable = os.path.join(os.path.basename(get_executable()))"
sheb_mov2 = " executable = os.path.join('..',os.path.basename(get_executable()))"
if 'pypy3' in sys.executable:
the_place=r"\site-packages\pip\_vendor\distlib\scripts.py"
else:
the_place=r"\Lib\site-packages\pip\_vendor\distlib\scripts.py"

# Adpating to PyPy
the_place=site_package_place + r"pip\_vendor\distlib\scripts.py"
print(the_place)
if to_movable:
utils.patch_sourcefile(
Expand Down Expand Up @@ -591,7 +592,7 @@ def patch_standard_packages(
# will be in standard pip 8.0.3
utils.patch_sourcefile(
self.target
+ (r"\Lib\site-packages\pip\wheel.py"),
+ (site_package_place +r"pip\wheel.py"),
" writer.writerow((f, h, l))",
" writer.writerow((normpath(f, lib_dir), h, l))",
)
Expand All @@ -606,15 +607,15 @@ def patch_standard_packages(
utils.patch_sourcefile(
self.target
+ (
r"\Lib\site-packages\spyderlib\config\main.py"
site_package_place+r"spyderlib\config\main.py"
),
"'check_updates_on_startup': True,",
"'check_updates_on_startup': False,",
)
utils.patch_sourcefile(
self.target
+ (
r"\Lib\site-packages\spyder\config\main.py"
site_package_place+r"spyder\config\main.py"
),
"'check_updates_on_startup': True,",
"'check_updates_on_startup': False,",
Expand Down