Skip to content

Commit

Permalink
bump version, merge pull request #36 from iterative/devel
Browse files Browse the repository at this point in the history
  • Loading branch information
casperdcl authored Jul 3, 2021
2 parents d93d6af + f0f48b4 commit 7802725
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 20 deletions.
21 changes: 6 additions & 15 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
5 changes: 2 additions & 3 deletions shtab/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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=(
Expand Down
4 changes: 2 additions & 2 deletions tests/test_shtab.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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",
Expand Down

0 comments on commit 7802725

Please sign in to comment.