8000 Merge pull request #522 from stonebig/master · secondmover/winpython@5b51fce · GitHub
[go: up one dir, main page]

Skip to content

Commit 5b51fce

Browse files
authored
Merge pull request winpython#522 from stonebig/master
separate 32bit and 64bit changelogs
2 parents f5ba0d1 + 6164a57 commit 5b51fce

File tree

2 files changed

+29
-22
lines changed

2 files changed

+29
-22
lines changed

diff.py

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,11 @@ def diff_package_dicts(dict1_in, dict2_in):
148148
return text
149149

150150

151-
def find_closer_version(version1, basedir=None, flavor=''):
151+
def find_closer_version(version1, basedir=None, flavor='', architecture=64):
152152
"""Find version which is the closest to `version`"""
153153
builddir = osp.join(basedir, 'build%s' % flavor)
154-
func = lambda name: re.match(r'WinPython%s-([0-9\.]*)\.(txt|md)' % flavor, name)
154+
func = lambda name: re.match(r'WinPython%s-%sbit-([0-9\.]*)\.(txt|md)' %
155+
(flavor, architecture), name)
155156
versions = [func(name).groups()[0]
156157
for name in os.listdir(builddir) if func(name)]
157158
try:
@@ -165,16 +166,17 @@ def find_closer_version(version1, basedir=None, flavor=''):
165166

166167

167168
def compare_package_indexes(version2, version1=None, basedir=None, flavor='',
168-
flavor1=None):
169+
flavor1=None, architecture=64):
169170
"""Compare two package index Wiki pages"""
170171
if version1 is None:
171172
version1 = find_closer_version(version2, basedir=basedir,
172-
flavor=flavor)
173+
flavor=flavor, architecture=architecture)
173174
flavor1 = flavor1 if flavor1 is not None else flavor
174-
text = '\r\n'.join(["## History of changes for WinPython %s" %
175-
(version2+flavor),
176-
"", "The following changes were made to WinPython "
177-
"distribution since version %s." % (version1+flavor1),
175+
text = '\r\n'.join(["## History of changes for WinPython-%sbit %s" %
176+
(architecture, version2+flavor),
177+
"", "The following changes were made to WinPython-%sbit"
178+
" distribution since version %s." % (architecture,
179+
version1+flavor1),
178180
"", ""])
179181
pi1 = PackageIndex(version1, basedir=basedir, flavor=flavor1)
180182
pi2 = PackageIndex(version2, basedir=basedir, flavor=flavor)
@@ -188,24 +190,25 @@ def compare_package_indexes(version2, version1=None, basedir=None, flavor='',
188190
return text
189191

190192

191-
def _copy_all_changelogs(version, basedir, flavor=''):
193+
def _copy_all_changelogs(version, basedir, flavor='', architecture=64):
192194
basever = '.'.join(version.split('.')[:2])
193195
for name in os.listdir(CHANGELOGS_DIR):
194-
if re.match(r'WinPython%s-%s([0-9\.]*)\.(txt|md)' %
195-
(flavor, basever), name):
196+
if re.match(r'WinPython%s-%sbit-%s([0-9\.]*)\.(txt|md)' %
197+
(flavor, architecture, basever), name):
196198
shutil.copyfile(osp.join(CHANGELOGS_DIR, name),
197199
osp.join(basedir, 'build%s' % flavor, name))
198200

199201

200202
def write_changelog(version2, version1=None, basedir=None, flavor='',
201-
release_level=''):
203+
release_level='', architecture=64):
202204
"""Write changelog between version1 and version2 of WinPython"""
203-
_copy_all_changelogs(version2, basedir, flavor=flavor)
204-
print ('comparing_package_indexes', version2, basedir, flavor)
205+
_copy_all_changelogs(version2, basedir, flavor=flavor, architecture=architecture)
206+
print ('comparing_package_indexes', version2, basedir, flavor, architecture)
205207
text = compare_package_indexes(version2, version1, basedir=basedir,
206-
flavor=flavor)
208+
flavor=flavor, architecture=architecture)
207209
fname = osp.join(basedir, 'build%s' % flavor,
208-
'WinPython%s-%s_History.md' % (flavor, version2))
210+
'WinPython%s-%sbit-%s_History.md' % (flavor, architecture,
211+
version2))
209212
with open(fname, 'w', encoding='utf-8-sig') as fdesc: # python 3 need
210213
fdesc.write(text)
211214
# Copy to winpython/changelogs
@@ -226,8 +229,9 @@ def test_parse_package_index_wiki(version, basedir=None, flavor=''):
226229
print('')
227230

228231

229-
def test_compare(basedir, version2, version1):
230-
print(compare_package_indexes(basedir, version2, version1))
232+
def test_compare(basedir, version2, version1, architecture=64):
233+
print(compare_package_indexes(basedir, version2, version1,
234+
architecture=architecture))
231235

232236

233237
if __name__ == '__main__':

make.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ def get_tool_path(relpath, checkfunc):
177177
python_desc = 'Python programming language with standard library'
178178
return """## WinPython %s
179179
180-
The following packages are included in WinPython v%s%s.
180+
The following packages are included in WinPython-%s v%s%s.
181181
182182
### Tools
183183
@@ -190,7 +190,7 @@ def get_tool_path(relpath, checkfunc):
190190
Name | Version | Description
191191
-----|---------|------------
192192
[Python](http://www.python.org/) | %s | %s
193-
%s""" % (self.winpyver2+self.flavor, self.winpyver2+self.flavor,
193+
%s""" % (self.winpy_arch, self.winpyver2+self.flavor, self.winpyver2+self.flavor,
194194
(' %s' % self.release_level), '\n'.join(tools),
195195
self.python_fullversion, python_desc, '\n'.join(packages))
196196

@@ -1181,9 +1181,11 @@ def make(self, remove_existing=True, requirements=None, my_winpydir=None): #, f
11811181
# Writing package index
11821182
self._print("Writing package index")
11831183
# winpyver2 = need the version without build part
1184+
# but with self.distribution.architecture
11841185
self.winpyver2 = '%s.%s' % (self.python_fullversion, self.build_number)
11851186
fname = osp.join(self.winpydir, os.pardir,
1186-
'WinPython%s-%s.md' % (self.flavor, self.winpyver2))
1187+
'WinPython%s-%sbit-%s.md' % (self.flavor,
1188+
self.distribution.architecture, self.winpyver2))
11871189
open(fname, 'w').write(self.package_index_wiki)
11881190
# Copy to winpython/changelogs
11891191
shutil.copyfile(fname, osp.join(CHANGELOGS_DIR, osp.basename(fname)))
@@ -1192,7 +1194,8 @@ def make(self, remove_existing=True, requirements=None, my_winpydir=None): #, f
11921194
# Writing changelog
11931195
self._print("Writing changelog")
11941196
diff.write_changelog(self.winpyver2, basedir=self.basedir,
1195-
flavor=self.flavor, release_level=self.release_level)
1197+
flavor=self.flavor, release_level=self.release_level,
1198+
architecture=self.distribution.architecture)
11961199
self._print_done()
11971200

11981201

0 commit comments

Comments
 (0)
0