There was a PR https://github.com/ultrabug/py3status/pull/959 that implemented a much faster py3-cmd. However, when I install py3status via AUR, I'm getting "AttributeError" in the install_py3_cmd and all I'm left with is the slow default. This is quite annoying as even if I manually put the faster script, it will be overwritten back to the slow one on every upgrade. I'm not sure where the problem lies, I assume it is something that can be fixed in PKGBUILD, but I'm asking for your guidance on what to investigate. I also assume that every user of the AUR packages struggles from the same issue.
By the way, when I manually took the contents of PY3_CMD_SCRIPT_TEXT and placed it in /usr/bin/py3-cmd, I noticed that the shebang line is missing, and nothing worked until I added it. Not sure if write_script is supposed to add it or it is a bug.
/cc @tobes
Ok the sad truth is you need to do `python setup.py develop for the full effects. I need to look into this more as I can hack something but it would be nice to be sure it'll work stably. For some reason the setup_tools people don't seem to care about this which effects so many python projects
Hi. I tried https://github.com/ninjaaron/fast-entry_points today.
fast-entry-points py3-cmd
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# EASY-INSTALL-ENTRY-SCRIPT: 'py3status==3.11','console_scripts','py3-cmd'
__requires__ = 'py3status==3.11'
import re
import sys
from py3status.command import send_command
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(send_command())
master py3-cmd
#!/usr/bin/python3
# EASY-INSTALL-ENTRY-SCRIPT: 'py3status==3.11','console_scripts','py3-cmd'
__requires__ = 'py3status==3.11'
import re
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(
load_entry_point('py3status==3.11', 'console_scripts', 'py3-cmd')()
)
fast-entry-points py3status
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# EASY-INSTALL-ENTRY-SCRIPT: 'py3status==3.11','console_scripts','py3status'
__requires__ = 'py3status==3.11'
import re
import sys
from py3status import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(main())
master py3status
#!/usr/bin/python3
# EASY-INSTALL-ENTRY-SCRIPT: 'py3status==3.11','console_scripts','py3status'
__requires__ = 'py3status==3.11'
import re
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(
load_entry_point('py3status==3.11', 'console_scripts', 'py3status')()
)
It seems that py3status does not need this either, so it should more faster now and this worked fine for me. I'm not sure if it is faster as it gave me mixed timing results between versions. D'oh.
I had some issues too, but I don't know if it is related because I kept changing several versions (py3status and python) to test this. I'd like others to test this too... to see if this worked okay for others or if they receive same issues. My issues seems to be related with permissions occurring right after [installing|removing|executing] [python_apps].
Maybe because of mixed versions/files and/or python-setuptools. Anyhow, it's too early to confirm anything, but it's a start. Maybe someone can work on top of this. Make sure to read issues in fast-entry_points project to ensure that this would not be a problem for py3status (eg requests). Thank you.
Branch: https://github.com/lasers/py3status/tree/add-fast-entry_points
@lasers I reinstalled the AUR package from your branch, so far everything seems to work fine, and fast, love it! I'll keep testing, but I think you should proceed with a PR 😉
@maximbaz I saw your review. but you deleted it so I figure I wouldn't reply. I wanted to say: All is good with paths (imho) as I think paths would be very similar to events = [] even if users are more likely to use a single path or a single (glob) path more than a list of paths or a list of (glob) paths.
I tested this again after nuking files and can confirm this worked okay here, so it was likely a mixed versions/files. I also forget that when we are on develop branch, we basically will get the same thing so hence the mixed timing results (heh).
It would be very nice if you could produce some results (eg time py3-cmd) between -git and this branch to ensure significant improvements. There might be some stuffs in fast-entry_points file that I think we would not need (so maybe we should simplify it a bit first... or not). I await reviews first.
but I think you should proceed with a PR :wink:
I wholesomely agree. I have nothing more for this PR, but I can't really make more PRs. I already have too many out there waiting and I already have some more issues (like this one) possibly resolved too. On top of that, I have more modules, enhancements, improvements, changes, etc to offer. Pretty crazy... huh... :cry:
I was confused where it should be paths (in config) and where it should be path (in format), once I figured out I removed my comment 🙂
Perf results: your branch gives 75% faster response.
ultrabug/master:
❯ time (repeat 500 py3-cmd click 4 backlight)
95.02s user 10.21s system 99% cpu **1:45.84 total**
lasers/add-fast-entry_points:
❯ time (repeat 500 py3-cmd click 4 backlight)
23.37s user 3.74s system 99% cpu **27.200 total**
Most helpful comment
I was confused where it should be
paths(in config) and where it should bepath(in format), once I figured out I removed my comment 🙂Perf results: your branch gives 75% faster response.
ultrabug/master:lasers/add-fast-entry_points: