From 125d03891fb62f71eaa8ba50ad0fb34c1b449992 Mon Sep 17 00:00:00 2001 From: Micah Lee Date: Sun, 2 Oct 2022 17:09:04 -0700 Subject: [PATCH] Change how poetry is installed in snapcraft, and update release docs --- RELEASE.md | 18 +++++++++--------- snap/snapcraft.yaml | 3 +-- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/RELEASE.md b/RELEASE.md index 6cf919a9..5ed0f217 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -201,13 +201,12 @@ After there's a new release tag, make the Flathub package work here: https://git You must have `flatpak` and `flatpak-builder` installed, with flathub remote added (`flatpak remote-add --if-not-exists --user flathub https://flathub.org/repo/flathub.flatpakrepo`). - [ ] Change the tag (for both `onionshare` and `onionshare-cli`) to match the new git tag -- [ ] Update `tor`, `libevent`, and `obfs4` dependencies, if necessary +- [ ] Update `tor`, `libevent`, `obfs4`, `meek-client`, and `snowflake-client` dependencies, if necessary - [ ] Built the latest python dependencies using [this tool](https://github.com/flatpak/flatpak-builder-tools/blob/master/pip/flatpak-pip-generator) (see below) - [ ] Test the Flatpak package, ensure it works ``` -# you may need to install toml -pip3 install --user toml +pip3 install toml requirements-parser # clone flatpak-build-tools git clone https://github.com/flatpak/flatpak-builder-tools.git @@ -219,15 +218,16 @@ cd .. # get onionshare dependencies cd pip -./flatpak-pip-generator $(python3 -c 'import toml; print("\n".join(toml.loads(open("../../onionshare/desktop/pyproject.toml").read())["tool"]["briefcase"]["app"]["onionshare"]["requires"]))' |grep -v "./onionshare_cli" |grep -v -i "pyside2" |tr "\n" " ") -mv python3-modules.json onionshare.json +./flatpak-pip-generator $(python3 -c 'import toml; print("\n".join(toml.loads(open("../../onionshare/desktop/pyproject.toml").read())["tool"]["poetry"]["dependencies"]))' |grep -vi onionshare_cli |grep -vi python | grep -vi pyside2 | grep -vi cx_freeze |tr "\n" " ") +cd .. -# use something like https://www.json2yaml.com/ to convert to yaml and update the manifest -# add all of the modules in both onionshare-cli and onionshare to the submodules of "onionshare" -# - poetry/generated-poetry-sources.json (onionshare-cli) -# - pip/python3-modules.json (onionshare) +# convert to yaml +./flatpak-json2yaml.py -o onionshare-cli.yml poetry/generated-poetry-sources.json +./flatpak-json2yaml.py -o onionshare.yml pip/python3-qrcode.json ``` +Now, merge `onionshare-cli.yml` and `onionshare.yml` into the Flatpak config. + Build and test the Flatpak package before publishing: ```sh diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 2f1960eb..55b5334c 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -117,8 +117,6 @@ parts: onionshare-cli: source: ./cli plugin: python - python-packages: - - poetry stage-packages: - build-essential - libssl-dev @@ -127,6 +125,7 @@ parts: - python3-pip - cargo override-build: | + python3 -m pip install poetry poetry install poetry build python3 -m pip install ./dist/onionshare_cli-*.whl --prefix $SNAPCRAFT_PART_INSTALL