BunsenLabs / bunsen-utilities

https://pkg.bunsenlabs.org/debian/pool/main/b/bunsen-utilities/
GNU General Public License v3.0
30 stars 21 forks source link

lithium: Port bl-xinerama-prop to py3/gtk3 & implement bl-reload-gtk23 #68

Closed ghost closed 4 years ago

ghost commented 4 years ago

Effectively, we now can drop all py2 dependencies from this package.

ghost commented 4 years ago
ghost commented 4 years ago

Utilities that have been touched:

ghost commented 4 years ago

@johnraff That'd be fine with me. I'll be looking into preserving the commit history in bunsen-common from the affected files here (should be possible using git filter-branch). I'll open a separate PR for b-c and update this one here.

johnraff commented 4 years ago

bl-kb and bl-xinerama-prop tested OK. Now testing bl-reload-gtk23 as discussed here: https://github.com/BunsenLabs/bunsen-common/pull/5

-- One small point: Debian Python Policy deprecates the /usr/bin/env shebang. https://www.debian.org/doc/packaging-manuals/python-policy/ch-python.html#s-interpreter_loc It's up to you though.

johnraff commented 4 years ago

I think the problems I was having with bl-reload-gtk23 were largely because I was mistaking some gtk3 apps for gtk2. Pure gtk2 apps (eg mirage) do indeed immediately reflect edits to .gtkrc-2.0 after running the reload.

Confirmed also that bl-obthemes is working as before when restoring themes. Gtk3 apps like geany needed restarting to show the new theme, and that has not changed.

Now to reinstall xsettingsd and try with gtk3.

ghost commented 4 years ago

On Fri, 15 May 2020, at 04:39, John Crawley wrote:

One small point: Debian Python Policy deprecates the /usr/bin/env shebang. https://www.debian.org/doc/packaging-manuals/python-policy/ch-python.html#s-interpreter_loc It's up to you though.

The point of /usr/bin/env is, as is also implied by that resource, that "python3" is freely looked up in the $PATH.

I reject the Debian suggestion of directly referencing /usr/bin/python3 for 3 reasons:

  1. The code is supposed to run anywhere, not just on Debian. Although "python3" maybe present, what about /usr/local/bin/python3? Won't work.

  2. The standard/common Python development workflow makes use of venvs, which work by modifying PATH to point to a specifically created and populated directory tree. From inside a venv, /usr/bin/env python3 will therefore correctly use the "python3" provided by the venv. When hard-coding /usr/bin/python3, that wouldn't work and break expectations. It's pretentious (typical Debian) to demand that upstream code conform to Debian policy instead of community standards.

  3. When using python3 setup.py install (which we don't provide here, but proper Python packages do -- if more BL code is becoming Python, then that's what I would do -- in fact, I have a branch for that here, but it seems like overkill for the simple scripts with minimal code duplication as they are now) as the Debian dh_python debhelper does to install packages into the build's package root, Python setuptools will adjust the shebangs in all .py files anyway to match the interpreter used to run setup.py, in which case the Debian policy is not just wrong but pointless.

I don't get some of the stuff the Debian folks are writing down. The Debian policy makes sense from a security point of view, because PATH can be spoofed easily. But even then, all points still hold.

johnraff commented 4 years ago

I reject the Debian suggestion of directly referencing /usr/bin/python3

This is fine. I was expecting you'd have some good reasons.

johnraff commented 4 years ago

OK so this PR gets rid of python2 dependencies in bunsen-utilities, supports existing functionality and introduces no regressions. Let's merge it in.

(And think about GTK3 at leisure.)

GitHub is offering a "squash" merge button, but I guess you'd prefer to keep all the commit history intact? If so, I'll checkout your branch, merge locally and push.

ghost commented 4 years ago

@johnraff I have rebased, merged into lithium and pushed it upstream to here. Closing this PR.

I haven't added a tag though - are we ready to release the next changes from this packages?

ghost commented 4 years ago

Nevermind, created the tag 10.2.2-1 myself.

johnraff commented 4 years ago

All the other BL packages that we need for Lithium have now had their changelogs updated, released to the experimental repo and been tagged on GitHub.