plone / plone/plonecli

plonecli_autocomplete.sh script gets mangled by setup.py scripts stanza

Open
#55 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
20
Forks
12
PR merge metrics
No merged PRs in 30d

Description

  • Plone CLI version: 1.1
  • Python version: 2.7.16
  • Operating System: OSX 10.14

When I install plonecli in a tools builout using:

[plonecli]
recipe = zc.recipe.egg
eggs = plonecli

the plone_autocomplete.sh gets procesed by the setup.py scripts attribute at https://github.com/plone/plonecli/blob/5ba7bc547a3baa110210853a9c6b35b1aa2c7f5a/setup.py#L40

and the resulting bin/plonecli_autocomplete.sh is mangled. The first line is missing and replaced by a shebang to the local python executable and python syspath code is added at the end:

#!/Users/fred/buildouts/my.tools.buildout/bin/python2.7
    COMPREPLY=( $( env COMP_WORDS="${COMP_WORDS[*]}" \
                   COMP_CWORD=$COMP_CWORD \
                   _PLONECLI_COMPLETE=complete $1 ) )
    return 0
}

complete -F _plonecli_completion -o default plonecli;


import sys
sys.path[0:0] = [
  '/Users/fred/buildouts/my.tools.buildout/src/bobtemplates.plone',
  '/Users/fred/.buildout/eggs/plonecli-1.1-py2.7.egg',
  '/Users/fred/.buildout/eggs/zest.releaser-6.18.2-py2.7.egg',
  '/Users/fred/.buildout/eggs/virtualenv-15.1.0-py2.7.egg',
  '/Users/fred/.buildout/eggs/mr.bob-0.1.2-py2.7.egg',
  '/Users/fred/.buildout/eggs/Click-7.0-py2.7.egg',
  '/Users/fred/.buildout/eggs/twine-1.11.0-py2.7.egg',
  '/Users/fred/.buildout/eggs/six-1.11.0-py2.7.egg',
  '/Users/fred/.buildout/eggs/requests-2.18.4-py2.7.egg',
  '/Users/fred/.buildout/eggs/colorama-0.3.9-py2.7.egg',
  '/Users/fred/.buildout/eggs/Jinja2-2.10-py2.7.egg',
  '/Users/fred/.buildout/eggs/case_conversion-2.1.0-py2.7.egg',
  '/Users/fred/.buildout/eggs/lxml-4.1.1-py2.7-macosx-10.12-x86_64.egg',
  '/Users/fred/.buildout/eggs/tqdm-4.19.6-py2.7.egg',
  '/Users/fred/.buildout/eggs/requests_toolbelt-0.8.0-py2.7.egg',
  '/Users/fred/.buildout/eggs/pkginfo-1.4.2-py2.7.egg',
  '/Users/fred/.buildout/eggs/certifi-2018.1.18-py2.7.egg',
  '/Users/fred/.buildout/eggs/urllib3-1.22-py2.7.egg',
  '/Users/fred/.buildout/eggs/idna-2.6-py2.7.egg',
  '/Users/fred/.buildout/eggs/chardet-3.0.4-py2.7.egg',
  '/Users/fred/.buildout/eggs/MarkupSafe-1.0-py2.7-macosx-10.12-x86_64.egg',
  '/Users/fred/.buildout/eggs/regex-2018.8.29-py2.7-macosx-10.13-x86_64.egg',
  '/Users/fred/buildouts/my.tools.buildout/lib/python2.7/site-packages',
  ]




Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the scripts stanza in setup.py and the plonecli_autocomplete.sh source referenced by the issue. Reproduce installation through the shown tools buildout configuration, then verify that the generated bin/plonecli_autocomplete.sh remains a usable shell script without the added Python shebang or sys.path code.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, shell
Domain
build-system, cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.