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

Python 3.x support #237

Open
sivabudh opened this issue Nov 29, 2015 · 13 comments
Open

Python 3.x support #237

sivabudh opened this issue Nov 29, 2015 · 13 comments

Comments

@sivabudh
Copy link

Hello,

I saw from your documentation that there's currently no plan to interoperate with Python 3.x yet. But just want to ask if there's any plan / efforts in the near future (< 1 year) to support Python 3.x?

Just curious. Thanks for a wonderful network framework!

@jathanism
Copy link
Member

Hello!

There are no current plans because of some upstream dependent libraries that are not yet ready for Python 3. See here:

https://caniusepython3.com/project/trigger

Twisted is the asynchronous event loop around which Trigger is built and it would need to be upgraded or replaced entirely within Trigger core.

This is bot impossible, but also non-trivial.

If we wanted to prioritize getting Python 3 compatibility we would have to make some important decisions about which direction to go, libraries to use, etc. and then dedicate time and people to do it.

If this interests you, let's talk!

@digitalresistor
Copy link

Twisted is listed as supporting Python 3 here: https://pypi.python.org/pypi/Twisted

@jathanism
Copy link
Member

It's a work in progress but still not complete!

http://twistedmatrix.com/documents/current/core/howto/python3.html

We should look into how far along they are and what features we are using that have already been ported.

Contributing to Twisted to help them move along with Python 3 should also be on the table... If we decide that we should stick with Twisted.

Again... Prioritization, longevity, all that jazz.

@sivabudh
Copy link
Author

@jathanism Hey, I'm interested in helping out if I can! Suppose I was your arms and legs, how should we get started porting this fine framework to Python 3? 😁

Twisted migrating to Python 3 is – slowly but surely – a step in the right direction!

@jathanism
Copy link
Member

@sivabudh We should start with Twisted support. We should look at how Trigger is using Twisted, and to what degree that functionality has been ported to Python 3 within Twisted.

There's a chance that we aren't blocked by Twisted at all, because the calls we're using are already ported. That will give us a starting point to understand HOW if at all we are blocked upstream by Twisted, and then whether we should invest in contributing to Twisted to help unblock.

The other alternative would be to decide perhaps if Twisted is not worth keeping as a dependency longer term, for example, would it be LESS effort to switch Trigger to use a different async i/o library for networking/SSH/etc. This topic comes up from time to time, and it's worth thinking about.

I'm not married to Twisted, but I do want Trigger to continue to be a successful and useful project!

So, if this answers your question, if you're up for it, let's start with investigating inside of trigger/twister.py, identifying the Twisted library calls being used, and going from there.

@jathanism
Copy link
Member

So... As of today this thing is reporting that Twisted is now Python 3-compatible. So Let's get crackin!

https://caniusepython3.com/project/trigger

@jathanism jathanism added this to the Trigger 2.0 milestone Feb 25, 2016
@tarkatronic
Copy link

There are currently no visible blockers on moving to Python 3. Is there any movement on this effort?

I believe that, in updating dependencies to Python 3 compatible versions, this would also fix #313.

@coxley
Copy link
Contributor

coxley commented Mar 15, 2017

Moving to Py 3.5+ would give type annotations which would greatly help catching errors via mypy. ;)

@sivabudh
Copy link
Author

sivabudh commented Mar 17, 2017

Couldn't we just run 2to3 on the whole directory, and run the tests to see if anything breaks?

@jathanism
Copy link
Member

I mean yeah we could do that. Unfortunately this isn't a high priority right now, BUT Iif anyone is interested in volunteering to lead the effort I would be more than happy to assist and guide you in working on it!

@sivabudh
Copy link
Author

@jathanism I will have a go at it.

Once I have cloned the repo, what commands do you usually run to run all the test suites?

@jathanism
Copy link
Member

@sivabudh Just check out the .travis.yml file. Effectively it's:

pip install -r requirements-dev.txt
pip install .
export TRIGGER_SETTINGS=tests/data/settings.py
py.test -vv tests/

Unfortunately the tests don't exercise any of the SSH client code. That's something we're still working on.

If you're going to take a serious look at this, we should discuss some of the changes for Trigger 2.0, which would involve removing a bunch of the core functionality and converting it to optional add-ons. I feel like we should probably focus on what functionality will remain in the core before you spend a lot of time making the code Python3 compatible, especially if it's code that might not be required anymore!

@qmontal
Copy link

qmontal commented Mar 27, 2020

Hey guys,

I know that this project is not currently in development (it looks great btw!), but I just noticed that Twisted are dropping support for Python2.7 from now on, being the latest release to support Python2.7 Twisted 20.3.0.

Thanks for all the effort done here with this project, as I said, it looks great!

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

No branches or pull requests

6 participants