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

Port twisted.python.modules on py3 for trial #7804

Closed
twisted-trac opened this issue Mar 7, 2015 · 23 comments
Closed

Port twisted.python.modules on py3 for trial #7804

twisted-trac opened this issue Mar 7, 2015 · 23 comments

Comments

@twisted-trac
Copy link

adiroiban's avatar @adiroiban reported
Trac ID trac#7804
Type enhancement
Created 2015-03-07 22:45:07Z
Branch https://github.com/twisted/twisted/tree/tpmodules-py3-7804-3

As a start my plan is to port t.p.modules just that I can bootstrap trial.

I have checked the current code and the only problem is children.sort()

I already have a branch with module ported and all tests passing and will create a branch for this ticket.

Searchable metadata
trac-id__7804 7804
type__enhancement enhancement
reporter__adiroiban adiroiban
priority__normal normal
milestone__Python_3_x Python-3.x
branch__branches_tpmodules_py3_7804_3 branches/tpmodules-py3-7804-3
branch_author__hawkowl__adiroiban hawkowl, adiroiban
status__closed closed
resolution__fixed fixed
component__core core
keywords__ 
time__1425768307247687 1425768307247687
changetime__1427797025914035 1427797025914035
version__None None
owner__hawkowl hawkowl

@twisted-trac
Copy link
Author

adiroiban's avatar @adiroiban commented

(In [43989]) Branching to py3-t.p.modules-7804.

@twisted-trac
Copy link
Author

adiroiban's avatar @adiroiban removed owner

there are still failing tests but I am just putting this for review to get initial feedback.

Thanks!

@twisted-trac
Copy link
Author

glyph's avatar @glyph set owner to @adiroiban

Thanks for working on this.

  1. the tests are failing, as you've noticed, that needs to be fixed :)
  2. the big pile of inequality methods should probably be on a helper that implements inequality; this would be less code, and also more generally useful. I'd say functools.total_ordering but that's 2.7+ only, and we still support 2.6...

Otherwise, looks basically sensible.

@twisted-trac
Copy link
Author

Julian's avatar @Julian commented

Even 2.6 has next(), is there something I'm missing on why it was added to t.p.compat?

@twisted-trac
Copy link
Author

glyph's avatar @glyph commented

Good catch, Julian. Thanks!

@twisted-trac
Copy link
Author

adiroiban's avatar @adiroiban commented

Thanks for the review.

I have removed next from compat. I was over exicted with having Trial working on Python and forgot to check if next is available in python2.6 ... I have never touched 2.6.
I hate using run-python3-tests for doing TDD

I have pushed my current changes but they are junk...and they also touch zippath.

my changes in filepath were wrong as I see that FilePath requires path to be pass as bytes... this is a PITA and I think that before continuing with Python3 port we need an Unicode friendly FilePath.

Will wait for progress from #7805

@twisted-trac
Copy link
Author

hawkowl's avatar @hawkowl commented

(In [44200]) Branching to tpmodules-py3-7804.

@twisted-trac
Copy link
Author

hawkowl's avatar @hawkowl commented

(In [44201]) Branching to tpmodules-py3-7804-2.

@twisted-trac
Copy link
Author

hawkowl's avatar @hawkowl commented

I have a working version in tpmodules-py3-7804-2. Once #7805 lands, I can put this up for review.

@twisted-trac
Copy link
Author

adiroiban's avatar @adiroiban commented

Ok. I guess that this is the current diff d5fb42b...tpmodules-py3-7804-2

As commented before I was also waiting for #7805 to land before continue working on it.

If you want to continue working in this, please feel free to change the owner.

Cheers

@twisted-trac
Copy link
Author

hawkowl's avatar @hawkowl set owner to @hawkowl

Hi Adi,

I'll take this one over. :)

@twisted-trac
Copy link
Author

hawkowl's avatar @hawkowl commented

I'm happy with this one so far.

Can be reviewed when #7805 lands.

@twisted-trac
Copy link
Author

hawkowl's avatar @hawkowl commented

(In [44246]) Branching to tpmodules-py3-7804-3.

@twisted-trac
Copy link
Author

hawkowl's avatar @hawkowl commented

Merged forward, fixed up some small things, please review.

(As an aside, this work has been done as a part of my work on Crossbar.io for Tavendo GmbH)

@twisted-trac
Copy link
Author

hawkowl's avatar @hawkowl removed owner

@twisted-trac
Copy link
Author

adiroiban's avatar @adiroiban commented

Thanks for working on this. They look good.
Twistedchecker is red.

  1. Please check latest docs from trunk regarding how to add references to tickets in comments.

  2. do we need to bother about __all__ and __all3__ in test code?

  3. Can we just keep _ZipMapImpl in py3 but just don't register it? it could reduce the diff. Same for ZipArchive , maybe we can update it just to compile on py3 and do the actual port / tests later. The only reason for doing this is to make sure that when someone changes the _ZipMapImpl code in the future it will at least make it compile on python3

As I am just a junior reviewer I will leave this ticket on review queue so that others can review it.

@twisted-trac
Copy link
Author

hawkowl's avatar @hawkowl commented

Hi Adi! Thanks for the review.

  • Fixed up those comments.
  • The __all__ and __all3__ del method is recommended (instead of skips) in the Python3 plan doc.
  • If we register it without actually implementing it, it's more likely to break. When zippath is ported, the support can be enabled in future.

Respinning the buildbots. I'll look into the twistedchecker failure.

@twisted-trac
Copy link
Author

adiroiban's avatar @adiroiban set owner to @hawkowl

OK.

My point with defining _ZipMapImpl in Python3 is that while working on py2.7 specific changes a developers might avoid introducing changes which are not py3 compatible.


Still some twistedchecker errors... and this just made my review 30 seconds longer as I had to check the builder and then report the errors... all this could be avoid if developers would be able to run twistedchecker on their systems

************* Module twisted
W9208: 11,0:_checkRequirements: Missing docstring
W9402: 58,0: The first letter of comment should be capitalized

Please fix the errors and merge.

Thanks!

@twisted-trac
Copy link
Author

hawkowl's avatar @hawkowl commented

Hi Adi,

Thanks!

Those twistedchecker errors are spurious -- since there's not a "new" entry, it means there's no new errors. It's from the change introduced that sets the exit flag correctly.

Will merge.

@twisted-trac
Copy link
Author

hawkowl's avatar @hawkowl set status to closed

(In [44338]) Merge tpmodules-py3-7804-3: Port twisted.python.modules to Python3

Author: hawkowl
Reviewer: adiroiban
Fixes: #7804

@twisted-trac
Copy link
Author

glyph's avatar @glyph commented

So we should update the buildbot config to explicitly succeed except when there are "new" errors now?

@twisted-trac
Copy link
Author

hawkowl's avatar @hawkowl commented

I think so. Maybe?

@twisted-trac
Copy link
Author

adiroiban's avatar @adiroiban commented

I have created this github issue to trac this problem twisted-infra/braid#80

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

2 participants