xonsh / xontrib-template

Full-featured template for building extension (xontrib) for the xonsh shell.
MIT License
42 stars 12 forks source link

Autoloading support to xontribs #17

Closed jnoortheen closed 1 year ago

jnoortheen commented 2 years ago

Closes #16

anki-code commented 2 years ago

I have no question about autoloading:

```python cd /tmp git clone https://github.com/xonsh/xontrib-template cd xontrib-template git checkout remotes/origin/autoloading copier . . ``` ``` 🎤 Enter your full name. This will appear in the License generated and `setu anki-code 🎤 You Github username or organization name under which the projects lives. anki-code 🎤 Your E-mail address. This will appear in the License generated and `setup no@no.no 🎤 Name of the project without the 'xontrib-' prefix autorc 🎤 full repository name. Mostly the default is good. xontrib-autorc 🎤 name of the Python module created inside the 'xontrib/' namespace package autorc 🎤 A short description of the project. autorc 🎤 package_manager setuptools 🎤 Enable pre-commit for this project? Yes 🎤 Use Only pure Python for developing the extension? Yes 🎤 project version 0.0.1 Copying from template version 0.0.1 identical . create xontrib-autorc create xontrib-autorc/.pre-commit-config.yaml create xontrib-autorc/xontrib create xontrib-autorc/xontrib/autorc.py create xontrib-autorc/.editorconfig create xontrib-autorc/.gitignore create xontrib-autorc/tests create xontrib-autorc/tests/test_xontrib.py create xontrib-autorc/tests/__init__.py create xontrib-autorc/LICENSE create xontrib-autorc/README.md create xontrib-autorc/.gitattributes create xontrib-autorc/pyproject.toml create xontrib-autorc/.copier-answers.yml create xontrib-autorc/.github create xontrib-autorc/.github/release-drafter.yml create xontrib-autorc/.github/issue_template.md create xontrib-autorc/.github/pull_request_template.md create xontrib-autorc/.github/workflows create xontrib-autorc/.github/workflows/release.yml create xontrib-autorc/.github/workflows/test.yml ```
jnoortheen commented 2 years ago

It selects the recent tag by default. please use --vcs-ref

copier --vcs-ref=HEAD . /tmp/test
anki-code commented 2 years ago

I've got the error:

``` copier --vcs-ref=HEAD . . 🎤 Enter your full name. This will appear in the License generated and `setu ggg 🎤 You Github username or organization name under which the projects lives. ggg 🎤 Your E-mail address. This will appear in the License generated and `setup ggg 🎤 Name of the project without the 'xontrib-' prefix ggg 🎤 full repository name. Mostly the default is good. xontrib-ggg 🎤 A short description of the project. 🎤 Choose a build backend for the project setuptools 🎤 Enable auto-loading the xontrib when installed? Yes 🎤 name of the xontrib/plugin gggTraceback (most recent call last): File "/home/user/.local/pipx/venvs/copier/lib/python3.10/site-packages/copier/user_data.py", line 215, in get_default result = self.answers.init[self.var_name] KeyError: 'has_aliases' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/user/.local/pipx/venvs/copier/lib/python3.10/site-packages/copier/user_data.py", line 218, in get_default result = self.answers.last[self.var_name] KeyError: 'has_aliases' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/user/.local/pipx/venvs/copier/lib/python3.10/site-packages/copier/user_data.py", line 221, in get_default result = self.answers.user_defaults[self.var_name] KeyError: 'has_aliases' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/user/.local/bin/copier", line 8, in sys.exit(CopierApp.run()) File "/home/user/.local/pipx/venvs/copier/lib/python3.10/site-packages/plumbum/cli/application.py", line 629, in run inst, retcode = subapp.run(argv, exit=False) File "/home/user/.local/pipx/venvs/copier/lib/python3.10/site-packages/plumbum/cli/application.py", line 624, in run retcode = inst.main(*tailargs) File "/home/user/.local/pipx/venvs/copier/lib/python3.10/site-packages/copier/cli.py", line 71, in _wrapper return method(*args, **kwargs) File "/home/user/.local/pipx/venvs/copier/lib/python3.10/site-packages/copier/cli.py", line 298, in main ).run_copy() File "/home/user/.local/pipx/venvs/copier/lib/python3.10/site-packages/copier/main.py", line 597, in run_copy src_abspath = self.template_copy_root File "/usr/lib/python3.10/functools.py", line 981, in __get__ val = self.func(instance) File "/home/user/.local/pipx/venvs/copier/lib/python3.10/site-packages/copier/main.py", line 570, in template_copy_root subdir = self._render_string(self.template.subdirectory) or "" File "/home/user/.local/pipx/venvs/copier/lib/python3.10/site-packages/copier/main.py", line 544, in _render_string return tpl.render(**self._render_context()) File "/home/user/.local/pipx/venvs/copier/lib/python3.10/site-packages/copier/main.py", line 209, in _render_context **self.answers.combined, File "/usr/lib/python3.10/functools.py", line 981, in __get__ val = self.func(instance) File "/home/user/.local/pipx/venvs/copier/lib/python3.10/site-packages/copier/main.py", line 353, in answers [question.get_questionary_structure()], answers=result.combined File "/home/user/.local/pipx/venvs/copier/lib/python3.10/site-packages/copier/user_data.py", line 311, in get_questionary_structure "default": self.get_default_rendered(), File "/home/user/.local/pipx/venvs/copier/lib/python3.10/site-packages/copier/user_data.py", line 236, in get_default_rendered default = self.get_default() File "/home/user/.local/pipx/venvs/copier/lib/python3.10/site-packages/copier/user_data.py", line 223, in get_default result = self.render_value(self.default) File "/home/user/.local/pipx/venvs/copier/lib/python3.10/site-packages/copier/user_data.py", line 394, in render_value return template.render(**self.answers.combined) File "/home/user/.local/pipx/venvs/copier/lib/python3.10/site-packages/jinja2/environment.py", line 1301, in render self.environment.handle_exception() File "/home/user/.local/pipx/venvs/copier/lib/python3.10/site-packages/jinja2/environment.py", line 936, in handle_exception raise rewrite_traceback_stack(source=source) File "