Skip to content

Commit

Permalink
Use namespace packaging so xonsh 0.12 loads correctly with pytest
Browse files Browse the repository at this point in the history
Entrypoints are still used in 3.12, but load_xontrib() test fails if you're not using namespace packaging
  • Loading branch information
Spitfire1900 committed Mar 23, 2024
1 parent f75ad3c commit 14029d6
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ content-type = "text/markdown"


[project.entry-points."xonsh.xontribs"]
"pygitstatus" = "xontrib_pygitstatus.main"
"pygitstatus" = "xontrib.pygitstatus.entrypoint"


[project.urls]
Expand Down
1 change: 1 addition & 0 deletions xontrib/pygitstatus/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# This module is loaded by xontrib if no entrypoint is defined. -- https://xon.sh/tutorial_xontrib.html#structure
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ def _load_xontrib_(xsh: XonshSession, **_):
from .event_hooks import listen_cd
xsh.builtins.events.on_chdir(listen_cd)


def _unload_xontrib_(xsh: XonshSession, **kwargs) -> dict:
"""If you want your extension to be unloadable, put that logic here"""
raise NotImplementedError('unload of pygitstatusnot implemented')
File renamed without changes.
Empty file removed xontrib_pygitstatus/__init__.py
Empty file.

0 comments on commit 14029d6

Please sign in to comment.