From ef01e7039d044fffe6a2c4b38ad59264899c5e77 Mon Sep 17 00:00:00 2001 From: William Lachance Date: Tue, 19 Nov 2019 14:51:12 -0500 Subject: [PATCH] Make mkpkg command more prominent in the docs (#567) * Make mkpkg command more prominent in the docs Under "adding new packages", information on the mkpkg command is buried under "meta.yaml". To make it easier to find, give this command its own section. * Update docs/new_packages.md Co-Authored-By: Michael Droettboom --- docs/new_packages.md | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/docs/new_packages.md b/docs/new_packages.md index e98f254b8..e74b31fb9 100644 --- a/docs/new_packages.md +++ b/docs/new_packages.md @@ -1,9 +1,7 @@ # Creating a Pyodide package -Pyodide includes a set of automatic tools to make it easier to add new -third-party Python libraries to the build. - -These tools automate the following steps to build a package: +Pyodide includes a toolchain to make it easier to add new third-party Python +libraries to the build. We automate the following steps: - Download a source tarball (usually from PyPI) - Confirm integrity of the package by comparing it to a checksum @@ -26,6 +24,18 @@ Lastly, a `packages.json` file is output containing the dependency tree of all packages, so `pyodide.loadPackage` can load a package's dependencies automatically. +## mkpkg + +If you wish to create a new package for pyodide, the easiest place to start is +with the `mkpkg` tool. If your package is on PyPI, just run: + +`bin/pyodide mkpkg $PACKAGE_NAME` + +This will generate a `meta.yaml` (see below) that should work out of the box +for many pure Python packages. This tool will populate the latest version, download +link and sha256 hash by querying PyPI. It doesn't currently handle package +dependencies, so you will need to specify those yourself. + ## The meta.yaml file Packages are defined by writing a `meta.yaml` file. The format of these files is @@ -41,13 +51,6 @@ expect Conda packages to "just work" with Pyodide. (In the longer term, Pyodide may use conda as its packaging system, and this should hopefully ease that transition.) -There is a helper tool that will generate a `meta.yaml` for packages on PyPI -that will work for many pure Python packages. This tool will populate the latest -version, download link and sha256 hash by querying PyPI. It doesn't currently -handle package dependencies. To run it, do: - -`bin/pyodide mkpkg $PACKAGE_NAME` - The supported keys in the `meta.yaml` file are described below. ### `package`