From 999fcf8083ae46a4dd48898b7a3f2c7f4adf63f5 Mon Sep 17 00:00:00 2001 From: Valentin Niess Date: Fri, 3 Apr 2020 23:54:57 +0200 Subject: [PATCH] Clean the CLI, applications workflow & README --- .github/workflows/applications.yml | 9 ++++--- README.md | 35 +++++++++++++++++++++++++-- python_appimage/__main__.py | 6 +++++ python_appimage/commands/build/app.py | 3 ++- 4 files changed, 47 insertions(+), 6 deletions(-) diff --git a/.github/workflows/applications.yml b/.github/workflows/applications.yml index 79fb074..05da762 100644 --- a/.github/workflows/applications.yml +++ b/.github/workflows/applications.yml @@ -1,4 +1,4 @@ -name: PyPI +name: Applications on: push: paths: @@ -21,12 +21,15 @@ jobs: - name: Test scipy run: | - python -m python_appimage build app applications/scipy + python -m python_appimage build app applications/scipy \ + --python-version=2.7 \ + --python-tag=cp27-cp27mu test -e scipy-x86_64.AppImage - name: Test tasmotizer run: | - python -m python_appimage build app applications/tasmotizer + python -m python_appimage build app applications/tasmotizer \ + --linux-tag=manylinux2014_x86_64 test -e tasmotizer-x86_64.AppImage - name: Test xonsh diff --git a/README.md b/README.md index ac923ac..7facad0 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,38 @@ # AppImage distributions of Python -_Work in progress - Check the [releases][RELEASES] area for available -AppImages._ +_Ready to use AppImages of Python are available as GitHub [releases][RELEASES]._ + +## Quickstart + +Our AppImages provide relocatable Python runtimes. Installation is as simple as +downloading a single file and changing its mode to executable, e.g. as: + +```sh +wget https://github.com/niess/python-appimage/releases/download/python3.8/python3.8.2-cp38-cp38-manylinux1_x86_64.AppImage +chmod +x python3.8.2-cp38-cp38-manylinux1_x86_64.AppImage +./python3.8 python3.8.2-cp38-cp38-manylinux1_x86_64.AppImage +``` + +This should run Python 3.8 on _almost_ any Linux provided that `fuse` is +available. Note that on WSL1 since `fuse` is not supported you will need to +extract the AppImage as explained hereafter. + +The installation mode described previously is enough if you only need vanilla +Python with its standard library. However, if you plan to install extra +packages we recommmed extracting the AppImage as: + +```sh +./python3.8.2-cp38-cp38-manylinux1_x86_64.AppImage --appimage-extract +mv squashfs-root python3.8.2-cp38-cp38-manylinux1_x86_64.AppDir +ln -s python3.8.2-cp38-cp38-manylinux1_x86_64.AppDir/AppRun python3.8 +``` + +Then, extra packages can be installed to the extracted AppDir using `pip`. E.g. +updating pip can be done as: + +```sh +./python3.8 -m pip install -U pip +``` [RELEASES]: https://github.com/niess/python-appimage/releases diff --git a/python_appimage/__main__.py b/python_appimage/__main__.py index a59fcb4..24f395e 100644 --- a/python_appimage/__main__.py +++ b/python_appimage/__main__.py @@ -62,6 +62,12 @@ def main(): help='path to the application metadata') build_app_parser.add_argument('-n', '--name', help='application name') + build_app_parser.add_argument('-l', '--linux-tag', + help='linux compatibility tag (e.g. manylinux1_x86_64)') + build_app_parser.add_argument('--python-tag', + help='python compatibility tag (e.g. cp37-cp37m)') + build_app_parser.add_argument('-p', '--python-version', + help='python version (e.g. 3.8)') which_parser = subparsers.add_parser('which', description='Locate a binary dependency') diff --git a/python_appimage/commands/build/app.py b/python_appimage/commands/build/app.py index eb378f8..7ad096b 100644 --- a/python_appimage/commands/build/app.py +++ b/python_appimage/commands/build/app.py @@ -24,7 +24,8 @@ __all__ = ['execute'] def _unpack_args(args): '''Unpack command line arguments ''' - return args.appdir, args.name + return args.appdir, args.name, args.python_version, args.linux_tag, \ + args.python_tag _tag_pattern = re.compile('python([^-]+)[-]([^.]+)[.]AppImage')