13
13
from __future__ import print_function , with_statement
14
14
15
15
import os
16
- # import os.path as osp
17
16
from pathlib import Path
18
17
import re
19
18
import shutil
25
24
def normalize (name ):
26
25
return re .sub (r"[-_.]+" , "-" , name ).lower ()
27
26
28
- # CHANGELOGS_DIR = osp.join(
29
- # osp.dirname(__file__), 'changelogs'
30
- # )
31
27
CHANGELOGS_DIR = str (Path (__file__ ).parent / 'changelogs' )
32
- # assert osp.isdir(CHANGELOGS_DIR)
33
28
assert Path (CHANGELOGS_DIR ).is_dir ()
34
29
35
30
@@ -111,16 +106,6 @@ def __init__(
111
106
self .from_file (basedir )
112
107
113
108
def from_file (self , basedir ):
114
- # fname = osp.join(basedir, 'build%s' % self.flavor,
115
- #fname = osp.join(
116
- # CHANGELOGS_DIR,
117
- # 'WinPython%s-%sbit-%s.md'
118
- # % (
119
- # self.flavor,
120
- # self.architecture,
121
- # self.version,
122
- # ),
123
- #)
124
109
fname = str (Path (CHANGELOGS_DIR ) /
125
110
f'WinPython{ self .flavor } -{ self .architecture } bit-{ self .version } .md' )
126
111
@@ -214,7 +199,6 @@ def find_closer_version(
214
199
version1 , basedir = None , flavor = '' , architecture = 64
215
200
):
216
201
"""Find version which is the closest to `version`"""
217
- # builddir = osp.join(basedir, 'bu%s' % flavor)
218
202
builddir = str (Path (basedir ) / f'bu{ flavor } ' )
219
203
func = lambda name : re .match (
220
204
r'WinPython%s-%sbit-([0-9\.]*)\.(txt|md)'
@@ -311,9 +295,7 @@ def _copy_all_changelogs(
311
295
name ,
312
296
):
313
297
shutil .copyfile (
314
- # osp.join(CHANGELOGS_DIR, name),
315
298
str (Path (CHANGELOGS_DIR ) / name ),
316
- # osp.join(basedir, 'bu%s' % flavor, name),
317
299
str (Path (basedir ) / f'bu{ flavor } ' / name ),
318
300
)
319
301
@@ -347,12 +329,6 @@ def write_changelog(
347
329
flavor = flavor ,
348
330
architecture = architecture ,
349
331
)
350
- #fname = osp.join(
351
- # basedir,
352
- # 'bu%s' % flavor,
353
- # 'WinPython%s-%sbit-%s_History.md'
354
- # % (flavor, architecture, version2),
355
- #)
356
332
fname = str (Path (basedir ) /
357
333
f'bu{ flavor } ' /
358
334
f'WinPython{ flavor } -{ architecture } bit-{ version2 } _History.md' )
@@ -364,7 +340,6 @@ def write_changelog(
364
340
fdesc .write (text )
365
341
# Copy to winpython/changelogs
366
342
shutil .copyfile (
367
- #fname, osp.join(CHANGELOGS_DIR, osp.basename(fname))
368
343
fname , str (Path (CHANGELOGS_DIR ) / Path (fname ).name )
369
344
)
370
345
0 commit comments