From ghayoun at gmail.com Tue Dec 3 06:24:43 2019 From: ghayoun at gmail.com (Gautier HAYOUN) Date: Tue, 3 Dec 2019 11:24:43 +0000 Subject: [python-uk] London Python Code Dojo next Thursday at 2Sixty/Essence In-Reply-To: References: Message-ID: Hi all, We have a bunch of tickets left for the dojo this coming Thursday so grab yourself a ticket: https://www.eventbrite.co.uk/e/copy-of-london-python-code-dojo-season-11-episode-4-tickets-84110567973 ! Gautier Le jeu. 28 nov. 2019 ? 13:38, Gautier HAYOUN a ?crit : > Python-UK, > > The London Python Code Dojo is coming back on Thursday 5th December 2019 > at 6:30pm. > > This month we're returning to 2Sixty/Essence at 180 Oxford Street, W1D 1NN. > > We will have our usual mixture of socialising and hacking on silly > problems. For those who wish, there will be post-Dojo socialising in a > nearby pub. > > So book now for a free ticket at > https://www.eventbrite.co.uk/e/copy-of-london-python-code-dojo-season-11-episode-4-tickets-84110567973 > ! > > See you next week, > Gautier for the Dojo team > -------------- next part -------------- An HTML attachment was scrubbed... URL: From richard at arbee-design.co.uk Tue Dec 3 16:12:38 2019 From: richard at arbee-design.co.uk (Richard Barran) Date: Tue, 3 Dec 2019 22:12:38 +0100 Subject: [python-uk] Python 2.7 code: a spring-clean Message-ID: <939D62DB-784D-403E-86DB-FB7DD8DC59B8@arbee-design.co.uk> Hi all, With the end-of-life of Python 2 upon us, I wondered about cleaning up code that has (had!) to support both Python 2 and Python 3. Some of it is easy (e.g. look for any references to the ?six? library), some of it is relatively easy (e.g. super(Foobar, self) ) and? actually, there could be quite a few things to tidy up. I?m wondering if there is a script out there to quickly introspect a codebase and flag up any legacy code? I?ve tried googling but drew up a blank. Any suggestions welcome! Richard From GadgetSteve at hotmail.com Wed Dec 4 02:04:08 2019 From: GadgetSteve at hotmail.com (Steve - Gadget Barnes) Date: Wed, 4 Dec 2019 07:04:08 +0000 Subject: [python-uk] Python 2.7 code: a spring-clean In-Reply-To: <939D62DB-784D-403E-86DB-FB7DD8DC59B8@arbee-design.co.uk> References: <939D62DB-784D-403E-86DB-FB7DD8DC59B8@arbee-design.co.uk> Message-ID: Hi Richard, One trick that I have used is to use os.walk to find all of the python files and then tried parsing them with ast - this at least throws an error for the files that are completely broken for python 3. Another is to use the python 3 version pylint on the files/project this finds more but in many cases results in a lot more noise. Steve (Gadget). -----Original Message----- From: python-uk On Behalf Of Richard Barran Sent: 03 December 2019 21:13 To: UK Python Users Subject: [python-uk] Python 2.7 code: a spring-clean Hi all, With the end-of-life of Python 2 upon us, I wondered about cleaning up code that has (had!) to support both Python 2 and Python 3. Some of it is easy (e.g. look for any references to the ?six? library), some of it is relatively easy (e.g. super(Foobar, self) ) and? actually, there could be quite a few things to tidy up. I?m wondering if there is a script out there to quickly introspect a codebase and flag up any legacy code? I?ve tried googling but drew up a blank. Any suggestions welcome! Richard _______________________________________________ python-uk mailing list python-uk at python.org https://mail.python.org/mailman/listinfo/python-uk From jml at mumak.net Wed Dec 4 04:51:21 2019 From: jml at mumak.net (Jonathan Lange) Date: Wed, 4 Dec 2019 09:51:21 +0000 Subject: [python-uk] Python 2.7 code: a spring-clean In-Reply-To: <939D62DB-784D-403E-86DB-FB7DD8DC59B8@arbee-design.co.uk> References: <939D62DB-784D-403E-86DB-FB7DD8DC59B8@arbee-design.co.uk> Message-ID: We've had good luck using https://github.com/asottile/pyupgrade as a pre-commit hook (see https://pre-commit.com/ ? highly recommended). We were already using Python 3, but it's helped us deal with some of the 3.n -> 3.n+1 upgrades. On Tue, 3 Dec 2019 at 21:23, Richard Barran wrote: > Hi all, > > With the end-of-life of Python 2 upon us, I wondered about cleaning up > code that has (had!) to support both Python 2 and Python 3. Some of it is > easy (e.g. look for any references to the ?six? library), some of it is > relatively easy (e.g. super(Foobar, self) ) and? actually, there could be > quite a few things to tidy up. > > I?m wondering if there is a script out there to quickly introspect a > codebase and flag up any legacy code? I?ve tried googling but drew up a > blank. Any suggestions welcome! > > Richard > _______________________________________________ > python-uk mailing list > python-uk at python.org > https://mail.python.org/mailman/listinfo/python-uk > -------------- next part -------------- An HTML attachment was scrubbed... URL: From richard at arbee-design.co.uk Wed Dec 4 13:12:35 2019 From: richard at arbee-design.co.uk (Richard Barran) Date: Wed, 4 Dec 2019 19:12:35 +0100 Subject: [python-uk] Python 2.7 code: a spring-clean In-Reply-To: References: <939D62DB-784D-403E-86DB-FB7DD8DC59B8@arbee-design.co.uk> Message-ID: <45AE8CFA-4AEB-4049-8179-1961A8E9841F@arbee-design.co.uk> That might do the trick - I?ll try it out. Mucho thanks! > On 4 Dec 2019, at 10:51, Jonathan Lange wrote: > > We've had good luck using https://github.com/asottile/pyupgrade as a pre-commit hook (see https://pre-commit.com/ ? highly recommended). > > We were already using Python 3, but it's helped us deal with some of the 3.n -> 3.n+1 upgrades. > > On Tue, 3 Dec 2019 at 21:23, Richard Barran > wrote: > Hi all, > > With the end-of-life of Python 2 upon us, I wondered about cleaning up code that has (had!) to support both Python 2 and Python 3. Some of it is easy (e.g. look for any references to the ?six? library), some of it is relatively easy (e.g. super(Foobar, self) ) and? actually, there could be quite a few things to tidy up. > > I?m wondering if there is a script out there to quickly introspect a codebase and flag up any legacy code? I?ve tried googling but drew up a blank. Any suggestions welcome! > > Richard > _______________________________________________ > python-uk mailing list > python-uk at python.org > https://mail.python.org/mailman/listinfo/python-uk > _______________________________________________ > python-uk mailing list > python-uk at python.org > https://mail.python.org/mailman/listinfo/python-uk -------------- next part -------------- An HTML attachment was scrubbed... URL: From steve at holdenweb.com Thu Dec 5 17:15:20 2019 From: steve at holdenweb.com (Steve Holden) Date: Thu, 5 Dec 2019 22:15:20 +0000 Subject: [python-uk] Python 2.7 code: a spring-clean In-Reply-To: <939D62DB-784D-403E-86DB-FB7DD8DC59B8@arbee-design.co.uk> References: <939D62DB-784D-403E-86DB-FB7DD8DC59B8@arbee-design.co.uk> Message-ID: There's been loose talk of adding "minus2" fixers to 2to3, but I don't know whether there's been any concrete progress. At least most refactorings will be taking place on a code base that already runs on Python 3, so tests (where they exist) can ensure that such automated refactorings would do relatively little damage. Kind regards, Steve Holden On Tue, Dec 3, 2019 at 9:23 PM Richard Barran wrote: > Hi all, > > With the end-of-life of Python 2 upon us, I wondered about cleaning up > code that has (had!) to support both Python 2 and Python 3. Some of it is > easy (e.g. look for any references to the ?six? library), some of it is > relatively easy (e.g. super(Foobar, self) ) and? actually, there could be > quite a few things to tidy up. > > I?m wondering if there is a script out there to quickly introspect a > codebase and flag up any legacy code? I?ve tried googling but drew up a > blank. Any suggestions welcome! > > Richard > _______________________________________________ > python-uk mailing list > python-uk at python.org > https://mail.python.org/mailman/listinfo/python-uk > -------------- next part -------------- An HTML attachment was scrubbed... URL: