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

Upgrade to python3 version #67

Merged
merged 10 commits into from
Mar 15, 2023
Merged

Upgrade to python3 version #67

merged 10 commits into from
Mar 15, 2023

Conversation

harrtho
Copy link
Contributor

@harrtho harrtho commented Jan 12, 2023

Motivation

I had the same problems as anyone after upgrading to Monterey. After a long time of waiting for a solution, unfortunately it seems that the author of the original alfred-workflow library is inactive (his good right to do whatever he wants to do 🙂).

As I was using his workflows a lot, I decided to fork and port his library to python3: alfred-pyworkflow. I know the name is not quite creative 😅. In the end the best solution would be that the original author would continue, but until this day I will move on with "my" solution.

Proposed Solution

I added the alfred-pyworkflow library and refactored the code to use python3 and the library. The library is still work in progress but I'm currently fixing step by step workflows that I'm using and it looks quite good.

The workflow now will use the location of python3 from the system PATH via. /usr/bin/env python3. I made also some structural changes, as it makes it more easy to zip the code and all dependencies to *.alfredworflow file.

I will also update the README and try to remove the php dependency as in #63 requested, but in the mean time maybe somebody additional can test the workflow? I'm working on Intel Mac, maybe a ARM Mac user?

Requirements

Since Monterey no php and no python is pre-installed, I recommend to use Homebrew to install both dependencies. Homebrew seems also to be the solution for the Alfred Author to manage workflow dependencies with the new Alfred 5 Beta Feature Gallery.

I made a test release with the same 'old' version number at my fork. If the pull request is accepted and the version number is increased the workflow should update by it self to the release at this repo.

Resolves #66
Resolves #64

@benknight
Copy link
Owner

Wow, this is awesome! I was really hoping someone would take charge of this.

Currently I don't own a Philips Hue system so I can't test this, but I think I will buy one again so that I can.

Could you provide a *.alfredworkflow file for testing? Maybe you can also reach out to a few other users who've commented on this repo's issues to see if they would help you test. I have an ARM Mac, so I can help test on my Macbook Air M1.

Also, doesn't macOS come with python3 preinstalled now? Or is that still necessary to install via Homebrew?

@harrtho
Copy link
Contributor Author

harrtho commented Jan 15, 2023

Thank you :)

Is it not a little expensive to buy a Philips Hue to just test a workflow 😄 ?

I published a "release" with a *.alfredworkflow on my fork for testing. Is this enough or should I provide it somewhere else?

I will try to get in touch with some other users.

As far as I know no. It is possible to install python3 as part of the command-line tool / developer tools that are also needed for Homebrew or via Homebrew or directly with the *.pkg file etc... But I can also be wrong and this changed with an update of Monterey?

@harrtho
Copy link
Contributor Author

harrtho commented Jan 15, 2023

Additionally, where did you get the colorpick binary? If it's open source I was thinking about to compile the binary on the fly with the first execution of the workflow.

This could be a next step after der migration, if useful

@ninpnin
Copy link
Contributor

ninpnin commented Jan 22, 2023

@harrtho
Running on M1 MBA, I get this Screenshot 2023-01-22 at 19 39 07

This happens after connecting to the bridge.

EDIT: this issue is fixed now.

@ninpnin
Copy link
Contributor

ninpnin commented Jan 22, 2023

Don't know if it's a change in implicit float-int conversions between Python2 and Python3, but explicitly converting the tuple to integers here seemed to fix the whole extension.

@mschel
Copy link

mschel commented Mar 12, 2023

just tested your release https://github.com/harrtho/alfred-hue/releases/tag/v3.0.8 @harrtho on Intel Mac on 13.2.1 and it's all working again. So +1 for merging into this repo :)

@benknight benknight merged commit 16946bb into benknight:master Mar 15, 2023
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.

No Keyword reaction after Update to 3.0.8 Support for macOS 12.3+
4 participants