From 6c46bb19a04bb546dbf23396a8ac52c3354b51f8 Mon Sep 17 00:00:00 2001 From: Hynek Schlawack Date: Fri, 25 Nov 2022 08:30:34 +0100 Subject: [PATCH] Start building Dash/Zeal docsets for docs (#1056) --- .github/workflows/build-docset.yml | 39 +++++++++++++++++++++++++++++ .gitignore | 4 ++- docs/_static/docset-icon.png | Bin 0 -> 637 bytes docs/_static/docset-icon@2x.png | Bin 0 -> 1109 bytes tox.ini | 15 +++++++++++ 5 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build-docset.yml create mode 100644 docs/_static/docset-icon.png create mode 100644 docs/_static/docset-icon@2x.png diff --git a/.github/workflows/build-docset.yml b/.github/workflows/build-docset.yml new file mode 100644 index 00000000..36d3c12a --- /dev/null +++ b/.github/workflows/build-docset.yml @@ -0,0 +1,39 @@ +--- +name: Build docset + +on: + push: + tags: ["*"] + workflow_dispatch: + +env: + PIP_DISABLE_PIP_VERSION_CHECK: 1 + PIP_NO_PYTHON_VERSION_WARNING: 1 + +permissions: # added using https://github.com/step-security/secure-workflows + contents: read + +jobs: + docset: + runs-on: ubuntu-latest + steps: + - name: Harden Runner + uses: step-security/harden-runner@v1 + with: + egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs + + - uses: actions/checkout@v3 + with: + fetch-depth: 0 # get correct version once we switch to hatch-vcs + - uses: actions/setup-python@v4 + with: + python-version: "3.11" + + - run: pip install tox + + - run: tox -e docset + + - uses: actions/upload-artifact@v3 + with: + name: docset + path: attrs.tgz diff --git a/.gitignore b/.gitignore index 3c89675a..f1c6979d 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,8 @@ .vscode build dist -docs/_build/ +docs/_build htmlcov tmp* +attrs.docset +attrs.tgz diff --git a/docs/_static/docset-icon.png b/docs/_static/docset-icon.png new file mode 100644 index 0000000000000000000000000000000000000000..36d10348c4605a62b8fc7e7a7063ca37e203de36 GIT binary patch literal 637 zcmeAS@N?(olHy`uVBq!ia0vp^0w6XA3y|d6q_!SNv7|ftIx;Y9?C1WI$O_~uBzpw; zGB8xBF)%c=FfjZA3N^f7U???UV0e|lz+g3lfkC`r&aOZkpafHrx4R3&|Mvbf`++>p z0*}aI1_r((Aj~*bn@<`j$X?><>&pI&TarzWCGP#HJq!$t;+`&!ArhBE&!5*`Qpmve z;r#cx;mOk8@0VPgH>GHU>z!{;j|NeJX(*f@GkYSpLfus9TGJ;E zettRU7n?InY+T@YwJTLebHBOC%n;M$Qw{U~O{iM8BKO0Cu&{QQNLkT|N+%qY*0xQG zb5{C%ZOL-4ttl0I#YR4VKetu-YQk&#;u+pQmwCVA1%{exiEBhjN@7W>RdP`(kYX@0Ff!6L zFxNFS3^A~pq9HdwB{QuOsKL-&*T6{E$RNbf$jZnZuA%Jm z_e!7!4Y&;@nYpROC5gEO5K9aVb&X6z49u)d%&ZJdAeMaOw73e?BMH(IoS#-wo>-L1 kP+nfHmzkGcoSayYs+V7sKKq@G6i^X^r>mdKI;Vst02Qn3r2qf` literal 0 HcmV?d00001 diff --git a/docs/_static/docset-icon@2x.png b/docs/_static/docset-icon@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..ae336fee3bb40ac76bd4a532bb4f35d78a472a30 GIT binary patch literal 1109 zcmeAS@N?(olHy`uVBq!ia0vp^3P3Ey!2%>}CQaJ{q*&4&eH|GXHuiJ>Nn{1`6_P!I zd>I(3)EF2VS{N990fib~Fff!FFfhDIU|_JC!N4G1FlSew4N!t9$=lt9;eUJonf*W> zXMsm#F#`kN5fEmas?8@26l5>)^mS!_#x2RFr_}SvA7~TPdrud~5R22Tmvb|&rb@7V zxc~XPegEutSMDsEq`&3nof-P38dFcq@lllGNYtLNhF>f&V1`Ibf@znX>x2vK99%}q zr*5b;o5&_=h=@!zTbrZ3TvPA*vy%7E|NKsvWL>%K_vO!bVy++kdguCI7U3{er#Uv- zZ{^ z@~+~8A1l(BX75qaK6F`P+vNuKuiiPF)xyG790zMcAGhs3x8eGm(qj|uPd@X5rzmNS zO73>Hi9KTXZ!eKrY<8($$KMw8}reZKTxeZz?xS09IL{vvTgJbs>t zn~F$e#wx+(ygo~>GPTi21xaMeCWzg!c_cq-OKQ`&#gl(~lfB%^p!_~@Xm9u)y z3AxT*wk1=Jzp_~zb;`tXxuE&W&vUt1euY{*6rXv(=<^my$BkRG-oGxr!@f~>T6O4r z^^}r@=QQuKa2khZPh|A&&0wEyo4zzMEBCr+bZ&q7CdFHC-0yaU{Jgn9n``q_E5^vc zxtIT`2tL}V{87*(YN58-aoJgmjZWL@C$||Hn`rxdvtAIhkyp&iRX%E2?TbeyjqZ<4 z{iL>rwI>IAT{?9|^IFz&Zw;gKxm{Z<^n-FHs_JC~C&t&<2x@G+^fvEeX1n}9Mg!5O zJyVP2P5^U*YKdz^NlIc#s#S7PDv)9@GB7gIH89sTGz>AYurjf*GPKY(Ft9Q(a4)&Q ziJ~DlKP5A*5~#t@T-U%z*T^8m(8$Wj9Im14^7l%h1`W6kC7HRY#U+Wk1rSRN4Rwu7 zLk!HUOw6o+9s^ra-)3(H)FTPf6P%w`Ql40p%1~Zju9umYU7Va)kgAtols@~NjTBH3 NgQu&X%Q~loCICh|&87eV literal 0 HcmV?d00001 diff --git a/tox.ini b/tox.ini index f0a84c29..2a2dfdaf 100644 --- a/tox.ini +++ b/tox.ini @@ -114,3 +114,18 @@ commands = nodeenv --prebuilt --node=lts --force {envdir} npm install -g --no-package-lock --no-save pyright pytest tests/test_pyright.py -vv + + +[testenv:docset] +deps = doc2dash +extras = docs +allowlist_externals = + rm + cp + tar +commands = + rm -rf attrs.docset attrs.tgz docs/_build + sphinx-build -n -T -W -b html -d {envtmpdir}/doctrees docs docs/_build/html + doc2dash --index-page index.html --icon docs/_static/docset-icon.png --online-redirect-url https://www.attrs.org/en/latest/ docs/_build/html + cp docs/_static/docset-icon@2x.png attrs.docset/icon@2x.png + tar --exclude='.DS_Store' -cvzf attrs.tgz attrs.docset