Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Py3 qt5 el8 #64

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Py3 qt5 el8 #64

wants to merge 5 commits into from

Conversation

helge000
Copy link

@helge000 helge000 commented Apr 22, 2022

This is based on #40 and fixes all issues with it to run on EL8; python 3.6. With python3.7 there may be changes needed to all Popen() - calls (text=True).

Fixes:

I build an RPM; released in my fork.

Warning, the RPM above is still based on 0.3.0-rc13 form last year. The current branch is rebased; haven't tested it tough.

@helge000 helge000 force-pushed the py3-qt5-el8 branch 2 times, most recently from 2d8671f to fc8459f Compare April 22, 2022 17:43
@helge000
Copy link
Author

Rebased to current HEAD.

BuildRequires: python
Source0: %{name}-%{version}-%{release}.tar.xz
BuildRequires: python3
Source0: %{name}-%{version}-%{release}.tar.gz
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure whatever you want a .gz or .xz tarball here

@@ -1,32 +1,31 @@
%global libwacom_ver 1.11
%global libwacom_ver 2.2.0
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On EL8 I currently get a libwacom-1.6-3.el8.x86_64 - don't know whatever the version is important here?

@epifanio
Copy link

Trying this PR on ubuntu 22 [WM: gnome] - i got the following message:

Unknown Device: "Device information for Wacom Intuos Pro 2 M" not found.

Any clue what I am missing> the device is detected by gnome.

@@ -36,7 +37,7 @@ def __init__(self):
def get_connected_tablets(self):
# check if tablet is actually detected
p = subprocess.Popen("xsetwacom --list devices", shell=True, stdout=subprocess.PIPE)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@epifanio - phew, I am a little out of my depth with the whole wacom stuff - the oldest device I can test is Indous4.
That said, please check your python version. If it is py3.7+, you might want to add text=True as a named param here. Also see my fist comment in the PR.
EL8 ships with 3.6; here Popen() does not need this param. Please report back if this works for you or not. If so, we'll need to refactor the all Popen() calls and check for python version.
Side note, you are really my favourite, python!

@tb2097
Copy link
Owner

tb2097 commented May 9, 2022

Apologies for the lack of my response on this, work has been rather hectic and I haven't had the time to fully test out a release. My goal is to target support based on the VFX Reference platform (https://vfxplatform.com/), although it does put it at odds with OS-stable releases (ie. EL8 being based on Py3.6). As well, given EL8 is now effectively EoL with EL9's release imminent it may be easier to just target Py3.9 and see how backwards compatible it is. I have a conversion I started testing but I've been hitting edge cases that I don't quite feel comfortable releasing as of yet. Your build appears to be hitting similar issues to what I have unfortunately and I'd like to try and avoid putting in hacky per-python release coding, if possible. The alternative is to have the release be compiled based on the install to "hide" the python release aspects but then it would cause the install to break if the user upgrades their python release at a later date.

@helge000
Copy link
Author

@tb2097 - no worries!
Please allow me a few remarks:

  • We should not confuse vfxplatform with EL-python. Apps targeting a platform usually ship their bundled python.
  • If we release RPMs we should target 3.6 with an EL8 release and 3.9 with EL9
  • The way forward might be an appimage/flatpack?

El8 is not effectively EOL, far from it. I expect EL9 in production for VFX-Shops in maybe five years give or take as most of them now only transitioning from EL7; may I present your own wacom-gui as evidence.

Currently I see only issues with popen(); here it is feasible to change kwargs depending on the python version...

@20kdc
Copy link

20kdc commented Oct 31, 2022

Just so you know, your PR removes the Wacom One by Wacom S translation (which I need as the local libwacom database here uses the expected One by Wacom (small) name)

20kdc@Magnus:/media/modus/External2/wacom-gui/wacom-gui$ libwacom-list-local-devices --format datafile
# One by Wacom (small)
#  - /dev/input/event11
[Device]
Name=One by Wacom (small)
ModelName=CTL-472
DeviceMatch=usb:056a:037a;
Class=Bamboo
Width=6
Height=4
IntegratedIn=
Styli=0xffffe;0xfffff;

[Features]
Reversible=true
Stylus=true
Ring=false
Ring2=false
Touch=false
TouchSwitch=false
# StatusLEDs=
NumStrips=0
Buttons=0

There is also the matter of needing --format datafile because libwacom-list-local-devices will now output in YAML by default for... some reason.

I have a patched version of wacom-gui but I ended up doing the patching before checking the PRs.

As it is, the following is my rather informally-sent patch:

20kdc@Magnus:/media/modus/External2/wacom-gui/wacom-gui$ git diff
diff --git a/wacom-gui/wacom_data.py b/wacom-gui/wacom_data.py
index fc3f13f..566dfe3 100644
--- a/wacom-gui/wacom_data.py
+++ b/wacom-gui/wacom_data.py
@@ -82,6 +82,9 @@ class Tablets:
                 if dev_type.startswith('Wacom Intuos Pro') :
                     if dev_type not in self.device_data.keys():
                         dev_type = dev_type.replace("Pro", "Pro 2")
+                # One Wacom hack
+                if dev_type == 'Wacom One by Wacom S':
+                    dev_type = 'One by Wacom (small)'
                 devID = self.device_data[dev_type]['devID']
                 if self.device_data[dev_type]['devID'] not in self.tablets.keys():
                     self.tablets[devID] = []
@@ -113,7 +116,7 @@ class Tablets:
 
 
     def __get_libwacom_data(self):
-        p = subprocess.Popen("libwacom-list-local-devices --database %s" % self.db_path, shell=True,
+        p = subprocess.Popen("libwacom-list-local-devices --format datafile --database %s" % self.db_path, shell=True,
                              stdout=subprocess.PIPE)
         output = p.communicate()[0].decode('utf-8').split('\n')
         cur_device = None

@ehanuise
Copy link

ehanuise commented Nov 3, 2022

Had the same issue with a Bamboo one.
Fixed by adding this to wacom_data.py (and added the --format datafile in line 113)

# bamboo One hack
if dev_type == 'Wacom Bamboo1':
    dev_type = 'Bamboo One'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants