 My name is Chun Fuwen, from Red Hat Company, located in Beijing. So today I want to present a topic about the journey to migrate patent to project to pass three So just I mentioned that I work for a life hat. I have a bound of working experience in Oracle, Morona or Siemens So this is the agenda today First I will have a brief introduction about the protein project second part I will Introduce some high-level protein strategies So the third part I will introduce some automated tools to help you do the migration The final part will address some common pregnant issues so So this is the all-protein part of you Actually, we are pulling two parts together because they are dependent on each other The first part is our code dash VT. It's some kind of compatibility black in Let's you execution what I say in test cases and Then the second part is TB dash reward the kind of for Pacific test provider To cover some test case such as the board or what I say is related test cases Just I mentioned because they are dependent on each other So we are pulling it together before migration or before putting the both online writing in present 2007 So what's modulation behind why we needed to model? migration there are various reasons Number one is because on pass three we have enjoyed faster than pattern two So there are statistics released by that highlight It can serve CBO till percent are even more on the memory Also, they are a bunch of backfist on pattern three suffering even if CV is fixed Also, you can enjoy sign advance Features that not available on pattern two such as I think I owe We also have some better type different definition in pattern three For example is to distinguish test stream and the best dream and also you can enjoy the real life division That means the division So integer division will return float float now So the last one is more concrete reason is that and your 2020 the present tool will be enough life So what's migration strategy? Normally we have three choices number one choice is just completely convert currently present to code it to pass three and the totally sacred by to present to Number two choice you can create a separate launch for your present to and a pattern three But it if we are new feet alive or your new fix you need to push Separately so it will double your maternal and the developer info The last choice is the coexist what mean that means that present to and a pencil a Let's show the so clear the base and then they work on both person environments So perceived our Such strategy to our product. We are some ground rules. First of all, we needed to also present module or test cases should the point to pattern version which is greater than or equal to 3.6 and Then we need to show to keep conviviality with the present to and the present three in the same code base and also we make sure that Any old change push it was a good hub or a branch should be validates on both pattern towards three So generally also have some good idea. You like you can use them towards pilot with the option Pies looking at along it. We are doing your Look, it will help you to locate it the scope changes. So it will give us some As last I've seen it how much effort you needed to put in migrating some project So we set up continue. You use continuous integration to migrate this project We love me devise a pulling ever in those three faces in the face of one. We just adjust some Issues that some all the major tool can help you to let and In face tool, we just adjust the more difficult part such as the difference between text and the panel a strong handler on present to and the past three We use the increments integration. We create a separate Call request according to specific items in math because it helps us lower lower back if we can't sign issues we set up That's the moment because we tried to call it Any change we are the many are the we call any change we can see that They are huge Difference between present to and the past three. So I just made a lot. We have a son So pulling effort is time consuming But it doesn't mean that you need to do it manually. We have some tools or the mentors Can help you do the easy stuff things for you So total three to three is the first release kind of automated tool to help you migration your present code to pass away and It is actually is the Python program and the interview ladies sign your present to code and apply a serious fisters Finally chance to learn into validated personal code So under the hood it depends on the standard library lab to those three So lab lab to those days contents a serious fixes and almost kind of almost called for you more advanced that Yep, like to those three is a flexible and the genetic lab learning So it's possible to let your own fix based on that. So another tool for example for your life is just based on this library So how to use is it's quite easy. It's just common line. So you can use the sign Passed by some common line parameters. For example, you can use the dash F to specify Pacific Fixes even you can apply on the entire project or Pacific one file So feudalize feel as also another tool It's actually is customized to those three based secretive Hope you're to make present code to code or pencil code compatible in the same code base So To those three is just make your code to pass away. They don't make your code Compatible in the same code base. The feudalize can do that so normally how it use you just Passing to code slow or appropriate fixes the tenant by the code Very naturally we are at some important dependency. For example, the other son Dutch school future on the future package in your pattern file Normally it will Long in two stages city one you just will apply sign very safe fix on your entire code State tool we'll fix some more not it's safe, but the more challenging one such as String handling each one pattern 2.3. So six six is announced present tool and pencil a compatible library which is written by Benjamin Peterson is a very smart solution for that is only its six can provide Symbol your titties for lepping some or let me over difference pattern tool and pass rate and I really make your code working on as a same Color based results modification So six is really is very simple one is only one pattern file. So Anyway, you can easily to copy you the project and they use that modernize modernize is Yeah, it's also a Automation tool to come up with you is more conservative way to migration a pattern to code 2.3 and It is the under the hood it depends on modernization library is really seen left around lab 2 to 3 So it's harness the lab lab 2 to 3 So it's make your code more modern With the intention of eventually pulling to my pencil it So how do you use use it is a quite similar to To the three you just long it's in common line So previously we just talking some tools now we can do fun about is some common time is usually hung account I try to Categorize those issue with below collect this we are go through it go through it So They are essentially syntax difference between pattern to 1.3 for example Print is a function instead of statement. So you can see there are some syntax changes They say apply for ask you ask her So they now also is a function instead of statement we also have some slightly difference in the extension handling you needed to use keyboard as now on pencil a and My class attribute is not a bit now on pencil a is could should be a parameter in your class constructor Also there are slightly changes in the lazy session you'll need to use Newly you need to include close your parameter in the pair in the pair palestinates And also for some comprehensive functions such as map filter chip Now on policy the return illiterate inside of list So if you want to loop the return of value multi types it could be some issue because It's not this now. We also have some For the octal literals. We need an additional Small little case all among light On person three We only sport implicit relative import so on pattern to its sport kind of implicit Import so now it's not spot on pencil a so neither use and leading pure the symbol to glad Opposite way, it's unified Int and along it so this syntax not spot impending three now because they unify unify the int and along it for the division upon the tool tool integer Divide divide return to the in my return the integer, but Obviously the return float and all so this is a particular dangerous because It's often and go unnoticed the is that in the slow any Syntax alo so to be careful of this Sensing is gone means that something is completely moved from pattern three for example, especially in the dictionary we can see that Additionally it is keys values items has a key this function not available on the pattern three Instead of you need to use additional keys values it turns this kind of function instead and They also have some Type different return so on pattern to Italy keys via return list But on pattern three those kinds of function will return dynamic view In most cases it's work as you're expected, but dynamic view doesn't sport Index, so if you apply some index on the dynamic view will return alo and also For unicode function because on pattern three via native spot unicode, so this phone is not available and also on Pattern to we have two global functions to let you use it to impose the input from the common common alarm The law does import and the import on policy there are both of them But on but it's a pattern to obviously the only one left. It is input But they also have some minor change on Pattern to input if your input some numbers one two three you return a integer for you But on pattern three this much of over the return star. So be careful of it and also for the Lange as a sling we on pattern to we are to Functions generally the data one is a sling the other one is range So on pattern to we only have range available and also there are some type difference on Pattern to land that will return list on pattern three. We only take a little later And the file you can really move you can use open or with open some kind of sins and The commander modules also removed Instead of you need to use the software sets Sensing is the name Because on pattern to there are some modules. They are fine name convention was something not good. So they try to obviously they just Change the light. So you can see config of puzzle All the No, no, no, no, it is a low case now or and it's a private to Queen and also there are some Function attribute becoming is a function. They all know they move this but but just put double on the score on it for the building in module Impassory they use on the school at the beginning. No, I'm personally just use the more light Pica on pattern to your topic one is Pica the other one is PC Pica and Cpica you are more Best performance But on personally they only use the Pica and underlying they use sign algorithm the Implement by C Six server is the same. They just change the smoke case Something is the organize what I mean that They are caught number of Python 3.0 low organized time standard library moves and classes into some other modules For example, it's a you are your lab and you are that lab to and you are your parcel. They are heavily the organized with individual class and Functions they distribute it to some sub module for example previously we can import your lab from here, but actually on person 3 you needed from this module it's a happen from here and Also on person 3 we are more base HTTP server module into the HTTP server and html parcel move to html.parcel this module We also see that The load function previously on pattern 2 is the building function not move to the import lab library so this is just a Gunsan reference Solution to just make them work on Boston to advance pathway, but it's not only one. They are quite few options so From given a point of view the largest change between pattern 2.3 is the string handling On pattern 2 we are confusing use Stir Means two different type value sometimes the test sometimes the binary So on pattern 3 we are created separate For for the string for example We have clear separate string one is text another is the base So from the table you can see test string on pattern 3 we use Stir and pattern 2 is used unique code binary parts on pattern 3 we use base and test To finally we use turn so you can see this turn is confusing use But on pattern 3 it means test string Python 2 is means Banner this banner data, so this this is this chain is nearly putting a lot of challenges So just imagine that so we are some lesson learned So try not to mix text and then finally in your string sequence We are heavily strong here for example, we are Might allow this kind of issues With because there are two different pipe now. This is the Test string this is by string you cannot combine together and also you cannot here is the pattern is the String this is best so you cannot use this also This is bias by this is the test string they use is your slow. Yeah, I lose They are caught There are many situations that you need to convert them so your if you want to convert bias to test just use building in decoded measures decoded functions, and if you convert back to test You'll need to yeah coding that Because you are heavily used this conversion you can left sign functions like this So yeah This is quite Useful because your kindly use through the conversion this sign useful resource reference So that's all So just time open for question Please so the question is the your bundle can work sign present to string To present three present to finally, can you repeat it like so? Don't catch your You can can you edit a lot or some kind so you'll mean your present three we are we we needed to Use unique code, right? or Yeah, you default uniquely if you use as the decoding you can input as a as a parameter as a parameter for example as a encoding such Your tf any of them is no question But so the question is now if you are some dependency when your migration Yeah, actually are some other tools to check whether you have a dependency like two or not. Can I Make this present three or some kind of tools you go first along lights. I check where the approach is dependent on that No more Okay, let's be another week. Thank you