Skip to content

changelog split bug corrections #523

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 14, 2017
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
20 changes: 11 additions & 9 deletions diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,24 +62,26 @@ def upgrade_wiki(self, other):


class PackageIndex(object):
WINPYTHON_PATTERN = r'\#\# WinPython ([0-9\.a-zA-Z]*)'
WINPYTHON_PATTERN = r'\#\# WinPython\-*[0-9b-t]* ([0-9\.a-zA-Z]*)'
TOOLS_LINE = '### Tools'
PYTHON_PACKAGES_LINE = '### Python packages'
HEADER_LINE1 = 'Name | Version | Description'
HEADER_LINE2 = '-----|---------|------------'

def __init__(self, version, basedir=None, flavor=''):
def __init__(self, version, basedir=None, flavor='', architecture=64):
self.version = version
self.other_packages = {}
self.python_packages = {}
self.flavor = flavor
self.basedir = basedir
self.architecture = architecture
self.from_file(basedir)

def from_file(self, basedir):
#fname = osp.join(basedir, 'build%s' % self.flavor,
fname = osp.join(CHANGELOGS_DIR,
'WinPython%s-%s.md' % (self.flavor, self.version))
'WinPython%s-%sbit-%s.md' % (self.flavor,
self.architecture, self.version))
with open(fname, 'r') as fdesc: # python3 doesn't like 'rb'
text = fdesc.read()
self.from_text(text)
Expand Down Expand Up @@ -178,8 +180,8 @@ def compare_package_indexes(version2, version1=None, basedir=None, flavor='',
" distribution since version %s." % (architecture,
version1+flavor1),
"", ""])
pi1 = PackageIndex(version1, basedir=basedir, flavor=flavor1)
pi2 = PackageIndex(version2, basedir=basedir, flavor=flavor)
pi1 = PackageIndex(version1, basedir=basedir, flavor=flavor1, architecture=architecture)
pi2 = PackageIndex(version2, basedir=basedir, flavor=flavor, architecture=architecture)
tools_text = diff_package_dicts(pi1.other_packages, pi2.other_packages)
if tools_text:
text += PackageIndex.TOOLS_LINE + '\r\n\r\n' + tools_text
Expand Down Expand Up @@ -215,9 +217,9 @@ def write_changelog(version2, version1=None, basedir=None, flavor='',
shutil.copyfile(fname, osp.join(CHANGELOGS_DIR, osp.basename(fname)))


def test_parse_package_index_wiki(version, basedir=None, flavor=''):
def test_parse_package_index_wiki(version, basedir=None, flavor='', architecture=64):
"""Parse the package index Wiki page"""
pi = PackageIndex(version, basedir=basedir, flavor=flavor)
pi = PackageIndex(version, basedir=basedir, flavor=flavor, architecture=architecture)
utils.print_box("WinPython %s:" % pi.version)
utils.print_box("Tools:")
for package in pi.other_packages.values():
Expand All @@ -235,8 +237,8 @@ def test_compare(basedir, version2, version1, architecture=64):


if __name__ == '__main__':
print (compare_package_indexes('3.4.4.1', '3.4.3.6',
basedir='D:\Winpython\basedir34', flavor='Slim', flavor1=''))
print (compare_package_indexes('3.6.1.1', '3.6.1.0',
basedir='D:\Winpython\basedir36', flavor='Qt5', flavor1='Qt5', architecture=32))
# test_parse_package_index_wiki('2.7.3.3')
# print(compare_package_indexes('2.7.3.3', '2.7.3.1'))
# write_changelog('2.7.4.1', '2.7.4.0')
Expand Down
2 changes: 1 addition & 1 deletion make.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ def get_tool_path(relpath, checkfunc):
Name | Version | Description
-----|---------|------------
[Python](http://www.python.org/) | %s | %s
%s""" % (self.winpy_arch, self.winpyver2+self.flavor, self.winpyver2+self.flavor,
%s""" % (self.winpyver2+self.flavor, self.winpy_arch, self.winpyver2+self.flavor,
(' %s' % self.release_level), '\n'.join(tools),
self.python_fullversion, python_desc, '\n'.join(packages))

Expand Down