133 @param version version string for the package (string) |
134 @param version version string for the package (string) |
134 """ |
135 """ |
135 if not fileName: |
136 if not fileName: |
136 return |
137 return |
137 |
138 |
138 try: |
139 with contextlib.suppress(OSError): |
139 os.rename(fileName, fileName + ".orig") |
140 os.rename(fileName, fileName + ".orig") |
140 except OSError: |
|
141 pass |
|
142 try: |
141 try: |
143 hgOut = subprocess.check_output(["hg", "identify", "-i"]) # secok |
142 hgOut = subprocess.check_output(["hg", "identify", "-i"]) # secok |
144 hgOut = hgOut.decode() |
143 hgOut = hgOut.decode() |
145 except (OSError, subprocess.CalledProcessError): |
144 except (OSError, subprocess.CalledProcessError): |
146 hgOut = "" |
145 hgOut = "" |
168 @param version version string for the package (string) |
167 @param version version string for the package (string) |
169 """ |
168 """ |
170 if not fileName: |
169 if not fileName: |
171 return |
170 return |
172 |
171 |
173 try: |
172 with contextlib.suppress(OSError): |
174 os.rename(fileName, fileName + ".orig") |
173 os.rename(fileName, fileName + ".orig") |
175 except OSError: |
|
176 pass |
|
177 with open(fileName + ".orig", "r", encoding="utf-8") as f: |
174 with open(fileName + ".orig", "r", encoding="utf-8") as f: |
178 text = f.read() |
175 text = f.read() |
179 text = ( |
176 text = ( |
180 text.replace("@VERSION@", version) |
177 text.replace("@VERSION@", version) |
181 .replace("@DATE@", datetime.date.today().isoformat()) |
178 .replace("@DATE@", datetime.date.today().isoformat()) |
346 "QScintilla>=2.11.1", |
343 "QScintilla>=2.11.1", |
347 "docutils", |
344 "docutils", |
348 "Markdown", |
345 "Markdown", |
349 "pyyaml", |
346 "pyyaml", |
350 "toml", |
347 "toml", |
|
348 "chardet", |
|
349 "asttokens", |
|
350 "EditorConfig", |
|
351 "Send2Trash", |
|
352 "Pygments", |
351 "pywin32>=1.0;platform_system=='Windows'", |
353 "pywin32>=1.0;platform_system=='Windows'", |
352 ], |
354 ], |
353 data_files=getDataFiles(), |
355 data_files=getDataFiles(), |
354 packages=find_packages(), |
356 packages=find_packages(), |
355 zip_safe=False, |
357 zip_safe=False, |