Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ jobs:

build-snap:
runs-on: ${{ matrix.os }}
if: github.repository == 'tldr-pages/tldr-python-client' && github.ref == 'refs/heads/main'
needs: ['build-linux']

strategy:
Expand All @@ -152,6 +153,7 @@ jobs:
id: snapcraft-build
with:
snapcraft-args: "-v"
path: "snap/test-snapcraft.yaml"

- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
Expand Down
76 changes: 76 additions & 0 deletions snap/test-snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: tldr
base: core24
summary: tldr python client
description: Python command-line client for tldr pages.

grade: stable
confinement: strict

platforms:
amd64:
build-on: [amd64]
build-for: [amd64]
arm64:
build-on: [arm64]
build-for: [arm64]
armhf:
build-on: [armhf]
build-for: [armhf]
ppc64el:
build-on: [ppc64el]
build-for: [ppc64el]
s390x:
build-on: [s390x]
build-for: [s390x]

parts:
tldr:
plugin: python
source: https://github.com/tldr-pages/tldr-python-client.git
source-type: git
build-environment:
- PATH: ${CRAFT_PART_INSTALL}/bin:${PATH}
- PYTHONPATH: ${CRAFT_PART_INSTALL}/lib/python3.12/site-packages
override-pull: |
craftctl default
sed -i "/data_files=\[('share\/man\/man1', \['docs\/man\/tldr\.1'\])\],/d" setup.py
override-build: |
craftctl default
cd $CRAFT_PART_SRC/docs
make man
mkdir -p $CRAFT_PART_INSTALL/share/man/man1
cp -r $CRAFT_PART_SRC/docs/man/tldr.1 $CRAFT_PART_INSTALL/share/man/man1/tldr.1
python-packages:
- Sphinx
- sphinx-argparse
prime:
- -include
- -bin/activate
- -bin/activate.csh
- -bin/activate.fish
- -bin/Activate.ps1
- -bin/python
- -bin/python3
- -bin/python3.12
- -lib/*/*/sphinx*
- -lib/*/*/setuptools*
- -lib/*/*/pip*
- -lib/*/*/pkg_resources
- -bin/pip
- -bin/pip3
- -bin/pip3.12
- -bin/[a-s, u-z, _]*
- -pyvenv.cfg
- -lib/*/*/[a-b, d-r, u-z, A-B, D-R, U-Z, _]*
- -lib/*/*/certifi*
- -lib/*/*/charset*
- -lib/*/*/snowballs*

apps:
tldr:
command: bin/tldr
environment:
PYTHONPATH: $SNAP/lib/python3.12/site-packages:$PYTHONPATH
plugs:
- network
- home