diff --git a/make.py b/make.py index c560d594..8d6e57c0 100644 --- a/make.py +++ b/make.py @@ -130,26 +130,22 @@ def package_index_markdown(self) -> str: def _get_installed_tools_markdown(self) -> str: """Generates Markdown for installed tools section in package index.""" - installed_tools = [] - - def get_tool_path(relative_path): - path = self.winpython_directory / relative_path if self.winpython_directory else None - return path if path and path.exists() else None + tool_lines = [] - if nodejs_path := get_tool_path(NODEJS_RELATIVE_PATH): - installed_tools.append(("Nodejs", utils.get_nodejs_version(nodejs_path))) - installed_tools.append(("npmjs", utils.get_npmjs_version(nodejs_path))) + if (nodejs_path := self.winpython_directory / NODEJS_RELATIVE_PATH).exists(): + version = utils.get_nodejs_version(nodejs_path) + tool_lines.append(f"[Nodejs](https://nodejs.org) | {version} | a JavaScript runtime built on Chrome's V8 JavaScript engine") + version = utils.get_npmjs_version(nodejs_path) + tool_lines.append(f"[npmjs](https://www.npmjs.com) | {version} | a package manager for JavaScript") - if pandoc_exe := get_tool_path("t/pandoc.exe"): - installed_tools.append(("Pandoc", utils.get_pandoc_version(str(pandoc_exe.parent)))) + if (pandoc_exe := self.winpython_directory / "t" / "pandoc.exe").exists(): + version = utils.get_pandoc_version(str(pandoc_exe.parent)) + tool_lines.append(f"[Pandoc](https://pandoc.org) | {version} | an universal document converter") - if vscode_exe := get_tool_path("t/VSCode/Code.exe"): - installed_tools.append(("VSCode", utils.getFileProperties(str(vscode_exe))["FileVersion"])) + if vscode_exe := (self.winpython_directory / "t" / "VSCode" / "Code.exe").exists(): + version = utils.getFileProperties(str(vscode_exe))["FileVersion"] + tool_lines.append(f"[VSCode](https://code.visualstudio.com) | {version} | a source-code editor developed by Microsoft") - tool_lines = [] - for name, version in installed_tools: - metadata = utils.get_package_metadata("tools.ini", name) - tool_lines.append(f"[{name}]({metadata['url']}) | {version} | {metadata['description']}") return "\n".join(tool_lines) def _get_installed_packages_markdown(self) -> str: diff --git a/winpython/__init__.py b/winpython/__init__.py index b1267b4e..8bddcb81 100644 --- a/winpython/__init__.py +++ b/winpython/__init__.py @@ -28,6 +28,6 @@ OTHER DEALINGS IN THE SOFTWARE. """ -__version__ = '15.2.20250412' +__version__ = '15.3.20250417' __license__ = __doc__ __project_url__ = 'http://winpython.github.io/' diff --git a/winpython/data/tools.ini b/winpython/data/tools.ini deleted file mode 100644 index 0f27fc8f..00000000 --- a/winpython/data/tools.ini +++ /dev/null @@ -1,47 +0,0 @@ -[gettext] -description=GNU gettext Win32 porting - the GNU translation tool (useful tools for pygettext, a standard library module) -url=https://sourceforge.net/projects/gettext - -[julia] -description=The Julia Langage -url=https://julialang.org/ - -[mingw32] -description=C/C++ and Fortran compilers (Mingwpy static toolchain version) -url=https://github.com/numpy/numpy/wiki/Mingw-static-toolchain - -[pandoc] -description=a universal document converter -url=https://pandoc.org/ - -[r] -description=The R Project for Statistical Computing -url=https://www.r-project.org - -[scite] -description=SCIntilla based Text Editor - Multilanguage, powerful and light-weight text editor -url=http://www.scintilla.org/SciTE.html - -[tortoisehg] -description=Set of graphical tools and a shell extension for the Mercurial distributed revision control system -url=https://tortoisehg.bitbucket.io/ - -[winmerge] -description=Open Source differencing and merging tool for Windows -url=http://winmerge.org - -[nodejs] -description=a JavaScript runtime built on Chrome's V8 JavaScript engine -url=https://nodejs.org - -[npmjs] -description=a package manager for JavaScript -url=https://www.npmjs.com/ - -[yarnpkg] -description=a package manager for JavaScriptFast, reliable, and secure dependency management -url=https://yarnpkg.com/lang/en/ - -[ffmpeg] -description=a collection of libraries and tools to process multimedia content such as audio, video, subtitles and related metadata -url=https://ffmpeg.org diff --git a/winpython/utils.py b/winpython/utils.py index 7939c3a3..0ee7c875 100644 --- a/winpython/utils.py +++ b/winpython/utils.py @@ -379,27 +379,6 @@ def normalize(this): """Apply PEP 503 normalization to the string.""" return re.sub(r"[-_.]+", "-", this).lower() -def get_package_metadata(database, name): - """Extract infos (description, url) from the local database.""" - DATA_PATH = Path(sys.modules['winpython'].__file__).parent / 'data' - db = cp.ConfigParser() - filepath = Path(database) if Path(database).is_absolute() else DATA_PATH / database - db.read_file(open(str(filepath), encoding=guess_encoding(filepath)[0])) - - my_metadata = { - "description": "", - "url": f"https://pypi.org/project/{name}", - } - for key in my_metadata: - for name2 in (name, normalize(name)): - try: - my_metadata[key] = db.get(name2, key) - break - except (cp.NoSectionError, cp.NoOptionError): - pass - - return my_metadata - if __name__ == '__main__': print_box("Test") dname = sys.prefix