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

Working Python 2.7 support under Microsoft Windows #2

Closed
wants to merge 4 commits into from

Conversation

clach04
Copy link

@clach04 clach04 commented Jul 26, 2022

Tested with:

Python 2.7.10 (default, May 23 2015, 09:40:32) [MSC v.1500 32 bit (Intel)] on win32

Ready for 2nd review 2023-07-22 (12:11 Pacific time)

Tested with:

    Python 2.7.10 (default, May 23 2015, 09:40:32) [MSC v.1500 32 bit (Intel)] on win32
@clach04
Copy link
Author

clach04 commented Jul 26, 2022

This was enough so I could get logs out of the running watchface/app on my phone.

I think pyreadline is OK to include, https://pypi.org/project/pyreadline/ claims to support Python3.

https://pypi.org/project/anyreadline/ might be another alternative but I only have experience with pyreadline hence using it.

@clach04
Copy link
Author

clach04 commented Aug 13, 2022

@Katharine anything else this would need to be considered mergeable? You did the last commit so picked you to ping :-p

@clach04
Copy link
Author

clach04 commented Jul 22, 2023

@ishotjr do you have time and permission to merge this? There are a few other PRs that would be nice to get consolidated

As always thanks to everyone on the Rebble time, you all rock!

Copy link
Member

@Katharine Katharine left a comment

Choose a reason for hiding this comment

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

My number one question would be: why not just run under WSL? You might get the pure python part working, which I'm not opposed to, but most of the functionality will fail awkwardly. It's designed for WSL.

requirements.txt Outdated
Comment on lines 1 to 2
#libpebble2==0.0.28
git+https://github.com/pebble-dev/libpebble2.git@685cd9841e647b48609ce904a87540019390b3be#egg=libpebble2
Copy link
Member

Choose a reason for hiding this comment

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

The libpebble2 on pypi isn't unmaintained - I'd rather use that.

Copy link
Author

Choose a reason for hiding this comment

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

Ahhh, that's not clear from the pypi page. All the links are to the old pebble project and CI. Thanks for making that clear :-). I was wondering maybe I can open a PR to clean that up, but the readme at https://github.com/pebble-dev/libpebble2/blob/master/README.rst doesn't match the (long) description over at https://pypi.org/project/libpebble2/ - I'll get a bug opened over there but notes (mostly to myself)

https://pypi.org/project/libpebble2/ points to:

I don't remember why I felt the direct link was necessary, I'm reasonably confident I was ending up with the wrong/old version and it didn't work without it.

Copy link
Author

Choose a reason for hiding this comment

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

Issues are not enabled on https://github.com/pebble-dev/libpebble2 - https://pypi.org/project/libpebble2/ looks abandoned (readme/description and links are not the current readme in https://github.com/pebble-dev/libpebble2). This may be a pypi issue?

Copy link
Author

Choose a reason for hiding this comment

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

...

I don't remember why I felt the direct link was necessary, I'm reasonably confident I was ending up with the wrong/old version and it didn't work without it.

lol, I missed the setup.py requirements - that's probably why :-D

@@ -16,3 +17,4 @@ websocket-client==0.32.0
wheel==0.24.0
colorama==0.3.3
packaging==16.7
pyreadline==2.1
Copy link
Member

Choose a reason for hiding this comment

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

A quick look suggests that pyreadline has been unmaintained for longer than this tool, and does not work under the latest version of Python. pyreadline3 might be a better choice, though it's very obscure.

Does installing this without importing it do anything?

Copy link
Author

Choose a reason for hiding this comment

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

I'll need to get back to you on this, been a while since I looked at it.

Copy link
Author

Choose a reason for hiding this comment

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

A quick look suggests that pyreadline has been unmaintained for longer than this tool, and does not work under the latest version of Python. pyreadline3 might be a better choice, though it's very obscure.

Do you mean https://pypi.org/project/pyreadline3 ? That doesn't look appropriate, it does NOT support Python 2.7 :-(, only some 3.x

Does installing this without importing it do anything?

Are you asking if the install runs some code in the background I'd need to look at the setup.py to know? I'm not 100% sure what you are asking. It's defintely being imported by commands/repl.py

Copy link
Member

Choose a reason for hiding this comment

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

Supporting Python 2.7 is not really a goal at this point, given that Python 2.7 has been dead for years. That said, it is still necessary given that while this runs (or should run) fine under Python 3, the build chain does not. (For that matter, supporting Windows outside WSL is also a non-goal...)

Is editing requirements.txt even the right thing to be doing? Selectively installing things might be better. What, if anything, happens if this is installed on Linux or macOS?

Copy link
Author

Choose a reason for hiding this comment

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

Hmmm, maybe that's the way to tackle this. Scratch this PR, and I open a new one that's ONLY a readme change with a note for py2.7 (and Windows) so it's a manual step (or a separate requirements file) so the current known platforms work the way they always have.

Let me try that out real quick.

Copy link
Member

Choose a reason for hiding this comment

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

It should be possible to selectively install things in setup.py, if one uses that mechanism instead of requirements.txt.

Copy link
Author

Choose a reason for hiding this comment

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

I'm definitely down for that :-)

I just posted a hopefully easier to accept PR #4 to fix things on all platforms, with Windows to follow. I already tested out requirements windows file and it works great, but a conditional in setup.py would be great too. My main goal is to get something merged so it's in a central place, for a clean working version.

README.md Outdated
@@ -0,0 +1,8 @@
# Pebble build tool
Copy link
Member

Choose a reason for hiding this comment

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

It's the Pebble Tool, not the Pebble Build Tool.

Copy link
Author

Choose a reason for hiding this comment

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

I'll fix that now get it done. If things look good I can squash changes into a single commit.

Thanks for taking the time for review!

@clach04
Copy link
Author

clach04 commented Jul 22, 2023

My number one question would be: why not just run under WSL? You might get the pure python part working, which I'm not opposed to, but most of the functionality will fail awkwardly. It's designed for WSL.

Not sure if this is a reasonable answer but building a native binary (pebble.exe) ;-) ... and I don't have to get to grips with WSL ;-p the different versions originally confused me. Seems to have settled down with WSL2.

This commit is untested.
Match versions in setup.py with (working) requirements.txt.

When ran from setup.py httplib2 would pull in pyparsing 3.1.0
rather than 2.4.7. This does not happen with pip install of
requirements.txt, manually added pyparsing with pinned version number.
@clach04
Copy link
Author

clach04 commented Jul 22, 2023

@Katharine and @ishotjr I think I'm ready for round 2 :-)

Thanks again for you help with this.

@clach04
Copy link
Author

clach04 commented Jul 22, 2023

@Katharine and @ishotjr I think I'm ready for round 2 :-)

Thanks again for you help with this.

I was writing this when #2 (comment) was posted, hold fire on review. New approach being tested.

@clach04
Copy link
Author

clach04 commented Jul 22, 2023

@clach04 clach04 closed this Jul 22, 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.

2 participants