8000 compatibility clean-up by stonebig · Pull Request #1338 · winpython/winpython · GitHub
[go: up one dir, main page]

Skip to content

compatibility clean-up #1338

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
May 12, 2024
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
26 changes: 14 additions & 12 deletions generate_a_winpython_distro.bat
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ rem 2020-12-05 : add a constrints.txt file from a recent pip list
rem 2021-03-20 : track successes packages combination are archived for future contraint update
rem 2021-04-22 : path PyPy3 (as we don't try to copy PyPy3.exe to Python.exe)
rem 2023-08-21a: add a pre_step with my_requirements_pre.txt + my_find_links_pre
rem 2024-05-12a: use python -m pip instead of pip , and remove --upgrade %new_resolver%
rem *****************************

rem algorithm:
Expand Down Expand Up @@ -46,11 +47,12 @@ echo ------------------
echo 0.0 Initialize variables
echo ------------------

if "%my_release_level%"=="" set my_release_level=b4
if "%my_release_level%"=="" set my_release_level=b2

set my_basedir=%my_root_dir_for_builds%\bd%my_python_target%

set my_buildenv=C:\WinPdev\WPy64-3890
rem since 2024-05-01, a building env need is reduced to a WinPythondot 3.8+ augmented with packages: flit + packaging
set my_buildenv=C:\WinPdev\WPy64-310111

if "%my_constraints%"=="" set my_constraints=C:\WinP\constraints.txt

Expand Down Expand Up @@ -79,7 +81,7 @@ if %my_python_target%==311 (

if %my_python_target%==312 (
set my_python_target_release=3123
set my_release=0
set my_release=1
)

if %my_python_target%==313 (
Expand Down Expand Up @@ -270,9 +272,9 @@ rem echo python.exe -c "import sys;from pathlib import Path;f=open(Path(sys.pre
rem F/2024-04-10

rem D/2020-07-05: install msvc_runtime before packages that may want to compile
echo pip install msvc_runtime --pre --no-index --trusted-host=None --find-links=%my_find_links% --upgrade
echo pip install msvc_runtime --pre --no-index --trusted-host=None --find-links=%my_find_links% --upgrade>>%my_archive_log%
pip install msvc_runtime --pre --no-index --trusted-host=None --find-links=%my_find_links% --upgrade
echo python -m pip install msvc_runtime --pre --no-index --trusted-host=None --find-links=%my_find_links% --upgrade
echo python -m pip install msvc_runtime --pre --no-index --trusted-host=None --find-links=%my_find_links% --upgrade>>%my_archive_log%
python -m pip install msvc_runtime --pre --no-index --trusted-host=None --find-links=%my_find_links% --upgrade
rem F/2020-07-05: install msvc_runtime before packages that may want to compile


Expand All @@ -292,11 +294,11 @@ if not "Z%my_requirements_pre%Z"=="ZZ" (
rem 2023-08-21a: add a pre_step with my_requirements_pre.txt + my_find_links_pre
if "%my_find_links_pre%"=="" set my_find_links_pre=%my_find_links%

echo pip install -r %my_requirements_pre% -c %my_constraints% --pre --no-index --trusted-host=None --find-links=%my_find_links_pre% --upgrade %new_resolver%
echo pip install -r %my_requirements_pre% -c %my_constraints% --pre --no-index --trusted-host=None --find-links=%my_find_links_pre% --upgrade %new_resolver%>>%my_archive_log%
echo python -m pip install -r %my_requirements_pre% -c %my_constraints% --pre --no-index --trusted-host=None --find-links=%my_find_links_pre%
echo python -m pip install -r %my_requirements_pre% -c %my_constraints% --pre --no-index --trusted-host=None --find-links=%my_find_links_pre% >>%my_archive_log%
echo if pip doesn't work, check the path of %my_WINPYDIRBASE%

pip install -r %my_requirements_pre% -c %my_constraints% --pre --no-index --trusted-host=None --find-links=%my_find_links_pre% --upgrade %new_resolver%>>%my_archive_log%
python -m pip install -r %my_requirements_pre% -c %my_constrain 10000 ts% --pre --no-index --trusted-host=None --find-links=%my_find_links_pre% >>%my_archive_log%
) else (
echo no packages pre_requirements
echo no packages pre_requirements>>%my_archive_log%
Expand All @@ -312,13 +314,13 @@ echo 2.5 add requirement packages_versions>>%my_archive_log%
echo %date% %time% >>%my_archive_log%
echo ----------------------------->>%my_archive_log%

echo pip install -r %my_requirements% -c %my_constraints% --pre --no-index --trusted-host=None --find-links=%my_find_links% --upgrade %new_resolver%
echo pip install -r %my_requirements% -c %my_constraints% --pre --no-index --trusted-host=None --find-links=%my_find_links% --upgrade %new_resolver%>>%my_archive_log%
echo python -m pip install -r %my_requirements% -c %my_constraints% --pre --no-index --trusted-host=None --find-links=%my_find_links%
echo python -m pip install -r %my_requirements% -c %my_constraints% --pre --no-index --trusted-host=None --find-links=%my_find_links% >>%my_archive_log%
echo if pip doesn't work, check the path of %my_WINPYDIRBASE%


rem 2020-12-05 : add a constraints.txt file from a recent pip list
pip install -r %my_requirements% -c %my_constraints% --pre --no-index --trusted-host=None --find-links=%my_find_links% --upgrade %new_resolver%>>%my_archive_log%
python -m pip install -r %my_requirements% -c %my_constraints% --pre --no-index --trusted-host=None --find-links=%my_find_links% >>%my_archive_log%

echo mid of step 2/3

Expand Down
2 changes: 1 addition & 1 deletion winpython/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@
OTHER DEALINGS IN THE SOFTWARE.
"""

__version__ = '8.0.20240501'
__version__ = '8.0.20240512'
__license__ = __doc__
__project_url__ = 'http://winpython.github.io/'
4 changes: 1 addition & 3 deletions winpython/piptree.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def get_packages_ini_metadata(name):
return get_package_metadata("packages.ini", name, False, update=False, suggested_summary=None)

class pipdata:
"""Wrapper around Distribution.discover() or pip inspect"""
"""Wrapper around Distribution.discover() or Distribution.distributions()"""

def __init__(self, Target=None):

Expand Down Expand Up @@ -99,11 +99,9 @@ def __init__(self, Target=None):
"sys_platform": sys.platform,
}

# get pip_inpsect raw data in json form
if Target == None:
Target = sys.executable

# faster then pip_inspect = utils.exec_shell_cmd(f'set pythonutf8=1 & python -X utf8=1 -m pip inspect', sys.prefix)
if sys.executable==Target:
# self-Distro inspection case (use all packages reachable per sys.path I presume )
pip_json_installed=Distribution.discover()
Expand Down
4 changes: 2 additions & 2 deletions winpython/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -847,7 +847,7 @@ def direct_pip_install(
verbose=False,
install_options=None,
):
"""Direct install via pip !"""
"""Direct install via python -m pip !"""
copy_to = str(Path(fname).parent)

if python_exe is None:
Expand All @@ -858,7 +858,7 @@ def direct_pip_install(
cmd = [python_exe, '-m', 'pip', 'install']
if install_options:
cmd += install_options # typically ['--no-deps']
print('pip install_options', install_options)
print('python -m pip install_options', install_options)
cmd += [fname]

if verbose:
Expand Down
0