Use setuputils generated console scripts for xonsh and xonsh-cat

This commit is contained in:
Bob Hyman 2020-08-08 00:53:44 -04:00
parent d826d201cc
commit 989db694a3
5 changed files with 7 additions and 41 deletions

View file

@ -1,4 +0,0 @@
#!/usr/bin/env -S python3 -u
from xonsh.main import main
main()

View file

@ -1,4 +0,0 @@
#!/usr/bin/env -S python3 -u
from xonsh.xoreutils.cat import cat_main as main
main()

View file

@ -1,14 +0,0 @@
@echo off
call :s_which py.exe
if not "%_path%" == "" (
py -3 -m xonsh.xoreutils.cat %*
) else (
python -m xonsh.xoreutils.cat %*
)
goto :eof
:s_which
setlocal
endlocal & set _path=%~$PATH:1
goto :eof

View file

@ -1,2 +0,0 @@
@echo off
python -m xonsh %*

View file

@ -323,12 +323,6 @@ def main():
with open(os.path.join(os.path.dirname(__file__), "README.rst"), "r") as f:
readme = f.read()
scripts = ["scripts/xon.sh"]
if sys.platform == "win32":
scripts.append("scripts/xonsh.bat")
scripts.append("scripts/xonsh-cat.bat")
else:
scripts.append("scripts/xonsh")
scripts.append("scripts/xonsh-cat")
skw = dict(
name="xonsh",
description="Python-powered, cross-platform, Unix-gazing shell",
@ -370,27 +364,23 @@ def main():
"js/app.min.js",
"js/bootstrap.min.css",
"js/LICENSE-bootstrap",
]
],
},
cmdclass=cmdclass,
scripts=scripts,
)
# WARNING!!! Do not use setuptools 'console_scripts'
# It validates the dependencies (of which we have none) every time the
# 'xonsh' command is run. This validation adds ~0.2 sec. to the startup
# time of xonsh - for every single xonsh run. This prevents us from
# reaching the goal of a startup time of < 0.1 sec. So never ever write
# the following:
#
# 'console_scripts': ['xonsh = xonsh.main:main'],
#
# END WARNING
# We used to avoid setuptools 'console_scripts' due to startup performance
# concerns which have since been resolved. So now we use them.
skw["entry_points"] = {
"pygments.lexers": [
"xonsh = xonsh.pyghooks:XonshLexer",
"xonshcon = xonsh.pyghooks:XonshConsoleLexer",
],
"pytest11": ["xonsh = xonsh.pytest_plugin"],
"console_scripts": [
"xonsh = xonsh.main:main",
"xonsh-cat = xonsh.xorutils.cat",
],
}
skw["cmdclass"]["develop"] = xdevelop
skw["extras_require"] = {