Skip to content
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
14 changes: 1 addition & 13 deletions generate_a_winpython_distro.bat
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ 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 2024-09-15a: compactify for lisiblity
rem 2025-03-02 : remove step 2.3 (pre-build), and 2.8 (post-patch) as we simplify to only wheels
rem *****************************

rem algorithm:
Expand All @@ -18,10 +19,8 @@ rem 2 a Pre-clear of previous build infrastructure
rem 2.0 Create a new build
rem 2.1 Create basic build infrastructure
rem 2.2 check infrastructure is in place
rem 2.3 add mandatory packages for build
rem 2.4 add packages pre_requirements (if any)
rem 2.5 add requirement packages
rem 2.8 post-build (if specific workarounds)
rem 2.9 archive success
rem 3.0 Generate Changelog and binaries

Expand Down Expand Up @@ -274,17 +273,6 @@ echo if pip doesn't work, check the path of %my_WINPYDIRBASE%
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 ----------------------------------------
echo 2.8 (%date% %time%) post-build (if specific workarounds)
echo ----------------------------------------
echo ---------------------------------------- >>%my_archive_log%
echo 2.8 (%date% %time%) post-build (if specific workarounds)>>%my_archive_log%
echo ---------------------------------------- >>%my_archive_log%

@echo on
call %my_basedir%\run_complement_newbuild.bat %my_WINPYDIRBASE%


echo ----------------------------------------
echo 2.9 (%date% %time%) archive success
echo ----------------------------------------
Expand Down
44 changes: 15 additions & 29 deletions winpython/wppm.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,40 +26,27 @@
# Workaround for installing PyVISA on Windows from source:
os.environ["HOME"] = os.environ["USERPROFILE"]

class BasePackage:
def __init__(self, fname):
class Package:
"standardize a Package from filename or pip list"
def __init__(self, fname, suggested_summary=None):
self.fname = fname
self.description = piptree.sum_up(suggested_summary) if suggested_summary else ""
self.name = None
self.version = None
self.description = ""
if fname.endswith((".zip", ".tar.gz", ".whl")):
bname = Path(self.fname).name #wheel style name like "sqlite_bro-1.0.0..."
infos = utils.get_source_package_infos(bname) # get name, version
if infos is not None:
self.name, self.version = infos
self.name = utils.normalize(self.name)
self.url = None
self.files = []

setattr(self,'url',"https://pypi.org/project/" + self.name)

def __str__(self):
return f"{self.name} {self.version}\r\n{self.description}\r\nWebsite: {self.url}"


class Package(BasePackage):
def __init__(self, fname, update=False, suggested_summary=None):
BasePackage.__init__(self, fname)
self.files = []
self.extract_infos()
if suggested_summary:
setattr(self, 'description',
piptree.sum_up(suggested_summary ))
bname = fname.split("-")[0]
setattr(self,'url',"https://pypi.org/project/" + bname)

def extract_infos(self):
"Extract package (name, version) from filename (installer basename)"
bname = Path(self.fname).name
if bname.endswith((".zip", ".tar.gz", ".whl")):
# distutils sdist
infos = utils.get_source_package_infos(bname)
if infos is not None:
self.name, self.version = infos
return
raise NotImplementedError(f"Not supported package type {bname}")



class Distribution:
def __init__(self, target=None, verbose=False, indent=False):
Expand Down Expand Up @@ -156,8 +143,7 @@ def get_installed_packages(self, update=False):
# create pip package list
wppm = [
Package(
f"{i[0].replace('-', '_').lower()}-{i[1]}-py3-none-any.whl",
update=update,
f"{i[0].replace('-', '_').lower()}-{i[1]}-py3-none-any.whl", #faking wheel
suggested_summary=self.pip.summary(i[0]) if self.pip else None
)
for i in pip_list
Expand Down