From 4011f864c47d9c8311f1aaebbde4ea18f7a06796 Mon Sep 17 00:00:00 2001 From: Casper da Costa-Luis Date: Mon, 3 May 2021 15:09:17 +0100 Subject: [PATCH 1/3] build: update actions - actions/create-release@v1 is no longer maintained --- .github/workflows/test.yml | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6f4f8cb..8fae992 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -54,27 +54,18 @@ jobs: - id: dist uses: casperdcl/deploy-pypi@v2 with: - build: true + pip: true password: ${{ secrets.PYPI_TOKEN }} upload: ${{ github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') }} - name: Changelog run: git log --pretty='format:%d%n- %s%n%b---' $(git tag --sort=v:refname | tail -n2 | head -n1)..HEAD > _CHANGES.md - if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') - id: create_release - uses: actions/create-release@v1 + uses: softprops/action-gh-release@v1 env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} with: - tag_name: ${{ github.ref }} - release_name: shtab ${{ github.ref }} beta + release_name: shtab ${{ github.ref }} stable body_path: _CHANGES.md draft: true - - if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: dist/${{ steps.dist.outputs.whl }} - asset_name: ${{ steps.dist.outputs.whl }} - asset_content_type: application/zip + files: | + dist/${{ steps.dist.outputs.whl }} From 6eeb7dcc245990485feb2e1b21c34baa9673a98f Mon Sep 17 00:00:00 2001 From: Casper da Costa-Luis Date: Thu, 1 Jul 2021 21:00:22 +0100 Subject: [PATCH 2/3] bash: cleaner file/dir completions - fixes #37 Co-authored-by: Benjamin Morledge-Hampton --- shtab/__init__.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/shtab/__init__.py b/shtab/__init__.py index fd8d7a7..9fda301 100644 --- a/shtab/__init__.py +++ b/shtab/__init__.py @@ -268,12 +268,11 @@ def complete_bash( # $1=COMP_WORDS[1] _shtab_compgen_files() { compgen -f -- $1 # files - compgen -d -S '/' -- $1 # recurse into subdirs } # $1=COMP_WORDS[1] _shtab_compgen_dirs() { - compgen -d -S '/' -- $1 # recurse into subdirs + compgen -d -- $1 # recurse into subdirs } # $1=COMP_WORDS[1] @@ -344,7 +343,7 @@ def complete_bash( return 0 } -complete -o nospace -F {root_prefix} {prog}""", +complete -o filenames -F {root_prefix} {prog}""", commands=" ".join(commands), options=" ".join(options), preamble=( From f0f48b44c92812c2ac231cd4295edfa80ce59f1a Mon Sep 17 00:00:00 2001 From: Casper da Costa-Luis Date: Thu, 1 Jul 2021 21:13:36 +0100 Subject: [PATCH 3/3] update tests --- tests/test_shtab.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_shtab.py b/tests/test_shtab.py index 9e431fb..e8f1e75 100644 --- a/tests/test_shtab.py +++ b/tests/test_shtab.py @@ -81,7 +81,7 @@ def test_prog_override(shell, caplog, capsys): captured = capsys.readouterr() assert not captured.err if shell == "bash": - assert "complete -o nospace -F _shtab_shtab foo" in captured.out + assert "complete -o filenames -F _shtab_shtab foo" in captured.out assert not caplog.record_tuples @@ -95,7 +95,7 @@ def test_prog_scripts(shell, caplog, capsys): assert not captured.err script_py = [i.strip() for i in captured.out.splitlines() if "script.py" in i] if shell == "bash": - assert script_py == ["complete -o nospace -F _shtab_shtab script.py"] + assert script_py == ["complete -o filenames -F _shtab_shtab script.py"] elif shell == "zsh": assert script_py == [ "#compdef script.py",