diff --git a/.venv/Lib/site-packages/Django-5.1.2.dist-info/AUTHORS b/.venv/Lib/site-packages/Django-5.1.2.dist-info/AUTHORS new file mode 100644 index 00000000..0ba20a21 --- /dev/null +++ b/.venv/Lib/site-packages/Django-5.1.2.dist-info/AUTHORS @@ -0,0 +1,1106 @@ +Django was originally created in late 2003 at World Online, the web division +of the Lawrence Journal-World newspaper in Lawrence, Kansas. + +Here is an inevitably incomplete list of MUCH-APPRECIATED CONTRIBUTORS -- +people who have submitted patches, reported bugs, added translations, helped +answer newbie questions, and generally made Django that much better: + + Aaron Cannon + Aaron Linville + Aaron Swartz + Aaron T. Myers + Abeer Upadhyay + Abhijeet Viswa + Abhinav Patil + Abhinav Yadav + Abhishek Gautam + Abhyudai + Adam Allred + Adam Bogdał + Adam Donaghy + Adam Johnson + Adam Malinowski + Adam Vandenberg + Adam Zapletal + Ade Lee + Adiyat Mubarak + Adnan Umer + Arslan Noor + Adrian Holovaty + Adrian Torres + Adrien Lemaire + Afonso Fernández Nogueira + AgarFu + Ahmad Alhashemi + Ahmad Al-Ibrahim + Ahmed Eltawela + ajs + Akash Agrawal + Akash Kumar Sen + Akis Kesoglou + Aksel Ethem + Akshesh Doshi + alang@bright-green.com + Alasdair Nicol + Albert Defler + Albert Wang + Alcides Fonseca + Aldian Fazrihady + Alejandro García Ruiz de Oteiza + Aleksander Milinkevich + Aleksandra Sendecka + Aleksi Häkli + Alex Dutton + Alexander Lazarević + Alexander Myodov + Alexandr Tatarinov + Alex Aktsipetrov + Alex Becker + Alex Couper + Alex Dedul + Alex Gaynor + Alex Hill + Alex Ogier + Alex Robbins + Alexey Boriskin + Alexey Tsivunin + Ali Vakilzade + Aljaž Košir + Aljosa Mohorovic + Alokik Vijay + Amir Karimi + Amit Chakradeo + Amit Ramon + Amit Upadhyay + A. Murat Eren + Ana Belen Sarabia + Ana Krivokapic + Andi Albrecht + André Ericson + Andrei Kulakov + Andreas + Andreas Mock + Andreas Pelme + Andrés Torres Marroquín + Andrew Brehaut + Andrew Clark + Andrew Durdin + Andrew Godwin + Andrew Miller + Andrew Pinkham + Andrews Medina + Andrew Northall + Andriy Sokolovskiy + Andy Chosak + Andy Dustman + Andy Gayton + andy@jadedplanet.net + Anssi Kääriäinen + ant9000@netwise.it + Anthony Briggs + Anthony Wright + Antoine Chéneau + Anton Samarchyan + Antoni Aloy + Antonio Cavedoni + Antonis Christofides + Antti Haapala + Antti Kaihola + Anubhav Joshi + Anvesh Mishra + Anže Pečar + Aram Dulyan + arien + Armin Ronacher + Aron Podrigal + Arsalan Ghassemi + Artem Gnilov + Arthur + Arthur Jovart + Arthur Koziel + Arthur Moreira + Arthur Rio + Arvis Bickovskis + Arya Khaligh + Aryeh Leib Taurog + A S Alam + Asif Saif Uddin + atlithorn + Audrey Roy + av0000@mail.ru + Axel Haustant + Aymeric Augustin + Bahadır Kandemir + Baishampayan Ghose + Baptiste Mispelon + Barry Pederson + Bartolome Sanchez Salado + Barton Ip + Bartosz Grabski + Bashar Al-Abdulhadi + Bastian Kleineidam + Batiste Bieler + Batman + Batuhan Taskaya + Baurzhan Ismagulov + Ben Dean Kawamura + Ben Firshman + Ben Godfrey + Benjamin Wohlwend + Ben Khoo + Ben Lomax + Ben Slavin + Ben Sturmfels + Berker Peksag + Bernd Schlapsi + Bernhard Essl + berto + Bhuvnesh Sharma + Bill Fenner + Bjørn Stabell + Bo Marchman + Bogdan Mateescu + Bojan Mihelac + Bouke Haarsma + Božidar Benko + Brad Melin + Brandon Chinn + Brant Harris + Brendan Hayward + Brendan Quinn + Brenton Simpson + Brett Cannon + Brett Hoerner + Brian Beck + Brian Fabian Crain + Brian Harring + Brian Helba + Brian Ray + Brian Rosner + Bruce Kroeze + Bruno Alla + Bruno Renié + brut.alll@gmail.com + Bryan Chow + Bryan Veloso + bthomas + btoll@bestweb.net + C8E + Caio Ariede + Calvin Spealman + Cameron Curry + Cameron Knight (ckknight) + Can Burak Çilingir + Can Sarıgöl + Carl Meyer + Carles Pina i Estany + Carlos Eduardo de Paula + Carlos Matías de la Torre + Carlton Gibson + cedric@terramater.net + Chad Whitman + ChaosKCW + Charlie Leifer + charly.wilhelm@gmail.com + Chason Chaffin + Cheng Zhang + Chinmoy Chakraborty + Chris Adams + Chris Beaven + Chris Bennett + Chris Cahoon + Chris Chamberlin + Chris Jerdonek + Chris Jones + Chris Lamb + Chris Streeter + Christian Barcenas + Christian Metts + Christian Oudard + Christian Tanzer + Christoffer Sjöbergsson + Christophe Pettus + Christopher Adams + Christopher Babiak + Christopher Lenz + Christoph Mędrela + Chris Wagner + Chris Wesseling + Chris Wilson + Ciaran McCormick + Claude Paroz + Clint Ecker + colin@owlfish.com + Colin Wood + Collin Anderson + Collin Grady + Colton Hicks + Craig Blaszczyk + crankycoder@gmail.com + Curtis Maloney (FunkyBob) + dackze+django@gmail.com + Dagur Páll Ammendrup + Dane Springmeyer + Dan Fairs + Daniel Alves Barbosa de Oliveira Vaz + Daniel Duan + Daniele Procida + Daniel Fairhead + Daniel Greenfeld + dAniel hAhler + Daniel Jilg + Daniel Lindsley + Daniel Poelzleithner + Daniel Pyrathon + Daniel Roseman + Daniel Tao + Daniel Wiesmann + Danilo Bargen + Dan Johnson + Dan Palmer + Dan Poirier + Dan Stephenson + Dan Watson + dave@thebarproject.com + David Ascher + David Avsajanishvili + David Blewett + David Brenneman + David Cramer + David Danier + David Eklund + David Foster + David Gouldin + david@kazserve.org + David Krauth + David Larlet + David Reynolds + David Sanders + David Schein + David Tulig + David Winterbottom + David Wobrock + Davide Ceretti + Deep L. Sukhwani + Deepak Thukral + Denis Kuzmichyov + Dennis Schwertel + Derek Willis + Deric Crago + deric@monowerks.com + Deryck Hodge + Dimitris Glezos + Dirk Datzert + Dirk Eschler + Dmitri Fedortchenko + Dmitry Jemerov + dne@mayonnaise.net + Dolan Antenucci + Donald Harvey + Donald Stufft + Don Spaulding + Doug Beck + Doug Napoleone + dready + Durval Carvalho de Souza + dusk@woofle.net + Dustyn Gibson + Ed Morley + Egidijus Macijauskas + eibaan@gmail.com + elky + Emmanuelle Delescolle + Emil Stenström + enlight + Enrico + Eric Boersma + Eric Brandwein + Eric Floehr + Eric Florenzano + Eric Holscher + Eric Moritz + Eric Palakovich Carr + Erik Karulf + Erik Romijn + eriks@win.tue.nl + Erin Kelly + Erwin Junge + Esdras Beleza + Espen Grindhaug + Étienne Beaulé + Eugene Lazutkin + Evan Grim + Fabian Büchler + Fabian Braun + Fabrice Aneche + Faishal Manzar + Farhaan Bukhsh + favo@exoweb.net + fdr + Federico Capoano + Felipe Lee + Filip Noetzel + Filip Wasilewski + Finn Gruwier Larsen + Fiza Ashraf + Flávio Juvenal da Silva Junior + flavio.curella@gmail.com + Florian Apolloner + Florian Demmer + Florian Moussous + fnaimi66 + Fran Hrženjak + Francesco Panico + Francisco Albarran Cristobal + Francisco Couzo + François Freitag + Frank Tegtmeyer + Frank Wierzbicki + Frank Wiles + František Malina + Fraser Nevett + Gabriel Grant + Gabriel Hurley + gandalf@owca.info + Garry Lawrence + Garry Polley + Garth Kidd + Gary Wilson + Gasper Koren + Gasper Zejn + Gav O'Connor + Gavin Wahl + Ge Hanbin + geber@datacollect.com + Geert Vanderkelen + George Karpenkov + George Song + George Vilches + George Y. Kussumoto + Georg "Hugo" Bauer + Georgi Stanojevski + Gerardo Orozco + Gil Gonçalves + Girish Kumar + Girish Sontakke + Gisle Aas + Glenn Maynard + glin@seznam.cz + GomoX + Gonzalo Saavedra + Gopal Narayanan + Graham Carlyle + Grant Jenks + Greg Chapple + Greg Twohig + Gregor Allensworth + Gregor Müllegger + Grigory Fateyev + Grzegorz Ślusarek + Guilherme Mesquita Gondim + Guillaume Pannatier + Gustavo Picon + hambaloney + Hang Park + Hannes Ljungberg + Hannes Struß + Hao Dong + Harm Geerts + Hasan Ramezani + Hawkeye + Helen Sherwood-Taylor + Henrique Romano + Henry Dang + Hidde Bultsma + Himanshu Chauhan + hipertracker@gmail.com + Hiroki Kiyohara + Hisham Mahmood + Honza Král + Horst Gutmann + Hugo Osvaldo Barrera + HyukJin Jang + Hyun Mi Ae + Iacopo Spalletti + Ian A Wilson + Ian Clelland + Ian Holsman + Ian Lee + Ibon + Idan Gazit + Idan Melamed + Ifedapo Olarewaju + Igor Kolar + Illia Volochii + Ilya Bass + Ilya Semenov + Ingo Klöcker + I.S. van Oostveen + Iuri de Silvio + ivan.chelubeev@gmail.com + Ivan Sagalaev (Maniac) + Jaap Roes + Jack Moffitt + Jacob Burch + Jacob Green + Jacob Kaplan-Moss + Jacob Rief + Jacob Walls + Jakub Bagiński + Jakub Paczkowski + Jakub Wilk + Jakub Wiśniowski + james_027@yahoo.com + James Aylett + James Bennett + James Gillard + James Murty + James Tauber + James Timmins + James Turk + James Wheare + Jamie Matthews + Jannis Leidel + Janos Guljas + Jan Pazdziora + Jan Rademaker + Jarek Głowacki + Jarek Zgoda + Jarosław Wygoda + Jason Davies (Esaj) + Jason Huggins + Jason McBrayer + jason.sidabras@gmail.com + Jason Yan + Javier Mansilla + Jay Parlar + Jay Welborn + Jay Wineinger + J. Clifford Dyer + jcrasta@gmail.com + jdetaeye + Jeff Anderson + Jeff Balogh + Jeff Hui + Jeffrey Gelens + Jeff Triplett + Jeffrey Yancey + Jens Diemer + Jens Page + Jensen Cochran + Jeong-Min Lee + Jérémie Blaser + Jeremy Bowman + Jeremy Carbaugh + Jeremy Dunck + Jeremy Lainé + Jerin Peter George + Jesse Young + Jezeniel Zapanta + jhenry + Jim Dalton + Jimmy Song + Jiri Barton + Joachim Jablon + Joao Oliveira + Joao Pedro Silva + Joe Heck + Joe Jackson + Joel Bohman + Joel Heenan + Joel Watts + Joe Topjian + Johan C. Stöver + Johann Queuniet + Johannes Westphal + john@calixto.net + John D'Agostino + John D'Ambrosio + John Huddleston + John Moses + John Paulett + John Shaffer + Jökull Sólberg Auðunsson + Jon Dufresne + Jon Janzen + Jonas Haag + Jonas Lundberg + Jonathan Davis + Jonatas C. D. + Jonathan Buchanan + Jonathan Daugherty (cygnus) + Jonathan Feignberg + Jonathan Slenders + Jonny Park + Jordan Bae + Jordan Dimov + Jordi J. Tablada + Jorge Bastida + Jorge Gajon + José Tomás Tocino García + Josef Rousek + Joseph Kocherhans + Josh Smeaton + Joshua Cannon + Joshua Ginsberg + Jozko Skrablin + J. Pablo Fernandez + jpellerin@gmail.com + Juan Catalano + Juan Manuel Caicedo + Juan Pedro Fisanotti + Julia Elman + Julia Matsieva + Julian Bez + Julie Rymer + Julien Phalip + Junyoung Choi + junzhang.jn@gmail.com + Jure Cuhalev + Justin Bronn + Justine Tunney + Justin Lilly + Justin Michalicek + Justin Myles Holmes + Jyrki Pulliainen + Kacper Wolkiewicz + Kadesarin Sanjek + Kapil Bansal + Karderio + Karen Tracey + Karol Sikora + Kasun Herath + Katherine “Kati” Michel + Kathryn Killebrew + Katie Miller + Keith Bussell + Kenneth Love + Kent Hauser + Keryn Knight + Kevin Grinberg + Kevin Kubasik + Kevin McConnell + Kieran Holland + kilian + Kim Joon Hwan 김준환 + Kim Soung Ryoul 김성렬 + Klaas van Schelven + knox + konrad@gwu.edu + Kowito Charoenratchatabhan + Krišjānis Vaiders + krzysiek.pawlik@silvermedia.pl + Krzysztof Jagiello + Krzysztof Jurewicz + Krzysztof Kulewski + kurtiss@meetro.com + Lakin Wecker + Lars Yencken + Lau Bech Lauritzen + Laurent Luce + Laurent Rahuel + lcordier@point45.com + Leah Culver + Leandra Finger + Lee Reilly + Lee Sanghyuck + Lemuel Sta Ana + Leo "hylje" Honkanen + Leo Shklovskii + Leo Soto + lerouxb@gmail.com + Lex Berezhny + Liang Feng + Lily Foote + limodou + Lincoln Smith + Liu Yijie <007gzs@gmail.com> + Loek van Gent + Loïc Bistuer + Lowe Thiderman + Luan Pablo + Lucas Connors + Luciano Ramalho + Lucidiot + Ludvig Ericson + Luis C. Berrocal + Łukasz Langa + Łukasz Rekucki + Luke Granger-Brown + Luke Plant + Maciej Fijalkowski + Maciej Wiśniowski + Mads Jensen + Makoto Tsuyuki + Malcolm Tredinnick + Manav Agarwal + Manuel Saelices + Manuzhai + Marc Aymerich Gubern + Marc Egli + Marcel Telka + Marcelo Galigniana + Marc Fargas + Marc Garcia + Marcin Wróbel + Marc Remolt + Marc Seguí Coll + Marc Tamlyn + Marc-Aurèle Brothier + Marian Andre + Marijke Luttekes + Marijn Vriens + Mario Gonzalez + Mariusz Felisiak + Mark Biggers + Mark Evans + Mark Gensler + mark@junklight.com + Mark Lavin + Mark Sandstrom + Markus Amalthea Magnuson + Markus Holtermann + Marten Kenbeek + Marti Raudsepp + martin.glueck@gmail.com + Martin Green + Martin Kosír + Martin Mahner + Martin Maney + Martin von Gagern + Mart Sõmermaa + Marty Alchin + Masashi Shibata + masonsimon+django@gmail.com + Massimiliano Ravelli + Massimo Scamarcia + Mathieu Agopian + Matías Bordese + Matt Boersma + Matt Brewer + Matt Croydon + Matt Deacalion Stevens + Matt Dennenbaum + Matthew Flanagan + Matthew Schinckel + Matthew Somerville + Matthew Tretter + Matthew Wilkes + Matthias Kestenholz + Matthias Pronk + Matt Hoskins + Matt McClanahan + Matt Riggott + Matt Robenolt + Mattia Larentis + Mattia Procopio + Mattias Loverot + mattycakes@gmail.com + Max Burstein + Max Derkachev + Max Smolens + Maxime Lorant + Maxime Toussaint + Maxime Turcotte + Maximilian Merz + Maximillian Dornseif + mccutchen@gmail.com + Meghana Bhange + Meir Kriheli + Michael S. Brown + Michael Hall + Michael Josephson + Michael Lissner + Michael Manfre + michael.mcewan@gmail.com + Michael Placentra II + Michael Radziej + Michael Sanders + Michael Schwarz + Michael Sinov + Michael Thornhill + Michal Chruszcz + michal@plovarna.cz + Michał Modzelewski + Mihai Damian + Mihai Preda + Mikaël Barbero + Mike Axiak + Mike Grouchy + Mike Malone + Mike Richardson + Mike Wiacek + Mikhail Korobov + Mikko Hellsing + Mikołaj Siedlarek + milkomeda + Milton Waddams + mitakummaa@gmail.com + mmarshall + Moayad Mardini + Morgan Aubert + Moritz Sichert + Morten Bagai + msaelices + msundstr + Mushtaq Ali + Mykola Zamkovoi + Nadège Michel + Nagy Károly + Nasimul Haque + Nasir Hussain + Natalia Bidart + Nate Bragg + Nathan Gaberel + Neal Norwitz + Nebojša Dorđević + Ned Batchelder + Nena Kojadin + Niall Dalton + Niall Kelly + Nick Efford + Nick Lane + Nick Pope + Nick Presta + Nick Sandford + Nick Sarbicki + Niclas Olofsson + Nicola Larosa + Nicolas Lara + Nicolas Noé + Nikita Marchant + Nikita Sobolev + Nina Menezes + Niran Babalola + Nis Jørgensen + Nowell Strite + Nuno Mariz + Octavio Peri + oggie rob + oggy + Oguzhan Akan + Oliver Beattie + Oliver Rutherfurd + Olivier Le Thanh Duong + Olivier Sels + Olivier Tabone + Orestis Markou + Orne Brocaar + Oscar Ramirez + Ossama M. Khayat + Owen Griffiths + Ömer Faruk Abacı + Pablo Martín + Panos Laganakos + Paolo Melchiorre + Pascal Hartig + Pascal Varet + Patrik Sletmo + Paul Bissex + Paul Collier + Paul Collins + Paul Donohue + Paul Lanier + Paul McLanahan + Paul McMillan + Paulo Poiati + Paulo Scardine + Paul Smith + Pavel Kulikov + pavithran s + Pavlo Kapyshin + permonik@mesias.brnonet.cz + Petar Marić + Pete Crosier + peter@mymart.com + Peter Sheats + Peter van Kampen + Peter Zsoldos + Pete Shinners + Petr Marhoun + Petter Strandmark + pgross@thoughtworks.com + phaedo + phil.h.smith@gmail.com + Philip Lindborg + Philippe Raoult + phil@produxion.net + Piotr Jakimiak + Piotr Lewandowski + plisk + polpak@yahoo.com + pradeep.gowda@gmail.com + Prashant Pandey + Preston Holmes + Preston Timmons + Priyank Panchal + Priyansh Saxena + Przemysław Buczkowski + Przemysław Suliga + Qi Zhao + Rachel Tobin + Rachel Willmer + Radek Švarz + Rafael Giebisch + Raffaele Salmaso + Rahmat Faisal + Rajesh Dhawan + Ramez Ashraf + Ramil Yanbulatov + Ramin Farajpour Cami + Ramiro Morales + Ramon Saraiva + Ram Rachum + Randy Barlow + Raphaël Barrois + Raphael Michel + Raúl Cumplido + Rebecca Smith + Remco Wendt + Renaud Parent + Renbi Yu + Reza Mohammadi + rhettg@gmail.com + Ricardo Javier Cárdenes Medina + ricardojbarrios@gmail.com + Riccardo Di Virgilio + Riccardo Magliocchetti + Richard Davies + Richard House + Rick Wagner + Rigel Di Scala + Robert Coup + Robert Myers + Roberto Aguilar + Robert Rock Howard + Robert Wittams + Rob Golding-Day + Rob Hudson + Rob Nguyen + Robin Munn + Rodrigo Pinheiro Marques de Araújo + Rohith P R + Romain Garrigues + Ronnie van den Crommenacker + Ronny Haryanto + Ross Poulton + Roxane Bellot + Rozza + Rudolph Froger + Rudy Mutter + Rune Rønde Laursen + Russell Cloran + Russell Keith-Magee + Russ Webber + Ryan Hall + Ryan Heard + ryankanno + Ryan Kelly + Ryan Niemeyer + Ryan Petrello + Ryan Rubin + Ryno Mathee + Sachin Jat + Sage M. Abdullah + Sam Newman + Sander Dijkhuis + Sanket Saurav + Sanyam Khurana + Sarah Abderemane + Sarah Boyce + Sarthak Mehrish + schwank@gmail.com + Scot Hacker + Scott Barr + Scott Cranfill + Scott Fitsimones + Scott Pashley + scott@staplefish.com + Sean Brant + Sebastian Hillig + Sebastian Spiegel + Segyo Myung + Selwin Ong + Sengtha Chay + Senko Rašić + serbaut@gmail.com + Sergei Maertens + Sergey Fedoseev + Sergey Kolosov + Seth Hill + Shafiya Adzhani + Shai Berger + Shannon -jj Behrens + Shawn Milochik + Shreya Bamne + Silvan Spross + Simeon Visser + Simon Blanchard + Simon Charette + Simon Greenhill + Simon Litchfield + Simon Meers + Simon Williams + Simon Willison + Sjoerd Job Postmus + Slawek Mikula + sloonz + smurf@smurf.noris.de + sopel + Sreehari K V + Sridhar Marella + Srinivas Reddy Thatiparthy + Stanislas Guerra + Stanislaus Madueke + Stanislav Karpov + starrynight + Stefan R. Filipek + Stefane Fermgier + Stefano Rivera + Stéphane Raimbault + Stephan Jaekel + Stephen Burrows + Steven L. Smith (fvox13) + Steven Noorbergen (Xaroth) + Stuart Langridge + Subhav Gautam + Sujay S Kumar + Sune Kirkeby + Sung-Jin Hong + SuperJared + Susan Tan + Sutrisno Efendi + Swaroop C H + Szilveszter Farkas + Taavi Teska + Tai Lee + Takashi Matsuo + Tareque Hossain + Taylor Mitchell + tell-k + Terry Huang + thebjorn + Thejaswi Puthraya + Thijs van Dien + Thom Wiggers + Thomas Chaumeny + Thomas Güttler + Thomas Kerpe + Thomas Sorrel + Thomas Steinacher + Thomas Stromberg + Thomas Tanner + tibimicu@gmx.net + Ties Jan Hefting + Tim Allen + Tim Givois + Tim Graham + Tim Heap + Tim McCurrach + Tim Saylor + Toan Vuong + Tobias Kunze + Tobias McNulty + tobias@neuyork.de + Todd O'Bryan + Tom Carrick + Tom Christie + Tom Forbes + Tom Insam + Tom Tobin + Tom Wojcik + Tomáš Ehrlich + Tomáš Kopeček + Tome Cvitan + Tomek Paczkowski + Tomer Chachamu + Tommy Beadle + Tore Lundqvist + torne-django@wolfpuppy.org.uk + Travis Cline + Travis Pinney + Travis Swicegood + Travis Terry + Trevor Caira + Trey Long + tstromberg@google.com + tt@gurgle.no + Tyler Tarabula + Tyson Clugg + Tyson Tate + Unai Zalakain + Valentina Mukhamedzhanova + valtron + Vasiliy Stavenko + Vasil Vangelovski + Vibhu Agarwal + Victor Andrée + viestards.lists@gmail.com + Viktor Danyliuk + Viktor Grabov + Ville Säävuori + Vinay Karanam + Vinay Sajip + Vincent Foley + Vinny Do + Vitaly Babiy + Vitaliy Yelnik + Vladimir Kuzma + Vlado + Vsevolod Solovyov + Vytis Banaitis + wam-djangobug@wamber.net + Wang Chun + Warren Smith + Waylan Limberg + Wiktor Kołodziej + Wiley Kestner + Wiliam Alves de Souza + Will Ayd + William Schwartz + Will Hardy + Will Zhao + Wilson Miner + Wim Glenn + wojtek + Wu Haotian + Xavier Francisco + Xia Kai + Yann Fouillat + Yann Malet + Yash Jhunjhunwala + Yasushi Masuda + ye7cakf02@sneakemail.com + ymasuda@ethercube.com + Yoong Kang Lim + Yury V. Zaytsev + Yusuke Miyazaki + Yves Weissig + yyyyyyyan + Zac Hatfield-Dodds + Zachary Voase + Zach Liu + Zach Thompson + Zain Memon + Zain Patel + Zak Johnson + Žan Anderle + Zbigniew Siciarz + zegor + Zeynel Özdemir + Zlatko Mašek + zriv + + +A big THANK YOU goes to: + + Rob Curley and Ralph Gage for letting us open-source Django. + + Frank Wiles for making excellent arguments for open-sourcing, and for + his sage sysadmin advice. + + Ian Bicking for convincing Adrian to ditch code generation. + + Mark Pilgrim for "Dive Into Python" (https://diveintopython3.net/). + + Guido van Rossum for creating Python. diff --git a/.venv/Lib/site-packages/Django-5.1.2.dist-info/INSTALLER b/.venv/Lib/site-packages/Django-5.1.2.dist-info/INSTALLER new file mode 100644 index 00000000..a1b589e3 --- /dev/null +++ b/.venv/Lib/site-packages/Django-5.1.2.dist-info/INSTALLER @@ -0,0 +1 @@ +pip diff --git a/.venv/Lib/site-packages/Django-5.1.2.dist-info/LICENSE b/.venv/Lib/site-packages/Django-5.1.2.dist-info/LICENSE new file mode 100644 index 00000000..5f4f225d --- /dev/null +++ b/.venv/Lib/site-packages/Django-5.1.2.dist-info/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) Django Software Foundation and individual contributors. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + 3. Neither the name of Django nor the names of its contributors may be used + to endorse or promote products derived from this software without + specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/.venv/Lib/site-packages/Django-5.1.2.dist-info/LICENSE.python b/.venv/Lib/site-packages/Django-5.1.2.dist-info/LICENSE.python new file mode 100644 index 00000000..9f995bf7 --- /dev/null +++ b/.venv/Lib/site-packages/Django-5.1.2.dist-info/LICENSE.python @@ -0,0 +1,288 @@ +Django is licensed under the three-clause BSD license; see the file +LICENSE for details. + +Django includes code from the Python standard library, which is licensed under +the Python license, a permissive open source license. The copyright and license +is included below for compliance with Python's terms. + +---------------------------------------------------------------------- + +Copyright (c) 2001-present Python Software Foundation; All Rights Reserved + +A. HISTORY OF THE SOFTWARE +========================== + +Python was created in the early 1990s by Guido van Rossum at Stichting +Mathematisch Centrum (CWI, see https://www.cwi.nl) in the Netherlands +as a successor of a language called ABC. Guido remains Python's +principal author, although it includes many contributions from others. + +In 1995, Guido continued his work on Python at the Corporation for +National Research Initiatives (CNRI, see https://www.cnri.reston.va.us) +in Reston, Virginia where he released several versions of the +software. + +In May 2000, Guido and the Python core development team moved to +BeOpen.com to form the BeOpen PythonLabs team. In October of the same +year, the PythonLabs team moved to Digital Creations, which became +Zope Corporation. In 2001, the Python Software Foundation (PSF, see +https://www.python.org/psf/) was formed, a non-profit organization +created specifically to own Python-related Intellectual Property. +Zope Corporation was a sponsoring member of the PSF. + +All Python releases are Open Source (see https://opensource.org for +the Open Source Definition). Historically, most, but not all, Python +releases have also been GPL-compatible; the table below summarizes +the various releases. + + Release Derived Year Owner GPL- + from compatible? (1) + + 0.9.0 thru 1.2 1991-1995 CWI yes + 1.3 thru 1.5.2 1.2 1995-1999 CNRI yes + 1.6 1.5.2 2000 CNRI no + 2.0 1.6 2000 BeOpen.com no + 1.6.1 1.6 2001 CNRI yes (2) + 2.1 2.0+1.6.1 2001 PSF no + 2.0.1 2.0+1.6.1 2001 PSF yes + 2.1.1 2.1+2.0.1 2001 PSF yes + 2.1.2 2.1.1 2002 PSF yes + 2.1.3 2.1.2 2002 PSF yes + 2.2 and above 2.1.1 2001-now PSF yes + +Footnotes: + +(1) GPL-compatible doesn't mean that we're distributing Python under + the GPL. All Python licenses, unlike the GPL, let you distribute + a modified version without making your changes open source. The + GPL-compatible licenses make it possible to combine Python with + other software that is released under the GPL; the others don't. + +(2) According to Richard Stallman, 1.6.1 is not GPL-compatible, + because its license has a choice of law clause. According to + CNRI, however, Stallman's lawyer has told CNRI's lawyer that 1.6.1 + is "not incompatible" with the GPL. + +Thanks to the many outside volunteers who have worked under Guido's +direction to make these releases possible. + + +B. TERMS AND CONDITIONS FOR ACCESSING OR OTHERWISE USING PYTHON +=============================================================== + +Python software and documentation are licensed under the +Python Software Foundation License Version 2. + +Starting with Python 3.8.6, examples, recipes, and other code in +the documentation are dual licensed under the PSF License Version 2 +and the Zero-Clause BSD license. + +Some software incorporated into Python is under different licenses. +The licenses are listed with code falling under that license. + + +PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2 +-------------------------------------------- + +1. This LICENSE AGREEMENT is between the Python Software Foundation +("PSF"), and the Individual or Organization ("Licensee") accessing and +otherwise using this software ("Python") in source or binary form and +its associated documentation. + +2. Subject to the terms and conditions of this License Agreement, PSF hereby +grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce, +analyze, test, perform and/or display publicly, prepare derivative works, +distribute, and otherwise use Python alone or in any derivative version, +provided, however, that PSF's License Agreement and PSF's notice of copyright, +i.e., "Copyright (c) 2001-2024 Python Software Foundation; All Rights Reserved" +are retained in Python alone or in any derivative version prepared by Licensee. + +3. In the event Licensee prepares a derivative work that is based on +or incorporates Python or any part thereof, and wants to make +the derivative work available to others as provided herein, then +Licensee hereby agrees to include in any such work a brief summary of +the changes made to Python. + +4. PSF is making Python available to Licensee on an "AS IS" +basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR +IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND +DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS +FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT +INFRINGE ANY THIRD PARTY RIGHTS. + +5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON +FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS +A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON, +OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. + +6. This License Agreement will automatically terminate upon a material +breach of its terms and conditions. + +7. Nothing in this License Agreement shall be deemed to create any +relationship of agency, partnership, or joint venture between PSF and +Licensee. This License Agreement does not grant permission to use PSF +trademarks or trade name in a trademark sense to endorse or promote +products or services of Licensee, or any third party. + +8. By copying, installing or otherwise using Python, Licensee +agrees to be bound by the terms and conditions of this License +Agreement. + + +BEOPEN.COM LICENSE AGREEMENT FOR PYTHON 2.0 +------------------------------------------- + +BEOPEN PYTHON OPEN SOURCE LICENSE AGREEMENT VERSION 1 + +1. This LICENSE AGREEMENT is between BeOpen.com ("BeOpen"), having an +office at 160 Saratoga Avenue, Santa Clara, CA 95051, and the +Individual or Organization ("Licensee") accessing and otherwise using +this software in source or binary form and its associated +documentation ("the Software"). + +2. Subject to the terms and conditions of this BeOpen Python License +Agreement, BeOpen hereby grants Licensee a non-exclusive, +royalty-free, world-wide license to reproduce, analyze, test, perform +and/or display publicly, prepare derivative works, distribute, and +otherwise use the Software alone or in any derivative version, +provided, however, that the BeOpen Python License is retained in the +Software, alone or in any derivative version prepared by Licensee. + +3. BeOpen is making the Software available to Licensee on an "AS IS" +basis. BEOPEN MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR +IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, BEOPEN MAKES NO AND +DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS +FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE WILL NOT +INFRINGE ANY THIRD PARTY RIGHTS. + +4. BEOPEN SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF THE +SOFTWARE FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS +AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THE SOFTWARE, OR ANY +DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. + +5. This License Agreement will automatically terminate upon a material +breach of its terms and conditions. + +6. This License Agreement shall be governed by and interpreted in all +respects by the law of the State of California, excluding conflict of +law provisions. Nothing in this License Agreement shall be deemed to +create any relationship of agency, partnership, or joint venture +between BeOpen and Licensee. This License Agreement does not grant +permission to use BeOpen trademarks or trade names in a trademark +sense to endorse or promote products or services of Licensee, or any +third party. As an exception, the "BeOpen Python" logos available at +http://www.pythonlabs.com/logos.html may be used according to the +permissions granted on that web page. + +7. By copying, installing or otherwise using the software, Licensee +agrees to be bound by the terms and conditions of this License +Agreement. + + +CNRI LICENSE AGREEMENT FOR PYTHON 1.6.1 +--------------------------------------- + +1. This LICENSE AGREEMENT is between the Corporation for National +Research Initiatives, having an office at 1895 Preston White Drive, +Reston, VA 20191 ("CNRI"), and the Individual or Organization +("Licensee") accessing and otherwise using Python 1.6.1 software in +source or binary form and its associated documentation. + +2. Subject to the terms and conditions of this License Agreement, CNRI +hereby grants Licensee a nonexclusive, royalty-free, world-wide +license to reproduce, analyze, test, perform and/or display publicly, +prepare derivative works, distribute, and otherwise use Python 1.6.1 +alone or in any derivative version, provided, however, that CNRI's +License Agreement and CNRI's notice of copyright, i.e., "Copyright (c) +1995-2001 Corporation for National Research Initiatives; All Rights +Reserved" are retained in Python 1.6.1 alone or in any derivative +version prepared by Licensee. Alternately, in lieu of CNRI's License +Agreement, Licensee may substitute the following text (omitting the +quotes): "Python 1.6.1 is made available subject to the terms and +conditions in CNRI's License Agreement. This Agreement together with +Python 1.6.1 may be located on the internet using the following +unique, persistent identifier (known as a handle): 1895.22/1013. This +Agreement may also be obtained from a proxy server on the internet +using the following URL: http://hdl.handle.net/1895.22/1013". + +3. In the event Licensee prepares a derivative work that is based on +or incorporates Python 1.6.1 or any part thereof, and wants to make +the derivative work available to others as provided herein, then +Licensee hereby agrees to include in any such work a brief summary of +the changes made to Python 1.6.1. + +4. CNRI is making Python 1.6.1 available to Licensee on an "AS IS" +basis. CNRI MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR +IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, CNRI MAKES NO AND +DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS +FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON 1.6.1 WILL NOT +INFRINGE ANY THIRD PARTY RIGHTS. + +5. CNRI SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON +1.6.1 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS +A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON 1.6.1, +OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. + +6. This License Agreement will automatically terminate upon a material +breach of its terms and conditions. + +7. This License Agreement shall be governed by the federal +intellectual property law of the United States, including without +limitation the federal copyright law, and, to the extent such +U.S. federal law does not apply, by the law of the Commonwealth of +Virginia, excluding Virginia's conflict of law provisions. +Notwithstanding the foregoing, with regard to derivative works based +on Python 1.6.1 that incorporate non-separable material that was +previously distributed under the GNU General Public License (GPL), the +law of the Commonwealth of Virginia shall govern this License +Agreement only as to issues arising under or with respect to +Paragraphs 4, 5, and 7 of this License Agreement. Nothing in this +License Agreement shall be deemed to create any relationship of +agency, partnership, or joint venture between CNRI and Licensee. This +License Agreement does not grant permission to use CNRI trademarks or +trade name in a trademark sense to endorse or promote products or +services of Licensee, or any third party. + +8. By clicking on the "ACCEPT" button where indicated, or by copying, +installing or otherwise using Python 1.6.1, Licensee agrees to be +bound by the terms and conditions of this License Agreement. + + ACCEPT + + +CWI LICENSE AGREEMENT FOR PYTHON 0.9.0 THROUGH 1.2 +-------------------------------------------------- + +Copyright (c) 1991 - 1995, Stichting Mathematisch Centrum Amsterdam, +The Netherlands. All rights reserved. + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Stichting Mathematisch +Centrum or CWI not be used in advertising or publicity pertaining to +distribution of the software without specific, written prior +permission. + +STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO +THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE +FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT +OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +ZERO-CLAUSE BSD LICENSE FOR CODE IN THE PYTHON DOCUMENTATION +---------------------------------------------------------------------- + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. diff --git a/.venv/Lib/site-packages/Django-5.1.2.dist-info/METADATA b/.venv/Lib/site-packages/Django-5.1.2.dist-info/METADATA new file mode 100644 index 00000000..e6a9bec3 --- /dev/null +++ b/.venv/Lib/site-packages/Django-5.1.2.dist-info/METADATA @@ -0,0 +1,100 @@ +Metadata-Version: 2.1 +Name: Django +Version: 5.1.2 +Summary: A high-level Python web framework that encourages rapid development and clean, pragmatic design. +Author-email: Django Software Foundation +License: BSD-3-Clause +Project-URL: Homepage, https://www.djangoproject.com/ +Project-URL: Documentation, https://docs.djangoproject.com/ +Project-URL: Release notes, https://docs.djangoproject.com/en/stable/releases/ +Project-URL: Funding, https://www.djangoproject.com/fundraising/ +Project-URL: Source, https://github.com/django/django +Project-URL: Tracker, https://code.djangoproject.com/ +Classifier: Development Status :: 5 - Production/Stable +Classifier: Environment :: Web Environment +Classifier: Framework :: Django +Classifier: Intended Audience :: Developers +Classifier: License :: OSI Approved :: BSD License +Classifier: Operating System :: OS Independent +Classifier: Programming Language :: Python +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: 3 :: Only +Classifier: Programming Language :: Python :: 3.10 +Classifier: Programming Language :: Python :: 3.11 +Classifier: Programming Language :: Python :: 3.12 +Classifier: Topic :: Internet :: WWW/HTTP +Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content +Classifier: Topic :: Internet :: WWW/HTTP :: WSGI +Classifier: Topic :: Software Development :: Libraries :: Application Frameworks +Classifier: Topic :: Software Development :: Libraries :: Python Modules +Requires-Python: >=3.10 +Description-Content-Type: text/x-rst +License-File: LICENSE +License-File: LICENSE.python +License-File: AUTHORS +Requires-Dist: asgiref<4,>=3.8.1 +Requires-Dist: sqlparse>=0.3.1 +Requires-Dist: tzdata; sys_platform == "win32" +Provides-Extra: argon2 +Requires-Dist: argon2-cffi>=19.1.0; extra == "argon2" +Provides-Extra: bcrypt +Requires-Dist: bcrypt; extra == "bcrypt" + +====== +Django +====== + +Django is a high-level Python web framework that encourages rapid development +and clean, pragmatic design. Thanks for checking it out. + +All documentation is in the "``docs``" directory and online at +https://docs.djangoproject.com/en/stable/. If you're just getting started, +here's how we recommend you read the docs: + +* First, read ``docs/intro/install.txt`` for instructions on installing Django. + +* Next, work through the tutorials in order (``docs/intro/tutorial01.txt``, + ``docs/intro/tutorial02.txt``, etc.). + +* If you want to set up an actual deployment server, read + ``docs/howto/deployment/index.txt`` for instructions. + +* You'll probably want to read through the topical guides (in ``docs/topics``) + next; from there you can jump to the HOWTOs (in ``docs/howto``) for specific + problems, and check out the reference (``docs/ref``) for gory details. + +* See ``docs/README`` for instructions on building an HTML version of the docs. + +Docs are updated rigorously. If you find any problems in the docs, or think +they should be clarified in any way, please take 30 seconds to fill out a +ticket here: https://code.djangoproject.com/newticket + +To get more help: + +* Join the ``#django`` channel on ``irc.libera.chat``. Lots of helpful people + hang out there. `Webchat is available `_. + +* Join the django-users mailing list, or read the archives, at + https://groups.google.com/group/django-users. + +* Join the `Django Discord community `_. + +* Join the community on the `Django Forum `_. + +To contribute to Django: + +* Check out https://docs.djangoproject.com/en/dev/internals/contributing/ for + information about getting involved. + +To run Django's test suite: + +* Follow the instructions in the "Unit tests" section of + ``docs/internals/contributing/writing-code/unit-tests.txt``, published online at + https://docs.djangoproject.com/en/dev/internals/contributing/writing-code/unit-tests/#running-the-unit-tests + +Supporting the Development of Django +==================================== + +Django's development depends on your contributions. + +If you depend on Django, remember to support the Django Software Foundation: https://www.djangoproject.com/fundraising/ diff --git a/.venv/Lib/site-packages/Django-5.1.2.dist-info/RECORD b/.venv/Lib/site-packages/Django-5.1.2.dist-info/RECORD new file mode 100644 index 00000000..03b27688 --- /dev/null +++ b/.venv/Lib/site-packages/Django-5.1.2.dist-info/RECORD @@ -0,0 +1,4540 @@ +../../Scripts/django-admin.exe,sha256=xYtRjKmJQkW8sjqcIa4DEbXxoSPIqi8OytaRJGH5aHw,108475 +Django-5.1.2.dist-info/AUTHORS,sha256=PRqRG0Fm9_wNJAoFDQo51gEVArm104sUEQB5GRGBSxw,43110 +Django-5.1.2.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +Django-5.1.2.dist-info/LICENSE,sha256=uEZBXRtRTpwd_xSiLeuQbXlLxUbKYSn5UKGM0JHipmk,1552 +Django-5.1.2.dist-info/LICENSE.python,sha256=ktIAtrhtqXpPighr74DsWGJ6aCryy_ks3CvX6ekGLlE,14261 +Django-5.1.2.dist-info/METADATA,sha256=1cL1vzbUIeBuxO5rTH4J982fgzBnPsCyEeEDnsz5AAU,4167 +Django-5.1.2.dist-info/RECORD,, +Django-5.1.2.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +Django-5.1.2.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92 +Django-5.1.2.dist-info/entry_points.txt,sha256=hi1U04jQDqr9xaV6Gklnqh-d69jiCZdS73E0l_671L4,82 +Django-5.1.2.dist-info/top_level.txt,sha256=V_goijg9tfO20ox_7os6CcnPvmBavbxu46LpJiNLwjA,7 +django/__init__.py,sha256=l739GHmSrmebZH-t5miEoXwlPTowW-LHCYI3tmY2R7A,799 +django/__main__.py,sha256=XO-CRvbZFCKtIvAT6Jvbn32dWnv2pnNszRVS-1nKX0I,212 +django/__pycache__/__init__.cpython-312.pyc,, +django/__pycache__/__main__.cpython-312.pyc,, +django/__pycache__/shortcuts.cpython-312.pyc,, +django/apps/__init__.py,sha256=8WZTI_JnNuP4tyfuimH3_pKQYbDAy2haq-xkQT1UXkc,90 +django/apps/__pycache__/__init__.cpython-312.pyc,, +django/apps/__pycache__/config.cpython-312.pyc,, +django/apps/__pycache__/registry.cpython-312.pyc,, +django/apps/config.py,sha256=1Zhxt4OrwRnOmsT_B_BurImz3oi8330TJG0rRRJ58bQ,11482 +django/apps/registry.py,sha256=rdexON5JuhKAMWAZv4k2DH0fRSKdPZoi6_tTjOUgFRA,17693 +django/conf/__init__.py,sha256=z-39ierCs_8FYomobh9PWESoZI5RJ-TgzEuew8B9kJM,9809 +django/conf/__pycache__/__init__.cpython-312.pyc,, +django/conf/__pycache__/global_settings.cpython-312.pyc,, +django/conf/app_template/__init__.py-tpl,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/app_template/admin.py-tpl,sha256=suMo4x8I3JBxAFBVIdE-5qnqZ6JAZV0FESABHOSc-vg,63 +django/conf/app_template/apps.py-tpl,sha256=jrRjsh9lSkUvV4NnKdlAhLDtvydwBNjite0w2J9WPtI,171 +django/conf/app_template/migrations/__init__.py-tpl,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/app_template/models.py-tpl,sha256=Vjc0p2XbAPgE6HyTF6vll98A4eDhA5AvaQqsc4kQ9AQ,57 +django/conf/app_template/tests.py-tpl,sha256=mrbGGRNg5jwbTJtWWa7zSKdDyeB4vmgZCRc2nk6VY-g,60 +django/conf/app_template/views.py-tpl,sha256=xc1IQHrsij7j33TUbo-_oewy3vs03pw_etpBWaMYJl0,63 +django/conf/global_settings.py,sha256=UaMjYpMCgVGN3h2uxsLYnxk5t7hXfvq5650ctiy-BWM,22889 +django/conf/locale/__init__.py,sha256=QHDK8QIAcRjGMtWL8QVgYA_6psetuZuWBJkPwumTeI8,13864 +django/conf/locale/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/af/LC_MESSAGES/django.mo,sha256=xpMB1OGspYCduAEidr_EPfAJon5f1JrF_WCQFokkoBo,27068 +django/conf/locale/af/LC_MESSAGES/django.po,sha256=sQd5MkwXD8R2o28JFbnp4pIwqvz_thflWmBo9a_4QjY,29915 +django/conf/locale/ar/LC_MESSAGES/django.mo,sha256=qBaEPhfJxd2mK1uPH7J06hPI3_leRPsWkVgcKtJSAvQ,35688 +django/conf/locale/ar/LC_MESSAGES/django.po,sha256=MQeB4q0H-uDLurniJP5b2SBOTETAUl9k9NHxtaw0nnU,38892 +django/conf/locale/ar/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/locale/ar/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/ar/__pycache__/formats.cpython-312.pyc,, +django/conf/locale/ar/formats.py,sha256=EI9DAiGt1avNY-a6luMnAqKISKGHXHiKE4QLRx7wGHU,696 +django/conf/locale/ar_DZ/LC_MESSAGES/django.mo,sha256=QosXYYYvQjGu13pLrC9LIVwUQXVwdJpIYn7RB9QCJY8,33960 +django/conf/locale/ar_DZ/LC_MESSAGES/django.po,sha256=2iT_sY4XedSSiHagu03OgpYXWNJVaKDwKUfxgEN4k3k,37626 +django/conf/locale/ar_DZ/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/locale/ar_DZ/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/ar_DZ/__pycache__/formats.cpython-312.pyc,, +django/conf/locale/ar_DZ/formats.py,sha256=T84q3oMKng-L7_xymPqYwpzs78LvvfHy2drfSRj8XjE,901 +django/conf/locale/ast/LC_MESSAGES/django.mo,sha256=XSStt50HP-49AJ8wFcnbn55SLncJCsS2lx_4UwK-h-8,15579 +django/conf/locale/ast/LC_MESSAGES/django.po,sha256=7qZUb5JjfrWLqtXPRjpNOMNycbcsEYpNO-oYmazLTk4,23675 +django/conf/locale/az/LC_MESSAGES/django.mo,sha256=EJI2hYCCFFJb0YhaS7b5LrHOG6TGT_lJSOYQ2K7VAbY,28595 +django/conf/locale/az/LC_MESSAGES/django.po,sha256=44nzF7PPC0Ax1QI-PSpwvAGyyKQBwoLyZKJlPfJ9vfw,30893 +django/conf/locale/az/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/locale/az/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/az/__pycache__/formats.cpython-312.pyc,, +django/conf/locale/az/formats.py,sha256=JQoS2AYHKJxiH6TJas1MoeYgTeUv5XcNtYUHF7ulDmw,1087 +django/conf/locale/be/LC_MESSAGES/django.mo,sha256=rcdijOhkdSXs8BoQZN5jQDB-pkWYlgWF3m5VfJjCssI,37554 +django/conf/locale/be/LC_MESSAGES/django.po,sha256=7h7Z5qvjhD3BYgmbF1G7-Z2I70t1figiFlvMAz6twA4,40172 +django/conf/locale/bg/LC_MESSAGES/django.mo,sha256=x22bBhceDhNZXSoXiTKnc7w_HvtmW3EfWrZgsomUv6A,34729 +django/conf/locale/bg/LC_MESSAGES/django.po,sha256=xTU8GIhvPPuU7K4G8lZq8FXFsWiloT2u-118KtxkxBc,37283 +django/conf/locale/bg/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/locale/bg/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/bg/__pycache__/formats.cpython-312.pyc,, +django/conf/locale/bg/formats.py,sha256=LC7P_5yjdGgsxLQ_GDtC8H2bz9NTxUze_CAtzlm37TA,705 +django/conf/locale/bn/LC_MESSAGES/django.mo,sha256=sB0RIFrGS11Z8dx5829oOFw55vuO4vty3W4oVzIEe8Q,16660 +django/conf/locale/bn/LC_MESSAGES/django.po,sha256=rF9vML3LDOqXkmK6R_VF3tQaFEoZI7besJAPx5qHNM0,26877 +django/conf/locale/bn/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/locale/bn/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/bn/__pycache__/formats.cpython-312.pyc,, +django/conf/locale/bn/formats.py,sha256=jynhZ9XNNuxTXeF7f2FrJYYZuFwlLY58fGfQ6gVs7s8,964 +django/conf/locale/br/LC_MESSAGES/django.mo,sha256=Xow2-sd55CZJsvfF8axtxXNRe27EDwxKixCGelVQ4aU,14009 +django/conf/locale/br/LC_MESSAGES/django.po,sha256=ODCUDdEDAvsOVOAr49YiWT2YQaBZmc-38brdgYWc8Bs,24293 +django/conf/locale/bs/LC_MESSAGES/django.mo,sha256=Xa5QAbsHIdLkyG4nhLCD4UHdCngrw5Oh120abCNdWlA,10824 +django/conf/locale/bs/LC_MESSAGES/django.po,sha256=IB-2VvrQKUivAMLMpQo1LGRAxw3kj-7kB6ckPai0fug,22070 +django/conf/locale/bs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/locale/bs/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/bs/__pycache__/formats.cpython-312.pyc,, +django/conf/locale/bs/formats.py,sha256=760m-h4OHpij6p_BAD2dr3nsWaTb6oR1Y5culX9Gxqw,705 +django/conf/locale/ca/LC_MESSAGES/django.mo,sha256=v6lEJTUbXyEUBsctIdNFOg-Ck5MVFbuz-JgjqkUe32c,27707 +django/conf/locale/ca/LC_MESSAGES/django.po,sha256=16M-EtYLbfKnquh-IPRjWxTdHAqtisDc46Dzo5n-ZMc,30320 +django/conf/locale/ca/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/locale/ca/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/ca/__pycache__/formats.cpython-312.pyc,, +django/conf/locale/ca/formats.py,sha256=s7N6Ns3yIqr_KDhatnUvfjbPhUbrhvemB5HtCeodGZo,940 +django/conf/locale/ckb/LC_MESSAGES/django.mo,sha256=-Wk2cPQA7s-zQQKuzxnrQ18w-9LnAOfT3Ji5htLgbqI,34015 +django/conf/locale/ckb/LC_MESSAGES/django.po,sha256=OlbnQh93KtkGZ0yQKi8_r-BQQceL5EvAiB30f3Z84Vw,36195 +django/conf/locale/ckb/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/locale/ckb/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/ckb/__pycache__/formats.cpython-312.pyc,, +django/conf/locale/ckb/formats.py,sha256=EbmQC-dyQl8EqVQOVGwy1Ra5-P1n-J3UF4K55p3VzOM,728 +django/conf/locale/cs/LC_MESSAGES/django.mo,sha256=7_tvOmbJAdC-A1yk1503fdzjBxpwA9QJmfRcyPsmTBw,30186 +django/conf/locale/cs/LC_MESSAGES/django.po,sha256=wDPx3mYbrjmdTJEjNJM9odEpMT3j-xSkHqx1FARKMF0,33138 +django/conf/locale/cs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/locale/cs/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/cs/__pycache__/formats.cpython-312.pyc,, +django/conf/locale/cs/formats.py,sha256=3MA70CW0wfr0AIYvYqE0ACmX79tNOx-ZdlR6Aetp9e8,1539 +django/conf/locale/cy/LC_MESSAGES/django.mo,sha256=s7mf895rsoiqrPrXpyWg2k85rN8umYB2aTExWMTux7s,18319 +django/conf/locale/cy/LC_MESSAGES/django.po,sha256=S-1PVWWVgYmugHoYUlmTFAzKCpI81n9MIAhkETbpUoo,25758 +django/conf/locale/cy/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/locale/cy/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/cy/__pycache__/formats.cpython-312.pyc,, +django/conf/locale/cy/formats.py,sha256=NY1pYPfpu7XjLMCCuJk5ggdpLcufV1h101ojyxfPUrY,1355 +django/conf/locale/da/LC_MESSAGES/django.mo,sha256=V5XqSSfkF19P9QbNWPVlF-x3_3di8YohxNlbCRyyeG4,27799 +django/conf/locale/da/LC_MESSAGES/django.po,sha256=8Wkt220nr-BgTKMXzFK_y4o6v8wrz4mof_sI30vJlVs,30236 +django/conf/locale/da/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/locale/da/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/da/__pycache__/formats.cpython-312.pyc,, +django/conf/locale/da/formats.py,sha256=-y3033Fo7COyY0NbxeJVYGFybrnLbgXtRf1yBGlouys,876 +django/conf/locale/de/LC_MESSAGES/django.mo,sha256=-J6VqvJeSF8tk4rjb1aI5MSWwyV372EPzwI3O18vecE,29167 +django/conf/locale/de/LC_MESSAGES/django.po,sha256=RZMqmCY1nUVapY7ryTBN3vFNlEsuhw8mQC7b5M6IV9c,31680 +django/conf/locale/de/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/locale/de/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/de/__pycache__/formats.cpython-312.pyc,, +django/conf/locale/de/formats.py,sha256=fysX8z5TkbPUWAngoy_sMeFGWp2iaNU6ftkBz8cqplg,996 +django/conf/locale/de_CH/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/locale/de_CH/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/de_CH/__pycache__/formats.cpython-312.pyc,, +django/conf/locale/de_CH/formats.py,sha256=22UDF62ESuU0Jp_iNUqAj-Bhq4_-frpji0-ynBdHXYk,1377 +django/conf/locale/dsb/LC_MESSAGES/django.mo,sha256=bk6Zro_bOi3XJbPqJmSQm9CmN03uBxzbplR_GvviOD4,30724 +django/conf/locale/dsb/LC_MESSAGES/django.po,sha256=7t1URhKYbg8wl7Z_SXbkuuRkZtNvtPSTnijIFiAAxUA,33248 +django/conf/locale/el/LC_MESSAGES/django.mo,sha256=P5lTOPFcl9x6_j69ZN3hM_mQbhW7Fbbx02RtTNJwfS0,33648 +django/conf/locale/el/LC_MESSAGES/django.po,sha256=rZCComPQcSSr8ZDLPgtz958uBeBZsmV_gEP-sW88kRA,37123 +django/conf/locale/el/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/locale/el/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/el/__pycache__/formats.cpython-312.pyc,, +django/conf/locale/el/formats.py,sha256=RON2aqQaQK3DYVF_wGlBQJDHrhANxypcUW_udYKI-ro,1241 +django/conf/locale/en/LC_MESSAGES/django.mo,sha256=mVpSj1AoAdDdW3zPZIg5ZDsDbkSUQUMACg_BbWHGFig,356 +django/conf/locale/en/LC_MESSAGES/django.po,sha256=5rdKpzn7YKtjU3sGEHcCGPD9j0c907Xo9k_noqnTglo,30401 +django/conf/locale/en/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/locale/en/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/en/__pycache__/formats.cpython-312.pyc,, +django/conf/locale/en/formats.py,sha256=VTQUhaZ_WFhS5rQj0PxbnoMySK0nzUSqrd6Gx-DtXxI,2438 +django/conf/locale/en_AU/LC_MESSAGES/django.mo,sha256=SntsKx21R2zdjj0D73BkOXGTDnoN5unsLMJ3y06nONM,25633 +django/conf/locale/en_AU/LC_MESSAGES/django.po,sha256=6Qh4Z6REzhUdG5KwNPNK9xgLlgq3VbAJuoSXyd_eHdE,28270 +django/conf/locale/en_AU/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/locale/en_AU/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/en_AU/__pycache__/formats.cpython-312.pyc,, +django/conf/locale/en_AU/formats.py,sha256=BoI5UviKGZ4TccqLmxpcdMf0Yk1YiEhY_iLQUddjvi0,1650 +django/conf/locale/en_CA/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/locale/en_CA/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/en_CA/__pycache__/formats.cpython-312.pyc,, +django/conf/locale/en_CA/formats.py,sha256=joB2Dy7XYhlii_PBJfuzHNLbOPmRXW2JjYkmxFr6KxI,1166 +django/conf/locale/en_GB/LC_MESSAGES/django.mo,sha256=jSIe44HYGfzQlPtUZ8tWK2vCYM9GqCKs-CxLURn4e1o,12108 +django/conf/locale/en_GB/LC_MESSAGES/django.po,sha256=PTXvOpkxgZFRoyiqftEAuMrFcYRLfLDd6w0K8crN8j4,22140 +django/conf/locale/en_GB/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/locale/en_GB/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/en_GB/__pycache__/formats.cpython-312.pyc,, +django/conf/locale/en_GB/formats.py,sha256=cJN8YNthkIOHCIMnwiTaSZ6RCwgSHkjWYMcfw8VFScE,1650 +django/conf/locale/en_IE/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/locale/en_IE/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/en_IE/__pycache__/formats.cpython-312.pyc,, +django/conf/locale/en_IE/formats.py,sha256=aKEIT96Y6tzbGHFu3qsFzFc4Qw_uzhNjB69GpmP6qX8,1484 +django/conf/locale/eo/LC_MESSAGES/django.mo,sha256=TPgHTDrh1amnOQjA7sY-lQvicdFewMutOfoptV3OKkU,27676 +django/conf/locale/eo/LC_MESSAGES/django.po,sha256=IPo-3crOWkp5dDQPDAFSzgCbf9OHjWB1zE3mklhTexk,30235 +django/conf/locale/eo/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/locale/eo/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/eo/__pycache__/formats.cpython-312.pyc,, +django/conf/locale/eo/formats.py,sha256=zIEAk-SiLX0cvQVmRc3LpmV69jwRrejMMdC7vtVsSh0,1715 +django/conf/locale/es/LC_MESSAGES/django.mo,sha256=obYxux5pMwwbgMs6c_I5T-3CR7e_07d0h-JwmzwsKWU,29265 +django/conf/locale/es/LC_MESSAGES/django.po,sha256=77fpBrwtaZ3nvcXyLrf5k4Psq22dHuN0iR7OPn0MUTs,33344 +django/conf/locale/es/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/locale/es/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/es/__pycache__/formats.cpython-312.pyc,, +django/conf/locale/es/formats.py,sha256=7SusO1dPErY68h5g4lpxvPbsJYdrbTcr_0EX7uDKYNo,978 +django/conf/locale/es_AR/LC_MESSAGES/django.mo,sha256=Bopydg7VICPh0jmrCT7REwC6nBQJG_-42PlTIE5l1eA,29668 +django/conf/locale/es_AR/LC_MESSAGES/django.po,sha256=RHzG_jk2J-AkjkTfwN3Ai_Sq3nGbDk3XpLI9j3DjvLc,32071 +django/conf/locale/es_AR/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/locale/es_AR/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/es_AR/__pycache__/formats.cpython-312.pyc,, +django/conf/locale/es_AR/formats.py,sha256=4qgOJoR2K5ZE-pA2-aYRwFW7AbK-M9F9u3zVwgebr2w,935 +django/conf/locale/es_CO/LC_MESSAGES/django.mo,sha256=ehUwvqz9InObH3fGnOLuBwivRTVMJriZmJzXcJHsfjc,18079 +django/conf/locale/es_CO/LC_MESSAGES/django.po,sha256=XRgn56QENxEixlyix3v4ZSTSjo4vn8fze8smkrv_gc4,25107 +django/conf/locale/es_CO/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/locale/es_CO/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/es_CO/__pycache__/formats.cpython-312.pyc,, +django/conf/locale/es_CO/formats.py,sha256=0uAbBvOkdJZKjvhrrd0htScdO7sTgbofOkkC8A35_a8,691 +django/conf/locale/es_MX/LC_MESSAGES/django.mo,sha256=UkpQJeGOs_JQRmpRiU6kQmmYGL_tizL4JQOWb9i35M4,18501 +django/conf/locale/es_MX/LC_MESSAGES/django.po,sha256=M0O6o1f3V-EIY9meS3fXP_c7t144rXWZuERF5XeG5Uo,25870 +django/conf/locale/es_MX/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/locale/es_MX/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/es_MX/__pycache__/formats.cpython-312.pyc,, +django/conf/locale/es_MX/formats.py,sha256=fBvyAqBcAXARptSE3hxwzFYNx3lEE8QrhNrCWuuGNlA,768 +django/conf/locale/es_NI/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/locale/es_NI/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/es_NI/__pycache__/formats.cpython-312.pyc,, +django/conf/locale/es_NI/formats.py,sha256=UiOadPoMrNt0iTp8jZVq65xR_4LkOwp-fjvFb8MyNVg,711 +django/conf/locale/es_PR/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/locale/es_PR/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/es_PR/__pycache__/formats.cpython-312.pyc,, +django/conf/locale/es_PR/formats.py,sha256=VVTlwyekX80zCKlg1P4jhaAdKNpN5I64pW_xgrhpyVs,675 +django/conf/locale/es_VE/LC_MESSAGES/django.mo,sha256=h-h1D_Kr-LI_DyUJuIG4Zbu1HcLWTM1s5X515EYLXO8,18840 +django/conf/locale/es_VE/LC_MESSAGES/django.po,sha256=Xj38imu4Yw-Mugwge5CqAqWlcnRWnAKpVBPuL06Twjs,25494 +django/conf/locale/et/LC_MESSAGES/django.mo,sha256=G4JFXVc99Y4GDRrqMb6LRH4Iprg_EmEYMZFW6zSwKBk,27273 +django/conf/locale/et/LC_MESSAGES/django.po,sha256=Hi-kAoqksNbFYkGda0_kphd34Oy9Ti78-oPBiYpV1lg,30056 +django/conf/locale/et/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/locale/et/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/et/__pycache__/formats.cpython-312.pyc,, +django/conf/locale/et/formats.py,sha256=DyFSZVuGSYGoImrRI2FodeM51OtvIcCkKzkI0KvYTQw,707 +django/conf/locale/eu/LC_MESSAGES/django.mo,sha256=EdncCA6Qp76DsqkyEYygaZFrnKRYzJ6LEucQqIjCsSM,21725 +django/conf/locale/eu/LC_MESSAGES/django.po,sha256=6T-yCAeg_8ntlqD_KJyjbqY0qgKPTwi3J46j0J6Ld1I,27752 +django/conf/locale/eu/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/locale/eu/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/eu/__pycache__/formats.cpython-312.pyc,, +django/conf/locale/eu/formats.py,sha256=-PuRA6eHeXP8R3YV0aIEQRbk2LveaZk-_kjHlBT-Drg,749 +django/conf/locale/fa/LC_MESSAGES/django.mo,sha256=i9wWfM-zV76dkEoItqgfDniZ8qI66htM3cw48bBnvNg,31655 +django/conf/locale/fa/LC_MESSAGES/django.po,sha256=yry0L0s1KLG-NZ5T6rAAiQ1j7vhc3vXG24Knzn141eo,35114 +django/conf/locale/fa/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/locale/fa/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/fa/__pycache__/formats.cpython-312.pyc,, +django/conf/locale/fa/formats.py,sha256=v0dLaIh6-CWCAQHkmX0PaIlA499gTeRcJEi7lVJzw9o,722 +django/conf/locale/fi/LC_MESSAGES/django.mo,sha256=_Co3hzTYSaAMnKp8sNnxlX73AtEfjdUaqK46fiV7LdA,27865 +django/conf/locale/fi/LC_MESSAGES/django.po,sha256=_vBbAfxE0j-qD8PKwyxalip51sRZpA1NRpDnQwsyzXY,30420 +django/conf/locale/fi/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/locale/fi/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/fi/__pycache__/formats.cpython-312.pyc,, +django/conf/locale/fi/formats.py,sha256=CO_wD5ZBHwAVgjxArXktLCD7M-PPhtHbayX_bBKqhlA,1213 +django/conf/locale/fr/LC_MESSAGES/django.mo,sha256=7VGI5GSSsL83Z7rrN5r5BcRGKVcN0sTLe4cXygpzr5w,30291 +django/conf/locale/fr/LC_MESSAGES/django.po,sha256=ubj47GdaMGdh5ureglmUxmouEWF_jI9aSXz-0j3KMPI,32907 +django/conf/locale/fr/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/locale/fr/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/fr/__pycache__/formats.cpython-312.pyc,, +django/conf/locale/fr/formats.py,sha256=0uO3NMUAc2rRZOtr9SMJgFHTNNhr8t2xrGruVBRHTmw,938 +django/conf/locale/fr_BE/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/locale/fr_BE/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/fr_BE/__pycache__/formats.cpython-312.pyc,, +django/conf/locale/fr_BE/formats.py,sha256=DB7W-i5BYeRjMRGWMWmm5oK4FNOTy4H4LL_xx6Ztk00,1154 +django/conf/locale/fr_CA/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/locale/fr_CA/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/fr_CA/__pycache__/formats.cpython-312.pyc,, +django/conf/locale/fr_CA/formats.py,sha256=uSZ4s7XJmcutcbx51DVRu2Sh9ZkOhlTU1RHI37NQqQs,1171 +django/conf/locale/fr_CH/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/locale/fr_CH/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/fr_CH/__pycache__/formats.cpython-312.pyc,, +django/conf/locale/fr_CH/formats.py,sha256=DB7W-i5BYeRjMRGWMWmm5oK4FNOTy4H4LL_xx6Ztk00,1154 +django/conf/locale/fy/LC_MESSAGES/django.mo,sha256=9P7zoJtaYHfXly8d6zBoqkxLM98dO8uI6nmWtsGu-lM,2286 +django/conf/locale/fy/LC_MESSAGES/django.po,sha256=jveK-2MjopbqC9jWcrYbttIb4DUmFyW1_-0tYaD6R0I,19684 +django/conf/locale/fy/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/locale/fy/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/fy/__pycache__/formats.cpython-312.pyc,, +django/conf/locale/fy/formats.py,sha256=mJXj1dHUnO883PYWPwuI07CNbjmnfBTQVRXZMg2hmOk,658 +django/conf/locale/ga/LC_MESSAGES/django.mo,sha256=AE9Vz07y6hXsV3gP-E3uboUU1nWLREpQYUBhKXI0UZY,31429 +django/conf/locale/ga/LC_MESSAGES/django.po,sha256=3biGJaUwzLN_q9b1Pe3_lpQ4-zlT8qEGhCGIU1bMzGo,34517 +django/conf/locale/ga/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/locale/ga/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/ga/__pycache__/formats.cpython-312.pyc,, +django/conf/locale/ga/formats.py,sha256=Qh7R3UMfWzt7QIdMZqxY0o4OMpVsqlchHK7Z0QnDWds,682 +django/conf/locale/gd/LC_MESSAGES/django.mo,sha256=2VKzI7Nqd2NjABVQGdcduWHjj0h2b3UBGQub7xaTVPs,30752 +django/conf/locale/gd/LC_MESSAGES/django.po,sha256=3PfuhhmosuarfPjvM2TVf2kHhZaw5_G8oIM2VWTc3gI,33347 +django/conf/locale/gd/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/locale/gd/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/gd/__pycache__/formats.cpython-312.pyc,, +django/conf/locale/gd/formats.py,sha256=7doL7JIoCqA_o-lpCwM3jDHMpptA3BbSgeLRqdZk8Lc,715 +django/conf/locale/gl/LC_MESSAGES/django.mo,sha256=UJY2CZtRqTkiPz5CgV1y1qPbcxZ6tPZvYtAWhwCNGgQ,28464 +django/conf/locale/gl/LC_MESSAGES/django.po,sha256=ZT-YXU4N4Z6qYkUPm84IXPqLznbOsOEE-PQJN9FCzIc,30925 +django/conf/locale/gl/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/locale/gl/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/gl/__pycache__/formats.cpython-312.pyc,, +django/conf/locale/gl/formats.py,sha256=ygSFv-YTS8htG_LW0awegkkOarPRTZNPbUck5sxkAwI,757 +django/conf/locale/he/LC_MESSAGES/django.mo,sha256=pAzuekmiofxdO7eLRThdsoghuHLWhzaeIrrNy0s6eCQ,32301 +django/conf/locale/he/LC_MESSAGES/django.po,sha256=JHeqYJDlX7s9sAkx1voy68XF_w21sopMLypB3I_ioqs,35086 +django/conf/locale/he/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/locale/he/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/he/__pycache__/formats.cpython-312.pyc,, +django/conf/locale/he/formats.py,sha256=M-tu-LmTZd_oYPNH6CZEsdxJN526RUOfnLHlQxRL0N0,712 +django/conf/locale/hi/LC_MESSAGES/django.mo,sha256=8pV5j5q8VbrxdVkcS0qwhVx6DmXRRXPKfRsm3nWhI2g,19712 +django/conf/locale/hi/LC_MESSAGES/django.po,sha256=DPV-I1aXgIiZB7zHdEgAHShZFyb9zlNmMXlyjH5ug0I,29221 +django/conf/locale/hi/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/locale/hi/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/hi/__pycache__/formats.cpython-312.pyc,, +django/conf/locale/hi/formats.py,sha256=JArVM9dMluSP-cwpZydSVXHB5Vs9QKyR9c-bftI9hds,684 +django/conf/locale/hr/LC_MESSAGES/django.mo,sha256=HP4PCb-i1yYsl5eqCamg5s3qBxZpS_aXDDKZ4Hlbbcc,19457 +django/conf/locale/hr/LC_MESSAGES/django.po,sha256=qeVJgKiAv5dKR2msD2iokSOApZozB3Gp0xqzC09jnvs,26329 +django/conf/locale/hr/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/locale/hr/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/hr/__pycache__/formats.cpython-312.pyc,, +django/conf/locale/hr/formats.py,sha256=F4mIdDoaOYJ_lPmsJ_6bQo4Zj8pOSVwuldm92zRy4Fo,1723 +django/conf/locale/hsb/LC_MESSAGES/django.mo,sha256=5MHc26OtRFQ2dUfzDiB-wSqIkS42A9sCe2I_Z_dbR10,30380 +django/conf/locale/hsb/LC_MESSAGES/django.po,sha256=GqEREqt7jWVckUK57SH6VSrz9WjCOlQcAY7lm9FZnAI,32876 +django/conf/locale/hu/LC_MESSAGES/django.mo,sha256=6rkADx1TKbehAEauc_lga5Yo43l26UAG83jrlHmUEiE,29197 +django/conf/locale/hu/LC_MESSAGES/django.po,sha256=kpqAkbZlMHbIY4hfPj230Rssvp8v7OrTpm7FTxbfbwY,31802 +django/conf/locale/hu/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/locale/hu/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/hu/__pycache__/formats.cpython-312.pyc,, +django/conf/locale/hu/formats.py,sha256=xAD7mNsC5wFA2_KGRbBMPKwj884pq0jCKmXhEenGAEk,1001 +django/conf/locale/hy/LC_MESSAGES/django.mo,sha256=KfmTnB-3ZUKDHeNgLiego2Af0WZoHTuNKss3zE-_XOE,22207 +django/conf/locale/hy/LC_MESSAGES/django.po,sha256=kNKlJ5NqZmeTnnxdqhmU3kXiqT9t8MgAFgxM2V09AIc,28833 +django/conf/locale/ia/LC_MESSAGES/django.mo,sha256=JcrpersrDAoJXrD3AnPYBCQyGJ-6kUzH_Q8StbqmMeE,21428 +django/conf/locale/ia/LC_MESSAGES/django.po,sha256=LG0juYDjf3KkscDxwjY3ac6H1u5BBwGHljW3QWvr1nc,26859 +django/conf/locale/id/LC_MESSAGES/django.mo,sha256=yvfilgl_Bt8BXM4bFbQACjS1Nx4vbkcJk3juYpocu7M,27405 +django/conf/locale/id/LC_MESSAGES/django.po,sha256=bLzDlWUNQPsloIlto2GVuStzGJtjiUuDZ3ky3U-R47Q,29999 +django/conf/locale/id/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/locale/id/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/id/__pycache__/formats.cpython-312.pyc,, +django/conf/locale/id/formats.py,sha256=kYyOxWHN3Jyif3rFxLFyBUjTzFUwmuaLrkw5JvGbEz8,1644 +django/conf/locale/ig/LC_MESSAGES/django.mo,sha256=tAZG5GKhEbrUCJtLrUxzmrROe1RxOhep8w-RR7DaDYo,27188 +django/conf/locale/ig/LC_MESSAGES/django.po,sha256=DB_I4JXKMY4M7PdAeIsdqnLSFpq6ImkGPCuY82rNBpY,28931 +django/conf/locale/ig/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/locale/ig/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/ig/__pycache__/formats.cpython-312.pyc,, +django/conf/locale/ig/formats.py,sha256=P3IsxhF5rNFZ5nCWUSyJfFLb0V1QdX_Xn-tYdrcll5Q,1119 +django/conf/locale/io/LC_MESSAGES/django.mo,sha256=uI78C7Qkytf3g1A6kVWiri_CbS55jReO2XmRfLTeNs0,14317 +django/conf/locale/io/LC_MESSAGES/django.po,sha256=FyN4ZTfNPV5TagM8NEhRts8y_FhehIPPouh_MfslnWY,23124 +django/conf/locale/is/LC_MESSAGES/django.mo,sha256=1pFU-dTPg2zs87L0ZqFFGS9q-f-XrzTOlhKujlyNL2E,24273 +django/conf/locale/is/LC_MESSAGES/django.po,sha256=76cQ_9DLg1jR53hiKSc1tLUMeKn8qTdPwpHwutEK014,28607 +django/conf/locale/is/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/locale/is/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/is/__pycache__/formats.cpython-312.pyc,, +django/conf/locale/is/formats.py,sha256=scsNfP4vVacxWIoN03qc2Fa3R8Uh5Izr1MqBicrAl3A,688 +django/conf/locale/it/LC_MESSAGES/django.mo,sha256=39GKwsSkjlL1h4vVysTWMuo4hq2UGQEC-kqJcaVW54A,28587 +django/conf/locale/it/LC_MESSAGES/django.po,sha256=t973TArDuAfpRpPgSTyc-bU6CPti2xkST9O2tVb8vFc,31670 +django/conf/locale/it/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/locale/it/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/it/__pycache__/formats.cpython-312.pyc,, +django/conf/locale/it/formats.py,sha256=KzkSb3KXBwfM3gk2FezyR-W8_RYKpnlFeFuIi5zl-S0,1774 +django/conf/locale/ja/LC_MESSAGES/django.mo,sha256=2Ye0yCvw0i_rJuhaPU4PmXMytkvUPh0eFAr2mcj3QAo,30945 +django/conf/locale/ja/LC_MESSAGES/django.po,sha256=E3n4fgr5Hje_J0OfnatKyGHkduYHigwuywmLRwynZHo,33466 +django/conf/locale/ja/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/locale/ja/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/ja/__pycache__/formats.cpython-312.pyc,, +django/conf/locale/ja/formats.py,sha256=COUuaXo5zCSNzEwJ0smjbm9Qj28YNBcGxm8qFCJv4sE,729 +django/conf/locale/ka/LC_MESSAGES/django.mo,sha256=4e8at-KNaxYJKIJd8r6iPrYhEdnaJ1qtPw-QHPMh-Sc,24759 +django/conf/locale/ka/LC_MESSAGES/django.po,sha256=pIgaLU6hXgVQ2WJp1DTFoubI7zHOUkkKMddwV3PTdt8,32088 +django/conf/locale/ka/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/locale/ka/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/ka/__pycache__/formats.cpython-312.pyc,, +django/conf/locale/ka/formats.py,sha256=elTGOjS-mxuoSCAKOm8Wz2aLfh4pWvNyClUFcrYq9ng,1861 +django/conf/locale/kab/LC_MESSAGES/django.mo,sha256=x5Kyq2Uf3XNlQP06--4lT8Q1MacA096hZbyMJRrHYIc,7139 +django/conf/locale/kab/LC_MESSAGES/django.po,sha256=DsFL3IzidcAnPoAWIfIbGJ6Teop1yKPBRALeLYrdiFA,20221 +django/conf/locale/kk/LC_MESSAGES/django.mo,sha256=krjcDvA5bu591zcP76bWp2mD2FL1VUl7wutaZjgD668,13148 +django/conf/locale/kk/LC_MESSAGES/django.po,sha256=RgM4kzn46ZjkSDHMAsyOoUg7GdxGiZ-vaEOdf7k0c5A,23933 +django/conf/locale/km/LC_MESSAGES/django.mo,sha256=kEvhZlH7lkY1DUIHTHhFVQzOMAPd_-QMItXTYX0j1xY,7223 +django/conf/locale/km/LC_MESSAGES/django.po,sha256=QgRxEiJMopO14drcmeSG6XEXQpiAyfQN0Ot6eH4gca8,21999 +django/conf/locale/km/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/locale/km/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/km/__pycache__/formats.cpython-312.pyc,, +django/conf/locale/km/formats.py,sha256=0UMLrZz1aI2sdRPkJ0YzX99co2IV6tldP7pEvGEPdP0,750 +django/conf/locale/kn/LC_MESSAGES/django.mo,sha256=fQ7AD5tUiV_PZFBxUjNPQN79dWBJKqfoYwRdrOaQjU4,17515 +django/conf/locale/kn/LC_MESSAGES/django.po,sha256=fS4Z7L4NGVQ6ipZ7lMHAqAopTBP0KkOc-eBK0IYdbBE,28133 +django/conf/locale/kn/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/locale/kn/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/kn/__pycache__/formats.cpython-312.pyc,, +django/conf/locale/kn/formats.py,sha256=X5j9VHIW2XRdeTzDFEyS8tG05OBFzP2R7sEGUQa_INg,680 +django/conf/locale/ko/LC_MESSAGES/django.mo,sha256=21a6D_pZTeyP9B7n19gLYBPuweAdWawAZFPYzVrUaRY,29175 +django/conf/locale/ko/LC_MESSAGES/django.po,sha256=_0oYJJD8RcPEkuyQ48xCuH60EINzVdCopTzIysYJIiM,32054 +django/conf/locale/ko/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/locale/ko/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/ko/__pycache__/formats.cpython-312.pyc,, +django/conf/locale/ko/formats.py,sha256=qn36EjiO4Bu12D_6qitjMDkBfy4M0LgFE-FhK8bPOto,2061 +django/conf/locale/ky/LC_MESSAGES/django.mo,sha256=IBVfwPwaZmaoljMRBGww_wWGMJqbF_IOHHnH2j-yJw8,31395 +django/conf/locale/ky/LC_MESSAGES/django.po,sha256=5ACTPMMbXuPJbU7Rfzs0yZHh3xy483pqo5DwSBQp4s4,33332 +django/conf/locale/ky/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/locale/ky/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/ky/__pycache__/formats.cpython-312.pyc,, +django/conf/locale/ky/formats.py,sha256=QCq7vxAD5fe9VhcjRhG6C3N28jNvdzKR-c-EvDSJ1Pg,1178 +django/conf/locale/lb/LC_MESSAGES/django.mo,sha256=tQSJLQUeD5iUt-eA2EsHuyYqsCSYFtbGdryATxisZsc,8008 +django/conf/locale/lb/LC_MESSAGES/django.po,sha256=GkKPLO3zfGTNync-xoYTf0vZ2GUSAotAjfPSP01SDMU,20622 +django/conf/locale/lt/LC_MESSAGES/django.mo,sha256=cdUzK5RYW-61Upf8Sd8ydAg9wXg21pJaIRWFSKPv17c,21421 +django/conf/locale/lt/LC_MESSAGES/django.po,sha256=Lvpe_xlbxSa5vWEossxBCKryDVT7Lwz0EnuL1kSO6OY,28455 +django/conf/locale/lt/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/locale/lt/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/lt/__pycache__/formats.cpython-312.pyc,, +django/conf/locale/lt/formats.py,sha256=C9ScR3gYswT1dQXFedUUnYe6DQPVGAS_nLxs0h2E3dE,1637 +django/conf/locale/lv/LC_MESSAGES/django.mo,sha256=EYHx-u3LwFcMCO9oHR1IAhAfm5axFLatAqe7CMNaszo,29213 +django/conf/locale/lv/LC_MESSAGES/django.po,sha256=920CMyfWRaJVTO6hJjiAJN33GTRcymBga7FjlqrcZhI,32015 +django/conf/locale/lv/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/locale/lv/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/lv/__pycache__/formats.cpython-312.pyc,, +django/conf/locale/lv/formats.py,sha256=k8owdq0U7-x6yl8ll1W5VjRoKdp8a1G2enH04G5_nvU,1713 +django/conf/locale/mk/LC_MESSAGES/django.mo,sha256=uQKmcys0rOsRynEa812XDAaeiNTeBMkqhR4LZ_cfdAk,22737 +django/conf/locale/mk/LC_MESSAGES/django.po,sha256=4K11QRb493wD-FM6-ruCxks9_vl_jB59V1c1rx-TdKg,29863 +django/conf/locale/mk/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/locale/mk/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/mk/__pycache__/formats.cpython-312.pyc,, +django/conf/locale/mk/formats.py,sha256=xwnJsXLXGogOqpP18u6GozjehpWAwwKmXbELolYV_k4,1451 +django/conf/locale/ml/LC_MESSAGES/django.mo,sha256=MGvV0e3LGUFdVIA-h__BuY8Ckom2dAhSFvAtZ8FiAXU,30808 +django/conf/locale/ml/LC_MESSAGES/django.po,sha256=iLllS6vlCpBNZfy9Xd_2Cuwi_1-Vz9fW4G1lUNOuZ6k,37271 +django/conf/locale/ml/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/locale/ml/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/ml/__pycache__/formats.cpython-312.pyc,, +django/conf/locale/ml/formats.py,sha256=ZR7tMdJF0U6K1H95cTqrFH4gop6ZuSQ7vD2h0yKq6mo,1597 +django/conf/locale/mn/LC_MESSAGES/django.mo,sha256=T8B76Nv_h6nCsTENPSAag_oGc67uj-fMy0jfHyQ7WLI,33282 +django/conf/locale/mn/LC_MESSAGES/django.po,sha256=uaXe-9Y8KcNBAij69nU0Id1ABE6q_pyNRhqigKGlzZY,35852 +django/conf/locale/mn/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/locale/mn/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/mn/__pycache__/formats.cpython-312.pyc,, +django/conf/locale/mn/formats.py,sha256=fsexJU9_UTig2PS_o11hcEmrbPBS8voI4ojuAVPOd_U,676 +django/conf/locale/mr/LC_MESSAGES/django.mo,sha256=wDaS4FOhKcxM7mhzwItieazQ_qBp97ZaKhTZgETDXt0,27608 +django/conf/locale/mr/LC_MESSAGES/django.po,sha256=6eBOK9ZgqrvD1pdIa3NtXojHx-qw_WJLxtNdCkEelrg,34449 +django/conf/locale/ms/LC_MESSAGES/django.mo,sha256=U4_kzfbYF7u78DesFRSReOIeVbOnq8hi_pReFfHfyUQ,27066 +django/conf/locale/ms/LC_MESSAGES/django.po,sha256=49pG3cykGjVfC9N8WPyskz-m7r6KmQiq5i8MR6eOi54,28985 +django/conf/locale/ms/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/locale/ms/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/ms/__pycache__/formats.cpython-312.pyc,, +django/conf/locale/ms/formats.py,sha256=YtOBs6s4j4SOmfB3cpp2ekcxVFoVGgUN8mThoSueCt0,1522 +django/conf/locale/my/LC_MESSAGES/django.mo,sha256=SjYOewwnVim3-GrANk2RNanOjo6Hy2omw0qnpkMzTlM,2589 +django/conf/locale/my/LC_MESSAGES/django.po,sha256=b_QSKXc3lS2Xzb45yVYVg307uZNaAnA0eoXX2ZmNiT0,19684 +django/conf/locale/nb/LC_MESSAGES/django.mo,sha256=qX1Z1F3YXVavlrECVkHXek9tsvJEXbWNrogdjjY3jCg,27007 +django/conf/locale/nb/LC_MESSAGES/django.po,sha256=QQ_adZsyp2BfzcJS-LXnZL0EMmUZLbnHsBB1pRRfV-8,29500 +django/conf/locale/nb/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/locale/nb/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/nb/__pycache__/formats.cpython-312.pyc,, +django/conf/locale/nb/formats.py,sha256=y1QLE-SG00eHwje0lkAToHtz4t621Rz_HQRyBWCgK8c,1552 +django/conf/locale/ne/LC_MESSAGES/django.mo,sha256=BcK8z38SNWDXXWVWUmOyHEzwk2xHEeaW2t7JwrxehKM,27248 +django/conf/locale/ne/LC_MESSAGES/django.po,sha256=_Kj_i2zMb7JLU7EN7Z7JcUn89YgonJf6agSFCjXa49w,33369 +django/conf/locale/nl/LC_MESSAGES/django.mo,sha256=1nQqA4PEgduFpzunMFi0pFVn2qmDPtI76umGzOlgoMU,28191 +django/conf/locale/nl/LC_MESSAGES/django.po,sha256=j5ZwYFj2voEYEybwkH5tPEYkn99g6xnCNH1Ej288yVw,31031 +django/conf/locale/nl/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/locale/nl/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/nl/__pycache__/formats.cpython-312.pyc,, +django/conf/locale/nl/formats.py,sha256=cKaaOvRdeauORjvuZ1xyVcVsl36J3Zk4FSE-lnx2Xwg,3927 +django/conf/locale/nn/LC_MESSAGES/django.mo,sha256=Ccj8kjvjTefC8H6TuDCOdSrTmtkYXkmRR2V42HBMYo4,26850 +django/conf/locale/nn/LC_MESSAGES/django.po,sha256=oaVJTl0NgZ92XJv9DHdsXVaKAc81ky_R3CA6HljTH-8,29100 +django/conf/locale/nn/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/locale/nn/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/nn/__pycache__/formats.cpython-312.pyc,, +django/conf/locale/nn/formats.py,sha256=y1QLE-SG00eHwje0lkAToHtz4t621Rz_HQRyBWCgK8c,1552 +django/conf/locale/os/LC_MESSAGES/django.mo,sha256=LBpf_dyfBnvGOvthpn5-oJuFiSNHrgiVHBzJBR-FxOw,17994 +django/conf/locale/os/LC_MESSAGES/django.po,sha256=WYlAnNYwGFnH76Elnnth6YP2TWA-fEtvV5UinnNj7AA,26278 +django/conf/locale/pa/LC_MESSAGES/django.mo,sha256=H1hCnQzcq0EiSEaayT6t9H-WgONO5V4Cf7l25H2930M,11253 +django/conf/locale/pa/LC_MESSAGES/django.po,sha256=26ifUdCX9fOiXfWvgMkOXlsvS6h6nNskZcIBoASJec4,23013 +django/conf/locale/pl/LC_MESSAGES/django.mo,sha256=8vp8b354Fc7VM1YuOJlOZLf4befel3MDCK-NybFMBtA,30667 +django/conf/locale/pl/LC_MESSAGES/django.po,sha256=v4-ZzdKIL3nYVUxTszG9up4pK1dkxaUiIjFrksu3DAo,34616 +django/conf/locale/pl/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/locale/pl/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/pl/__pycache__/formats.cpython-312.pyc,, +django/conf/locale/pl/formats.py,sha256=KREhPtHuzKS_ZsAqXs5LqYPGhn6O-jLd4WZQ-39BA8I,1032 +django/conf/locale/pt/LC_MESSAGES/django.mo,sha256=nlj_L7Z2FkXs1w6wCGGseuZ_U-IecnlfYRtG5jPkGrs,20657 +django/conf/locale/pt/LC_MESSAGES/django.po,sha256=ETTedbjU2J4FLi2QDHNN8C7zlAsvLWNUlYzkEV1WB6s,26224 +django/conf/locale/pt/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/locale/pt/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/pt/__pycache__/formats.cpython-312.pyc,, +django/conf/locale/pt/formats.py,sha256=RQ9MuIwUPhiY2u-1hFU2abs9Wqv1qZE2AUAfYVK-NU8,1520 +django/conf/locale/pt_BR/LC_MESSAGES/django.mo,sha256=4mM2UEHa1sbwQjlHbxhpGRafRyWyQs56zJ8d3nzNMD4,29218 +django/conf/locale/pt_BR/LC_MESSAGES/django.po,sha256=SvnvurlGJ2QutJGKbGmdAQ55QllPuDqAyDjF0ZYadSA,33298 +django/conf/locale/pt_BR/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/locale/pt_BR/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/pt_BR/__pycache__/formats.cpython-312.pyc,, +django/conf/locale/pt_BR/formats.py,sha256=J1IKV7cS2YMJ5_qlT9h1dDYUX9tLFvqA95l_GpZTLUY,1285 +django/conf/locale/ro/LC_MESSAGES/django.mo,sha256=9RSlC_3Ipn_Vm31ALaGHsrOA1IKmKJ5sN2m6iy5Hk60,21493 +django/conf/locale/ro/LC_MESSAGES/django.po,sha256=XoGlHKEnGlno_sbUTnbkg9nGkRfPIpxv7Wfm3hHGu9w,28099 +django/conf/locale/ro/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/locale/ro/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/ro/__pycache__/formats.cpython-312.pyc,, +django/conf/locale/ro/formats.py,sha256=e_dp0zyfFfoydrGyn6Kk3DnQIj7RTRuvRc6rQ6tSxzA,928 +django/conf/locale/ru/LC_MESSAGES/django.mo,sha256=Y9QMees4Kj3WQDoAtCcugQh2Ky1_ZoaU-vSyTckDxnk,38774 +django/conf/locale/ru/LC_MESSAGES/django.po,sha256=zWmJpjWwpKPnoCjIEKOjclbxBjWf6dwgwoJdnTEx0Jc,42141 +django/conf/locale/ru/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/locale/ru/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/ru/__pycache__/formats.cpython-312.pyc,, +django/conf/locale/ru/formats.py,sha256=lTfYbecdSmHCxebog_2bd0N32iD3nEq_f5buh9il-nI,1098 +django/conf/locale/sk/LC_MESSAGES/django.mo,sha256=2UgS2LCSCPEhJV4R2LQXxGw1LvAZMvi6B1ITaVD_x_U,29965 +django/conf/locale/sk/LC_MESSAGES/django.po,sha256=vt-A2Ayh5r-a49x3lLxe8FU7tm-S2YQHRk-N15smi9k,32799 +django/conf/locale/sk/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/locale/sk/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/sk/__pycache__/formats.cpython-312.pyc,, +django/conf/locale/sk/formats.py,sha256=bWj0FNpYfOAgi9J-L4VuiN6C_jsgPsKNdLYd9gTnFs0,1051 +django/conf/locale/sl/LC_MESSAGES/django.mo,sha256=1mzO4ZC9IYwbKM7iavLJfb2bYaLaC1UVmm4T37Xil7g,23147 +django/conf/locale/sl/LC_MESSAGES/django.po,sha256=EDR734fFO7UM_F-4Q-psEHc-VF2po7fl6n5akKdWYyY,29440 +django/conf/locale/sl/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/locale/sl/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/sl/__pycache__/formats.cpython-312.pyc,, +django/conf/locale/sl/formats.py,sha256=Nq4IfEUnlGebMZeRvB2l9aps-5G5b4y1kQ_3MiJTfe8,1642 +django/conf/locale/sq/LC_MESSAGES/django.mo,sha256=resBCLeu82Vp4LMPj8HJCOFKPxXqpmDJtZq9orfGh34,28679 +django/conf/locale/sq/LC_MESSAGES/django.po,sha256=kO8LFug9I9JdqNDta9pybyN659LMJTlA0vxFkUHN7Io,31128 +django/conf/locale/sq/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/locale/sq/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/sq/__pycache__/formats.cpython-312.pyc,, +django/conf/locale/sq/formats.py,sha256=SA_jCSNwI8-p79skHoLxrPLZnkyq1PVadwT6gMt7n_M,688 +django/conf/locale/sr/LC_MESSAGES/django.mo,sha256=bqJfj3QMTIUFiMxYWBUBGXdjZFLrz1HXMoEINi_Z04I,35035 +django/conf/locale/sr/LC_MESSAGES/django.po,sha256=NGxxpRU-9gqj2I0yPzRuE3alMaUAgOhD_pteaLIhB6A,37561 +django/conf/locale/sr/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/locale/sr/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/sr/__pycache__/formats.cpython-312.pyc,, +django/conf/locale/sr/formats.py,sha256=F3_gYopOXINcllaPFzTqZrZ2oZ1ye3xzR0NQtlqXYp0,1729 +django/conf/locale/sr_Latn/LC_MESSAGES/django.mo,sha256=GHilyEVbIGQt6ItMgQJVk-m6TF8tgHI4rtidYmOwUGI,28715 +django/conf/locale/sr_Latn/LC_MESSAGES/django.po,sha256=FegpyTDYtB-kPG8d8EmK_lK3C7PSxhc2p9xLAZadO74,41466 +django/conf/locale/sr_Latn/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/locale/sr_Latn/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/sr_Latn/__pycache__/formats.cpython-312.pyc,, +django/conf/locale/sr_Latn/formats.py,sha256=BDZm-ajQgCIxQ8mCcckEH32IoCN9233TvAOXkg4mc38,1728 +django/conf/locale/sv/LC_MESSAGES/django.mo,sha256=sLEVlvxPVNVms8Tfmhxs84Ltbx7ryDZtwU54SGJXKRc,28006 +django/conf/locale/sv/LC_MESSAGES/django.po,sha256=Emb4MrDT_fsFdZRhixZztQVgYb5Wl-YpsR8bC9yY3hs,30872 +django/conf/locale/sv/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/locale/sv/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/sv/__pycache__/formats.cpython-312.pyc,, +django/conf/locale/sv/formats.py,sha256=9o8ZtaSq1UOa5y6Du3rQsLAAl5ZOEdVY1OVVMbj02RA,1311 +django/conf/locale/sw/LC_MESSAGES/django.mo,sha256=aUmIVLANgSCTK5Lq8QZPEKWjZWnsnBvm_-ZUcih3J6g,13534 +django/conf/locale/sw/LC_MESSAGES/django.po,sha256=GOE6greXZoLhpccsfPZjE6lR3G4vpK230EnIOdjsgPk,22698 +django/conf/locale/ta/LC_MESSAGES/django.mo,sha256=WeM8tElbcmL11P_D60y5oHKtDxUNWZM9UNgXe1CsRQ4,7094 +django/conf/locale/ta/LC_MESSAGES/django.po,sha256=kgHTFqysEMj1hqktLr-bnL1NRM715zTpiwhelqC232s,22329 +django/conf/locale/ta/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/locale/ta/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/ta/__pycache__/formats.cpython-312.pyc,, +django/conf/locale/ta/formats.py,sha256=vmjfiM54oJJxqcdgZJUNNQN7oMS-XLVBYJ4lWBb5ctY,682 +django/conf/locale/te/LC_MESSAGES/django.mo,sha256=Sk45kPC4capgRdW5ImOKYEVxiBjHXsosNyhVIDtHLBc,13259 +django/conf/locale/te/LC_MESSAGES/django.po,sha256=IQxpGTpsKUtBGN1P-KdGwvE7ojNCqKqPXEvYD3qT5A4,25378 +django/conf/locale/te/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/locale/te/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/te/__pycache__/formats.cpython-312.pyc,, +django/conf/locale/te/formats.py,sha256=-HOoZgmnME4--4CuXzcnhXqNma0Wh7Ninof3RCCGZkU,680 +django/conf/locale/tg/LC_MESSAGES/django.mo,sha256=ePzS2pD84CTkHBaiaMyXBxiizxfFBjHdsGH7hCt5p_4,28497 +django/conf/locale/tg/LC_MESSAGES/django.po,sha256=oSKu3YT3griCrDLPqptZmHcuviI99wvlfX6I6nLJnDk,33351 +django/conf/locale/tg/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/locale/tg/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/tg/__pycache__/formats.cpython-312.pyc,, +django/conf/locale/tg/formats.py,sha256=TG5TGfLNy4JSjl-QAWk46gIEb0ijdBpqPrDtwfJzshw,1160 +django/conf/locale/th/LC_MESSAGES/django.mo,sha256=SJeeJWbdF-Lae5BendxlyMKqx5zdDmh3GCQa8ER5FyY,18629 +django/conf/locale/th/LC_MESSAGES/django.po,sha256=K4ITjzHLq6DyTxgMAfu3CoGxrTd3aG2J6-ZxQj2KG1U,27507 +django/conf/locale/th/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/locale/th/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/th/__pycache__/formats.cpython-312.pyc,, +django/conf/locale/th/formats.py,sha256=SmCUD-zVgI1QE2HwqkFtAO87rJ-FoCjw1s-2-cfl1h0,1072 +django/conf/locale/tk/LC_MESSAGES/django.mo,sha256=qtFLB9rBkpUDv5LtNAZqkkCKtquMySyg3dzQ8x_Nb-Y,27792 +django/conf/locale/tk/LC_MESSAGES/django.po,sha256=dEjcfeYmvjKbAPFVCmrlh7rVOU90MgiYpoo1cHfPj2E,30232 +django/conf/locale/tk/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/locale/tk/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/tk/__pycache__/formats.cpython-312.pyc,, +django/conf/locale/tk/formats.py,sha256=TG5TGfLNy4JSjl-QAWk46gIEb0ijdBpqPrDtwfJzshw,1160 +django/conf/locale/tr/LC_MESSAGES/django.mo,sha256=38GDWb1p0LnWAwXC5CaRYrMgBDgB1O68Jrzer-2Z6Ko,28842 +django/conf/locale/tr/LC_MESSAGES/django.po,sha256=6dCHOghUd4tr14G3ylLQRLkjOZcmY8RDjfSuL6FMq8A,31433 +django/conf/locale/tr/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/locale/tr/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/tr/__pycache__/formats.cpython-312.pyc,, +django/conf/locale/tr/formats.py,sha256=yJg-7hmevD1gvj9iBRMCiYGgd5DxKZcL7T_C3K3ztME,1019 +django/conf/locale/tt/LC_MESSAGES/django.mo,sha256=r554DvdPjD_S8hBRjW8ehccEjEk8h7czQsp46FZZ_Do,14500 +django/conf/locale/tt/LC_MESSAGES/django.po,sha256=W8QgEAH7yXNmjWoF-UeqyVAu5jEMHZ5MXE60e5sawJc,24793 +django/conf/locale/udm/LC_MESSAGES/django.mo,sha256=cIf0i3TjY-yORRAcSev3mIsdGYT49jioTHZtTLYAEyc,12822 +django/conf/locale/udm/LC_MESSAGES/django.po,sha256=n9Az_8M8O5y16yE3iWmK20R9F9VoKBh3jR3iKwMgFlY,23113 +django/conf/locale/ug/LC_MESSAGES/django.mo,sha256=iaFelEuogA9O-dWIUlp_Zjpq33zMNaFCsOpuZT26LfM,35467 +django/conf/locale/ug/LC_MESSAGES/django.po,sha256=Zd3j_J7Su7VTe6TGd8ghDBD2bxX1NLKfA2wsrHPvS2w,37731 +django/conf/locale/ug/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/locale/ug/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/ug/__pycache__/formats.cpython-312.pyc,, +django/conf/locale/ug/formats.py,sha256=qoSAkaWqJ7FW2OTGaZs_CfiMN9PxAVxHecZfwNCzdUo,454 +django/conf/locale/uk/LC_MESSAGES/django.mo,sha256=WD7WRpvZXYTPDagVTbqdpVJSVM4zP8xAmJXKs30tP4I,29855 +django/conf/locale/uk/LC_MESSAGES/django.po,sha256=QeMUwkqdBdnpYt1c2kkAh65HWLMKcHsgfAV1Ca-C_6w,36185 +django/conf/locale/uk/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/locale/uk/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/uk/__pycache__/formats.cpython-312.pyc,, +django/conf/locale/uk/formats.py,sha256=ZmeYmL0eooFwQgmE054V36RQ469ZTfAv6k8SUJrDYQ8,1241 +django/conf/locale/ur/LC_MESSAGES/django.mo,sha256=M6R2DYFRBvcVRAsgVxVOLvH3e8v14b2mJs650UlUb2I,12291 +django/conf/locale/ur/LC_MESSAGES/django.po,sha256=Lr0DXaPqWtCFAxn10BQ0vlvZIMNRvCg_QJQxAC01eWk,23479 +django/conf/locale/uz/LC_MESSAGES/django.mo,sha256=CJSRoHJANkNevG-6QM-TL5VJ9UgS63dWPHeGHan9Ano,26443 +django/conf/locale/uz/LC_MESSAGES/django.po,sha256=u6En3LJg7x7VKsCNff3haprDlsizPxBukfWomKXaMak,29725 +django/conf/locale/uz/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/locale/uz/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/uz/__pycache__/formats.cpython-312.pyc,, +django/conf/locale/uz/formats.py,sha256=cdmqOUBVnPSyi2k9AkOGl27s89PymFePG2gtnYzYbiw,1176 +django/conf/locale/vi/LC_MESSAGES/django.mo,sha256=TMsBzDnf9kZndozqVUnEKtKxfH2N1ajLdrm8hJ4HkYI,17396 +django/conf/locale/vi/LC_MESSAGES/django.po,sha256=tL2rvgunvaN_yqpPSBYAKImFDaFaeqbnpEw_egI11Lo,25342 +django/conf/locale/vi/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/locale/vi/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/vi/__pycache__/formats.cpython-312.pyc,, +django/conf/locale/vi/formats.py,sha256=_xIugkqLnjN9dzIhefMpsJXaTPldr4blKSGS-c3swg0,762 +django/conf/locale/zh_Hans/LC_MESSAGES/django.mo,sha256=pc4Tj52sDX136DQQsxtNKQ2pqCnmLZdZlVlTtyfz124,26944 +django/conf/locale/zh_Hans/LC_MESSAGES/django.po,sha256=qzXCLkD580Q8MzmbBFtTzaMecalBsMrZFzJiNJrD_sk,30141 +django/conf/locale/zh_Hans/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/locale/zh_Hans/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/zh_Hans/__pycache__/formats.cpython-312.pyc,, +django/conf/locale/zh_Hans/formats.py,sha256=iMb9Taj6xQQA3l_NWCC7wUlQuh4YfNUgs2mHcQ6XUEo,1598 +django/conf/locale/zh_Hant/LC_MESSAGES/django.mo,sha256=IdUhxMJtFZAzsKuTKsG_ehCT9xMss31d-KoVf7GkWQg,26802 +django/conf/locale/zh_Hant/LC_MESSAGES/django.po,sha256=yZ1jlfTF9Do5TayisoXES41toj-m_Nb4jauJm73NITg,29034 +django/conf/locale/zh_Hant/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/locale/zh_Hant/__pycache__/__init__.cpython-312.pyc,, +django/conf/locale/zh_Hant/__pycache__/formats.cpython-312.pyc,, +django/conf/locale/zh_Hant/formats.py,sha256=iMb9Taj6xQQA3l_NWCC7wUlQuh4YfNUgs2mHcQ6XUEo,1598 +django/conf/project_template/manage.py-tpl,sha256=JDuGG02670bELmn3XLUSxHFZ8VFhqZTT_oN9VbT5Acc,674 +django/conf/project_template/project_name/__init__.py-tpl,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/conf/project_template/project_name/asgi.py-tpl,sha256=q_6Jo5tLy6ba-S7pLs3YTK7byxSBmU0oYylYJlNvwHI,428 +django/conf/project_template/project_name/settings.py-tpl,sha256=JskIPIEWPSX2p7_rlsPr60JDjmFC0bVEeMChmq--0OY,3342 +django/conf/project_template/project_name/urls.py-tpl,sha256=5en0vlo3TdXdQquXZVNENrmX2DZJxje156HqcRbySKU,789 +django/conf/project_template/project_name/wsgi.py-tpl,sha256=OCfjjCsdEeXPkJgFIrMml_FURt7msovNUPnjzb401fs,428 +django/conf/urls/__init__.py,sha256=qmpaRi5Gn2uaY9h3g9RNu0z3LDEpEeNL9JlfSLed9s0,292 +django/conf/urls/__pycache__/__init__.cpython-312.pyc,, +django/conf/urls/__pycache__/i18n.cpython-312.pyc,, +django/conf/urls/__pycache__/static.cpython-312.pyc,, +django/conf/urls/i18n.py,sha256=M_lO6q_92QrrPoTY9oui95BQgJfPla9edRNuN5Vc4GM,1166 +django/conf/urls/static.py,sha256=gZOYaiIf3SxQ75N69GyVm9C0OmQv1r1IDrUJ0E7zMe0,908 +django/contrib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/contrib/__pycache__/__init__.cpython-312.pyc,, +django/contrib/admin/__init__.py,sha256=i0TwjHWq6qfZJ0e9pVWAZXxVHZ-eOPewGjtdwHljbOM,1203 +django/contrib/admin/__pycache__/__init__.cpython-312.pyc,, +django/contrib/admin/__pycache__/actions.cpython-312.pyc,, +django/contrib/admin/__pycache__/apps.cpython-312.pyc,, +django/contrib/admin/__pycache__/checks.cpython-312.pyc,, +django/contrib/admin/__pycache__/decorators.cpython-312.pyc,, +django/contrib/admin/__pycache__/exceptions.cpython-312.pyc,, +django/contrib/admin/__pycache__/filters.cpython-312.pyc,, +django/contrib/admin/__pycache__/forms.cpython-312.pyc,, +django/contrib/admin/__pycache__/helpers.cpython-312.pyc,, +django/contrib/admin/__pycache__/models.cpython-312.pyc,, +django/contrib/admin/__pycache__/options.cpython-312.pyc,, +django/contrib/admin/__pycache__/sites.cpython-312.pyc,, +django/contrib/admin/__pycache__/tests.cpython-312.pyc,, +django/contrib/admin/__pycache__/utils.cpython-312.pyc,, +django/contrib/admin/__pycache__/widgets.cpython-312.pyc,, +django/contrib/admin/actions.py,sha256=Rdz8-2cPMklSQoPuPBrhWY0MzgllGS6jHVDR0Mq2U48,3171 +django/contrib/admin/apps.py,sha256=BOiulA4tsb3wuAUtLGTGjrbywpSXX0dLo2pUCGV8URw,840 +django/contrib/admin/checks.py,sha256=KkyUfKtosw8cRETN3RSvPO2NOPgdEUjOt1ilnFMYvBM,50474 +django/contrib/admin/decorators.py,sha256=dki7GLFKOPT-mB5rxsYX12rox18BywroxmrzjG_VJXM,3481 +django/contrib/admin/exceptions.py,sha256=VJhzurallXV322hhZklmvp3OmDIZZQpbEOuE-CX7938,507 +django/contrib/admin/filters.py,sha256=xWca0wsA_fGlkgV9mAXA3RipmXvj8EKaumU4f_Kyk9s,27668 +django/contrib/admin/forms.py,sha256=0UCJstmmBfp_c_0AqlALJQYy9bxXo9fqoQQICQONGEo,1023 +django/contrib/admin/helpers.py,sha256=MBXCdcywfCWHUSymxYBNW8VyJ7u_lzpmz8ZISayYMR0,18622 +django/contrib/admin/locale/af/LC_MESSAGES/django.mo,sha256=pYiZtE4_lsLZTy0g4XzY3wx8DCNiDZXfRkSpGrDHyd4,17407 +django/contrib/admin/locale/af/LC_MESSAGES/django.po,sha256=yIx87yG_CHe1cWnimDcKnalK65_qaPqe3AAuDCpMjso,18838 +django/contrib/admin/locale/af/LC_MESSAGES/djangojs.mo,sha256=mvjNbeoFfpyc8aHeOi3-X7QGeY6o29IZPXMZT7BnOGU,5773 +django/contrib/admin/locale/af/LC_MESSAGES/djangojs.po,sha256=KdjKyHdgLPDj09K4IgTJ_KWU47ZlNSnuPklRZDT1bHo,6546 +django/contrib/admin/locale/am/LC_MESSAGES/django.mo,sha256=UOwMxYH1r5AEBpu-P9zxHazk3kwI4CtsPosGIYtl6Hs,8309 +django/contrib/admin/locale/am/LC_MESSAGES/django.po,sha256=NmsIZoBEQwyBIqbKjkwCJ2_iMHnMKB87atoT0iuNXrw,14651 +django/contrib/admin/locale/ar/LC_MESSAGES/django.mo,sha256=tzGQ8jSJc406IBBwtAErlXVqaA10glxB8krZtWp1Rq4,19890 +django/contrib/admin/locale/ar/LC_MESSAGES/django.po,sha256=RBJbiYNDy57K592OKghugZFYiHpTvxUoEQ_B26-5i8A,21339 +django/contrib/admin/locale/ar/LC_MESSAGES/djangojs.mo,sha256=xoI2xNKgspuuJe1UCUB9H6Kyp3AGhj5aeo_WEg5e23A,6545 +django/contrib/admin/locale/ar/LC_MESSAGES/djangojs.po,sha256=jwehFDFk3lMIEH43AEU_JyHOm84Seo-OLd5FmGBbaxo,7281 +django/contrib/admin/locale/ar_DZ/LC_MESSAGES/django.mo,sha256=ipELNNGQYb_nHTEQbUFED8IT26L9c2UXsELf4wk0q6k,19947 +django/contrib/admin/locale/ar_DZ/LC_MESSAGES/django.po,sha256=2mGF2NfofR8WgSJPShF5CrMjECXj0dGFcFaZ2lriulc,21378 +django/contrib/admin/locale/ar_DZ/LC_MESSAGES/djangojs.mo,sha256=L3N1U9OFXYZ8OfrvKHLbVvXa40biIDdmon0ZV8BOIvY,6423 +django/contrib/admin/locale/ar_DZ/LC_MESSAGES/djangojs.po,sha256=Atzp95E2dFtSHZHHna0pBCqU_2V7partODX675OBkQs,7206 +django/contrib/admin/locale/ast/LC_MESSAGES/django.mo,sha256=3uffu2zPbQ1rExUsG_ambggq854Vy8HbullkCYdazA4,2476 +django/contrib/admin/locale/ast/LC_MESSAGES/django.po,sha256=wCWFh9viYUhTGOX0mW3fpN2z0kdE6b7IaA-A5zzb3Yo,11676 +django/contrib/admin/locale/ast/LC_MESSAGES/djangojs.mo,sha256=kiG-lzQidkXER5s_6POO1G91mcAv9VAkAXI25jdYBLE,2137 +django/contrib/admin/locale/ast/LC_MESSAGES/djangojs.po,sha256=s4s6aHocTlzGcFi0p7cFGTi3K8AgoPvFCv7-Hji6At0,4085 +django/contrib/admin/locale/az/LC_MESSAGES/django.mo,sha256=iuElxhnD6K_xzp4WhuYrM6-EREY6WBWHntASQFOhFQ8,18963 +django/contrib/admin/locale/az/LC_MESSAGES/django.po,sha256=GiPWzcWbxWjfzDA4F_ed2j1Uce2Ktri8ZXm7ecF9jbk,20383 +django/contrib/admin/locale/az/LC_MESSAGES/djangojs.mo,sha256=sre90ULGTqwvLUyrrTJrj3kEPwlbP-VDg-fqT_02fsE,5225 +django/contrib/admin/locale/az/LC_MESSAGES/djangojs.po,sha256=-o9woCOf9ikbIptd9uTej6G-TtTQPKRSuK86N0Ta0yU,5968 +django/contrib/admin/locale/be/LC_MESSAGES/django.mo,sha256=ndFEwhHu8GP4EZQoJNSqH-oWNLWdEYcbleaFYCU74nI,23275 +django/contrib/admin/locale/be/LC_MESSAGES/django.po,sha256=QAwFZJpkz-Hm6vS5AHyQ8rxowt_LVhMAYC-cS78F9Qg,24597 +django/contrib/admin/locale/be/LC_MESSAGES/djangojs.mo,sha256=e1xbTtl47sBU5ZCUEf4fHN6E7rRkz_HIYCObX0lWDug,7703 +django/contrib/admin/locale/be/LC_MESSAGES/djangojs.po,sha256=DBSHPnSZm7AVqxg1fINkRQ89QVp_cdi4VhQ7Ynd1NWs,8466 +django/contrib/admin/locale/bg/LC_MESSAGES/django.mo,sha256=fNYcFUCFOnBEH_lR4t80bUN6IwkjS5tIs7xWRNxu80I,22994 +django/contrib/admin/locale/bg/LC_MESSAGES/django.po,sha256=1HZYpZgHwqJsPMwasK1O8zv7mDgX3t-2JTdtV_lzM_w,24461 +django/contrib/admin/locale/bg/LC_MESSAGES/djangojs.mo,sha256=IRQMah9wBmq0g9RZ5hBH_dvQD4Q_pmNG4jJHxCGWwZI,7195 +django/contrib/admin/locale/bg/LC_MESSAGES/djangojs.po,sha256=zv5xU9wS1PCdsmmWaV8txSdY4JduEse7w4iWd3QkzsE,7900 +django/contrib/admin/locale/bn/LC_MESSAGES/django.mo,sha256=I3KUX53ePEC-8x_bwkR5spx3WbJRR8Xf67_2Xrr7Ccg,18585 +django/contrib/admin/locale/bn/LC_MESSAGES/django.po,sha256=UvKCBSa5MuxxZ7U5pRWXH6CEQ9WCJH2cQND0jjBmgpQ,22889 +django/contrib/admin/locale/bn/LC_MESSAGES/djangojs.mo,sha256=t_OiMyPMsR2IdH65qfD9qvQfpWbwFueNuY72XSed2Io,2313 +django/contrib/admin/locale/bn/LC_MESSAGES/djangojs.po,sha256=iFwEJi4k3ULklCq9eQNUhKVblivQPJIoC_6lbyEkotY,4576 +django/contrib/admin/locale/br/LC_MESSAGES/django.mo,sha256=yCuMwrrEB_H44UsnKwY0E87sLpect_AMo0GdBjMZRPs,6489 +django/contrib/admin/locale/br/LC_MESSAGES/django.po,sha256=WMU_sN0ENWgyEbKOm8uVQfTQh9sabvKihtSdMt4XQBM,13717 +django/contrib/admin/locale/br/LC_MESSAGES/djangojs.mo,sha256=n7Yx2k9sAVSNtdY-2Ao6VFsnsx4aiExZ3TF_DnnrKU0,1658 +django/contrib/admin/locale/br/LC_MESSAGES/djangojs.po,sha256=gjg-VapbI9n_827CqNYhbtIQ8W9UcMmMObCsxCzReUU,4108 +django/contrib/admin/locale/bs/LC_MESSAGES/django.mo,sha256=44D550fxiO59Pczu5HZ6gvWEClsfmMuaxQWbA4lCW2M,8845 +django/contrib/admin/locale/bs/LC_MESSAGES/django.po,sha256=FrieR1JB4ssdWwYitJVpZO-odzPBKrW4ZsGK9LA595I,14317 +django/contrib/admin/locale/bs/LC_MESSAGES/djangojs.mo,sha256=SupUK-RLDcqJkpLEsOVjgZOWBRKQMALZLRXGEnA623M,1183 +django/contrib/admin/locale/bs/LC_MESSAGES/djangojs.po,sha256=TOtcfw-Spn5Y8Yugv2OlPoaZ5DRwJjRIl-YKiyU092U,3831 +django/contrib/admin/locale/ca/LC_MESSAGES/django.mo,sha256=Wj8KdBSUuUtebE45FK3kvzl155GdTv4KgecoMxFi0_g,17535 +django/contrib/admin/locale/ca/LC_MESSAGES/django.po,sha256=5s5RIsOY5uL1oQQ5IrOhsOgAWWFZ25vTcYURO2dlR8g,19130 +django/contrib/admin/locale/ca/LC_MESSAGES/djangojs.mo,sha256=HjPaPtF5TZGtRu1P40X2YIuRAoKndwurWE4nlZlc7sE,6075 +django/contrib/admin/locale/ca/LC_MESSAGES/djangojs.po,sha256=G7jxAwjnpvvlGinLWDx_awUBu6XwVrdIFqdxBDMVfJQ,6906 +django/contrib/admin/locale/ckb/LC_MESSAGES/django.mo,sha256=ZVy1U4xWrNSU7lUL2mfdqx9MMQODgbi5B5g7Cea_26M,23234 +django/contrib/admin/locale/ckb/LC_MESSAGES/django.po,sha256=TDGnHwoHvZbYmOvsQEU8rHAgzjp5dY1jAwyu3VGblbo,24560 +django/contrib/admin/locale/ckb/LC_MESSAGES/djangojs.mo,sha256=-Czkr04TLjKYmob6CyoJxuS3YcUs7z-I9Sgh6rOyOdc,7671 +django/contrib/admin/locale/ckb/LC_MESSAGES/djangojs.po,sha256=L1r7AcAvTOFO3_uzQ_9oRHEIYAcnDWd_oIIqX133mjU,8392 +django/contrib/admin/locale/cs/LC_MESSAGES/django.mo,sha256=w2IX5ZS8RaBtWWIvlPiAbcUDpmjiFD2ZGiqEkCzBSdc,19004 +django/contrib/admin/locale/cs/LC_MESSAGES/django.po,sha256=ijy86d9djUVhsRGT52tuLbrKRN3ETNQzo8bSxEdlmhs,20670 +django/contrib/admin/locale/cs/LC_MESSAGES/djangojs.mo,sha256=ArA6qnVlUAsj7EugF0GM4XW494VpTEj3Uu__Qu9jIig,6596 +django/contrib/admin/locale/cs/LC_MESSAGES/djangojs.po,sha256=DKsC0k5i9t3i77uxR_h99MOip-fc3JPDIV9EriGr7qw,7587 +django/contrib/admin/locale/cy/LC_MESSAGES/django.mo,sha256=7ifUyqraN1n0hbyTVb_UjRIG1jdn1HcwehugHBiQvHs,12521 +django/contrib/admin/locale/cy/LC_MESSAGES/django.po,sha256=bS_gUoKklZwd3Vs0YlRTt24-k5ure5ObTu-b5nB5qCA,15918 +django/contrib/admin/locale/cy/LC_MESSAGES/djangojs.mo,sha256=fOCA1fXEmJw_QaXEISLkuBhaMnEmP1ssP9lhqdCCC3c,3801 +django/contrib/admin/locale/cy/LC_MESSAGES/djangojs.po,sha256=OVcS-3tlMJS_T58qnZbWLGczHwFyAjbuWr35YwuxAVM,5082 +django/contrib/admin/locale/da/LC_MESSAGES/django.mo,sha256=UDegq2r-2A-LjbDNaiKxMhVAzZwoKyumfoJE-Y5rMPg,18085 +django/contrib/admin/locale/da/LC_MESSAGES/django.po,sha256=7UqmqCRnGeBRt-RnTa0UMjGVncSjWhddlOdYo0XS6iU,19498 +django/contrib/admin/locale/da/LC_MESSAGES/djangojs.mo,sha256=Y-_2QRAeQ3Mtl3stD2J4eHXdNyuzHcUcpIlvTEuDs6k,5984 +django/contrib/admin/locale/da/LC_MESSAGES/djangojs.po,sha256=tiONUqX3jJnHZ1BbMIOzuQH-SMp2ESlA0RuGJSumy_U,6866 +django/contrib/admin/locale/de/LC_MESSAGES/django.mo,sha256=v2tKhZL-KDMv4UDzNuUgXDEIIoE787wFfpKHk0PUTHU,18731 +django/contrib/admin/locale/de/LC_MESSAGES/django.po,sha256=lNY-xVF6alq55oF3Jn6wj2WWb2j9HO52OUVVxxqDHOQ,20259 +django/contrib/admin/locale/de/LC_MESSAGES/djangojs.mo,sha256=kdve4d181AhGDekHiaxt79iyVWvahp3k9SN3H6Xx_9w,6130 +django/contrib/admin/locale/de/LC_MESSAGES/djangojs.po,sha256=tb25boxPrggqnB7mB2M5iyZ6CEM87PBZNa_JzaOXFF4,6921 +django/contrib/admin/locale/dsb/LC_MESSAGES/django.mo,sha256=Gui7I3Hu5IIGSXXNUXFoaH6ovffmBiDqOSWnytGhZRM,19122 +django/contrib/admin/locale/dsb/LC_MESSAGES/django.po,sha256=Zt8PMJQeG4fJhMMqyroXMj-HNTPwSQ_f4eDjm4Q7QPQ,20379 +django/contrib/admin/locale/dsb/LC_MESSAGES/djangojs.mo,sha256=y9yhJ8ITu5uRDID0AX6dpqWLE5-0bqDuVmUBJ-JJ6H8,6609 +django/contrib/admin/locale/dsb/LC_MESSAGES/djangojs.po,sha256=ca5XVYaT4H4kK-LvvBL1fcpCxRbd1OrbSNk5DAZcfaM,7335 +django/contrib/admin/locale/el/LC_MESSAGES/django.mo,sha256=54kG_94nJigDgJpZM8Cy58G_AGLdS5csJFEjTTvJBfM,22968 +django/contrib/admin/locale/el/LC_MESSAGES/django.po,sha256=f2gUQtedb0sZCBxAoy3hP2rGXT9ysP5UTOlCBvu2NvI,24555 +django/contrib/admin/locale/el/LC_MESSAGES/djangojs.mo,sha256=cix1Bkj2hYO_ofRvtPDhJ9rBnTR6-cnKCFKpZrsxJ34,6509 +django/contrib/admin/locale/el/LC_MESSAGES/djangojs.po,sha256=R05tMMuQEjVQpioy_ayQgFBlLM4WdwXthkMguW6ga24,7339 +django/contrib/admin/locale/en/LC_MESSAGES/django.mo,sha256=U0OV81NfbuNL9ctF-gbGUG5al1StqN-daB-F-gFBFC8,356 +django/contrib/admin/locale/en/LC_MESSAGES/django.po,sha256=_LT1ydmUGadrxathYSS-mZOSmW1hdbKisiEhmTjU8Aw,25103 +django/contrib/admin/locale/en/LC_MESSAGES/djangojs.mo,sha256=U0OV81NfbuNL9ctF-gbGUG5al1StqN-daB-F-gFBFC8,356 +django/contrib/admin/locale/en/LC_MESSAGES/djangojs.po,sha256=XwjM4uE51Mw04zU5xdyW86VlEKYR25s3JxZIO6e8oEM,8920 +django/contrib/admin/locale/en_AU/LC_MESSAGES/django.mo,sha256=QEvxPxDqNUmq8NxN-8c_F6KMEcWWum3YzERlc3_S_DM,16191 +django/contrib/admin/locale/en_AU/LC_MESSAGES/django.po,sha256=BoVuGaPoGdQcF3zdgGRxrNKSq2XLHTvKfINCyU8t86Y,17548 +django/contrib/admin/locale/en_AU/LC_MESSAGES/djangojs.mo,sha256=s0qPS8TjODtPo4miSznQfS6M8CQK9URDeMKeQsp7DK4,5001 +django/contrib/admin/locale/en_AU/LC_MESSAGES/djangojs.po,sha256=YecPU6VmUDDNNIzZVl2Wgd6lNRp3msJaW8FhdHMtEyc,5553 +django/contrib/admin/locale/en_GB/LC_MESSAGES/django.mo,sha256=pFkTMRDDj76WA91wtGPjUB7Pq2PN7IJEC54Tewobrlc,11159 +django/contrib/admin/locale/en_GB/LC_MESSAGES/django.po,sha256=REUJMGLGRyDMkqh4kJdYXO9R0Y6CULFVumJ_P3a0nv0,15313 +django/contrib/admin/locale/en_GB/LC_MESSAGES/djangojs.mo,sha256=hW325c2HlYIIdvNE308c935_IaDu7_qeP-NlwPnklhQ,3147 +django/contrib/admin/locale/en_GB/LC_MESSAGES/djangojs.po,sha256=Ol5j1-BLbtSIDgbcC0o7tg_uHImcjJQmkA4-kSmZY9o,4581 +django/contrib/admin/locale/eo/LC_MESSAGES/django.mo,sha256=zAeGKzSNit2LNNX97WXaARyzxKIasOmTutcTPqpRKAE,14194 +django/contrib/admin/locale/eo/LC_MESSAGES/django.po,sha256=LHoYvbenD9A05EkHtOk8raW7aKyyiqN50d6OHMxnAZY,17258 +django/contrib/admin/locale/eo/LC_MESSAGES/djangojs.mo,sha256=hGXULxueBP24xSZ0StxfFCO0vwZZME7OEERxgnWBqcI,4595 +django/contrib/admin/locale/eo/LC_MESSAGES/djangojs.po,sha256=enHGjcvH_B0Z9K2Vk391qHAKT7QamqUcx8xPzYLQltA,5698 +django/contrib/admin/locale/es/LC_MESSAGES/django.mo,sha256=vKcsIAL0TDBolkBdzj0d8N60blUfGIHwTvN1r_tp3h4,19193 +django/contrib/admin/locale/es/LC_MESSAGES/django.po,sha256=5640-lfFYuO7ZsJ41VtaHdhvpqdPNtadbt88SK95xo4,21302 +django/contrib/admin/locale/es/LC_MESSAGES/djangojs.mo,sha256=GH3zJZEVfJc_REXoYwaCNzhL4EHJosWa7qDmeFRWbco,6347 +django/contrib/admin/locale/es/LC_MESSAGES/djangojs.po,sha256=aqR-EZ2XUWNclkSxVa1xKFdaZpw7sQMORSMMINDRjlQ,7290 +django/contrib/admin/locale/es_AR/LC_MESSAGES/django.mo,sha256=4HvVQ4w8m006ltb78ysEVBHfkb8HYQ_fOjKSNjZACVo,19355 +django/contrib/admin/locale/es_AR/LC_MESSAGES/django.po,sha256=SvEsxNt5fMCndJt7EM7wVPffLjZBM9I_6dtTtgFJB-E,20673 +django/contrib/admin/locale/es_AR/LC_MESSAGES/djangojs.mo,sha256=2VDkQJCHtYndAr3kz53BhLwxqbDzkQhoDwNedrGtMEw,6647 +django/contrib/admin/locale/es_AR/LC_MESSAGES/djangojs.po,sha256=MRHZAsXyTEiYtlqmybyuJgwfdHtjNOu4EgcWdzzVF4M,7351 +django/contrib/admin/locale/es_CO/LC_MESSAGES/django.mo,sha256=0k8kSiwIawYCa-Lao0uetNPLUzd4m_me3tCAVBvgcSw,15156 +django/contrib/admin/locale/es_CO/LC_MESSAGES/django.po,sha256=4T_syIsVY-nyvn5gEAtfN-ejPrJSUpNT2dmzufxaBsE,17782 +django/contrib/admin/locale/es_CO/LC_MESSAGES/djangojs.mo,sha256=PLS10KgX10kxyy7MUkiyLjqhMzRgkAFGPmzugx9AGfs,3895 +django/contrib/admin/locale/es_CO/LC_MESSAGES/djangojs.po,sha256=Y4bkC8vkJE6kqLbN8t56dR5670B06sB2fbtVzmQygK8,5176 +django/contrib/admin/locale/es_MX/LC_MESSAGES/django.mo,sha256=O8CbY83U4fTvvPPuONtlMx6jpA-qkrYxNTkLuMrWiRQ,11517 +django/contrib/admin/locale/es_MX/LC_MESSAGES/django.po,sha256=8MSKNxhHMp0ksr5AUUAbs_H6MtMjIqkaFwmaJlBxELs,16307 +django/contrib/admin/locale/es_MX/LC_MESSAGES/djangojs.mo,sha256=2w3CMJFBugP8xMOmXsDU82xUm8cWGRUGZQX5XjiTCpM,3380 +django/contrib/admin/locale/es_MX/LC_MESSAGES/djangojs.po,sha256=OP9cBsdCf3zZAXiKBMJPvY1AHwC_WE1k2vKlzVCtUec,4761 +django/contrib/admin/locale/es_VE/LC_MESSAGES/django.mo,sha256=himCORjsM-U3QMYoURSRbVv09i0P7-cfVh26aQgGnKg,16837 +django/contrib/admin/locale/es_VE/LC_MESSAGES/django.po,sha256=mlmaSYIHpa-Vp3f3NJfdt2RXB88CVZRoPEMfl-tccr0,18144 +django/contrib/admin/locale/es_VE/LC_MESSAGES/djangojs.mo,sha256=Zy-Hj_Mr2FiMiGGrZyssN7GZJrbxRj3_yKQFZKR36Ro,4635 +django/contrib/admin/locale/es_VE/LC_MESSAGES/djangojs.po,sha256=RI8CIdewjL3bAivniMOl7lA9tD7caP4zEo2WK71cX7c,5151 +django/contrib/admin/locale/et/LC_MESSAGES/django.mo,sha256=b1dS8_M7Ehzk0nZlgxMVrVGP7WqKZaGP7P0hRvUIb3E,17574 +django/contrib/admin/locale/et/LC_MESSAGES/django.po,sha256=tN1MhM7VyCCQn7nX5qE5r23hyK28BxEctylyZlIpikY,19239 +django/contrib/admin/locale/et/LC_MESSAGES/djangojs.mo,sha256=VftLeDX1ngXgy3Rvztk21zNcPus9Vbr-Gp4MnChaRbM,5880 +django/contrib/admin/locale/et/LC_MESSAGES/djangojs.po,sha256=yi-8VC9eCScS98u4CIDirsfG_a5-BDnO0XrI9Gm4lK8,6718 +django/contrib/admin/locale/eu/LC_MESSAGES/django.mo,sha256=CBk_9H8S8LlK8hfGQsEB7IgSms-BsURzAFrX9Zrsw4c,15009 +django/contrib/admin/locale/eu/LC_MESSAGES/django.po,sha256=9vnPgJRPcdSa4P5rguB5zqWQC1xAt4POzDw-mSD8UHs,17489 +django/contrib/admin/locale/eu/LC_MESSAGES/djangojs.mo,sha256=vKtO_mbexiW-EO-L-G0PYruvc8N7GOF94HWQCkDnJNQ,4480 +django/contrib/admin/locale/eu/LC_MESSAGES/djangojs.po,sha256=BAWU-6kH8PLBxx_d9ZeeueB_lV5KFXjbRJXgKN43nQ4,5560 +django/contrib/admin/locale/fa/LC_MESSAGES/django.mo,sha256=Y01G4go-V_BZ1aR7u5Z9StnqL0BS5kvj2ZlSfffhToY,20889 +django/contrib/admin/locale/fa/LC_MESSAGES/django.po,sha256=1q914M9N6NfUgP72mIhTRMYukc1r-GpVV5Pt4qESTTM,23054 +django/contrib/admin/locale/fa/LC_MESSAGES/djangojs.mo,sha256=MAje4ub3vWYhiKrVR_LvxAIqkvOlFpVcXQEBz3ezlPs,6050 +django/contrib/admin/locale/fa/LC_MESSAGES/djangojs.po,sha256=1nzEmRuswDmyCCMShGH2CYdjMY7tUuedfN4kDCEnTCM,6859 +django/contrib/admin/locale/fi/LC_MESSAGES/django.mo,sha256=o2bZycvUaAigyMRW2EOSkqJy2Xq0BfvGB2eEWV-h9jg,17289 +django/contrib/admin/locale/fi/LC_MESSAGES/django.po,sha256=dBux4oefCngbb6PCukB-U6XrpY5tym9B0CMIsWk2LIs,18990 +django/contrib/admin/locale/fi/LC_MESSAGES/djangojs.mo,sha256=ZIJoZ4T-2iNfpdHiyqsKTqIC9lgGAPOCbQhk7Lh36N4,5822 +django/contrib/admin/locale/fi/LC_MESSAGES/djangojs.po,sha256=6suDw1Cj_AVqQocM67EN7ZZs6hWgvTa9TP80a7Y9xaM,6742 +django/contrib/admin/locale/fr/LC_MESSAGES/django.mo,sha256=yDGZobllSEwKmcxgbEdivBgJrxcpSgytRR4tdTGsblo,20013 +django/contrib/admin/locale/fr/LC_MESSAGES/django.po,sha256=IjnhRml2Cqxd1Z93vz5CM3GjspM4rIuv9LsjF1YQFQk,21340 +django/contrib/admin/locale/fr/LC_MESSAGES/djangojs.mo,sha256=eSiwCTcZrv3jKlu_KVL9myvW6Yc6lSWx1CcA_T6qSng,6509 +django/contrib/admin/locale/fr/LC_MESSAGES/djangojs.po,sha256=lfTg4_vFyMbkCqTThaSn4f-D2S0sGNdW0PFWJgBz2ck,7226 +django/contrib/admin/locale/fy/LC_MESSAGES/django.mo,sha256=mWnHXGJUtiewo1F0bsuJCE_YBh7-Ak9gjTpwjOAv-HI,476 +django/contrib/admin/locale/fy/LC_MESSAGES/django.po,sha256=oSKEF_DInUC42Xzhw9HiTobJjE2fLNI1VE5_p6rqnCE,10499 +django/contrib/admin/locale/fy/LC_MESSAGES/djangojs.mo,sha256=YQQy7wpjBORD9Isd-p0lLzYrUgAqv770_56-vXa0EOc,476 +django/contrib/admin/locale/fy/LC_MESSAGES/djangojs.po,sha256=efBDCcu43j4SRxN8duO5Yfe7NlpcM88kUPzz-qOkC04,2864 +django/contrib/admin/locale/ga/LC_MESSAGES/django.mo,sha256=2Qn62CmOwgNaeLnV6JE2dNVl9tSZaYGGx5NG8X6g6Z0,19428 +django/contrib/admin/locale/ga/LC_MESSAGES/django.po,sha256=00HFcdeQmjvrTyfUz4I8cFM_bYqF5bLX5pwFht-iPO0,20913 +django/contrib/admin/locale/ga/LC_MESSAGES/djangojs.mo,sha256=Cdx01Gpcs6wYEnpSif1r4O9gKj-YL__IXfBaL-Wx0u0,6910 +django/contrib/admin/locale/ga/LC_MESSAGES/djangojs.po,sha256=7u1ncj7NVTb54Yak8wMFqCKHfjtb6EfFouhT2sbQlIg,7828 +django/contrib/admin/locale/gd/LC_MESSAGES/django.mo,sha256=HEqiGvjMp0NnfIS0Z-c1i8SicEtMPIg8LvNMh-SXiPg,18871 +django/contrib/admin/locale/gd/LC_MESSAGES/django.po,sha256=cZWnJyEoyGFLbk_M4-eddTJLKJ0dqTIlIj4w6YwcjJg,20139 +django/contrib/admin/locale/gd/LC_MESSAGES/djangojs.mo,sha256=QA2_hxHGzt_y0U8sAGQaT27IvvyWrehLPKP2X1jAvEs,5904 +django/contrib/admin/locale/gd/LC_MESSAGES/djangojs.po,sha256=KyYGpFHq2E55dK005xzH0I2RD-C2kD6BlJi8bcMjtRA,6540 +django/contrib/admin/locale/gl/LC_MESSAGES/django.mo,sha256=0sPdq8aidlYj1CYL0on_rwwp80oN1Ex-vw2pehBon-M,18542 +django/contrib/admin/locale/gl/LC_MESSAGES/django.po,sha256=GFJrhH0aQZsLrUe4Dbzwi7BDtp7KRyklnnzZFr2-BqU,20074 +django/contrib/admin/locale/gl/LC_MESSAGES/djangojs.mo,sha256=AePXV8VZToob6vNEsOqyuijJYv-QxRfBO7BrBUgLi_Q,6083 +django/contrib/admin/locale/gl/LC_MESSAGES/djangojs.po,sha256=eDMuV05SuQrACfcovaPb8Zsk8hP4g1GMx6507QNFAko,6868 +django/contrib/admin/locale/he/LC_MESSAGES/django.mo,sha256=DQnjAK201x7Zp_eoZiuq6GJZ7ML2WVeP5dXJNaeSEBs,19856 +django/contrib/admin/locale/he/LC_MESSAGES/django.po,sha256=-YnanZ_omTTjDkO8o-chGB6NSsKGLWmO7aWGnIUiJv8,21341 +django/contrib/admin/locale/he/LC_MESSAGES/djangojs.mo,sha256=E-ZlEnXIeJIkXWcthR9kgNJBzDp6gT7mKKDUpEVqM7k,6893 +django/contrib/admin/locale/he/LC_MESSAGES/djangojs.po,sha256=1tenNpIJmcT5wTRNETkSO7cDlDlL1Mqpnb-klRlHw-s,7809 +django/contrib/admin/locale/hi/LC_MESSAGES/django.mo,sha256=yWjTYyrVxXxwBWgPsC7IJ9IxL_85v378To4PCEEcwuI,13811 +django/contrib/admin/locale/hi/LC_MESSAGES/django.po,sha256=FpKFToDAMsgc1aG6-CVpi5wAxhMQjkZxz_89kCiKmS4,19426 +django/contrib/admin/locale/hi/LC_MESSAGES/djangojs.mo,sha256=yCUHDS17dQDKcAbqCg5q8ualaUgaa9qndORgM-tLCIw,4893 +django/contrib/admin/locale/hi/LC_MESSAGES/djangojs.po,sha256=U9rb5tPMICK50bRyTl40lvn-tvh6xL_6o7xIPkzfKi0,6378 +django/contrib/admin/locale/hr/LC_MESSAGES/django.mo,sha256=3TR3uFcd0pnkDi551WaB9IyKX1aOazH7USxqc0lA0KQ,14702 +django/contrib/admin/locale/hr/LC_MESSAGES/django.po,sha256=qcW7tvZoWZIR8l-nMRexGDD8VlrOD7l5Fah6-ecilMk,17378 +django/contrib/admin/locale/hr/LC_MESSAGES/djangojs.mo,sha256=KR34lviGYh1esCkPE9xcDE1pQ_q-RxK1R2LPjnG553w,3360 +django/contrib/admin/locale/hr/LC_MESSAGES/djangojs.po,sha256=w7AqbYcLtu88R3KIKKKXyRt2gwBBBnr-ulxONWbw01I,4870 +django/contrib/admin/locale/hsb/LC_MESSAGES/django.mo,sha256=z9pekTc31Iln5uwmdJ1AfhF5t2gekcgGE58qjvYKT90,18894 +django/contrib/admin/locale/hsb/LC_MESSAGES/django.po,sha256=XmdQtzpmAhp74NBwh7iY22RLQX5Bu2B-mlWvZLvy_mw,20153 +django/contrib/admin/locale/hsb/LC_MESSAGES/djangojs.mo,sha256=4kIdcgSBZ5ldlS0LKZV8-gh45-AcRTMQc784VmoRmP8,6693 +django/contrib/admin/locale/hsb/LC_MESSAGES/djangojs.po,sha256=7Lx6Be_8i8g2GtqOfc1UKpKgwF2CFXfYG4PrjKV0t-0,7425 +django/contrib/admin/locale/hu/LC_MESSAGES/django.mo,sha256=fMea7oqZDrBAicpyubIq-JCPg_7QBws7N0PdyBwebOo,18629 +django/contrib/admin/locale/hu/LC_MESSAGES/django.po,sha256=eFRlDToCWD_BZVyRxW6L_xLIfItPmHQshxoOFC53iV0,20211 +django/contrib/admin/locale/hu/LC_MESSAGES/djangojs.mo,sha256=tXeG5F6_Yh6qHmNUNrlgzavH1Wc8NZb3fj4oEW9qE_M,6034 +django/contrib/admin/locale/hu/LC_MESSAGES/djangojs.po,sha256=pvn7ae43zgVp3mpjXPI7_JCqvQLaHZZF7hTasP2uZx0,6854 +django/contrib/admin/locale/hy/LC_MESSAGES/django.mo,sha256=Dcx9cOsYBfbgQgoAQoLhn_cG1d2sKGV6dag4DwnUTaY,18274 +django/contrib/admin/locale/hy/LC_MESSAGES/django.po,sha256=CnQlRZ_DUILMIqVEgUTT2sufAseEKJHHjWsYr_LAqi8,20771 +django/contrib/admin/locale/hy/LC_MESSAGES/djangojs.mo,sha256=ttfGmyEN0-3bM-WmfCge2lG8inubMPOzFXfZrfX9sfw,5636 +django/contrib/admin/locale/hy/LC_MESSAGES/djangojs.po,sha256=jf94wzUOMQaKSBR-77aijQXfdRAqiYSeAQopiT_8Obc,6046 +django/contrib/admin/locale/ia/LC_MESSAGES/django.mo,sha256=SRKlr8RqW8FQhzMsXdA9HNqttO3hc0xf4QdQJd4Dy8c,11278 +django/contrib/admin/locale/ia/LC_MESSAGES/django.po,sha256=pBQLQsMinRNh0UzIHBy3qEW0etUWMhFALu4-h-woFyE,15337 +django/contrib/admin/locale/ia/LC_MESSAGES/djangojs.mo,sha256=28MiqUf-0-p3PIaongqgPQp2F3D54MLAujPslVACAls,3177 +django/contrib/admin/locale/ia/LC_MESSAGES/djangojs.po,sha256=CauoEc8Fiowa8k6K-f9N8fQDle40qsgtXdNPDHBiudQ,4567 +django/contrib/admin/locale/id/LC_MESSAGES/django.mo,sha256=mIBWsj9Dy85qvN7d08OhUU1lDsIRoxEDZEoGEua50qY,17877 +django/contrib/admin/locale/id/LC_MESSAGES/django.po,sha256=W4U2GvKuJ0LXHJhoGOGk2uXk1eDCg9LAzmubTKJyIjQ,19387 +django/contrib/admin/locale/id/LC_MESSAGES/djangojs.mo,sha256=aCPmIcwloBrlvfAf95HZfOgVs7XU9Bp064Sn08pQK1E,5275 +django/contrib/admin/locale/id/LC_MESSAGES/djangojs.po,sha256=x_D6AQiyGC-AJL889Q51JkmlqiVHfyAwGdA3Ck9_Z7Q,6589 +django/contrib/admin/locale/io/LC_MESSAGES/django.mo,sha256=URiYZQZpROBedC-AkpVo0q3Tz78VfkmwN1W7j6jYpMo,12624 +django/contrib/admin/locale/io/LC_MESSAGES/django.po,sha256=y0WXY7v_9ff-ZbFasj33loG-xWlFO8ttvCB6YPyF7FQ,15562 +django/contrib/admin/locale/io/LC_MESSAGES/djangojs.mo,sha256=nMu5JhIy8Fjie0g5bT8-h42YElCiS00b4h8ej_Ie-w0,464 +django/contrib/admin/locale/io/LC_MESSAGES/djangojs.po,sha256=WLh40q6yDs-8ZG1hpz6kfMQDXuUzOZa7cqtEPDywxG4,2852 +django/contrib/admin/locale/is/LC_MESSAGES/django.mo,sha256=csD3bmz3iQgLLdSqCKOmY_d893147TvDumrpRVoRTY0,16804 +django/contrib/admin/locale/is/LC_MESSAGES/django.po,sha256=tXgb3ARXP5tPa5iEYwwiHscDGfjS5JgIV2BsUX8OnjE,18222 +django/contrib/admin/locale/is/LC_MESSAGES/djangojs.mo,sha256=Z3ujWoenX5yYTAUmHUSCvHcuV65nQmYKPv6Jo9ygx_c,5174 +django/contrib/admin/locale/is/LC_MESSAGES/djangojs.po,sha256=YPf4XqfnpvrS9irAS8O4G0jgU5PCoQ9C-w3MoDipelk,5847 +django/contrib/admin/locale/it/LC_MESSAGES/django.mo,sha256=N_pVjbd3SkV4xtFMvwtlwRWo_ulGR83SzKcPD8wiFgY,18505 +django/contrib/admin/locale/it/LC_MESSAGES/django.po,sha256=hVYj4UvphkCqlFzH6NtyRAZgGewCKNjVnON0vHtxGKY,20338 +django/contrib/admin/locale/it/LC_MESSAGES/djangojs.mo,sha256=FWtyPVubufiaNKFxy4DQ0KbW93GUt-x1Mc8ZKhqokwg,5640 +django/contrib/admin/locale/it/LC_MESSAGES/djangojs.po,sha256=VRqeY7gYmcP5oWVMgpHL_Br8cAkFXphFQStFpIbWOrc,6578 +django/contrib/admin/locale/ja/LC_MESSAGES/django.mo,sha256=Cvue4zVcYA-3T0l6jKFglMDhzqNeLuGKKdTZ-JsZM4o,19945 +django/contrib/admin/locale/ja/LC_MESSAGES/django.po,sha256=DpjilJj0IrkqRNsegdDCs9_VzokjHA8j8NIXrg6Th4U,21521 +django/contrib/admin/locale/ja/LC_MESSAGES/djangojs.mo,sha256=XBOtJbkByhQEMUxvnqSr1XhBCe-DsII4Ke5pISJZAb8,6233 +django/contrib/admin/locale/ja/LC_MESSAGES/djangojs.po,sha256=SrJeh3-t73Z2gY7nVP01cgZE6H11pryDms1pqrQKjnw,6968 +django/contrib/admin/locale/ka/LC_MESSAGES/django.mo,sha256=M3FBRrXFFa87DlUi0HDD_n7a_0IYElQAOafJoIH_i60,20101 +django/contrib/admin/locale/ka/LC_MESSAGES/django.po,sha256=abkt7pw4Kc-Y74ZCpAk_VpFWIkr7trseCtQdM6IUYpQ,23527 +django/contrib/admin/locale/ka/LC_MESSAGES/djangojs.mo,sha256=GlPU3qUavvU0FXPfvCl-8KboYhDOmMsKM-tv14NqOac,5516 +django/contrib/admin/locale/ka/LC_MESSAGES/djangojs.po,sha256=jDpB9c_edcLoFPHFIogOSPrFkssOjIdxtCA_lum8UCs,6762 +django/contrib/admin/locale/kab/LC_MESSAGES/django.mo,sha256=9QKEWgr8YQV17OJ14rMusgV8b79ZgOOsX4aIFMZrEto,3531 +django/contrib/admin/locale/kab/LC_MESSAGES/django.po,sha256=cSOG_HqsNE4tA5YYDd6txMFoUul8d5UKvk77ZhaqOK0,11711 +django/contrib/admin/locale/kab/LC_MESSAGES/djangojs.mo,sha256=nqwZHJdtjHUSFDJmC0nPNyvWcAdcoRcN3f-4XPIItvs,1844 +django/contrib/admin/locale/kab/LC_MESSAGES/djangojs.po,sha256=tF3RH22p2E236Cv6lpIWQxtuPFeWOvJ-Ery3vBUv6co,3713 +django/contrib/admin/locale/kk/LC_MESSAGES/django.mo,sha256=f2WU3e7dOz0XXHFFe0gnCm1MAPCJ9sva2OUnWYTHOJg,12845 +django/contrib/admin/locale/kk/LC_MESSAGES/django.po,sha256=D1vF3nqANT46f17Gc2D2iGCKyysHAyEmv9nBei6NRA4,17837 +django/contrib/admin/locale/kk/LC_MESSAGES/djangojs.mo,sha256=cBxp5pFJYUF2-zXxPVBIG06UNq6XAeZ72uRLwGeLbiE,2387 +django/contrib/admin/locale/kk/LC_MESSAGES/djangojs.po,sha256=Y30fcDpi31Fn7DU7JGqROAiZY76iumoiW9qGAgPCCbU,4459 +django/contrib/admin/locale/km/LC_MESSAGES/django.mo,sha256=eOe9EcFPzAWrTjbGUr-m6RAz2TryC-qHKbqRP337lPY,10403 +django/contrib/admin/locale/km/LC_MESSAGES/django.po,sha256=RSxy5vY2sgC43h-9sl6eomkFvxClvH_Ka4lFiwTvc2I,17103 +django/contrib/admin/locale/km/LC_MESSAGES/djangojs.mo,sha256=Ja8PIXmw6FMREHZhhBtGrr3nRKQF_rVjgLasGPnU95w,1334 +django/contrib/admin/locale/km/LC_MESSAGES/djangojs.po,sha256=LH4h4toEgpVBb9yjw7d9JQ8sdU0WIZD-M025JNlLXAU,3846 +django/contrib/admin/locale/kn/LC_MESSAGES/django.mo,sha256=955iPq05ru6tm_iPFVMebxwvZMtEa5_7GaFG1mPt6HU,9203 +django/contrib/admin/locale/kn/LC_MESSAGES/django.po,sha256=-4YAm0MyhS-wp4RQmo0TzWvqYqmzHFNpIBtdQlg_8Dw,16059 +django/contrib/admin/locale/kn/LC_MESSAGES/djangojs.mo,sha256=kJsCOGf62XOWTKcB9AF6Oc-GqHl2LFtz-qw0spjcU_w,1847 +django/contrib/admin/locale/kn/LC_MESSAGES/djangojs.po,sha256=zzl7QZ5DfdyNWrkIqYlpUcZiTdlZXx_ktahyXqM2-0Q,5022 +django/contrib/admin/locale/ko/LC_MESSAGES/django.mo,sha256=NJinUQM_vWvXlwT3ek6DL1uFT_gzHWowxKxn_RQVDDA,18815 +django/contrib/admin/locale/ko/LC_MESSAGES/django.po,sha256=AfDcJo95_pYon8nP0Y48pIQGAHcSxKWADk4IkJATaec,20899 +django/contrib/admin/locale/ko/LC_MESSAGES/djangojs.mo,sha256=wZ2hHD7BJgl855rxKburyumBSS7ECkL3kqNv2col5mo,5985 +django/contrib/admin/locale/ko/LC_MESSAGES/djangojs.po,sha256=qvndtDKv_TIoeYuEErRb62oSaCeS2iFYkjyZ4m8YKHI,6899 +django/contrib/admin/locale/ky/LC_MESSAGES/django.mo,sha256=eg-TnIzJO4h3q_FS2a1LnCs7qOf5dpNJwvRD99ZZ0GQ,20129 +django/contrib/admin/locale/ky/LC_MESSAGES/django.po,sha256=dWxU3yUAKHUGKdVJbRLkS6fJEefPBk2XM0i2INcRPms,21335 +django/contrib/admin/locale/ky/LC_MESSAGES/djangojs.mo,sha256=VuBYBwFwIHC27GFZiHY2_4AB0cME2R0Q3juczjOs3G0,5888 +django/contrib/admin/locale/ky/LC_MESSAGES/djangojs.po,sha256=uMk9CxL1wP45goq2093lYMza7LRuO4XbVo5RRWlsbaE,6432 +django/contrib/admin/locale/lb/LC_MESSAGES/django.mo,sha256=8GGM2sYG6GQTQwQFJ7lbg7w32SvqgSzNRZIUi9dIe6M,913 +django/contrib/admin/locale/lb/LC_MESSAGES/django.po,sha256=PZ3sL-HvghnlIdrdPovNJP6wDrdDMSYp_M1ok6dodrw,11078 +django/contrib/admin/locale/lb/LC_MESSAGES/djangojs.mo,sha256=xokesKl7h7k9dXFKIJwGETgwx1Ytq6mk2erBSxkgY-o,474 +django/contrib/admin/locale/lb/LC_MESSAGES/djangojs.po,sha256=fiMelo6K0_RITx8b9k26X1R86Ck2daQXm86FLJpzt20,2862 +django/contrib/admin/locale/lt/LC_MESSAGES/django.mo,sha256=SpaNUiaGtDlX5qngVj0dWdqNLSin8EOXXyBvRM9AnKg,17033 +django/contrib/admin/locale/lt/LC_MESSAGES/django.po,sha256=tHnRrSNG2ENVduP0sOffCIYQUn69O6zIev3Bb7PjKb0,18497 +django/contrib/admin/locale/lt/LC_MESSAGES/djangojs.mo,sha256=vZtnYQupzdTjVHnWrtjkC2QKNpsca5yrpb4SDuFx0_0,5183 +django/contrib/admin/locale/lt/LC_MESSAGES/djangojs.po,sha256=dMjFClA0mh5g0aNFTyHC8nbYxwmFD0-j-7gCKD8NFnw,5864 +django/contrib/admin/locale/lv/LC_MESSAGES/django.mo,sha256=pzm-BGE4jnD7OPob0a6eI_gQYRAMtHJOqmnmJieJwuU,18547 +django/contrib/admin/locale/lv/LC_MESSAGES/django.po,sha256=9BAd3sT-aFEeUupwGWxIjT4YLoA2OC3lN2hqdXGayiM,20103 +django/contrib/admin/locale/lv/LC_MESSAGES/djangojs.mo,sha256=TfQupQgc6UMUbj_6MoEEO87VmZTsh2McSDl_4Dsqgvo,6446 +django/contrib/admin/locale/lv/LC_MESSAGES/djangojs.po,sha256=cT0J4Bvh8UEdNq2HphcOwJBkgXwXNXl-xhwNt6GBcqg,7336 +django/contrib/admin/locale/mk/LC_MESSAGES/django.mo,sha256=xcKetKf7XcO-4vbWEIoI2c40gRE2twuiINaby6ypO7Q,17948 +django/contrib/admin/locale/mk/LC_MESSAGES/django.po,sha256=hx2peq-wztDHtiST_zZ58c7rjZ6jSvDDXhVOTmyUDzI,21063 +django/contrib/admin/locale/mk/LC_MESSAGES/djangojs.mo,sha256=8BkWjadml2f1lDeH-IULdxsogXSK8NpVuu293GvcQc8,4719 +django/contrib/admin/locale/mk/LC_MESSAGES/djangojs.po,sha256=u9mVSzbIgA1uRgV_L8ZOZLelyknoKFvXH0HbBurezf8,6312 +django/contrib/admin/locale/ml/LC_MESSAGES/django.mo,sha256=4Y1KAip3NNsoRc9Zz3k0YFLzes3DNRFvAXWSTBivXDk,20830 +django/contrib/admin/locale/ml/LC_MESSAGES/django.po,sha256=jL9i3kmOnoKYDq2RiF90WCc55KeA8EBN9dmPHjuUfmo,24532 +django/contrib/admin/locale/ml/LC_MESSAGES/djangojs.mo,sha256=COohY0mAHAOkv1eNzLkaGZy8mimXzcDK1EgRd3tTB_E,6200 +django/contrib/admin/locale/ml/LC_MESSAGES/djangojs.po,sha256=NvN0sF_w5tkc3bND4lBtCHsIDLkwqdEPo-8wi2MTQ14,7128 +django/contrib/admin/locale/mn/LC_MESSAGES/django.mo,sha256=6Jhz8HVVnFDWT1kYR0QemGIK2C3AFIyLO34uqG0-zus,22236 +django/contrib/admin/locale/mn/LC_MESSAGES/django.po,sha256=uh2ZAdEdbTkIU3ORSOvgaetcF3kgR5WlA1f_2nWJ0ow,23694 +django/contrib/admin/locale/mn/LC_MESSAGES/djangojs.mo,sha256=H7fIPdWTK3_iuC0WRBJdfXN8zO77p7-IzTviEUVQJ2U,5228 +django/contrib/admin/locale/mn/LC_MESSAGES/djangojs.po,sha256=vJIqqVG34Zd7q8-MhTgZcXTtl6gukOSb6egt70AOyAc,5757 +django/contrib/admin/locale/mr/LC_MESSAGES/django.mo,sha256=4aUjTWqmtElJ-byWRVmaj4EI0TQIExyU68EB-VS6vnE,21488 +django/contrib/admin/locale/mr/LC_MESSAGES/django.po,sha256=svc6n_Jsn8vrL0hY7tRCl7YLrBVHDSLTrM2phQO5mHI,24801 +django/contrib/admin/locale/mr/LC_MESSAGES/djangojs.mo,sha256=2Z5jaGJzpiJTCnhCk8ulCDeAdj-WwR99scdHFPRoHoA,468 +django/contrib/admin/locale/mr/LC_MESSAGES/djangojs.po,sha256=uGe9kH2mwrab97Ue77oggJBlrpzZNckKGRUMU1vaigs,2856 +django/contrib/admin/locale/ms/LC_MESSAGES/django.mo,sha256=Xj5v1F4_m1ZFUn42Rbep9eInxIV-NE-oA_NyfQkbp00,16840 +django/contrib/admin/locale/ms/LC_MESSAGES/django.po,sha256=ykFH-mPbv2plm2NIvKgaj3WVukJ3SquU8nQIAXuOrWA,17967 +django/contrib/admin/locale/ms/LC_MESSAGES/djangojs.mo,sha256=9VY_MrHK-dGOIkucLCyR9psy4o5p4nHd8kN_5N2E-gY,5018 +django/contrib/admin/locale/ms/LC_MESSAGES/djangojs.po,sha256=P4GvM17rlX1Vl-7EbCyfWVasAJBEv_RvgWEvfJqcErA,5479 +django/contrib/admin/locale/my/LC_MESSAGES/django.mo,sha256=xvlgM0vdYxZuA7kPQR7LhrLzgmyVCHAvqaqvFhKX9wY,3677 +django/contrib/admin/locale/my/LC_MESSAGES/django.po,sha256=zdUCYcyq2-vKudkYvFcjk95YUtbMDDSKQHCysmQ-Pvc,12522 +django/contrib/admin/locale/my/LC_MESSAGES/djangojs.mo,sha256=1fS9FfWi8b9NJKm3DBKETmuffsrTX-_OHo9fkCCXzpg,3268 +django/contrib/admin/locale/my/LC_MESSAGES/djangojs.po,sha256=-z1j108uoswi9YZfh3vSIswLXu1iUKgDXNdZNEA0yrA,5062 +django/contrib/admin/locale/nb/LC_MESSAGES/django.mo,sha256=viQKBFH6ospYn2sE-DokVJGGYhSqosTgbNMn5sBVnmM,16244 +django/contrib/admin/locale/nb/LC_MESSAGES/django.po,sha256=x0ANRpDhe1rxxAH0qjpPxRfccCvR73_4g5TNUdJqmrc,17682 +django/contrib/admin/locale/nb/LC_MESSAGES/djangojs.mo,sha256=KwrxBpvwveERK4uKTIgh-DCc9aDLumpHQYh5YroqxhQ,4939 +django/contrib/admin/locale/nb/LC_MESSAGES/djangojs.po,sha256=ygn6a5zkHkoIYMC8Hgup8Uw1tMbZcLGgwwDu3x33M-o,5555 +django/contrib/admin/locale/ne/LC_MESSAGES/django.mo,sha256=yrm85YXwXIli7eNaPyBTtV7y3TxQuH4mokKuHdAja2A,15772 +django/contrib/admin/locale/ne/LC_MESSAGES/django.po,sha256=F8vfWKvSNngkLPZUIwik_qDYu0UAnrWepbI9Z9Iz35g,20400 +django/contrib/admin/locale/ne/LC_MESSAGES/djangojs.mo,sha256=mJdtpLT9k4vDbN9fk2fOeiy4q720B3pLD3OjLbAjmUI,5362 +django/contrib/admin/locale/ne/LC_MESSAGES/djangojs.po,sha256=N91RciTV1m7e8-6Ihod5U2xR9K0vrLoFnyXjn2ta098,6458 +django/contrib/admin/locale/nl/LC_MESSAGES/django.mo,sha256=FKCQ39RbxWddBA-Id8W-hxgH0tkixJkVctP1laEXJEU,18565 +django/contrib/admin/locale/nl/LC_MESSAGES/django.po,sha256=zRaeZKxUZbi-0CL9BBr-X0j5HOJvvrJ94u8jw3sbaaA,20308 +django/contrib/admin/locale/nl/LC_MESSAGES/djangojs.mo,sha256=iWjyDgay1LIiS6C-Zl33inFKxzM2LFQPIWyKEw2x6Is,6122 +django/contrib/admin/locale/nl/LC_MESSAGES/djangojs.po,sha256=xZjgzxEEWMG2ofgSfLNUU0abr9Y_cUpXIHsmjKBGyig,7217 +django/contrib/admin/locale/nn/LC_MESSAGES/django.mo,sha256=yAdb8Yew1ARlnAnvd5gHL7-SDzpkXedBwCSSPEzGCKk,16504 +django/contrib/admin/locale/nn/LC_MESSAGES/django.po,sha256=sFxr3UYzltQRqiotm_d5Qqtf8iLXI0LgCw_V6kYffJ0,17932 +django/contrib/admin/locale/nn/LC_MESSAGES/djangojs.mo,sha256=RsDri1DmCwrby8m7mLWkFdCe6HK7MD7GindOarVYPWc,4939 +django/contrib/admin/locale/nn/LC_MESSAGES/djangojs.po,sha256=koVTt2mmdku1j7SUDRbnug8EThxXuCIF2XPnGckMi7A,5543 +django/contrib/admin/locale/os/LC_MESSAGES/django.mo,sha256=c51PwfOeLU2YcVNEEPCK6kG4ZyNc79jUFLuNopmsRR8,14978 +django/contrib/admin/locale/os/LC_MESSAGES/django.po,sha256=yugDw7iziHto6s6ATNDK4yuG6FN6yJUvYKhrGxvKmcY,18188 +django/contrib/admin/locale/os/LC_MESSAGES/djangojs.mo,sha256=0gMkAyO4Zi85e9qRuMYmxm6JV98WvyRffOKbBVJ_fLQ,3806 +django/contrib/admin/locale/os/LC_MESSAGES/djangojs.po,sha256=skiTlhgUEN8uKk7ihl2z-Rxr1ZXqu5qV4wB4q9qXVq0,5208 +django/contrib/admin/locale/pa/LC_MESSAGES/django.mo,sha256=EEitcdoS-iQ9QWHPbJBK2ajdN56mBi0BzGnVl3KTmU4,8629 +django/contrib/admin/locale/pa/LC_MESSAGES/django.po,sha256=xscRlOkn9Jc8bDsSRM5bzQxEsCLMVsV-Wwin0rfkHDI,16089 +django/contrib/admin/locale/pa/LC_MESSAGES/djangojs.mo,sha256=Hub-6v7AfF-tWhw53abpyhnVHo76h_xBgGIhlGIcS70,1148 +django/contrib/admin/locale/pa/LC_MESSAGES/djangojs.po,sha256=7L8D4qqhq53XG83NJUZNoM8zCCScwMwzsrzzsyO4lHY,4357 +django/contrib/admin/locale/pl/LC_MESSAGES/django.mo,sha256=Lg8aJUDeJy2F4HJ0sHzexRSi6rVhAxfNxUMjWsLAZKU,19372 +django/contrib/admin/locale/pl/LC_MESSAGES/django.po,sha256=MM8TxQU-rsr0ZznLDZZ10ZbO9et8i63QC6A4iXWVkoY,21310 +django/contrib/admin/locale/pl/LC_MESSAGES/djangojs.mo,sha256=J06UuQkB2V4E8XAeUfTHbbjGVeNWAu328oFIeieb588,6655 +django/contrib/admin/locale/pl/LC_MESSAGES/djangojs.po,sha256=E084nmFnaWDKZHwwSVIjBdNc-9tIfgGWCl58GqbVRP8,7808 +django/contrib/admin/locale/pt/LC_MESSAGES/django.mo,sha256=jZNC62eFhnXnFY9MmqXGoELL7aH8OaJZ2h3cAYWnOWU,18681 +django/contrib/admin/locale/pt/LC_MESSAGES/django.po,sha256=ZGTP8N_3zvTyHBPXnmIch3pA4vafqalk__-lqyhkJps,20270 +django/contrib/admin/locale/pt/LC_MESSAGES/djangojs.mo,sha256=RlsEslBxu8-1AJUz6olYHOVpqnV2kXrYXjxsMPHWGHs,5392 +django/contrib/admin/locale/pt/LC_MESSAGES/djangojs.po,sha256=D1sNOYDTY1DsaGC09V4nAaMea-FvW6UWOpnknP2F5uE,6716 +django/contrib/admin/locale/pt_BR/LC_MESSAGES/django.mo,sha256=VFGVGpK6iSfh1bIwz_99Ioah4LOQR0GHdKCIaSFuQKs,18810 +django/contrib/admin/locale/pt_BR/LC_MESSAGES/django.po,sha256=qW8ZpwonsMz1PhLPDMPKNCoz05S2Yczl4t-njKxH-ZQ,21437 +django/contrib/admin/locale/pt_BR/LC_MESSAGES/djangojs.mo,sha256=xvi5ZdYPvbQ9xDFLn8B_twhZeP77rPUOj42nEoeI1IY,6329 +django/contrib/admin/locale/pt_BR/LC_MESSAGES/djangojs.po,sha256=-8OovJeLBnTxCEXDf8IPlhoMB_k6De6dxMcV9Jzr1Yw,7492 +django/contrib/admin/locale/ro/LC_MESSAGES/django.mo,sha256=SEbnJ1aQ3m2nF7PtqzKvYYCdvgg_iG5hzrdO_Xxiv_k,15157 +django/contrib/admin/locale/ro/LC_MESSAGES/django.po,sha256=wPfGo9yi3j28cwikkogZ_erQKtUZ9WmzdZ2FuMVugFE,18253 +django/contrib/admin/locale/ro/LC_MESSAGES/djangojs.mo,sha256=voEqSN3JUgJM9vumLxE_QNPV7kA0XOoTktN7E7AYV6o,4639 +django/contrib/admin/locale/ro/LC_MESSAGES/djangojs.po,sha256=SO7FAqNnuvIDfZ_tsWRiwSv91mHx5NZHyR2VnmoYBWY,5429 +django/contrib/admin/locale/ru/LC_MESSAGES/django.mo,sha256=scHv1IpdVCHwdVVxWAdW1Q0yT7SgoLz6paIYWiLZIEA,24187 +django/contrib/admin/locale/ru/LC_MESSAGES/django.po,sha256=OeUyRdR9uihQ912OU1cPPCD1nnkVqt_y46ENTI6SlUE,25938 +django/contrib/admin/locale/ru/LC_MESSAGES/djangojs.mo,sha256=TE4M5XbCJ3tX4pTzyTbLG_xjtCtqZzVg1ZXSxeSXgcU,8392 +django/contrib/admin/locale/ru/LC_MESSAGES/djangojs.po,sha256=owCCQnZqwfIOG3zZucZPwOh47TnDS59ItQwzYeEexvM,9546 +django/contrib/admin/locale/sk/LC_MESSAGES/django.mo,sha256=W1zA58jQsXhHMxwHi6m99yEwV3ku6MtlJgMxdQwpz-E,18945 +django/contrib/admin/locale/sk/LC_MESSAGES/django.po,sha256=p603cCupx37wBIStl1wGm7m_FEmNiZT25aPULwyb18o,20578 +django/contrib/admin/locale/sk/LC_MESSAGES/djangojs.mo,sha256=sl2PRwXLtikrOiHJ_EEltZivpV5IwT5lmbyfpGCSrLo,6305 +django/contrib/admin/locale/sk/LC_MESSAGES/djangojs.po,sha256=-ZcKl0UxOObVuB_8My20fdjCrV51drP4w-yan3X-RKk,7275 +django/contrib/admin/locale/sl/LC_MESSAGES/django.mo,sha256=rBSsaXNtCo43Cri9Gq_Ueq2IUNMBmzOV6lgMm7xF_p0,15077 +django/contrib/admin/locale/sl/LC_MESSAGES/django.po,sha256=ywIn4PB3xg6Q27NARZ3JRmSvNhcRFKU8nF_gbgA93qg,18281 +django/contrib/admin/locale/sl/LC_MESSAGES/djangojs.mo,sha256=chhBmd2IkeOONuRlRsOnrPAEbS0tlH4w-G8YKVNRsNI,6146 +django/contrib/admin/locale/sl/LC_MESSAGES/djangojs.po,sha256=8mrwhJ1Geg5TEvJY40COC7bZl7cyIecRhLyqLjBqBAQ,6975 +django/contrib/admin/locale/sq/LC_MESSAGES/django.mo,sha256=12ltn7X_iHVHreOt0Eev86XolcxoFxfORBOf48yuTDk,18886 +django/contrib/admin/locale/sq/LC_MESSAGES/django.po,sha256=sYkz3gXb7QU2hwinqakJb0EcibH-IgOMcoNUq4E5mxM,20193 +django/contrib/admin/locale/sq/LC_MESSAGES/djangojs.mo,sha256=JZd4AaMh0TPnT1bCSyDLWwRMMCVN9C8w3Ubd-UkLDWI,6122 +django/contrib/admin/locale/sq/LC_MESSAGES/djangojs.po,sha256=h0TU4rJnZ4KwpaL1mt8SiNvAQGuGVIFB1j4nh7vb7UI,6864 +django/contrib/admin/locale/sr/LC_MESSAGES/django.mo,sha256=7eF4L3TQMaMFXh2m1RkCdt4KZpICmgyvH15U9mLDrRA,23216 +django/contrib/admin/locale/sr/LC_MESSAGES/django.po,sha256=iKYVmh2UQk1Vf1qyhwD7WF_h9G9UaqL2bhnVKIV9BCs,24565 +django/contrib/admin/locale/sr/LC_MESSAGES/djangojs.mo,sha256=1GW3zhwJYBiH5c0dmy4sXOsnt1r88LiHSZdlJ5IP1bI,7234 +django/contrib/admin/locale/sr/LC_MESSAGES/djangojs.po,sha256=AY4qY7h8JdA4WgOam0lSeVp0nUz2fdiLNHrFRNh2jLQ,8013 +django/contrib/admin/locale/sr_Latn/LC_MESSAGES/django.mo,sha256=8wcRn4O2WYMFJal760MvjtSPBNoDgHAEYtedg8CC7Ao,12383 +django/contrib/admin/locale/sr_Latn/LC_MESSAGES/django.po,sha256=N4fPEJTtUrQnc8q1MioPZ2a7E55YXrE-JvfAcWZubfA,16150 +django/contrib/admin/locale/sr_Latn/LC_MESSAGES/djangojs.mo,sha256=HBndv8hTWMFpfJizmF-CkSmFr_-QPhdq-AziTaZCOOY,6021 +django/contrib/admin/locale/sr_Latn/LC_MESSAGES/djangojs.po,sha256=4m55hUurXwpzT968ifHH2FXAlt-ZmoqyjuLfUj8PpW8,10955 +django/contrib/admin/locale/sv/LC_MESSAGES/django.mo,sha256=-H1w7_y2w3bCRddOEq49tWofGGqbrJM8rmgdQWcAAFU,18004 +django/contrib/admin/locale/sv/LC_MESSAGES/django.po,sha256=Aq3NjhpgY7Ni2paOrWpeMB0zbm3zeK02JkHl-_dNYW8,19752 +django/contrib/admin/locale/sv/LC_MESSAGES/djangojs.mo,sha256=o0ExbIeEhV8xPC62BLMaaNEw8vQ1JSeYVwUTY4SZjwo,5938 +django/contrib/admin/locale/sv/LC_MESSAGES/djangojs.po,sha256=J7KNDezuRJfGIt4-z1-Mm2cKf9lGODrEScs3w3n88y0,6937 +django/contrib/admin/locale/sw/LC_MESSAGES/django.mo,sha256=kiy4ZiBR6SIzF3SIqC3dNLTUDncZ9qjTdiG1AkIuuXk,17698 +django/contrib/admin/locale/sw/LC_MESSAGES/django.po,sha256=Km7ETJkQTpQUyp1r4mEpa3d_rCLbwh4n5DnYF6JLCxc,19082 +django/contrib/admin/locale/sw/LC_MESSAGES/djangojs.mo,sha256=p0pi6-Zg-qsDVMDjNHO4aav3GfJ3tKKhy6MK7mPtC50,3647 +django/contrib/admin/locale/sw/LC_MESSAGES/djangojs.po,sha256=lZFP7Po4BM_QMTj-SXGlew1hqyJApZxu0lxMP-YduHI,4809 +django/contrib/admin/locale/ta/LC_MESSAGES/django.mo,sha256=ZdtNRZLRqquwMk7mE0XmTzEjTno9Zni3mV6j4DXL4nI,10179 +django/contrib/admin/locale/ta/LC_MESSAGES/django.po,sha256=D0TCLM4FFF7K9NqUGXNFE2KfoEzx5IHcJQ6-dYQi2Eg,16881 +django/contrib/admin/locale/ta/LC_MESSAGES/djangojs.mo,sha256=2-37FOw9Bge0ahIRxFajzxvMkAZL2zBiQFaELmqyhhY,1379 +django/contrib/admin/locale/ta/LC_MESSAGES/djangojs.po,sha256=Qs-D7N3ZVzpZVxXtMWKOzJfSmu_Mk9pge5W15f21ihI,3930 +django/contrib/admin/locale/te/LC_MESSAGES/django.mo,sha256=aIAG0Ey4154R2wa-vNe2x8X4fz2L958zRmTpCaXZzds,10590 +django/contrib/admin/locale/te/LC_MESSAGES/django.po,sha256=-zJYrDNmIs5fp37VsG4EAOVefgbBNl75c-Pp3RGBDAM,16941 +django/contrib/admin/locale/te/LC_MESSAGES/djangojs.mo,sha256=VozLzWQwrY-USvin5XyVPtUUKEmCr0dxaWC6J14BReo,1362 +django/contrib/admin/locale/te/LC_MESSAGES/djangojs.po,sha256=HI8IfXqJf4I6i-XZB8ELGyp5ZNr-oi5hW9h7n_8XSaQ,3919 +django/contrib/admin/locale/tg/LC_MESSAGES/django.mo,sha256=gJfgsEn9doTT0erBK77OBDi7_0O7Rb6PF9tRPacliXU,15463 +django/contrib/admin/locale/tg/LC_MESSAGES/django.po,sha256=Wkx7Hk2a9OzZymgrt9N91OL9K5HZXTbpPBXMhyE0pjI,19550 +django/contrib/admin/locale/tg/LC_MESSAGES/djangojs.mo,sha256=SEaBcnnKupXbTKCJchkSu_dYFBBvOTAOQSZNbCYUuHE,5154 +django/contrib/admin/locale/tg/LC_MESSAGES/djangojs.po,sha256=CfUjLtwMmz1h_MLE7c4UYv05ZTz_SOclyKKWmVEP9Jg,5978 +django/contrib/admin/locale/th/LC_MESSAGES/django.mo,sha256=EVlUISdKOvNkGMG4nbQFzSn5p7d8c9zOGpXwoHsHNlY,16394 +django/contrib/admin/locale/th/LC_MESSAGES/django.po,sha256=OqhGCZ87VX-WKdC2EQ8A8WeXdWXu9mj6k8mG9RLZMpM,20187 +django/contrib/admin/locale/th/LC_MESSAGES/djangojs.mo,sha256=ukj5tyDor9COi5BT9oRLucO2wVTI6jZWclOM-wNpXHM,6250 +django/contrib/admin/locale/th/LC_MESSAGES/djangojs.po,sha256=3L5VU3BNcmfiqzrAWK0tvRRVOtgR8Ceg9YIxL54RGBc,6771 +django/contrib/admin/locale/tk/LC_MESSAGES/django.mo,sha256=f51Ug7txuVeDo1WAywl6oi1aVi1ZJrv94rD4svUobm8,2845 +django/contrib/admin/locale/tk/LC_MESSAGES/django.po,sha256=AXMpn9mSO24azMC5CPHqPZRq-cbk6IpPpaF3Ab3K54k,13309 +django/contrib/admin/locale/tr/LC_MESSAGES/django.mo,sha256=2TG5asYEJCqGPGNofytA2qfjGxNVz3GwdOvkgbbHI-s,18745 +django/contrib/admin/locale/tr/LC_MESSAGES/django.po,sha256=CjXcGzi8vK12O_03qtUKTG8IPjOnKGP-08zoQjaNfzM,20255 +django/contrib/admin/locale/tr/LC_MESSAGES/djangojs.mo,sha256=ZD3OYJSFuhPLrYZbAHb3tPhIxWK_tW1F8DOt7UwDR6g,6044 +django/contrib/admin/locale/tr/LC_MESSAGES/djangojs.po,sha256=bmh2K3ZxUnvAy_OdQB-NOE2injry30mzKGlwCsigIjg,6789 +django/contrib/admin/locale/tt/LC_MESSAGES/django.mo,sha256=ObJ8zwVLhFsS6XZK_36AkNRCeznoJJwLTMh4_LLGPAA,12952 +django/contrib/admin/locale/tt/LC_MESSAGES/django.po,sha256=VDjg5nDrLqRGXpxCyQudEC_n-6kTCIYsOl3izt1Eblc,17329 +django/contrib/admin/locale/tt/LC_MESSAGES/djangojs.mo,sha256=Sz5qnMHWfLXjaCIHxQNrwac4c0w4oeAAQubn5R7KL84,2607 +django/contrib/admin/locale/tt/LC_MESSAGES/djangojs.po,sha256=_Uh3yH_RXVB3PP75RFztvSzVykVq0SQjy9QtTnyH3Qk,4541 +django/contrib/admin/locale/udm/LC_MESSAGES/django.mo,sha256=2Q_lfocM7OEjFKebqNR24ZBqUiIee7Lm1rmS5tPGdZA,622 +django/contrib/admin/locale/udm/LC_MESSAGES/django.po,sha256=L4TgEk2Fm2mtKqhZroE6k_gfz1VC-_dXe39CiJvaOPE,10496 +django/contrib/admin/locale/udm/LC_MESSAGES/djangojs.mo,sha256=CNmoKj9Uc0qEInnV5t0Nt4ZnKSZCRdIG5fyfSsqwky4,462 +django/contrib/admin/locale/udm/LC_MESSAGES/djangojs.po,sha256=ZLYr0yHdMYAl7Z7ipNSNjRFIMNYmzIjT7PsKNMT6XVk,2811 +django/contrib/admin/locale/ug/LC_MESSAGES/django.mo,sha256=1U-qjdk6839W4p5g4PL0l5GsehEwM-iPgMgzbvlmZ8Y,23241 +django/contrib/admin/locale/ug/LC_MESSAGES/django.po,sha256=0--xGDGJR01cIhmxISWl23PnRY2xvkKSHUMJLqfCyeA,24559 +django/contrib/admin/locale/ug/LC_MESSAGES/djangojs.mo,sha256=xC3-Xz8R95NL6EkVKvUuPX4jCwnNA_0sq6PvWEKbZ5I,7306 +django/contrib/admin/locale/ug/LC_MESSAGES/djangojs.po,sha256=V3UuGjeYLnfV151Yn_X0QrAYwfqMe6WvoyWJ1QnKsjo,7927 +django/contrib/admin/locale/uk/LC_MESSAGES/django.mo,sha256=LwO4uX79ZynANx47kGLijkDJ-DAdYWlmW3nYOqbXuuo,22319 +django/contrib/admin/locale/uk/LC_MESSAGES/django.po,sha256=9vEMtbw4ck4Sipdu-Y8mYOufWOTWpu7PVrMDu71GT9g,24335 +django/contrib/admin/locale/uk/LC_MESSAGES/djangojs.mo,sha256=_YwTcBttv3DZNYkBq4Rsl6oq30o8nDvUHPI5Yx0GaA4,5787 +django/contrib/admin/locale/uk/LC_MESSAGES/djangojs.po,sha256=4lYvm_LDX5xha4Qj1dXE5tGs4BjGPUgjigvG2n6y1S4,6993 +django/contrib/admin/locale/ur/LC_MESSAGES/django.mo,sha256=HvyjnSeLhUf1JVDy759V_TI7ygZfLaMhLnoCBJxhH_s,13106 +django/contrib/admin/locale/ur/LC_MESSAGES/django.po,sha256=BFxxLbHs-UZWEmbvtWJNA7xeuvO9wDc32H2ysKZQvF4,17531 +django/contrib/admin/locale/ur/LC_MESSAGES/djangojs.mo,sha256=eYN9Q9KKTV2W0UuqRc-gg7y42yFAvJP8avMeZM-W7mw,2678 +django/contrib/admin/locale/ur/LC_MESSAGES/djangojs.po,sha256=Nj-6L6axLrqA0RHUQbidNAT33sXYfVdGcX4egVua-Pk,4646 +django/contrib/admin/locale/uz/LC_MESSAGES/django.mo,sha256=yKpKebwX6RzUwCkvHzEQ_DFRr7x_nGeACRBP0PljTCQ,4634 +django/contrib/admin/locale/uz/LC_MESSAGES/django.po,sha256=bf_EhEV0c-H8MAdvRFb8TrXjgAAFfl8xif2Sw9uip_A,13776 +django/contrib/admin/locale/uz/LC_MESSAGES/djangojs.mo,sha256=LpuFvNKqNRCCiV5VyRnJoZ8gY3Xieb05YV9KakNU7o8,3783 +django/contrib/admin/locale/uz/LC_MESSAGES/djangojs.po,sha256=joswozR3I1ijRapf50FZMzQQhI_aU2XiiSTLeSxkL64,5235 +django/contrib/admin/locale/vi/LC_MESSAGES/django.mo,sha256=coCDRhju7xVvdSaounXO5cMqCmLWICZPJth6JI3Si2c,18077 +django/contrib/admin/locale/vi/LC_MESSAGES/django.po,sha256=Q1etVmaAb1f79f4uVjbNjPkn-_3m2Spz1buNAV3y9lk,19543 +django/contrib/admin/locale/vi/LC_MESSAGES/djangojs.mo,sha256=45E-fCQkq-BRLzRzsGkw1-AvWlvjL1rdsRFqfsvAq98,5302 +django/contrib/admin/locale/vi/LC_MESSAGES/djangojs.po,sha256=k87QvFnt8psnwMXXrFO6TyH6xCyXIDd_rlnWDfl2FAA,5958 +django/contrib/admin/locale/zh_Hans/LC_MESSAGES/django.mo,sha256=Mqf-2H_QUW3Ex30n_KSWdWufO6gFUYSUsBxdW418huM,17143 +django/contrib/admin/locale/zh_Hans/LC_MESSAGES/django.po,sha256=0rSHQ8jJ5OuiX5zgBwhswSqM6Z90NO5WASbZkFjTNy4,19234 +django/contrib/admin/locale/zh_Hans/LC_MESSAGES/djangojs.mo,sha256=-oaPtoS-K1iBfmpOtn-_XFuqJaFLFDDFzZ6EToaC8g0,5715 +django/contrib/admin/locale/zh_Hans/LC_MESSAGES/djangojs.po,sha256=lpJDxzzdngESFzW38Al5DbfQFfTmM59GCGpj8u9f4rA,6853 +django/contrib/admin/locale/zh_Hant/LC_MESSAGES/django.mo,sha256=XnlgIwrF5lx8UX3uH2x2mTvruwywKo1w2lJ2e07D1AQ,16991 +django/contrib/admin/locale/zh_Hant/LC_MESSAGES/django.po,sha256=t1qEsnnUFNko1aWiln7HpRxIgy7uQy_GlsVrKJ25vfw,18404 +django/contrib/admin/locale/zh_Hant/LC_MESSAGES/djangojs.mo,sha256=yFwS8aTJUAG5lN4tYLCxx-FLfTsiOxXrCEhlIA-9vcs,4230 +django/contrib/admin/locale/zh_Hant/LC_MESSAGES/djangojs.po,sha256=C4Yk5yuYcmaovVs_CS8YFYY2iS4RGi0oNaUpTm7akeU,4724 +django/contrib/admin/migrations/0001_initial.py,sha256=9HFpidmBW2Ix8NcpF1SDXgCMloGER_5XmEu_iYWIMzU,2507 +django/contrib/admin/migrations/0002_logentry_remove_auto_add.py,sha256=LBJ-ZZoiNu3qDtV-zNOHhq6E42V5CoC5a3WMYX9QvkM,553 +django/contrib/admin/migrations/0003_logentry_add_action_flag_choices.py,sha256=AnAKgnGQcg5cQXSVo5UHG2uqKKNOdLyPkIJK-q_AGEE,538 +django/contrib/admin/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/contrib/admin/migrations/__pycache__/0001_initial.cpython-312.pyc,, +django/contrib/admin/migrations/__pycache__/0002_logentry_remove_auto_add.cpython-312.pyc,, +django/contrib/admin/migrations/__pycache__/0003_logentry_add_action_flag_choices.cpython-312.pyc,, +django/contrib/admin/migrations/__pycache__/__init__.cpython-312.pyc,, +django/contrib/admin/models.py,sha256=c7KbDRElgwaEL479ZXHJPSa0mfcnZ7E7utzvEK0o6RM,8444 +django/contrib/admin/options.py,sha256=TRxEYp_9eBshk0E8IXr9-VE5bswkEvNGGb9JSYxxXKA,100242 +django/contrib/admin/sites.py,sha256=1I1B-JMkFk0eoACp8cxRDY1OKrnFaJzvLsL1TdQ0M-c,23204 +django/contrib/admin/static/admin/css/autocomplete.css,sha256=oZCQKaJleVU68lo5A1fRD1iGzqNgSgtollAc2gVWbaw,9185 +django/contrib/admin/static/admin/css/base.css,sha256=RO7kMJW2rLFbd-D9yY8GrwV-Co2V9XFBajNAS592Olc,22092 +django/contrib/admin/static/admin/css/changelists.css,sha256=qaNfxJlI_NarKm0IjyTkmtRoNXvOoVHfMhoOvVjbE4M,6878 +django/contrib/admin/static/admin/css/dark_mode.css,sha256=VexPq1oTRQFmQUvDWA5TXs113B3DonxjM1dVq3jWItE,2804 +django/contrib/admin/static/admin/css/dashboard.css,sha256=iCz7Kkr5Ld3Hyjx_O1r_XfZ2LcpxOpVjcDZS1wbqHWs,441 +django/contrib/admin/static/admin/css/forms.css,sha256=La0DBLZdAOZL6KCO6lXWahkNLpiYDssCFG1HJdVMhcE,8794 +django/contrib/admin/static/admin/css/login.css,sha256=f8lbZQdAWt1rGdvNrIf1kciQPVcBJX4zYHf81JrqXnI,951 +django/contrib/admin/static/admin/css/nav_sidebar.css,sha256=4wmBb5tVT5_fcnP_UtS16jal0QiqgOKq_yz162Hr_C4,2810 +django/contrib/admin/static/admin/css/responsive.css,sha256=jmrf-FGu2q4Fx6GshvgFoxaWeYvH6YZ48W25Gz6Y89Y,17972 +django/contrib/admin/static/admin/css/responsive_rtl.css,sha256=-rFxMozuMebKa4cF-mnIX4rc0BQ618-ErK8eAEmEHBw,2544 +django/contrib/admin/static/admin/css/rtl.css,sha256=1bBNLRcIPTteBElXxSRY1ctni3Fytx5jtCvKNyuaRnU,4696 +django/contrib/admin/static/admin/css/unusable_password_field.css,sha256=c-s6fSgH5n2hrZO6jopy__T9_VHX0YZJnnGTEfWNjRA,663 +django/contrib/admin/static/admin/css/vendor/select2/LICENSE-SELECT2.md,sha256=TuDLxRNwr941hlKg-XeXIFNyntV4tqQvXioDfRFPCzk,1124 +django/contrib/admin/static/admin/css/vendor/select2/select2.css,sha256=kalgQ55Pfy9YBkT-4yYYd5N8Iobe-iWeBuzP7LjVO0o,17358 +django/contrib/admin/static/admin/css/vendor/select2/select2.min.css,sha256=FdatTf20PQr_rWg-cAKfl6j4_IY3oohFAJ7gVC3M34E,14966 +django/contrib/admin/static/admin/css/widgets.css,sha256=NZBu1UEPYtta6ThHX9CFDIt2DflTjrSsBu5B5Me3QMw,11564 +django/contrib/admin/static/admin/img/LICENSE,sha256=0RT6_zSIwWwxmzI13EH5AjnT1j2YU3MwM9j3U19cAAQ,1081 +django/contrib/admin/static/admin/img/README.txt,sha256=Z5Y_AuG3V72qXRo_hS7JTHAid6deKUQKfLHgWP5hQHw,321 +django/contrib/admin/static/admin/img/calendar-icons.svg,sha256=VPzjt0-CwhFaiF2JyX2SjEkPuELU7QlhH4UhuWZmWX0,2455 +django/contrib/admin/static/admin/img/gis/move_vertex_off.svg,sha256=ou-ppUNyy5QZCKFYlcrzGBwEEiTDX5mmJvM8rpwC5DM,1129 +django/contrib/admin/static/admin/img/gis/move_vertex_on.svg,sha256=DgmcezWDms_3VhgqgYUGn-RGFHyScBP0MeX8PwHy_nE,1129 +django/contrib/admin/static/admin/img/icon-addlink.svg,sha256=_5bRQvExVwSP4DsRzIb-yDwutuft2RkHLqcifdlWypE,331 +django/contrib/admin/static/admin/img/icon-alert.svg,sha256=aXtd9PA66tccls-TJfyECQrmdWrj8ROWKC0tJKa7twA,504 +django/contrib/admin/static/admin/img/icon-calendar.svg,sha256=_bcF7a_R94UpOfLf-R0plVobNUeeTto9UMiUIHBcSHY,1086 +django/contrib/admin/static/admin/img/icon-changelink.svg,sha256=pjCclLDG8vvQmfZkFVzFMw1CLer930zafI8XgvDN86c,380 +django/contrib/admin/static/admin/img/icon-clock.svg,sha256=k55Yv6R6-TyS8hlL3Kye0IMNihgORFjoJjHY21vtpEA,677 +django/contrib/admin/static/admin/img/icon-deletelink.svg,sha256=06XOHo5y59UfNBtO8jMBHQqmXt8UmohlSMloUuZ6d0A,392 +django/contrib/admin/static/admin/img/icon-hidelink.svg,sha256=4MGicntOFkPurB9LW_IC-0N88WXKvrQxVyBB9p5gMTA,784 +django/contrib/admin/static/admin/img/icon-no.svg,sha256=QqBaTrrp3KhYJxLYB5E-0cn_s4A_Y8PImYdWjfQSM-c,560 +django/contrib/admin/static/admin/img/icon-unknown-alt.svg,sha256=LyL9oJtR0U49kGHYKMxmmm1vAw3qsfXR7uzZH76sZ_g,655 +django/contrib/admin/static/admin/img/icon-unknown.svg,sha256=ePcXlyi7cob_IcJOpZ66uiymyFgMPHl8p9iEn_eE3fc,655 +django/contrib/admin/static/admin/img/icon-viewlink.svg,sha256=NL7fcy7mQOQ91sRzxoVRLfzWzXBRU59cFANOrGOwWM0,581 +django/contrib/admin/static/admin/img/icon-yes.svg,sha256=_H4JqLywJ-NxoPLqSqk9aGJcxEdZwtSFua1TuI9kIcM,436 +django/contrib/admin/static/admin/img/inline-delete.svg,sha256=Ni1z8eDYBOveVDqtoaGyEMWG5Mdnt9dniiuBWTlnr5Y,560 +django/contrib/admin/static/admin/img/search.svg,sha256=HgvLPNT7FfgYvmbt1Al1yhXgmzYHzMg8BuDLnU9qpMU,458 +django/contrib/admin/static/admin/img/selector-icons.svg,sha256=0RJyrulJ_UR9aYP7Wbvs5jYayBVhLoXR26zawNMZ0JQ,3291 +django/contrib/admin/static/admin/img/sorting-icons.svg,sha256=cCvcp4i3MAr-mo8LE_h8ZRu3LD7Ma9BtpK-p24O3lVA,1097 +django/contrib/admin/static/admin/img/tooltag-add.svg,sha256=fTZCouGMJC6Qq2xlqw_h9fFodVtLmDMrpmZacGVJYZQ,331 +django/contrib/admin/static/admin/img/tooltag-arrowright.svg,sha256=GIAqy_4Oor9cDMNC2fSaEGh-3gqScvqREaULnix3wHc,280 +django/contrib/admin/static/admin/js/SelectBox.js,sha256=b42sGVqaCDqlr0ibFiZus9FbrUweRcKD_y61HDAdQuc,4530 +django/contrib/admin/static/admin/js/SelectFilter2.js,sha256=KHZTz9X8P7s1a_4Di1rpNfmnobP1Z49-JizDDDkqzLE,15502 +django/contrib/admin/static/admin/js/actions.js,sha256=KZnmpiDCroO8EcCawROJdHAdUFL87Xu9pqYUL5jHIxM,8076 +django/contrib/admin/static/admin/js/admin/DateTimeShortcuts.js,sha256=ryJhtM9SN0fMdfnhV_m2Hv2pc6a9B0Zpc37ocZ82_-0,19319 +django/contrib/admin/static/admin/js/admin/RelatedObjectLookups.js,sha256=XXtBFmKGeHSwL0SxEKKvzhbeLA1jax8ZasQobouWfGc,9097 +django/contrib/admin/static/admin/js/autocomplete.js,sha256=OAqSTiHZnTWZzJKEvOm-Z1tdAlLjPWX9jKpYkmH0Ozo,1060 +django/contrib/admin/static/admin/js/calendar.js,sha256=cj6qPrSqdWeq_OnWUUKWy4jVGCiy4YxsbXa5KhUw_r4,9141 +django/contrib/admin/static/admin/js/cancel.js,sha256=UEZdvvWu5s4ZH16lFfxa8UPgWXJ3i8VseK5Lcw2Kreg,884 +django/contrib/admin/static/admin/js/change_form.js,sha256=zOTeORCq1i9XXV_saSBBDOXbou5UtZvxYFpVPqxQ02Q,606 +django/contrib/admin/static/admin/js/core.js,sha256=H4_YZp2B3Y9JxMZPpHKVutrUZJbAZd4H6Gc-ilSb4_E,6208 +django/contrib/admin/static/admin/js/filters.js,sha256=T-JlrqZEBSWbiFw_e5lxkMykkACWqWXd_wMy-b3TnaE,978 +django/contrib/admin/static/admin/js/inlines.js,sha256=yWB-KSw_aZmVZpIitKde7imygAa36LBdqoBfB7lTvJQ,15526 +django/contrib/admin/static/admin/js/jquery.init.js,sha256=uM_Kf7EOBMipcCmuQHbyubQkycleSWDCS8-c3WevFW0,347 +django/contrib/admin/static/admin/js/nav_sidebar.js,sha256=1xzV95R3GaqQ953sVmkLIuZJrzFNoDJMHBqwQePp6-Q,3063 +django/contrib/admin/static/admin/js/popup_response.js,sha256=IKRg0dCpW_gkwT-l6yy3hIFxEwbaA5tw0XEckpPaHvE,532 +django/contrib/admin/static/admin/js/prepopulate.js,sha256=UYkWrHNK1-OWp1a5IWZdg0udfo_dcR-jKSn5AlxxqgU,1531 +django/contrib/admin/static/admin/js/prepopulate_init.js,sha256=mJIPAgn8QHji_rSqO6WKNREbpkCILFrjRCCOQ1-9SoQ,586 +django/contrib/admin/static/admin/js/theme.js,sha256=gG6whuLXbtdF-t_pvUO1O7LfVlNZDuzMZONENrOuZp4,1653 +django/contrib/admin/static/admin/js/unusable_password_field.js,sha256=tcGj7GAhLMohHLtxGOAsaZH1t0Fu3fTQk2l3vFV9AY4,1480 +django/contrib/admin/static/admin/js/urlify.js,sha256=8oC4Bcxt8oJY4uy9O4NjPws5lXzDkdfwI2Xo3MxpBTo,7887 +django/contrib/admin/static/admin/js/vendor/jquery/LICENSE.txt,sha256=1Nuevm8p9RaOrEWtcT8FViOsXQ3NW6ktoj1lCuASAg0,1097 +django/contrib/admin/static/admin/js/vendor/jquery/jquery.js,sha256=eKhayi8LEQwp4NKxN-CfCh-3qOVUtJn3QNZ0TciWLP4,285314 +django/contrib/admin/static/admin/js/vendor/jquery/jquery.min.js,sha256=_JqT3SQfawRcv_BIHPThkBvs0OEvtFFmqPF_lYI_Cxo,87533 +django/contrib/admin/static/admin/js/vendor/select2/LICENSE.md,sha256=TuDLxRNwr941hlKg-XeXIFNyntV4tqQvXioDfRFPCzk,1124 +django/contrib/admin/static/admin/js/vendor/select2/i18n/af.js,sha256=IpI3uo19fo77jMtN5R3peoP0OriN-nQfPY2J4fufd8g,866 +django/contrib/admin/static/admin/js/vendor/select2/i18n/ar.js,sha256=zxQ3peSnbVIfrH1Ndjx4DrHDsmbpqu6mfeylVWFM5mY,905 +django/contrib/admin/static/admin/js/vendor/select2/i18n/az.js,sha256=N_KU7ftojf2HgvJRlpP8KqG6hKIbqigYN3K0YH_ctuQ,721 +django/contrib/admin/static/admin/js/vendor/select2/i18n/bg.js,sha256=5Z6IlHmuk_6IdZdAVvdigXnlj7IOaKXtcjuI0n0FmYQ,968 +django/contrib/admin/static/admin/js/vendor/select2/i18n/bn.js,sha256=wdQbgaxZ47TyGlwvso7GOjpmTXUKaWzvVUr_oCRemEE,1291 +django/contrib/admin/static/admin/js/vendor/select2/i18n/bs.js,sha256=g56kWSu9Rxyh_rarLSDa_8nrdqL51JqZai4QQx20jwQ,965 +django/contrib/admin/static/admin/js/vendor/select2/i18n/ca.js,sha256=DSyyAXJUI0wTp_TbFhLNGrgvgRsGWeV3IafxYUGBggM,900 +django/contrib/admin/static/admin/js/vendor/select2/i18n/cs.js,sha256=t_8OWVi6Yy29Kabqs_l1sM2SSrjUAgZTwbTX_m0MCL8,1292 +django/contrib/admin/static/admin/js/vendor/select2/i18n/da.js,sha256=tF2mvzFYSWYOU3Yktl3G93pCkf-V9gonCxk7hcA5J1o,828 +django/contrib/admin/static/admin/js/vendor/select2/i18n/de.js,sha256=5bspfcihMp8yXDwfcqvC_nV3QTbtBuQDmR3c7UPQtFw,866 +django/contrib/admin/static/admin/js/vendor/select2/i18n/dsb.js,sha256=KtP2xNoP75oWnobUrS7Ep_BOFPzcMNDt0wyPnkbIF_Q,1017 +django/contrib/admin/static/admin/js/vendor/select2/i18n/el.js,sha256=IdvD8eY_KpX9fdHvld3OMvQfYsnaoJjDeVkgbIemfn8,1182 +django/contrib/admin/static/admin/js/vendor/select2/i18n/en.js,sha256=C66AO-KOXNuXEWwhwfjYBFa3gGcIzsPFHQAZ9qSh3Go,844 +django/contrib/admin/static/admin/js/vendor/select2/i18n/es.js,sha256=IhZaIy8ufTduO2-vBrivswMCjlPk7vrk4P81pD6B0SM,922 +django/contrib/admin/static/admin/js/vendor/select2/i18n/et.js,sha256=LgLgdOkKjc63svxP1Ua7A0ze1L6Wrv0X6np-8iRD5zw,801 +django/contrib/admin/static/admin/js/vendor/select2/i18n/eu.js,sha256=rLmtP7bA_atkNIj81l_riTM7fi5CXxVrFBHFyddO-Hw,868 +django/contrib/admin/static/admin/js/vendor/select2/i18n/fa.js,sha256=fqZkE9e8tt2rZ7OrDGPiOsTNdj3S2r0CjbddVUBDeMA,1023 +django/contrib/admin/static/admin/js/vendor/select2/i18n/fi.js,sha256=KVGirhGGNee_iIpMGLX5EzH_UkNe-FOPC_0484G-QQ0,803 +django/contrib/admin/static/admin/js/vendor/select2/i18n/fr.js,sha256=aj0q2rdJN47BRBc9LqvsgxkuPOcWAbZsUFUlbguwdY0,924 +django/contrib/admin/static/admin/js/vendor/select2/i18n/gl.js,sha256=HSJafI85yKp4WzjFPT5_3eZ_-XQDYPzzf4BWmu6uXHk,924 +django/contrib/admin/static/admin/js/vendor/select2/i18n/he.js,sha256=DIPRKHw0NkDuUtLNGdTnYZcoCiN3ustHY-UMmw34V_s,984 +django/contrib/admin/static/admin/js/vendor/select2/i18n/hi.js,sha256=m6ZqiKZ_jzwzVFgC8vkYiwy4lH5fJEMV-LTPVO2Wu40,1175 +django/contrib/admin/static/admin/js/vendor/select2/i18n/hr.js,sha256=NclTlDTiNFX1y0W1Llj10-ZIoXUYd7vDXqyeUJ7v3B4,852 +django/contrib/admin/static/admin/js/vendor/select2/i18n/hsb.js,sha256=FTLszcrGaelTW66WV50u_rS6HV0SZxQ6Vhpi2tngC6M,1018 +django/contrib/admin/static/admin/js/vendor/select2/i18n/hu.js,sha256=3PdUk0SpHY-H-h62womw4AyyRMujlGc6_oxW-L1WyOs,831 +django/contrib/admin/static/admin/js/vendor/select2/i18n/hy.js,sha256=BLh0fntrwtwNwlQoiwLkdQOVyNXHdmRpL28p-W5FsDg,1028 +django/contrib/admin/static/admin/js/vendor/select2/i18n/id.js,sha256=fGJ--Aw70Ppzk3EgLjF1V_QvqD2q_ufXjnQIIyZqYgc,768 +django/contrib/admin/static/admin/js/vendor/select2/i18n/is.js,sha256=gn0ddIqTnJX4wk-tWC5gFORJs1dkgIH9MOwLljBuQK0,807 +django/contrib/admin/static/admin/js/vendor/select2/i18n/it.js,sha256=kGxtapwhRFj3u_IhY_7zWZhKgR5CrZmmasT5w-aoXRM,897 +django/contrib/admin/static/admin/js/vendor/select2/i18n/ja.js,sha256=tZ4sqdx_SEcJbiW5-coHDV8FVmElJRA3Z822EFHkjLM,862 +django/contrib/admin/static/admin/js/vendor/select2/i18n/ka.js,sha256=DH6VrnVdR8SX6kso2tzqnJqs32uCpBNyvP9Kxs3ssjI,1195 +django/contrib/admin/static/admin/js/vendor/select2/i18n/km.js,sha256=x9hyjennc1i0oeYrFUHQnYHakXpv7WD7MSF-c9AaTjg,1088 +django/contrib/admin/static/admin/js/vendor/select2/i18n/ko.js,sha256=ImmB9v7g2ZKEmPFUQeXrL723VEjbiEW3YelxeqHEgHc,855 +django/contrib/admin/static/admin/js/vendor/select2/i18n/lt.js,sha256=ZT-45ibVwdWnTyo-TqsqW2NjIp9zw4xs5So78KMb_s8,944 +django/contrib/admin/static/admin/js/vendor/select2/i18n/lv.js,sha256=hHpEK4eYSoJj_fvA2wl8QSuJluNxh-Tvp6UZm-ZYaeE,900 +django/contrib/admin/static/admin/js/vendor/select2/i18n/mk.js,sha256=PSpxrnBpL4SSs9Tb0qdWD7umUIyIoR2V1fpqRQvCXcA,1038 +django/contrib/admin/static/admin/js/vendor/select2/i18n/ms.js,sha256=NCz4RntkJZf8YDDC1TFBvK-nkn-D-cGNy7wohqqaQD4,811 +django/contrib/admin/static/admin/js/vendor/select2/i18n/nb.js,sha256=eduKCG76J3iIPrUekCDCq741rnG4xD7TU3E7Lib7sPE,778 +django/contrib/admin/static/admin/js/vendor/select2/i18n/ne.js,sha256=QQjDPQE6GDKXS5cxq2JRjk3MGDvjg3Izex71Zhonbj8,1357 +django/contrib/admin/static/admin/js/vendor/select2/i18n/nl.js,sha256=JctLfTpLQ5UFXtyAmgbCvSPUtW0fy1mE7oNYcMI90bI,904 +django/contrib/admin/static/admin/js/vendor/select2/i18n/pl.js,sha256=6gEuKYnJdf8cbPERsw-mtdcgdByUJuLf1QUH0aSajMo,947 +django/contrib/admin/static/admin/js/vendor/select2/i18n/ps.js,sha256=4J4sZtSavxr1vZdxmnub2J0H0qr1S8WnNsTehfdfq4M,1049 +django/contrib/admin/static/admin/js/vendor/select2/i18n/pt-BR.js,sha256=0DFe1Hu9fEDSXgpjPOQrA6Eq0rGb15NRbsGh1U4vEr0,876 +django/contrib/admin/static/admin/js/vendor/select2/i18n/pt.js,sha256=L5jqz8zc5BF8ukrhpI2vvGrNR34X7482dckX-IUuUpA,878 +django/contrib/admin/static/admin/js/vendor/select2/i18n/ro.js,sha256=Aadb6LV0u2L2mCOgyX2cYZ6xI5sDT9OI3V7HwuueivM,938 +django/contrib/admin/static/admin/js/vendor/select2/i18n/ru.js,sha256=bV6emVCE9lY0LzbVN87WKAAAFLUT3kKqEzn641pJ29o,1171 +django/contrib/admin/static/admin/js/vendor/select2/i18n/sk.js,sha256=MnbUcP6pInuBzTW_L_wmXY8gPLGCOcKyzQHthFkImZo,1306 +django/contrib/admin/static/admin/js/vendor/select2/i18n/sl.js,sha256=LPIKwp9gp_WcUc4UaVt_cySlNL5_lmfZlt0bgtwnkFk,925 +django/contrib/admin/static/admin/js/vendor/select2/i18n/sq.js,sha256=oIxJLYLtK0vG2g3s5jsGLn4lHuDgSodxYAWL0ByHRHo,903 +django/contrib/admin/static/admin/js/vendor/select2/i18n/sr-Cyrl.js,sha256=BoT2KdiceZGgxhESRz3W2J_7CFYqWyZyov2YktUo_2w,1109 +django/contrib/admin/static/admin/js/vendor/select2/i18n/sr.js,sha256=7EELYXwb0tISsuvL6eorxzTviMK-oedSvZvEZCMloGU,980 +django/contrib/admin/static/admin/js/vendor/select2/i18n/sv.js,sha256=c6nqUmitKs4_6AlYDviCe6HqLyOHqot2IrvJRGjj1JE,786 +django/contrib/admin/static/admin/js/vendor/select2/i18n/th.js,sha256=saDPLk-2dq5ftKCvW1wddkJOg-mXA-GUoPPVOlSZrIY,1074 +django/contrib/admin/static/admin/js/vendor/select2/i18n/tk.js,sha256=mUEGlb-9nQHvzcTYI-1kjsB7JsPRGpLxWbjrJ8URthU,771 +django/contrib/admin/static/admin/js/vendor/select2/i18n/tr.js,sha256=dDz8iSp07vbx9gciIqz56wmc2TLHj5v8o6es75vzmZU,775 +django/contrib/admin/static/admin/js/vendor/select2/i18n/uk.js,sha256=MixhFDvdRda-wj-TjrN018s7R7E34aQhRjz4baxrdKw,1156 +django/contrib/admin/static/admin/js/vendor/select2/i18n/vi.js,sha256=mwTeySsUAgqu_IA6hvFzMyhcSIM1zGhNYKq8G7X_tpM,796 +django/contrib/admin/static/admin/js/vendor/select2/i18n/zh-CN.js,sha256=olAdvPQ5qsN9IZuxAKgDVQM-blexUnWTDTXUtiorygI,768 +django/contrib/admin/static/admin/js/vendor/select2/i18n/zh-TW.js,sha256=DnDBG9ywBOfxVb2VXg71xBR_tECPAxw7QLhZOXiJ4fo,707 +django/contrib/admin/static/admin/js/vendor/select2/select2.full.js,sha256=ugZkER5OAEGzCwwb_4MvhBKE5Gvmc0S59MKn-dooZaI,173566 +django/contrib/admin/static/admin/js/vendor/select2/select2.full.min.js,sha256=XG_auAy4aieWldzMImofrFDiySK-pwJC7aoo9St7rS0,79212 +django/contrib/admin/static/admin/js/vendor/xregexp/LICENSE.txt,sha256=c68pSb_5KWyw-BbDvhmk2k6VrclMH5JHlui60_A_Lyk,1106 +django/contrib/admin/static/admin/js/vendor/xregexp/xregexp.js,sha256=FM2fFr4a9mVscQobpyNQG1Bu4_8exjunQglEoPSP5uo,325171 +django/contrib/admin/static/admin/js/vendor/xregexp/xregexp.min.js,sha256=-FQXGywOGwW-5DdFMWIq0QWpGX3rQFuQpIDe6N_9eVI,163184 +django/contrib/admin/templates/admin/404.html,sha256=zyawWu1I9IxDGBRsks6-DgtLUGDDYOKHfj9YQqPl0AA,282 +django/contrib/admin/templates/admin/500.html,sha256=rZNmFXr9POnc9TdZwD06qkY8h2W5K05vCyssrIzbZGE,551 +django/contrib/admin/templates/admin/actions.html,sha256=B2s3wWt4g_uhd7CZdmXp4ZGZlMfh6K9RAH4Bv6Ud9nQ,1235 +django/contrib/admin/templates/admin/app_index.html,sha256=7NPb0bdLKOdja7FoIERyRZRYK-ldX3PcxMoydguWfzc,493 +django/contrib/admin/templates/admin/app_list.html,sha256=jiS-lqU3wzxA804jf-eR16GGXSKtiwok2BmGl9PXVcE,2054 +django/contrib/admin/templates/admin/auth/user/add_form.html,sha256=iZ8T3RZHTxB-RR1xVwEaajcmfgro7JOVJY_wXeL3aGg,633 +django/contrib/admin/templates/admin/auth/user/change_password.html,sha256=GVfOxP3n9o4VDcGfhugsfQrfnmIX3t39eUMVIWnYTZo,3788 +django/contrib/admin/templates/admin/base.html,sha256=afBV1wJ-8BcoXeTHr2mZ2enpRZ1ARk_FFvydsWWOWJo,6081 +django/contrib/admin/templates/admin/base_site.html,sha256=GCiXgXwC_ZZ1goTKnrbdNfWONojGxTatiD5hCsA8HTg,450 +django/contrib/admin/templates/admin/change_form.html,sha256=_SItPLxgcpREl0hhVXt92ZUoBbwFRjMxrLIe5lSAqt0,3097 +django/contrib/admin/templates/admin/change_form_object_tools.html,sha256=C0l0BJF2HuSjIvtY-Yr-ByZ9dePFRrTc-MR-OVJD-AI,403 +django/contrib/admin/templates/admin/change_list.html,sha256=S-i0XcBZuY00idddX6w1ZKyD33thTFASFQk39mQ5JSA,3808 +django/contrib/admin/templates/admin/change_list_object_tools.html,sha256=-AX0bYTxDsdLtEpAEK3RFpY89tdvVChMAWPYBLqPn48,378 +django/contrib/admin/templates/admin/change_list_results.html,sha256=yOpb1o-L5Ys9GiRA_nCXoFhIzREDVXLBuYzZk1xrx1w,1502 +django/contrib/admin/templates/admin/color_theme_toggle.html,sha256=a2uh7_c2umbLLGRD_cVdVmfp291TwQYkD_87sYCotIU,703 +django/contrib/admin/templates/admin/date_hierarchy.html,sha256=Hug06L1uQzPQ-NAeixTtKRtDu2lAWh96o6f8ElnyU0c,453 +django/contrib/admin/templates/admin/delete_confirmation.html,sha256=3eMxQPSITd7Mae22TALXtCvJR4YMwfzNG_iAtuyF0PI,2539 +django/contrib/admin/templates/admin/delete_selected_confirmation.html,sha256=5yyaNqfiK1evhJ7px7gmMqjFwYrrMaKNDvQJ3-Lu4mo,2241 +django/contrib/admin/templates/admin/edit_inline/stacked.html,sha256=q4DUCiTfrlVypMV6TrvkN4zl1QDe57l-VTvYcO6yl1Q,3108 +django/contrib/admin/templates/admin/edit_inline/tabular.html,sha256=Dk0R0Hb9a4Dwl_F9G5W7GMxvLiUeOCcnk04_khbzeeA,4436 +django/contrib/admin/templates/admin/filter.html,sha256=cvjazGEln3BL_0iyz8Kcsend5WhT9y-gXKRN2kHqejU,395 +django/contrib/admin/templates/admin/includes/fieldset.html,sha256=uS2WFHxTPM1S1AME9Jz_EXM_jBsRun1gVPJpO9yqBeY,2730 +django/contrib/admin/templates/admin/includes/object_delete_summary.html,sha256=OC7VhKQiczmi01Gt_3jyemelerSNrGyDiWghUK6xKEI,192 +django/contrib/admin/templates/admin/index.html,sha256=TQxZdAy2ZyeXBLA_KZMXus7e2TGezFAUTsYHJBMLPl8,2070 +django/contrib/admin/templates/admin/invalid_setup.html,sha256=F5FS3o7S3l4idPrX29OKlM_azYmCRKzFdYjV_jpTqhE,447 +django/contrib/admin/templates/admin/login.html,sha256=ShZFbs_ITw6YoOBI_L6B-zekHJqjlR14h8WHIo-g5Ro,1899 +django/contrib/admin/templates/admin/nav_sidebar.html,sha256=OfI8XJn3_Q_Wf2ymc1IH61eTGZNMFwkkGwXXTDqeuP8,486 +django/contrib/admin/templates/admin/object_history.html,sha256=5e6ki7C94YKBoFyCvDOfqt4YzCyhNmNMy8NM4aKqiHc,2136 +django/contrib/admin/templates/admin/pagination.html,sha256=OBvC2HWFaH3wIuk6gzKSyCli51NTaW8vnJFyBOpNo_8,549 +django/contrib/admin/templates/admin/popup_response.html,sha256=Lj8dfQrg1XWdA-52uNtWJ9hwBI98Wt2spSMkO4YBjEk,327 +django/contrib/admin/templates/admin/prepopulated_fields_js.html,sha256=PShGpqQWBBVwQ86r7b-SimwJS0mxNiz8AObaiDOSfvY,209 +django/contrib/admin/templates/admin/search_form.html,sha256=GImO4ldr2iVMDKPa2prQzrJyrZEQS1Zy6guNfF6VbQ8,1357 +django/contrib/admin/templates/admin/submit_line.html,sha256=yI7XWZCjvY5JtDAvbzx8hpXZi4vRYWx0mty7Zt5uWjY,1093 +django/contrib/admin/templates/admin/widgets/clearable_file_input.html,sha256=3g3JbkQmjgjl_Lyz6DzkvNBxlJT0GJAuQGV4MAGSyJ0,666 +django/contrib/admin/templates/admin/widgets/date.html,sha256=uJME8ir5DrcrWze9ikzlspoaCudQqxyMMGr6azIMkMc,71 +django/contrib/admin/templates/admin/widgets/foreign_key_raw_id.html,sha256=s5BiNQDbL9GcEVzYMwPfoYRFdnMiSeoyLKvyAzMqGnw,339 +django/contrib/admin/templates/admin/widgets/many_to_many_raw_id.html,sha256=w18JMKnPKrw6QyqIXBcdPs3YJlTRtHK5HGxj0lVkMlY,54 +django/contrib/admin/templates/admin/widgets/radio.html,sha256=-ob26uqmvrEUMZPQq6kAqK4KBk2YZHTCWWCM6BnaL0w,57 +django/contrib/admin/templates/admin/widgets/related_widget_wrapper.html,sha256=YwUzzVO2VBxqBJ-s0Aa9O5i1RDbo-HLqi1y-bbhvLWM,2102 +django/contrib/admin/templates/admin/widgets/split_datetime.html,sha256=BQ9XNv3eqtvNqZZGW38VBM2Nan-5PBxokbo2Fm_wwCQ,238 +django/contrib/admin/templates/admin/widgets/time.html,sha256=oiXCD1IvDhALK3w0fCrVc7wBOFMJhvPNTG2_NNz9H7A,71 +django/contrib/admin/templates/admin/widgets/url.html,sha256=Tf7PwdoKAiimfmDTVbWzRVxxUeyfhF0OlsuiOZ1tHgI,218 +django/contrib/admin/templates/registration/logged_out.html,sha256=PuviqzJh7C6SZJl9yKZXDcxxqXNCTDVfRuEpqvwJiPE,425 +django/contrib/admin/templates/registration/password_change_done.html,sha256=Ukca5IPY_VhtO3wfu9jABgY7SsbB3iIGp2KCSJqihlQ,745 +django/contrib/admin/templates/registration/password_change_form.html,sha256=vOyAdwDe7ajx0iFQR-dbWK7Q3bo6NVejWEFIoNlRYbQ,2428 +django/contrib/admin/templates/registration/password_reset_complete.html,sha256=_fc5bDeYBaI5fCUJZ0ZFpmOE2CUqlbk3npGk63uc_Ks,417 +django/contrib/admin/templates/registration/password_reset_confirm.html,sha256=r8SneE3ofcZkm38eV1FPBfyNyKXKNqGci-hdqifV_3k,1498 +django/contrib/admin/templates/registration/password_reset_done.html,sha256=SQsksjWN8vPLpvtFYPBFMMqZtLeiB4nesPq2VxpB3Y8,588 +django/contrib/admin/templates/registration/password_reset_email.html,sha256=rqaoGa900-rsUasaGYP2W9nBd6KOGZTyc1PsGTFozHo,612 +django/contrib/admin/templates/registration/password_reset_form.html,sha256=_Grf7jbOWrdT5RR8ypvCNv0j_huX5O_EiNwAO_NF0jc,955 +django/contrib/admin/templatetags/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/contrib/admin/templatetags/__pycache__/__init__.cpython-312.pyc,, +django/contrib/admin/templatetags/__pycache__/admin_list.cpython-312.pyc,, +django/contrib/admin/templatetags/__pycache__/admin_modify.cpython-312.pyc,, +django/contrib/admin/templatetags/__pycache__/admin_urls.cpython-312.pyc,, +django/contrib/admin/templatetags/__pycache__/base.cpython-312.pyc,, +django/contrib/admin/templatetags/__pycache__/log.cpython-312.pyc,, +django/contrib/admin/templatetags/admin_list.py,sha256=qWMkhfkrHzdpwpgprgV3anG_BW0Be0lKV3H34tj0Ogw,18871 +django/contrib/admin/templatetags/admin_modify.py,sha256=DGE-YaZB1-bUqvjOwmnWJTrIRiR1qYdY6NyPDj1Hj3U,4978 +django/contrib/admin/templatetags/admin_urls.py,sha256=fIWcZ4zhPURSQ0DliyMzmzALO5kshFyWG6YhIPvUx9A,2038 +django/contrib/admin/templatetags/base.py,sha256=0jlMfZu-IZkTJsnJQUtqBX2ceqCaVeClTTS1wdxn73w,1465 +django/contrib/admin/templatetags/log.py,sha256=vL2TNhgFsCH-4JXDE-2I_BhB2xQQLwx4GkHKx7m8Rz4,2050 +django/contrib/admin/tests.py,sha256=jItB0bAMHtTkDmsPXmg8UZue09a5zGV_Ws2hYH_bL80,8524 +django/contrib/admin/utils.py,sha256=d7m5I_5lC9JbrOXCNd_PCHefWmT-jc41HS3kTrFY3_0,21733 +django/contrib/admin/views/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/contrib/admin/views/__pycache__/__init__.cpython-312.pyc,, +django/contrib/admin/views/__pycache__/autocomplete.cpython-312.pyc,, +django/contrib/admin/views/__pycache__/decorators.cpython-312.pyc,, +django/contrib/admin/views/__pycache__/main.cpython-312.pyc,, +django/contrib/admin/views/autocomplete.py,sha256=PjC8db25zhYgwLS_4pq6PApTD_YRn4muIH0A_VN7kCg,4385 +django/contrib/admin/views/decorators.py,sha256=4ndYdYoPLhWsdutME0Lxsmcf6UFP5Z2ou3_pMjgNbw8,639 +django/contrib/admin/views/main.py,sha256=CzHtJVnFBREIxEv04n2gLKnWKwZDTlpK9B5p6y5Cq5Y,25866 +django/contrib/admin/widgets.py,sha256=ujOuEp7Db12KIEcje7_ry55q_FISyheBF-7E3z8drFg,19637 +django/contrib/admindocs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/contrib/admindocs/__pycache__/__init__.cpython-312.pyc,, +django/contrib/admindocs/__pycache__/apps.cpython-312.pyc,, +django/contrib/admindocs/__pycache__/middleware.cpython-312.pyc,, +django/contrib/admindocs/__pycache__/urls.cpython-312.pyc,, +django/contrib/admindocs/__pycache__/utils.cpython-312.pyc,, +django/contrib/admindocs/__pycache__/views.cpython-312.pyc,, +django/contrib/admindocs/apps.py,sha256=bklhU4oaTSmPdr0QzpVeuNT6iG77QM1AgiKKZDX05t4,216 +django/contrib/admindocs/locale/af/LC_MESSAGES/django.mo,sha256=UVln7JyuWsM6Et_syaOcMINSsBRDQFqOrbEBOy94_mE,3063 +django/contrib/admindocs/locale/af/LC_MESSAGES/django.po,sha256=eGuZrP2iI5iAnvalNJ_aCKBbLtjWF-qFV_f8WJwFyYs,5645 +django/contrib/admindocs/locale/ar/LC_MESSAGES/django.mo,sha256=MwAJ0TMsgRN4wrwlhlw3gYCfZK5IKDzNPuvjfJS_Eug,7440 +django/contrib/admindocs/locale/ar/LC_MESSAGES/django.po,sha256=KSmZCjSEizBx5a6yN_u0FPqG5QoXsTV9gdJkqWC8xC8,8052 +django/contrib/admindocs/locale/ar_DZ/LC_MESSAGES/django.mo,sha256=lW-fKcGwnRtdpJLfVw9i1HiM25TctVK0oA0bGV7yAzU,7465 +django/contrib/admindocs/locale/ar_DZ/LC_MESSAGES/django.po,sha256=c8LOJTCkHd1objwj6Xqh0wF3LwkLJvWg9FIWSWWMI-I,7985 +django/contrib/admindocs/locale/ast/LC_MESSAGES/django.mo,sha256=d4u-2zZXnnueWm9CLSnt4TRWgZk2NMlrA6gaytJ2gdU,715 +django/contrib/admindocs/locale/ast/LC_MESSAGES/django.po,sha256=TUkc-Hm4h1kD0NKyndteW97jH6bWcJMFXUuw2Bd62qo,4578 +django/contrib/admindocs/locale/az/LC_MESSAGES/django.mo,sha256=tuOpw3_db7qJuYYBmlEsi-Zmp8gRVsuxGh23Cb_WQes,6629 +django/contrib/admindocs/locale/az/LC_MESSAGES/django.po,sha256=ayt0aT7rdSJpgu88WSvciCREVhBadKDjQSHgMYwyI-g,7205 +django/contrib/admindocs/locale/be/LC_MESSAGES/django.mo,sha256=VZl0yvgbo0jwQpf-s472jagbUj83A3twnxddQGwGW5c,8163 +django/contrib/admindocs/locale/be/LC_MESSAGES/django.po,sha256=Z8ZtS_t5Tc7iy1p4TTrsKZqiMJl94f1jiTWuv1sep3A,8728 +django/contrib/admindocs/locale/bg/LC_MESSAGES/django.mo,sha256=bNNoMFB0_P1qut4txQqHiXGxJa8-sjIZA8bb_jPaaHk,8242 +django/contrib/admindocs/locale/bg/LC_MESSAGES/django.po,sha256=nJMwR6R19pXmf4u6jBwe8Xn9fObSaAzulNeqsm8bszo,8989 +django/contrib/admindocs/locale/bn/LC_MESSAGES/django.mo,sha256=NOKVcE8id9G1OctSly4C5lm64CgEF8dohX-Pdyt4kCM,3794 +django/contrib/admindocs/locale/bn/LC_MESSAGES/django.po,sha256=6M7LjIEjvDTjyraxz70On_TIsgqJPLW7omQ0Fz_zyfQ,6266 +django/contrib/admindocs/locale/br/LC_MESSAGES/django.mo,sha256=UsPTado4ZNJM_arSMXyuBGsKN-bCHXQZdFbh0GB3dtg,1571 +django/contrib/admindocs/locale/br/LC_MESSAGES/django.po,sha256=SHOxPSgozJbOkm8u5LQJ9VmL58ZSBmlxfOVw1fAGl2s,5139 +django/contrib/admindocs/locale/bs/LC_MESSAGES/django.mo,sha256=clvhu0z3IF5Nt0tZ85hOt4M37pnGEWeIYumE20vLpsI,1730 +django/contrib/admindocs/locale/bs/LC_MESSAGES/django.po,sha256=1-OrVWFqLpeXQFfh7JNjJtvWjVww7iB2s96dcSgLy90,5042 +django/contrib/admindocs/locale/ca/LC_MESSAGES/django.mo,sha256=nI2ctIbZVrsaMbJQGIHQCjwqJNTnH3DKxwI2dWR6G_w,6650 +django/contrib/admindocs/locale/ca/LC_MESSAGES/django.po,sha256=hPjkw0bkoUu-yKU8XYE3ji0NG4z5cE1LGonYPJXeze4,7396 +django/contrib/admindocs/locale/ckb/LC_MESSAGES/django.mo,sha256=QisqerDkDuKrctJ10CspniXNDqBnCI2Wo-CKZUZtsCY,8154 +django/contrib/admindocs/locale/ckb/LC_MESSAGES/django.po,sha256=0adJyGnFg3qoD11s9gZbJlY8O0Dd1mpKF8OLQAkHZHE,8727 +django/contrib/admindocs/locale/cs/LC_MESSAGES/django.mo,sha256=dJ-3fDenE42f6XZFc-yrfWL1pEAmSGt2j1eWAyy-5OQ,6619 +django/contrib/admindocs/locale/cs/LC_MESSAGES/django.po,sha256=uU4n9PsiI96O0UpJzL-inVzB1Kx7OB_SbLkjrFLuyVA,7227 +django/contrib/admindocs/locale/cy/LC_MESSAGES/django.mo,sha256=sYeCCq0CMrFWjT6rKtmFrpC09OEFpYLSI3vu9WtpVTY,5401 +django/contrib/admindocs/locale/cy/LC_MESSAGES/django.po,sha256=GhdikiXtx8Aea459uifQtBjHuTlyUeiKu0_rR_mDKyg,6512 +django/contrib/admindocs/locale/da/LC_MESSAGES/django.mo,sha256=vmsIZeMIVpLkSdJNS0G6alAmBBEtLDBLnOd-P3dSOAs,6446 +django/contrib/admindocs/locale/da/LC_MESSAGES/django.po,sha256=bSoTGPcE7MdRfAtBybZT9jsuww2VDH9t5CssaxSs_GU,7148 +django/contrib/admindocs/locale/de/LC_MESSAGES/django.mo,sha256=ReSz0aH1TKT6AtP13lWoONnwNM2OGo4jK9fXJlo75Hc,6567 +django/contrib/admindocs/locale/de/LC_MESSAGES/django.po,sha256=tVkDIPF_wYb_KaJ7PF9cZyBJoYu6RpznoM9JIk3RYN4,7180 +django/contrib/admindocs/locale/dsb/LC_MESSAGES/django.mo,sha256=K_QuInKk1HrrzQivwJcs_2lc1HreFj7_R7qQh3qMTPY,6807 +django/contrib/admindocs/locale/dsb/LC_MESSAGES/django.po,sha256=flF1D0gfTScuC_RddC9njLe6RrnqnksiRxwODVA9Vqw,7332 +django/contrib/admindocs/locale/el/LC_MESSAGES/django.mo,sha256=1x0sTZwWbGEURyRaSn4ONvTPXHwm7XemNlcun9Nm1QI,8581 +django/contrib/admindocs/locale/el/LC_MESSAGES/django.po,sha256=GebfJfW0QPzAQyBKz1Km9a3saCpAWT7d_Qe2nCBvGn4,9320 +django/contrib/admindocs/locale/en/LC_MESSAGES/django.mo,sha256=U0OV81NfbuNL9ctF-gbGUG5al1StqN-daB-F-gFBFC8,356 +django/contrib/admindocs/locale/en/LC_MESSAGES/django.po,sha256=pEypE71l-Ude2e3XVf0tkBpGx6BSYNqBagWnSYmEbxI,10688 +django/contrib/admindocs/locale/en_AU/LC_MESSAGES/django.mo,sha256=BQ54LF9Tx88m-pG_QVz_nm_vqvoy6pVJzL8urSO4l1Q,486 +django/contrib/admindocs/locale/en_AU/LC_MESSAGES/django.po,sha256=ho7s1uKEs9FGooyZBurvSjvFz1gDSX6R4G2ZKpF1c9Q,5070 +django/contrib/admindocs/locale/en_GB/LC_MESSAGES/django.mo,sha256=xKGbswq1kuWCbn4zCgUQUb58fEGlICIOr00oSdCgtU4,1821 +django/contrib/admindocs/locale/en_GB/LC_MESSAGES/django.po,sha256=No09XHkzYVFBgZqo7bPlJk6QD9heE0oaI3JmnrU_p24,4992 +django/contrib/admindocs/locale/eo/LC_MESSAGES/django.mo,sha256=114OOVg9hP0H0UU2aQngCm0wE7zEEAp7QFMupOuWCfQ,6071 +django/contrib/admindocs/locale/eo/LC_MESSAGES/django.po,sha256=h8P3lmvBaJ8J2xiytReJvI8iGK0gCe-LPK27kWxSNKI,6799 +django/contrib/admindocs/locale/es/LC_MESSAGES/django.mo,sha256=wVt9I5M6DGKZFhPhYuS2yKRGVzSROthx98TFiJvJA80,6682 +django/contrib/admindocs/locale/es/LC_MESSAGES/django.po,sha256=F72OFWbIZXvopNMzy7eIibNKc5EM0jsYgbN4PobD6tc,7602 +django/contrib/admindocs/locale/es_AR/LC_MESSAGES/django.mo,sha256=mZ7OKAmlj2_FOabKsEiWycxiKLSLCPFldponKNxINjs,6658 +django/contrib/admindocs/locale/es_AR/LC_MESSAGES/django.po,sha256=deaOq0YMCb1B1PHWYUbgUrQsyXFutn4wQ2BAXiyzugA,7257 +django/contrib/admindocs/locale/es_CO/LC_MESSAGES/django.mo,sha256=KFjQyWtSxH_kTdSJ-kNUDAFt3qVZI_3Tlpg2pdkvJfs,6476 +django/contrib/admindocs/locale/es_CO/LC_MESSAGES/django.po,sha256=dwrTVjYmueLiVPu2yiJ_fkFF8ZeRntABoVND5H2WIRI,7038 +django/contrib/admindocs/locale/es_MX/LC_MESSAGES/django.mo,sha256=3hZiFFVO8J9cC624LUt4lBweqmpgdksRtvt2TLq5Jqs,1853 +django/contrib/admindocs/locale/es_MX/LC_MESSAGES/django.po,sha256=gNmx1QTbmyMxP3ftGXGWJH_sVGThiSe_VNKkd7M9jOY,5043 +django/contrib/admindocs/locale/es_VE/LC_MESSAGES/django.mo,sha256=sMwJ7t5GqPF496w-PvBYUneZ9uSwmi5jP-sWulhc6BM,6663 +django/contrib/admindocs/locale/es_VE/LC_MESSAGES/django.po,sha256=ZOcE0f95Q6uD9SelK6bQlKtS2c3JX9QxNYCihPdlM5o,7201 +django/contrib/admindocs/locale/et/LC_MESSAGES/django.mo,sha256=JQHVKehV0sxNaBQRqbsN-Of22CMV70bQ9TUId3QDudY,6381 +django/contrib/admindocs/locale/et/LC_MESSAGES/django.po,sha256=qrS3cPEy16hEi1857jvqsmr9zHF9_AkkJUw4mKimg98,7096 +django/contrib/admindocs/locale/eu/LC_MESSAGES/django.mo,sha256=WHgK7vGaqjO4MwjBkWz2Y3ABPXCqfnwSGelazRhOiuo,6479 +django/contrib/admindocs/locale/eu/LC_MESSAGES/django.po,sha256=718XgJN7UQcHgE9ku0VyFp7Frs-cvmCTO1o-xS5kpqc,7099 +django/contrib/admindocs/locale/fa/LC_MESSAGES/django.mo,sha256=Qrkrb_CHPGymnXBoBq5oeTs4W54R6nLz5hLIWH63EHM,7499 +django/contrib/admindocs/locale/fa/LC_MESSAGES/django.po,sha256=L-rxiKqUmlQgrPTLQRaS50woZWB9JuEamJpgDpLvIXw,8251 +django/contrib/admindocs/locale/fi/LC_MESSAGES/django.mo,sha256=SzuPvgeiaBwABvkJbOoTHsbP7juAuyyMWAjENr50gYk,6397 +django/contrib/admindocs/locale/fi/LC_MESSAGES/django.po,sha256=jn4ZMVQ_Gh6I-YLSmBhlyTn5ICP5o3oj7u0VKpV2hnI,6972 +django/contrib/admindocs/locale/fr/LC_MESSAGES/django.mo,sha256=dD92eLXIDeI-a_BrxX1G49qRwLS4Vt56bTP9cha5MeE,6755 +django/contrib/admindocs/locale/fr/LC_MESSAGES/django.po,sha256=hiUeHTul4Z3JWmkClGZmD5Xn4a1Tj1A5OLRfKU5Zdmo,7329 +django/contrib/admindocs/locale/fy/LC_MESSAGES/django.mo,sha256=_xVO-FkPPoTla_R0CzktpRuafD9fuIP_G5N-Q08PxNg,476 +django/contrib/admindocs/locale/fy/LC_MESSAGES/django.po,sha256=b3CRH9bSUl_jjb9s51RlvFXp3bmsmuxTfN_MTmIIVNA,5060 +django/contrib/admindocs/locale/ga/LC_MESSAGES/django.mo,sha256=2kOgyNWHQaNq-cwsh5YmmqWa8z9WN7HHUEEW85hek4A,6786 +django/contrib/admindocs/locale/ga/LC_MESSAGES/django.po,sha256=PEuuqMz1-aW96Lcy72PsVormIrN522Qd6RxSM1VVMTk,7424 +django/contrib/admindocs/locale/gd/LC_MESSAGES/django.mo,sha256=k5-Ov9BkwYHZ_IvIxQdHKVBdOUN7kWGft1l7w5Scd5o,6941 +django/contrib/admindocs/locale/gd/LC_MESSAGES/django.po,sha256=FyvfRNkSrEZo8x1didB6nFHYD54lZfKSoAGcwJ2wLso,7478 +django/contrib/admindocs/locale/gl/LC_MESSAGES/django.mo,sha256=15OYKk17Dlz74RReFrCHP3eHmaxP8VeRE2ylDOeUY8w,6564 +django/contrib/admindocs/locale/gl/LC_MESSAGES/django.po,sha256=mvQmxR4LwDLbCWyIU-xmJEw6oeSY3KFWC1nqnbnuDyc,7197 +django/contrib/admindocs/locale/he/LC_MESSAGES/django.mo,sha256=1_aXtUXx-NISzJmlfprUZ5LieD9BwCcCUQ-DQ_YF-jk,6998 +django/contrib/admindocs/locale/he/LC_MESSAGES/django.po,sha256=aONIl7C_5hgo0agjYleyZAkj4_VPkQVPT0R7wWPhJEs,7589 +django/contrib/admindocs/locale/hi/LC_MESSAGES/django.mo,sha256=sZhObIxqrmFu5Y-ZOQC0JGM3ly4IVFr02yqOOOHnDag,2297 +django/contrib/admindocs/locale/hi/LC_MESSAGES/django.po,sha256=X6UfEc6q0BeaxVP_C4priFt8irhh-YGOUUzNQyVnEYY,5506 +django/contrib/admindocs/locale/hr/LC_MESSAGES/django.mo,sha256=fMsayjODNoCdbpBAk9GHtIUaGJGFz4sD9qYrguj-BQA,2550 +django/contrib/admindocs/locale/hr/LC_MESSAGES/django.po,sha256=qi2IB-fBkGovlEz2JAQRUNE54MDdf5gjNJWXM-dIG1s,5403 +django/contrib/admindocs/locale/hsb/LC_MESSAGES/django.mo,sha256=4CbZ95VHJUg3UNt-FdzPtUtHJLralgnhadz-evigiFA,6770 +django/contrib/admindocs/locale/hsb/LC_MESSAGES/django.po,sha256=ty8zWmqY160ZpSbt1-_2iY2M4RIL7ksh5-ggQGc_TO8,7298 +django/contrib/admindocs/locale/hu/LC_MESSAGES/django.mo,sha256=ATEt9wE2VNQO_NMcwepgxpS7mYXdVD5OySFFPWpnBUA,6634 +django/contrib/admindocs/locale/hu/LC_MESSAGES/django.po,sha256=3XKQrlonyLXXpU8xeS1OLXcKmmE2hiBoMJN-QZ3k82g,7270 +django/contrib/admindocs/locale/ia/LC_MESSAGES/django.mo,sha256=KklX2loobVtA6PqHOZHwF1_A9YeVGlqORinHW09iupI,1860 +django/contrib/admindocs/locale/ia/LC_MESSAGES/django.po,sha256=Z7btOCeARREgdH4CIJlVob_f89r2M9j55IDtTLtgWJU,5028 +django/contrib/admindocs/locale/id/LC_MESSAGES/django.mo,sha256=2HZrdwFeJV4Xk2HIKsxp_rDyBrmxCuRb92HtFtW8MxE,6343 +django/contrib/admindocs/locale/id/LC_MESSAGES/django.po,sha256=O01yt7iDXvEwkebUxUlk-vCrLR26ebuqI51x64uqFl4,7041 +django/contrib/admindocs/locale/io/LC_MESSAGES/django.mo,sha256=5t9Vurrh6hGqKohwsZIoveGeYCsUvRBRMz9M7k9XYY8,464 +django/contrib/admindocs/locale/io/LC_MESSAGES/django.po,sha256=SVZZEmaS1WbXFRlLLGg5bzUe09pXR23TeJtHUbhyl0w,5048 +django/contrib/admindocs/locale/is/LC_MESSAGES/django.mo,sha256=pEr-_MJi4D-WpNyFaQe3tVKVLq_9V-a4eIF18B3Qyko,1828 +django/contrib/admindocs/locale/is/LC_MESSAGES/django.po,sha256=-mD5fFnL6xUqeW4MITzm8Lvx6KXq4C9DGsEM9kDluZ8,5045 +django/contrib/admindocs/locale/it/LC_MESSAGES/django.mo,sha256=AzCkkJ8x-V38XSOdOG2kMSUujcn0mD8TIvdAeNT6Qcw,6453 +django/contrib/admindocs/locale/it/LC_MESSAGES/django.po,sha256=SUsGtCKkCVoj5jaM6z_-JQR8kv8W4Wv_OE26hpOb96s,7171 +django/contrib/admindocs/locale/ja/LC_MESSAGES/django.mo,sha256=KoPwCbH9VlKoP_7zTEjOzPsHZ7jVWl2grQRckQmshw4,7358 +django/contrib/admindocs/locale/ja/LC_MESSAGES/django.po,sha256=6ZTqM2qfBS_j5aLH52yJPYW4e4X5MqiQFdqV1fmEQGg,8047 +django/contrib/admindocs/locale/ka/LC_MESSAGES/django.mo,sha256=w2cHLI1O3pVt43H-h71cnNcjNNvDC8y9uMYxZ_XDBtg,4446 +django/contrib/admindocs/locale/ka/LC_MESSAGES/django.po,sha256=omKVSzNA3evF5Mk_Ud6utHql-Do7s9xDzCVQGQA0pSg,6800 +django/contrib/admindocs/locale/kab/LC_MESSAGES/django.mo,sha256=XTuWnZOdXhCFXEW4Hp0zFtUtAF0wJHaFpQqoDUTWYGw,1289 +django/contrib/admindocs/locale/kab/LC_MESSAGES/django.po,sha256=lQWewMZncWUvGhpkgU_rtwWHcgAyvhIkrDfjFu1l-d8,4716 +django/contrib/admindocs/locale/kk/LC_MESSAGES/django.mo,sha256=mmhLzn9lo4ff_LmlIW3zZuhE77LoSUfpaMMMi3oyi38,1587 +django/contrib/admindocs/locale/kk/LC_MESSAGES/django.po,sha256=72sxLw-QDSFnsH8kuzeQcV5jx7Hf1xisBmxI8XqSCYw,5090 +django/contrib/admindocs/locale/km/LC_MESSAGES/django.mo,sha256=Fff1K0qzialXE_tLiGM_iO5kh8eAmQhPZ0h-eB9iNOU,1476 +django/contrib/admindocs/locale/km/LC_MESSAGES/django.po,sha256=E_CaaYc4GqOPgPh2t7iuo0Uf4HSQQFWAoxSOCG-uEGU,4998 +django/contrib/admindocs/locale/kn/LC_MESSAGES/django.mo,sha256=lisxE1zzW-Spdm7hIzXxDAfS7bM-RdrAG_mQVwz9WMU,1656 +django/contrib/admindocs/locale/kn/LC_MESSAGES/django.po,sha256=u6JnB-mYoYWvLl-2pzKNfeNlT1s6A2I3lRi947R_0yA,5184 +django/contrib/admindocs/locale/ko/LC_MESSAGES/django.mo,sha256=nVBVLfXUlGQCeF2foSQ2kksBmR3KbweXdbD6Kyq-PrU,6563 +django/contrib/admindocs/locale/ko/LC_MESSAGES/django.po,sha256=y2YjuXM3p0haXrGpxRtm6I84o75TQaMeT4xbHCg7zOM,7342 +django/contrib/admindocs/locale/ky/LC_MESSAGES/django.mo,sha256=HEJo4CLoIOWpK-MPcTqLhbNMA8Mt3totYN1YbJ_SNn4,7977 +django/contrib/admindocs/locale/ky/LC_MESSAGES/django.po,sha256=VaSXjz8Qlr2EI8f12gtziN7yA7IWsaVoEzL3G6dERXs,8553 +django/contrib/admindocs/locale/lb/LC_MESSAGES/django.mo,sha256=N0hKFuAdDIq5clRKZirGh4_YDLsxi1PSX3DVe_CZe4k,474 +django/contrib/admindocs/locale/lb/LC_MESSAGES/django.po,sha256=B46-wRHMKUMcbvMCdojOCxqIVL5qVEh4Czo20Qgz6oU,5058 +django/contrib/admindocs/locale/lt/LC_MESSAGES/django.mo,sha256=KOnpaVeomKJIHcVLrkeRVnaqQHzFdYM_wXZbbqxWs4g,6741 +django/contrib/admindocs/locale/lt/LC_MESSAGES/django.po,sha256=-uzCS8193VCZPyhO8VOi11HijtBG9CWVKStFBZSXfI4,7444 +django/contrib/admindocs/locale/lv/LC_MESSAGES/django.mo,sha256=5PAE_peuqlRcc45pm6RsSqnBpG-o8OZpfdt2aasYM2w,6449 +django/contrib/admindocs/locale/lv/LC_MESSAGES/django.po,sha256=_mFvAQT1ZVBuDhnWgKY3bVQUWA8DoEf-HFAEsMfkGuU,7085 +django/contrib/admindocs/locale/mk/LC_MESSAGES/django.mo,sha256=8H9IpRASM7O2-Ql1doVgM9c4ybZ2KcfnJr12PpprgP4,8290 +django/contrib/admindocs/locale/mk/LC_MESSAGES/django.po,sha256=Uew7tEljjgmslgfYJOP9JF9ELp6NbhkZG_v50CZgBg8,8929 +django/contrib/admindocs/locale/ml/LC_MESSAGES/django.mo,sha256=bm4tYwcaT8XyPcEW1PNZUqHJIds9CAq3qX_T1-iD4k4,6865 +django/contrib/admindocs/locale/ml/LC_MESSAGES/django.po,sha256=yNINX5M7JMTbYnFqQGetKGIXqOjGJtbN2DmIW9BKQ_c,8811 +django/contrib/admindocs/locale/mn/LC_MESSAGES/django.mo,sha256=MyPphoXZCl6gPq74TyPBAvbc-aUQdUx5t3cdnj3vn_A,7108 +django/contrib/admindocs/locale/mn/LC_MESSAGES/django.po,sha256=h4GNr_G_lqLCiypMQNaw3ItF8RnHzdLhcrKs6vQVPfE,8058 +django/contrib/admindocs/locale/mr/LC_MESSAGES/django.mo,sha256=LDGC7YRyVBU50W-iH0MuESunlRXrNfNjwjXRCBdfFVg,468 +django/contrib/admindocs/locale/mr/LC_MESSAGES/django.po,sha256=5cUgPltXyS2Z0kIKF5ER8f5DuBhwmAINJQyfHj652d0,5052 +django/contrib/admindocs/locale/ms/LC_MESSAGES/django.mo,sha256=vgoSQlIQeFWaVfJv3YK9_0FOywWwxLhWGICKBdxcqJY,6557 +django/contrib/admindocs/locale/ms/LC_MESSAGES/django.po,sha256=Qy_NjgqwEwLGk4oaHB4Np3dVbPeCK2URdI73S73IZLE,7044 +django/contrib/admindocs/locale/my/LC_MESSAGES/django.mo,sha256=AsdUmou0FjCiML3QOeXMdbHiaSt2GdGMcEKRJFonLOQ,1721 +django/contrib/admindocs/locale/my/LC_MESSAGES/django.po,sha256=c75V-PprKrWzgrHbfrZOpm00U_zZRzxAUr2U_j8MF4w,5189 +django/contrib/admindocs/locale/nb/LC_MESSAGES/django.mo,sha256=qlzN0-deW2xekojbHi2w6mYKeBe1Cf1nm8Z5FVrmYtA,6308 +django/contrib/admindocs/locale/nb/LC_MESSAGES/django.po,sha256=a60vtwHJXhjbRAtUIlO0w3XfQcQ0ljwmwFG3WbQ7PNo,6875 +django/contrib/admindocs/locale/ne/LC_MESSAGES/django.mo,sha256=fWPAUZOX9qrDIxGhVVouJCVDWEQLybZ129wGYymuS-c,2571 +django/contrib/admindocs/locale/ne/LC_MESSAGES/django.po,sha256=wb8pCm141YfGSHVW84FnAvsKt5KnKvzNyzGcPr-Wots,5802 +django/contrib/admindocs/locale/nl/LC_MESSAGES/django.mo,sha256=1-s_SdVm3kci2yLQhv1q6kt7zF5EdbaneGAr6PJ7dQU,6498 +django/contrib/admindocs/locale/nl/LC_MESSAGES/django.po,sha256=7s4RysNYRSisywqqZOrRR0il530jRlbEFP3kr4Hq2PA,7277 +django/contrib/admindocs/locale/nn/LC_MESSAGES/django.mo,sha256=tIOU1WrHkAfxD6JBpdakiMi6pVzzvIg0jun6gii-D08,6299 +django/contrib/admindocs/locale/nn/LC_MESSAGES/django.po,sha256=oekYY3xjjM2sPnHv_ZXxAti1ySPF-HxLrvLLk7Izibk,6824 +django/contrib/admindocs/locale/os/LC_MESSAGES/django.mo,sha256=zSQBgSj4jSu5Km0itNgDtbkb1SbxzRvQeZ5M9sXHI8k,2044 +django/contrib/admindocs/locale/os/LC_MESSAGES/django.po,sha256=hZlMmmqfbGmoiElGbJg7Fp791ZuOpRFrSu09xBXt6z4,5215 +django/contrib/admindocs/locale/pa/LC_MESSAGES/django.mo,sha256=yFeO0eZIksXeDhAl3CrnkL1CF7PHz1PII2kIxGA0opQ,1275 +django/contrib/admindocs/locale/pa/LC_MESSAGES/django.po,sha256=DA5LFFLOXHIJIqrrnj9k_rqL-wr63RYX_i-IJFhBuc0,4900 +django/contrib/admindocs/locale/pl/LC_MESSAGES/django.mo,sha256=DHxRNP6YK8qocDqSd2DZg7n-wPp2hJSbjNBLFti7U8o,6633 +django/contrib/admindocs/locale/pl/LC_MESSAGES/django.po,sha256=mRjleE2-9r9TfseHWeyjvRwzBZP_t2LMvihq8n_baU8,7575 +django/contrib/admindocs/locale/pt/LC_MESSAGES/django.mo,sha256=WcXhSlbGdJgVMvydkPYYee7iOQ9SYdrLkquzgIBhVWU,6566 +django/contrib/admindocs/locale/pt/LC_MESSAGES/django.po,sha256=J98Hxa-ApyzRevBwcAldK9bRYbkn5DFw3Z5P7SMEwx0,7191 +django/contrib/admindocs/locale/pt_BR/LC_MESSAGES/django.mo,sha256=L8t589rbg4vs4HArLpgburmMufZ6BTuwxxkv1QUetBA,6590 +django/contrib/admindocs/locale/pt_BR/LC_MESSAGES/django.po,sha256=EG4xELZ8emUIWB78cw8gFeiqTiN9UdAuEaXHyPyNtIE,7538 +django/contrib/admindocs/locale/ro/LC_MESSAGES/django.mo,sha256=9K8Sapn6sOg1wtt2mxn7u0cnqPjEHH70qjwM-XMPzNA,6755 +django/contrib/admindocs/locale/ro/LC_MESSAGES/django.po,sha256=b4AsPjWBYHQeThAtLP_TH4pJitwidtoPNkJ7dowUuRg,7476 +django/contrib/admindocs/locale/ru/LC_MESSAGES/django.mo,sha256=9pIPv2D0rq29vrBNWZENM_SOdNpaPidxmgT20hWtBis,8434 +django/contrib/admindocs/locale/ru/LC_MESSAGES/django.po,sha256=BTlxkS4C0DdfC9QJCegXwi5ejfG9pMsAdfy6UJzec3s,9175 +django/contrib/admindocs/locale/sk/LC_MESSAGES/django.mo,sha256=QR3Yvh6y6qJLr4umB0_HcVRIrqD-o1z3rnDv38hLkCQ,6670 +django/contrib/admindocs/locale/sk/LC_MESSAGES/django.po,sha256=QPTSNtN-7QBUX7G7d67zs5kPHS3tXoi7WCy_y1nhPfQ,7375 +django/contrib/admindocs/locale/sl/LC_MESSAGES/django.mo,sha256=FMg_s9ZpeRD42OsSF9bpe8pRQ7wP7-a9WWnaVliqXpU,6508 +django/contrib/admindocs/locale/sl/LC_MESSAGES/django.po,sha256=JWO_WZAwBpXw-4FoB7rkWXGhi9aEVq1tH2fOC69rcgg,7105 +django/contrib/admindocs/locale/sq/LC_MESSAGES/django.mo,sha256=XvNDzCc3-Hh5Pz7SHhG8zCT_3dtqGzBLkDqhim4jJpc,6551 +django/contrib/admindocs/locale/sq/LC_MESSAGES/django.po,sha256=0GZvLpxbuYln7GrTsFyzgjIleSw6Z9IRSPgAWWdx6Eo,7165 +django/contrib/admindocs/locale/sr/LC_MESSAGES/django.mo,sha256=wQbXQFTFYjeJvUQ4twmF_O2SYkYkigJ1LQj8xdC5Yu4,8154 +django/contrib/admindocs/locale/sr/LC_MESSAGES/django.po,sha256=KT72y37njw6vgAfXOoY41w_Myv5yrzFC1BQVAd_V79s,8778 +django/contrib/admindocs/locale/sr_Latn/LC_MESSAGES/django.mo,sha256=3ytn9SeRgnbIC8YjYTcgdNKgNrizzDwwmLQhVwjvNCY,6542 +django/contrib/admindocs/locale/sr_Latn/LC_MESSAGES/django.po,sha256=2ojglF82ZPFxdnlICYkwkN_EOLli8QRSCPTbILxug9g,13364 +django/contrib/admindocs/locale/sv/LC_MESSAGES/django.mo,sha256=5i9qxo9V7TghSIpKCOw5PpITYYHMP-0NhFivwc-w0yw,6394 +django/contrib/admindocs/locale/sv/LC_MESSAGES/django.po,sha256=WhABV5B-rhBly6ueJPOMsIBjSiw7i1yCZUQsXWE_jV4,7137 +django/contrib/admindocs/locale/sw/LC_MESSAGES/django.mo,sha256=pyJfGL7UdPrJAVlCB3YimXxTjTfEkoZQWX-CSpDkcWc,1808 +django/contrib/admindocs/locale/sw/LC_MESSAGES/django.po,sha256=SIywrLX1UGx4OiPxoxUYelmQ1YaY2LMa3dxynGQpHp8,4929 +django/contrib/admindocs/locale/ta/LC_MESSAGES/django.mo,sha256=8SjQ9eGGyaZGhkuDoZTdtYKuqcVyEtWrJuSabvNRUVM,1675 +django/contrib/admindocs/locale/ta/LC_MESSAGES/django.po,sha256=k593yzVqpSQOsdpuF-rdsSLwKQU8S_QFMRpZXww__1A,5194 +django/contrib/admindocs/locale/te/LC_MESSAGES/django.mo,sha256=eAzNpYRy_G1erCcKDAMnJC4809ITRHvJjO3vpyAC_mk,1684 +django/contrib/admindocs/locale/te/LC_MESSAGES/django.po,sha256=oDg_J8JxepFKIe5m6lDKVC4YWQ_gDLibgNyQ3508VOM,5204 +django/contrib/admindocs/locale/tg/LC_MESSAGES/django.mo,sha256=jSMmwS6F_ChDAZDyTZxRa3YuxkXWlO-M16osP2NLRc0,7731 +django/contrib/admindocs/locale/tg/LC_MESSAGES/django.po,sha256=mewOHgRsFydk0d5IY3jy3rOWa6uHdatlSIvFNZFONsc,8441 +django/contrib/admindocs/locale/th/LC_MESSAGES/django.mo,sha256=bHK49r45Q1nX4qv0a0jtDja9swKbDHHJVLa3gM13Cb4,2167 +django/contrib/admindocs/locale/th/LC_MESSAGES/django.po,sha256=_GMgPrD8Zs0lPKQOMlBmVu1I59yXSV42kfkrHzeiehY,5372 +django/contrib/admindocs/locale/tr/LC_MESSAGES/django.mo,sha256=L1iBsNGqqfdNkZZmvnnBB-HxogAgngwhanY1FYefveE,6661 +django/contrib/admindocs/locale/tr/LC_MESSAGES/django.po,sha256=D4vmznsY4icyKLXQUgAL4WZL5TOUZYVUSCJ4cvZuFg8,7311 +django/contrib/admindocs/locale/tt/LC_MESSAGES/django.mo,sha256=pQmAQOPbrBVzBqtoQ0dsFWFwC6LxA5mQZ9QPqL6pSFw,1869 +django/contrib/admindocs/locale/tt/LC_MESSAGES/django.po,sha256=NCLv7sSwvEficUOSoMJlHGqjgjYvrvm2V3j1Gkviw80,5181 +django/contrib/admindocs/locale/udm/LC_MESSAGES/django.mo,sha256=hwDLYgadsKrQEPi9HiuMWF6jiiYUSy4y-7PVNJMaNpY,618 +django/contrib/admindocs/locale/udm/LC_MESSAGES/django.po,sha256=29fpfn4p8KxxrBdg4QB0GW_l8genZVV0kYi50zO-qKs,5099 +django/contrib/admindocs/locale/ug/LC_MESSAGES/django.mo,sha256=OIyPz5i48Ab2CVmCe71agW8qMsYMTwTG2E7rJft7P5k,7867 +django/contrib/admindocs/locale/ug/LC_MESSAGES/django.po,sha256=GM6ypRwZ6d6VXM0XVvg9p_334pxhex1yd5-HS8Z1z9U,8380 +django/contrib/admindocs/locale/uk/LC_MESSAGES/django.mo,sha256=G-3yCDj2jK7ZTu80YXGJ_ZR1E7FejbLxTFe866G4Pr0,8468 +django/contrib/admindocs/locale/uk/LC_MESSAGES/django.po,sha256=bbWzP-gpbslzbTBc_AO7WBNmtr3CkLOwkSJHI0Z_dTA,9330 +django/contrib/admindocs/locale/ur/LC_MESSAGES/django.mo,sha256=VNg9o_7M0Z2LC0n3_-iwF3zYmncRJHaFqqpxuPmMq84,1836 +django/contrib/admindocs/locale/ur/LC_MESSAGES/django.po,sha256=QTg85c4Z13hMN_PnhjaLX3wx6TU4SH4hPTzNBfNVaMU,5148 +django/contrib/admindocs/locale/vi/LC_MESSAGES/django.mo,sha256=F6dyo00yeyUND_w1Ocm9SL_MUdXb60QQpmAQPto53IU,1306 +django/contrib/admindocs/locale/vi/LC_MESSAGES/django.po,sha256=JrVKjT848Y1cS4tpH-eRivFNwM-cUs886UEhY2FkTPw,4836 +django/contrib/admindocs/locale/zh_Hans/LC_MESSAGES/django.mo,sha256=ngPlxN85wGOMKoo3OK3wUQeikoaxPKqAIsgw2_0ovN4,6075 +django/contrib/admindocs/locale/zh_Hans/LC_MESSAGES/django.po,sha256=TNdJGJCAi0OijBN6w23SwKieZqNqkgNt2qdlPfY-r20,6823 +django/contrib/admindocs/locale/zh_Hant/LC_MESSAGES/django.mo,sha256=Tx2MdoDy5aGjAGnDhYrV6mHN-inyqa3mA2zDAYPsQc4,6016 +django/contrib/admindocs/locale/zh_Hant/LC_MESSAGES/django.po,sha256=vhYxKhDRm6BkUKkLFetq1zDZ1-08Xe1xVnbUD0ABQuc,6734 +django/contrib/admindocs/middleware.py,sha256=owqLbigBtxKmhPQmz767KOAkN3nKRIJrwZAUuHRIAQM,1329 +django/contrib/admindocs/templates/admin_doc/bookmarklets.html,sha256=fSQP3eErm6R8yD7c8-KVilViI0vww6dqwkLwaAjgCaY,1282 +django/contrib/admindocs/templates/admin_doc/index.html,sha256=6bmIkahIH8CWMhGEytTHUZ7DtrDmcqhomJe48KbzvZY,1369 +django/contrib/admindocs/templates/admin_doc/missing_docutils.html,sha256=sx3z874_SIWPjKndIzfwYl8bQzEpTYMckA11RFFbqRI,788 +django/contrib/admindocs/templates/admin_doc/model_detail.html,sha256=DM5mTGfs1lEKlclSKMldLDsOoyrqRavqkR57hNM-cKE,1922 +django/contrib/admindocs/templates/admin_doc/model_index.html,sha256=sgwiE4Xxz7kcbk_UhHxgxLXyBh8SMHgHHvBucby3pPc,1358 +django/contrib/admindocs/templates/admin_doc/template_detail.html,sha256=sApk1HNa-n41lMIxRZHGoft9S4PvYedDPTtvHWuSsSc,1035 +django/contrib/admindocs/templates/admin_doc/template_filter_index.html,sha256=U2HBVHXtgCqUp9hLuOMVqCxBbXyYMMgAORG8fziN7uc,1775 +django/contrib/admindocs/templates/admin_doc/template_tag_index.html,sha256=S4U-G05yi1YIlFEv-HG20bDiq4rhdiZCgebhVBzNzdY,1731 +django/contrib/admindocs/templates/admin_doc/view_detail.html,sha256=XmsemLe45BpHDKAroqH7dwlmI9npVu2DZGzELA7trgs,914 +django/contrib/admindocs/templates/admin_doc/view_index.html,sha256=ZLfmxMkVlPYETRFnjLmU3bagve4ZvY1Xzsya1Lntgkw,1734 +django/contrib/admindocs/urls.py,sha256=spPSD6wc_B9eABF4mEWIhPSZ3w6W4fM6ERGepo8NRtY,1309 +django/contrib/admindocs/utils.py,sha256=38lwFUI08_m5OK6d-EUzp90qxysM9Da7lAn-rwcSnwI,7554 +django/contrib/admindocs/views.py,sha256=wziiyS5ZKAt2iLnhlBtzQbHheq4zmJqBl7B0YCoSAS8,18858 +django/contrib/auth/__init__.py,sha256=gq2Ba2T4Z5S7-_Vbo_7GVZ6CZAqawLbuUAMB4y4emgk,9587 +django/contrib/auth/__pycache__/__init__.cpython-312.pyc,, +django/contrib/auth/__pycache__/admin.cpython-312.pyc,, +django/contrib/auth/__pycache__/apps.cpython-312.pyc,, +django/contrib/auth/__pycache__/backends.cpython-312.pyc,, +django/contrib/auth/__pycache__/base_user.cpython-312.pyc,, +django/contrib/auth/__pycache__/checks.cpython-312.pyc,, +django/contrib/auth/__pycache__/context_processors.cpython-312.pyc,, +django/contrib/auth/__pycache__/decorators.cpython-312.pyc,, +django/contrib/auth/__pycache__/forms.cpython-312.pyc,, +django/contrib/auth/__pycache__/hashers.cpython-312.pyc,, +django/contrib/auth/__pycache__/middleware.cpython-312.pyc,, +django/contrib/auth/__pycache__/mixins.cpython-312.pyc,, +django/contrib/auth/__pycache__/models.cpython-312.pyc,, +django/contrib/auth/__pycache__/password_validation.cpython-312.pyc,, +django/contrib/auth/__pycache__/signals.cpython-312.pyc,, +django/contrib/auth/__pycache__/tokens.cpython-312.pyc,, +django/contrib/auth/__pycache__/urls.cpython-312.pyc,, +django/contrib/auth/__pycache__/validators.cpython-312.pyc,, +django/contrib/auth/__pycache__/views.cpython-312.pyc,, +django/contrib/auth/admin.py,sha256=gFrEFlXoSPb276iNUcg73lr2oeTFjAj4bxE43JHWVak,10243 +django/contrib/auth/apps.py,sha256=qpjjFdMH0H3-ialZrRYQ5fnmfCuSh0RiD3bsKzzTEeY,1284 +django/contrib/auth/backends.py,sha256=CimJyPjL4y1hth8WLKg87kJE7WqZYrNRKIZ8qfeaDIM,8535 +django/contrib/auth/base_user.py,sha256=4rB47WSGO4S_W21Tva3JGRq_FYj_cel0Qqqeu5913P0,4919 +django/contrib/auth/checks.py,sha256=yXWvy6kUyj4WfDlkDBtybwEFKuqvNhT9rqHj4FCdTlA,9847 +django/contrib/auth/common-passwords.txt.gz,sha256=MrUGEpphkJZUW9O7s1yYu5g7PnYWd48T5BWySr3CO-c,82262 +django/contrib/auth/context_processors.py,sha256=8BbvdbTVPl8GVgB5-2LTzx6FrGsMzev-E7JMnUgr-rM,1911 +django/contrib/auth/decorators.py,sha256=thqEdZgHN6Sez-O9ki7hUaP839w0QGbpOftxnedTrnk,4800 +django/contrib/auth/forms.py,sha256=L05inb4uSHgqCxneQkLluwhDeCOd3EwGDlTH2s9su7w,20635 +django/contrib/auth/handlers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/contrib/auth/handlers/__pycache__/__init__.cpython-312.pyc,, +django/contrib/auth/handlers/__pycache__/modwsgi.cpython-312.pyc,, +django/contrib/auth/handlers/modwsgi.py,sha256=bTXKVMezywsn1KA2MVyDWeHvTNa2KrwIxn2olH7o_5I,1248 +django/contrib/auth/hashers.py,sha256=6P2FN1q8DIJfO1yiGRVlI3WmrgXh6dYmrpvCoZ6E85s,23332 +django/contrib/auth/locale/af/LC_MESSAGES/django.mo,sha256=mVOEfY5dw97Eo1JuCOonKhU1p2Sfhi5QCPkvm_ExbOQ,7514 +django/contrib/auth/locale/af/LC_MESSAGES/django.po,sha256=twHhtsP_x0xV_NbCaTUqF4mBzODjmdjkrawlmn1qwbQ,7739 +django/contrib/auth/locale/ar/LC_MESSAGES/django.mo,sha256=7LhxFfL9y6RAfZ8PU-1lKI2V02LbHxXtB1UAf_vXpuc,10040 +django/contrib/auth/locale/ar/LC_MESSAGES/django.po,sha256=2QIaioY0RedAB0CFKVZLhGoCnhLzgUh84sAR7i6QUnQ,10520 +django/contrib/auth/locale/ar_DZ/LC_MESSAGES/django.mo,sha256=0UokSPc3WDs_0PozSalfBaq4JFYgF1Rt7b90CKvY5jE,10228 +django/contrib/auth/locale/ar_DZ/LC_MESSAGES/django.po,sha256=GDvm2m1U7NOY5l7FijKGR77DEZt6rYWoSPCxsY5BZ3Y,10574 +django/contrib/auth/locale/ast/LC_MESSAGES/django.mo,sha256=Pt3gYY3j8Eroo4lAEmf-LR6u9U56mpE3vqLhjR4Uq-o,2250 +django/contrib/auth/locale/ast/LC_MESSAGES/django.po,sha256=Kiq4s8d1HnYpo3DQGlgUl3bOkxmgGW8CvGp9AbryRk8,5440 +django/contrib/auth/locale/az/LC_MESSAGES/django.mo,sha256=lSvutBofai-DGk-5quHnAtUdvm8yMDODXE0mHRdXXG8,8758 +django/contrib/auth/locale/az/LC_MESSAGES/django.po,sha256=SCEXf1r7q8P0dXOM36RUM_vlxKzApsfHiN8U-IMUR_Q,9134 +django/contrib/auth/locale/be/LC_MESSAGES/django.mo,sha256=GiAmNOuVSc5mQ9ne8BGNz1BeK2WLZQPzIHTZsJZP6As,11469 +django/contrib/auth/locale/be/LC_MESSAGES/django.po,sha256=shpzgVhb1UC2uoq1IhlYRqm_b_YfGLXqdO-8pZVPBX0,11784 +django/contrib/auth/locale/bg/LC_MESSAGES/django.mo,sha256=qChURIcNm50ePM5nO-Rh44LO-f8ww7lUro0GQRXE_wY,10717 +django/contrib/auth/locale/bg/LC_MESSAGES/django.po,sha256=9Uo19-kzj6jTyvKGyWFk4KdqbXwZOvX4rucEJXRJFGE,11221 +django/contrib/auth/locale/bn/LC_MESSAGES/django.mo,sha256=cJSawQn3rNh2I57zK9vRi0r1xc598Wr26AyHh6D50ZQ,5455 +django/contrib/auth/locale/bn/LC_MESSAGES/django.po,sha256=5Vqd4n9ab98IMev4GHLxpO7f4r9nnhC3Nfx27HQNd8s,7671 +django/contrib/auth/locale/br/LC_MESSAGES/django.mo,sha256=nxLj88BBhT3Hudev1S_BRC8P6Jv7eoR8b6CHGt5eoPo,1436 +django/contrib/auth/locale/br/LC_MESSAGES/django.po,sha256=rFo68wfXMyju633KCAhg0Jcb3GVm3rk4opFQqI89d6Y,5433 +django/contrib/auth/locale/bs/LC_MESSAGES/django.mo,sha256=jDjP1qIs02k6RixY9xy3V7Cr6zi-henR8nDnhqNG18s,3146 +django/contrib/auth/locale/bs/LC_MESSAGES/django.po,sha256=NOICHHU8eFtltH0OBlnasz9TF0uZGZd3hMibRmn158E,5975 +django/contrib/auth/locale/ca/LC_MESSAGES/django.mo,sha256=lqiOLv_LZDLeXbJZYsrWRHzcnwd1vd00tW5Jrh-HHkY,7643 +django/contrib/auth/locale/ca/LC_MESSAGES/django.po,sha256=v-3t7bDTh1835nZnjYh3_HyN4yw4a1HyHpC3-jX79Z0,8216 +django/contrib/auth/locale/ckb/LC_MESSAGES/django.mo,sha256=JCxL4vCR76rQywGn0bbhs0DGltbj-DOF_GTjcWuk2n8,11066 +django/contrib/auth/locale/ckb/LC_MESSAGES/django.po,sha256=SdmYPkVor_sWdOnLkyclkaR52N1IiXUP-0i7xjZs2hk,11254 +django/contrib/auth/locale/cs/LC_MESSAGES/django.mo,sha256=BXWVPB6GeisxXPEq8Pn8wBw9ByZIW-JQAPomzzzx3vo,8888 +django/contrib/auth/locale/cs/LC_MESSAGES/django.po,sha256=Of36j3TXudwYp8to5RpuAoi-_zLcGHIRNkxcDG91AqA,9367 +django/contrib/auth/locale/cy/LC_MESSAGES/django.mo,sha256=lSfCwEVteW4PDaiGKPDxnSnlDUcGMkPfsxIluExZar0,4338 +django/contrib/auth/locale/cy/LC_MESSAGES/django.po,sha256=-LPAKGXNzB77lVHfCRmFlH3SUaLgOXk_YxfC0BomcEs,6353 +django/contrib/auth/locale/da/LC_MESSAGES/django.mo,sha256=VhiC9Xb7XETvGMN3aSnLOE2-VKMKrU3d_WMXjPrgAaE,8509 +django/contrib/auth/locale/da/LC_MESSAGES/django.po,sha256=AKKwK0cjG4SuQh5Rc1LU0b_rZnboXLHgvPreJv1NEVA,8979 +django/contrib/auth/locale/de/LC_MESSAGES/django.mo,sha256=nvwrbU-uvQonGW_UD5zVh7u70csi_5qCehsI-AlTRx4,7607 +django/contrib/auth/locale/de/LC_MESSAGES/django.po,sha256=MJGIuwfkwEs9oiktL4C2uB0XXG6gh2zCI_jr-DcH5Tk,8158 +django/contrib/auth/locale/dsb/LC_MESSAGES/django.mo,sha256=ogesq9DJTHrKXQu4r9oa0CDo7L3WBZLZOG9aXwX7-JQ,9303 +django/contrib/auth/locale/dsb/LC_MESSAGES/django.po,sha256=CmrZ132Xd77O05fxgwqfECh7Za73uHnjoh6z_0U-TBs,9598 +django/contrib/auth/locale/el/LC_MESSAGES/django.mo,sha256=KaP9RLYThwYWLBx0W90HI0zJZ09iNhZ3tk8UVF63n74,10072 +django/contrib/auth/locale/el/LC_MESSAGES/django.po,sha256=O5JsNCUNr1YcNNqMugoM5epN6nC5pgq3E6nKXDh3OY0,10795 +django/contrib/auth/locale/en/LC_MESSAGES/django.mo,sha256=U0OV81NfbuNL9ctF-gbGUG5al1StqN-daB-F-gFBFC8,356 +django/contrib/auth/locale/en/LC_MESSAGES/django.po,sha256=I3S-zHG_0-rk6CP7Qfv3wPX7U8zJCXfC6yGI_EeYAbY,9064 +django/contrib/auth/locale/en_AU/LC_MESSAGES/django.mo,sha256=7cPKOZX0ZmWCYU2ZwgCp8LwXj7FAdP3lMoI2u4nzgeU,7183 +django/contrib/auth/locale/en_AU/LC_MESSAGES/django.po,sha256=92Q42wfwKhGxDkomv8JlGBHVUdFIc_wvm_LUNBc9Q1k,7467 +django/contrib/auth/locale/en_GB/LC_MESSAGES/django.mo,sha256=p57gDaYVvgEk1x80Hq4Pn2SZbsp9ly3XrJ5Ttlt2yOE,3179 +django/contrib/auth/locale/en_GB/LC_MESSAGES/django.po,sha256=-yDflw5-81VOlyqkmLJN17FRuwDrhYXItFUJwx2aqpE,5787 +django/contrib/auth/locale/eo/LC_MESSAGES/django.mo,sha256=OCEu7qwKb20Cq2UO-dmHjNPXRfDTsQHp9DbyVXCxNMw,7421 +django/contrib/auth/locale/eo/LC_MESSAGES/django.po,sha256=wrvLqKIJycioUFAI7GkCRtDNZ9_OigG_Bf79Dmgpa7c,7868 +django/contrib/auth/locale/es/LC_MESSAGES/django.mo,sha256=c5Z43RTCGGNTYbYlkgLPLM669k5DfWGrqHWDhnB7Dy0,9100 +django/contrib/auth/locale/es/LC_MESSAGES/django.po,sha256=NbzqLfTGlDAQKs-_xBUijLliYyb9FgRA5z4wFnPuo94,9928 +django/contrib/auth/locale/es_AR/LC_MESSAGES/django.mo,sha256=1XY-cVhbpIxWOo3biI56d24QRRJEThPekbzeoz8qcw4,9235 +django/contrib/auth/locale/es_AR/LC_MESSAGES/django.po,sha256=g3YqB09gDHqvCyYhJlErpoOEpPpPzKkIVM_65PaJRWM,9490 +django/contrib/auth/locale/es_CO/LC_MESSAGES/django.mo,sha256=K5VaKTyeV_WoKsLR1x8ZG4VQmk3azj6ZM8Phqjs81So,6529 +django/contrib/auth/locale/es_CO/LC_MESSAGES/django.po,sha256=qJywTaYi7TmeMB1sjwsiwG8GXtxAOaOX0voj7lLVZRw,7703 +django/contrib/auth/locale/es_MX/LC_MESSAGES/django.mo,sha256=dCav1yN5q3bU4PvXZd_NxHQ8cZ9KqQCiNoe4Xi8seoY,7822 +django/contrib/auth/locale/es_MX/LC_MESSAGES/django.po,sha256=_4un21ALfFsFaqpLrkE2_I18iEfJlcAnd_X8YChfdWo,8210 +django/contrib/auth/locale/es_VE/LC_MESSAGES/django.mo,sha256=GwpZytNHtK7Y9dqQKDiVi4SfA1AtPlk824_k7awqrdI,7415 +django/contrib/auth/locale/es_VE/LC_MESSAGES/django.po,sha256=G3mSCo_XGRUfOAKUeP_UNfWVzDPpbQrVYQt8Hv3VZVM,7824 +django/contrib/auth/locale/et/LC_MESSAGES/django.mo,sha256=AeyT2OxqMVsE2qoQz_Q5GTdIIToKgkidn4KA3sTe66s,7216 +django/contrib/auth/locale/et/LC_MESSAGES/django.po,sha256=c9lhLx55iLurFJPybQyEqadVE2hfL_nIpDYazHAkkk4,8370 +django/contrib/auth/locale/eu/LC_MESSAGES/django.mo,sha256=aQfIMZ8FRzP-6OpZCpC2qrd4wbyWiapJOVIWlmyqde0,7181 +django/contrib/auth/locale/eu/LC_MESSAGES/django.po,sha256=AP53NIzFy-aCLnLds70LMg-XW7F_95VSD1ZWCedgkTI,7732 +django/contrib/auth/locale/fa/LC_MESSAGES/django.mo,sha256=yeA_5LAPu7OyQssunvUNlH07bPVCyGLpnvijNenrtHQ,8979 +django/contrib/auth/locale/fa/LC_MESSAGES/django.po,sha256=NChJSgpkXrwAiTrCJzvwlm9mh-LFSD1rR1ESdRQD43o,9513 +django/contrib/auth/locale/fi/LC_MESSAGES/django.mo,sha256=fH_rcYkl9L2dK1G3MjVETXAHunCPhsXQYMTbDcNe-00,7537 +django/contrib/auth/locale/fi/LC_MESSAGES/django.po,sha256=PVwyNBaToxjyHkxy4t4L-kULjJslTe94coSxWNseyn4,7892 +django/contrib/auth/locale/fr/LC_MESSAGES/django.mo,sha256=DUeXSFpP4KknfmgTVyNjdrtAfFGPgvOhcBhdDtvDKcg,9536 +django/contrib/auth/locale/fr/LC_MESSAGES/django.po,sha256=PAV72caHdYNROMLx64MaXJ5u8Tc-s5Vfg0ui0eVlJsE,9894 +django/contrib/auth/locale/fy/LC_MESSAGES/django.mo,sha256=95N-77SHF0AzQEer5LuBKu5n5oWf3pbH6_hQGvDrlP4,476 +django/contrib/auth/locale/fy/LC_MESSAGES/django.po,sha256=8XOzOFx-WerF7whzTie03hgO-dkbUFZneyrpZtat5JY,3704 +django/contrib/auth/locale/ga/LC_MESSAGES/django.mo,sha256=UblN6hhEtT4qBKfH-aMdUKXqOCELTZHp3sCZ8ECxPFM,9476 +django/contrib/auth/locale/ga/LC_MESSAGES/django.po,sha256=X1399hXdhaQLsVQvOr98GYPBWX9l1hY28-SjpT2Ma4Q,9891 +django/contrib/auth/locale/gd/LC_MESSAGES/django.mo,sha256=BLBYJV9Adx1BsXZaM0qZ54mNRAF5s4dxB1TBLtIyMHQ,8743 +django/contrib/auth/locale/gd/LC_MESSAGES/django.po,sha256=rqPK26mtE_U-TG2qyjc5xCR-feI3sGXZR5H6ohNzx4s,9099 +django/contrib/auth/locale/gl/LC_MESSAGES/django.mo,sha256=WTXkzn81WNcJXzDJoPdE3TWDQpKI8WP8GHx1Gq1sHv8,8805 +django/contrib/auth/locale/gl/LC_MESSAGES/django.po,sha256=xl3kbm0rMJ-3UcblwkEmjNLupbUdbNWqXiNNEUYbFYs,9223 +django/contrib/auth/locale/he/LC_MESSAGES/django.mo,sha256=gnP77qGURtGKPgbqmI6JqmX6TExxuCbM6nxZHXwRC58,8716 +django/contrib/auth/locale/he/LC_MESSAGES/django.po,sha256=qlwNJbk638S8p90BiMJyLCHZuReShEJCZTnmbPiJNks,9162 +django/contrib/auth/locale/hi/LC_MESSAGES/django.mo,sha256=7CxV1H37hMbgKIhnAWx-aJmipLRosJe1qg8BH2CABfw,5364 +django/contrib/auth/locale/hi/LC_MESSAGES/django.po,sha256=DU5YM6r1kd5fo40yqFXzEaNh42ezFQFQ-0dmVqkaKQ0,7769 +django/contrib/auth/locale/hr/LC_MESSAGES/django.mo,sha256=GEap3QClwCkuwQZKJE7qOZl93RRxmyyvTTnOTYaAWUo,5894 +django/contrib/auth/locale/hr/LC_MESSAGES/django.po,sha256=ALftoYSaI1U90RNDEvnaFATbw1SL0m8fNXAyl6DkSvo,7355 +django/contrib/auth/locale/hsb/LC_MESSAGES/django.mo,sha256=oJHYLO9gAJHRl_JK1zZYoH17fPpK4E_EynD-HJm09z8,9100 +django/contrib/auth/locale/hsb/LC_MESSAGES/django.po,sha256=-SXqWUuhlp-JLxrAFF7qVpWgkGBU_RlBujdUfII9w14,9386 +django/contrib/auth/locale/hu/LC_MESSAGES/django.mo,sha256=GnQqvpIXhU3emYyLw6MMNbspnvIFzpJsz8Pd-I9jrjg,7714 +django/contrib/auth/locale/hu/LC_MESSAGES/django.po,sha256=zPswCaG-SLvyVa16iRgmPDF6vmd1yxXmTWHbjwhzy0Q,8111 +django/contrib/auth/locale/hy/LC_MESSAGES/django.mo,sha256=zoLe0EqIH8HQYC5XAWd8b8mA2DpbmDSEBsF-WIKX_OQ,8001 +django/contrib/auth/locale/hy/LC_MESSAGES/django.po,sha256=wIWLbz6f0n44ZcjEbZZsgoWTpzXRGND15hudr_DQ3l0,8787 +django/contrib/auth/locale/ia/LC_MESSAGES/django.mo,sha256=OTxh6u0QmsytMrp8IKWBwMnhrYCpyS6qVnF7YBCAWe0,7626 +django/contrib/auth/locale/ia/LC_MESSAGES/django.po,sha256=ue4RXEXweO1-9sZOKkLZsyZe8yxnPWB3JZyyh3qzmlA,7895 +django/contrib/auth/locale/id/LC_MESSAGES/django.mo,sha256=rEtc08pC6VidwzSMWJvZjERYpdTZd6np3-N3YK8uILk,7296 +django/contrib/auth/locale/id/LC_MESSAGES/django.po,sha256=X1pfbeKqnWg-Sw_hycWuXWDqKpdzrDHMt2SVuifAQjQ,7733 +django/contrib/auth/locale/io/LC_MESSAGES/django.mo,sha256=YwAS3aWljAGXWcBhGU_GLVuGJbHJnGY8kUCE89CPdks,464 +django/contrib/auth/locale/io/LC_MESSAGES/django.po,sha256=W36JXuA1HQ72LspixRxeuvxogVxtk7ZBbT0VWI38_oM,3692 +django/contrib/auth/locale/is/LC_MESSAGES/django.mo,sha256=0PBYGqQKJaAG9m2jmJUzcqRVPc16hCe2euECMCrNGgI,7509 +django/contrib/auth/locale/is/LC_MESSAGES/django.po,sha256=o6dQ8WMuPCw4brSzKUU3j8PYhkLBO7XQ3M7RlsIw-VY,7905 +django/contrib/auth/locale/it/LC_MESSAGES/django.mo,sha256=pcBcdOXLqT4shr7Yw5l-pxfYknJyDW6d-jGtkncl24E,7862 +django/contrib/auth/locale/it/LC_MESSAGES/django.po,sha256=f03_tMPiwLF1ZyWfnB_j2vhPR1AXkborGQS2Tbxufzk,8471 +django/contrib/auth/locale/ja/LC_MESSAGES/django.mo,sha256=_iLobe-w4zxA1CQTZ045ZxuUiAsfSM-NL7p9H7C6shU,9229 +django/contrib/auth/locale/ja/LC_MESSAGES/django.po,sha256=JHggNIie2hqLGta327VO0e32U_AL8Ex30bnsS4CXhHY,9564 +django/contrib/auth/locale/ka/LC_MESSAGES/django.mo,sha256=4aJoE1O5jfm5MI7kBqymzb-xOKLDw2mJD5-VhezlMA8,10372 +django/contrib/auth/locale/ka/LC_MESSAGES/django.po,sha256=hvmbD3RS3lOFj2h7A3m23asktwM5zbCdRvs7YvesAkI,11163 +django/contrib/auth/locale/kab/LC_MESSAGES/django.mo,sha256=9qKeQ-gDByoOdSxDpSbLaM4uSP5sIi7qlTn8tJidVDs,2982 +django/contrib/auth/locale/kab/LC_MESSAGES/django.po,sha256=8cq5_rjRXPzTvn1jPo6H_Jcrv6IXkWr8n9fTPvghsS8,5670 +django/contrib/auth/locale/kk/LC_MESSAGES/django.mo,sha256=RJablrXpRba6YVB_8ACSt2q_BjmxrHQZzX6RxMJImlA,3542 +django/contrib/auth/locale/kk/LC_MESSAGES/django.po,sha256=OebwPN9iWBvjDu0P2gQyBbShvIFxFIqCw8DpKuti3xk,6360 +django/contrib/auth/locale/km/LC_MESSAGES/django.mo,sha256=FahcwnCgzEamtWcDEPOiJ4KpXCIHbnSowfSRdRQ2F9U,2609 +django/contrib/auth/locale/km/LC_MESSAGES/django.po,sha256=lvRHHIkClbt_8-9Yn0xY57dMxcS72z4sUkxLb4cohP0,5973 +django/contrib/auth/locale/kn/LC_MESSAGES/django.mo,sha256=u0YygqGJYljBZwI9rm0rRk_DdgaBEMA1etL-Lk-7Mls,4024 +django/contrib/auth/locale/kn/LC_MESSAGES/django.po,sha256=J67MIAas5egVq_FJBNsug3Y7rZ8KakhQt6isyF23HAA,6957 +django/contrib/auth/locale/ko/LC_MESSAGES/django.mo,sha256=8avsa0J96myXPxdFhChPiKpjvMhaQv3EHIjuo6f3jls,7651 +django/contrib/auth/locale/ko/LC_MESSAGES/django.po,sha256=gKhckUZzS1PekOV5Jingxke-3U2dPGRAidkgBbfootg,8422 +django/contrib/auth/locale/ky/LC_MESSAGES/django.mo,sha256=mnBXtpInYxaSNIURJTmx8uBg_PH-NuPN9r54pkQY3q4,8924 +django/contrib/auth/locale/ky/LC_MESSAGES/django.po,sha256=7FeO_Kb2er0S84KnFeXVHO3TgAmEJ0gTQEDHImoxiZ4,9170 +django/contrib/auth/locale/lb/LC_MESSAGES/django.mo,sha256=OFhpMA1ZXhrs5fwZPO5IjubvWDiju4wfwWiV94SFkiA,474 +django/contrib/auth/locale/lb/LC_MESSAGES/django.po,sha256=dOfY9HjTfMQ0nkRYumw_3ZaywbUrTgT-oTXAnrRyfxo,3702 +django/contrib/auth/locale/lt/LC_MESSAGES/django.mo,sha256=-nlZHl7w__TsFUmBb5pQV_XJtKGsi9kzP6CBZXkfM8M,8146 +django/contrib/auth/locale/lt/LC_MESSAGES/django.po,sha256=-rdhB6eroSSemsdZkG1Jl4CruNZc_7dj4m5IVoyRBUQ,8620 +django/contrib/auth/locale/lv/LC_MESSAGES/django.mo,sha256=BRIOgvLPHsfaWGrwYJNGCEKD-erXHTZpI8WNAlVGVBM,8802 +django/contrib/auth/locale/lv/LC_MESSAGES/django.po,sha256=nZJfE5Q4ISl7hsh0MR_vCReE7PGmTJKVYR22cEbHVGE,9322 +django/contrib/auth/locale/mk/LC_MESSAGES/django.mo,sha256=XS9dslnD_YBeD07P8WQkss1gT7GIV-qLiCx4i5_Vd_k,9235 +django/contrib/auth/locale/mk/LC_MESSAGES/django.po,sha256=QOLgcwHub9Uo318P2z6sp69MI8syIIWCcr4VOom9vfs,9799 +django/contrib/auth/locale/ml/LC_MESSAGES/django.mo,sha256=UEaqq7nnGvcZ8vqFicLiuqsuEUhEjd2FpWfyzy2HqdU,12611 +django/contrib/auth/locale/ml/LC_MESSAGES/django.po,sha256=xBROIwJb5h2LmyBLAafZ2tUlPVTAOcMgt-olq5XnPT8,13107 +django/contrib/auth/locale/mn/LC_MESSAGES/django.mo,sha256=hBYT0p3LcvIKKPtIn2NzPk_2di9L8jYrUt9j3TcVvaY,9403 +django/contrib/auth/locale/mn/LC_MESSAGES/django.po,sha256=R3wAEwnefEHZsma8J-XOn4XlLtuWYKDPLwJ99DUYmvE,9913 +django/contrib/auth/locale/mr/LC_MESSAGES/django.mo,sha256=c_W1FsdevGBCJfpcY4MmgSPGUGqFAqWArpXhldn9MA8,10430 +django/contrib/auth/locale/mr/LC_MESSAGES/django.po,sha256=x8RUK6Bymg2o3YDREqEZvaLpw2PIzMbXaQhJqpyGpLA,11068 +django/contrib/auth/locale/ms/LC_MESSAGES/django.mo,sha256=eCAZrzQxsM_pAxr_XQo2fIOsCbj5LjGKpLNCzob2l-I,7654 +django/contrib/auth/locale/ms/LC_MESSAGES/django.po,sha256=FAtyzSGcD1mIhRIg8O_1SHLdisTPGYZK-QUjzgw-wCY,7847 +django/contrib/auth/locale/my/LC_MESSAGES/django.mo,sha256=gYzFJKi15RbphgG1IHbJF3yGz3P2D9vaPoHZpA7LoH8,1026 +django/contrib/auth/locale/my/LC_MESSAGES/django.po,sha256=lH5mrq-MyY8gvrNkH2_20rkjFnbviq23wIUqIjPIgFI,5130 +django/contrib/auth/locale/nb/LC_MESSAGES/django.mo,sha256=vLJ9F73atlexwVRzZJpQjcB9arodHIMCh-z8lP5Ah9w,7023 +django/contrib/auth/locale/nb/LC_MESSAGES/django.po,sha256=c3sTCdzWGZgs94z9dIIpfrFuujBuvWvQ-P0gb1tuqlA,7520 +django/contrib/auth/locale/ne/LC_MESSAGES/django.mo,sha256=pq8dEr1ugF5ldwkCDHOq5sXaXV31InbLHYyXU56U_Ao,7722 +django/contrib/auth/locale/ne/LC_MESSAGES/django.po,sha256=bV-uWvT1ViEejrbRbVTtwC2cZVD2yX-KaESxKBnxeRI,8902 +django/contrib/auth/locale/nl/LC_MESSAGES/django.mo,sha256=mVnVHcT_txoSb49PFTXxGVjtdv6Anmo77Ut7YuXuYU8,8654 +django/contrib/auth/locale/nl/LC_MESSAGES/django.po,sha256=VIN_7kSM-4gJVypjnpuGTvYdtZRHDkpFWtuHnZi1TBQ,9445 +django/contrib/auth/locale/nn/LC_MESSAGES/django.mo,sha256=83HdNOuNQVgJXBZMytPz1jx3wWDy8-e6t_JNEUu6W8w,7147 +django/contrib/auth/locale/nn/LC_MESSAGES/django.po,sha256=4ciwQsZFYSV6CjFqzxxcESAm16huv9XyXvU-nchD-Fs,7363 +django/contrib/auth/locale/os/LC_MESSAGES/django.mo,sha256=DVsYGz-31nofEjZla4YhM5L7qoBnQaYnZ4TBki03AI4,4434 +django/contrib/auth/locale/os/LC_MESSAGES/django.po,sha256=Akc1qelQWRA1DE6xseoK_zsY7SFI8SpiVflsSTUhQLw,6715 +django/contrib/auth/locale/pa/LC_MESSAGES/django.mo,sha256=PeOLukzQ_CZjWBa5FGVyBEysat4Gwv40xGMS29UKRww,3666 +django/contrib/auth/locale/pa/LC_MESSAGES/django.po,sha256=7ts9PUSuvfXGRLpfyVirJLDtsQcsVWFXDepVKUVlmtc,6476 +django/contrib/auth/locale/pl/LC_MESSAGES/django.mo,sha256=NXZZQrnop8eooTdPzfp38tP0EMabV7CfpZgXxhPibyM,9123 +django/contrib/auth/locale/pl/LC_MESSAGES/django.po,sha256=aQho-iU1nlNxHQbCE1kxoz7_qhEHbNNlz4hU3fDl98g,9975 +django/contrib/auth/locale/pt/LC_MESSAGES/django.mo,sha256=wRDb8DfDcvtj6MCrLJ9gxKKF2SlK_QHpqufHfoYaFa8,6953 +django/contrib/auth/locale/pt/LC_MESSAGES/django.po,sha256=suckZxgfaB1G1iXeUI59tc0AsDpdvkLugy52q1qvw9I,7893 +django/contrib/auth/locale/pt_BR/LC_MESSAGES/django.mo,sha256=SbCDXBKvSHkdoVhcfQMXv4U_REmfd_trd6yx1iDUMTE,8790 +django/contrib/auth/locale/pt_BR/LC_MESSAGES/django.po,sha256=CQOyNh0snCEjcdMllEya8aIk3DLo1OJ0xC302hJVnFg,9955 +django/contrib/auth/locale/ro/LC_MESSAGES/django.mo,sha256=GD04tb5R6nEeD6ZMAcZghVhXwr8en1omw0c6BxnyHas,7777 +django/contrib/auth/locale/ro/LC_MESSAGES/django.po,sha256=YfkFuPrMwAR50k6lfOYeBbMosEbvXGWwMBD8B7p_2ZA,8298 +django/contrib/auth/locale/ru/LC_MESSAGES/django.mo,sha256=eCeiUY5awrFu5ih4y-pu8Tvul4vYKmwC0fFi_JXCWNY,11873 +django/contrib/auth/locale/ru/LC_MESSAGES/django.po,sha256=eLgUzuchTermohKhO3WxOHEPdW8IqwqBazgiWDEzkOk,12456 +django/contrib/auth/locale/sk/LC_MESSAGES/django.mo,sha256=FdPkNSXPm8P8iSHY8odyd_m0jFaXLK17SUTodO9FWoA,8862 +django/contrib/auth/locale/sk/LC_MESSAGES/django.po,sha256=K74Uk5HVmd5KRvF87GFL9edBcd0uuHyA8Sv_3qgwMuE,9312 +django/contrib/auth/locale/sl/LC_MESSAGES/django.mo,sha256=_Lx1YcW4tvCpsXXXmcCMhrttpLR4389330tnB1ycCok,7659 +django/contrib/auth/locale/sl/LC_MESSAGES/django.po,sha256=MPEv4Ac5MwcywffmPyLxAzSMLLX1cOdZevPlpIMju28,8136 +django/contrib/auth/locale/sq/LC_MESSAGES/django.mo,sha256=iR5C7Yh5am7z9QLU2jm9V3R9yWawAcu9NbhAvltg_RY,9021 +django/contrib/auth/locale/sq/LC_MESSAGES/django.po,sha256=yWGvT-IIdgXCyJB8dPps02iQDLSS1FVM4yPTckaMFPM,9381 +django/contrib/auth/locale/sr/LC_MESSAGES/django.mo,sha256=70UYT-rE32AZUMPTX2BLVzndmW6PFi9plyuVXV-AmaM,11244 +django/contrib/auth/locale/sr/LC_MESSAGES/django.po,sha256=V4DApTaiWBJmF-a5caRw_F5HZP34kV-N3X7U5IgHQxA,11554 +django/contrib/auth/locale/sr_Latn/LC_MESSAGES/django.mo,sha256=ErH27vBYfkVl7T9TtnaWTxVGdGSrbIC3cflXko3QIbA,8794 +django/contrib/auth/locale/sr_Latn/LC_MESSAGES/django.po,sha256=bNkHPHLgxmKe5biIdPN_Tgo6q7-u7hJaY0Jk36TU8a0,12715 +django/contrib/auth/locale/sv/LC_MESSAGES/django.mo,sha256=Hxy7f19YQMmOTq9YywhUd5p6Y8Wlfu55bXKw-SElw3I,8542 +django/contrib/auth/locale/sv/LC_MESSAGES/django.po,sha256=c_MyD3bQV8NrBYNDP1fvRoGsjXMZl6uPr55n-r5nmUg,9250 +django/contrib/auth/locale/sw/LC_MESSAGES/django.mo,sha256=I_lEsKuMGm07X1vM3-ReGDx2j09PGLkWcG0onC8q1uQ,5029 +django/contrib/auth/locale/sw/LC_MESSAGES/django.po,sha256=TiZS5mh0oN0e6dFEdh-FK81Vk-tdv35ngJ-EbM1yX80,6455 +django/contrib/auth/locale/ta/LC_MESSAGES/django.mo,sha256=T1t5CKEb8hIumvbOtai-z4LKj2et8sX-PgBMd0B3zuA,2679 +django/contrib/auth/locale/ta/LC_MESSAGES/django.po,sha256=X8UDNmk02X9q1leNV1qWWwPNakhvNd45mCKkQ8EpZQQ,6069 +django/contrib/auth/locale/te/LC_MESSAGES/django.mo,sha256=i9hG4thA0P-Hc-S2oX7GufWFDO4Y_LF4RcdQ22cbLyE,2955 +django/contrib/auth/locale/te/LC_MESSAGES/django.po,sha256=txND8Izv2oEjSlcsx3q6l5fEUqsS-zv-sjVVILB1Bmc,6267 +django/contrib/auth/locale/tg/LC_MESSAGES/django.mo,sha256=MwdyYwC4ILX4MFsqCy46NNfPKLbW1GzRhFxMV0uIbLI,7932 +django/contrib/auth/locale/tg/LC_MESSAGES/django.po,sha256=miOPNThjHZODwjXMbON8PTMQhaCGJ0Gy6FZr6Jcj4J8,8938 +django/contrib/auth/locale/th/LC_MESSAGES/django.mo,sha256=zRpZ2xM5JEQoHtfXm2_XYdhe2FtaqH-hULJadLJ1MHU,6013 +django/contrib/auth/locale/th/LC_MESSAGES/django.po,sha256=Yhh_AQS_aM_9f_yHNNSu_3THbrU-gOoMpfiDKhkaSHo,7914 +django/contrib/auth/locale/tk/LC_MESSAGES/django.mo,sha256=5Rl2GMYL11RMSyro83E2oHNaehHjjGJKAJmp0swjV-0,7467 +django/contrib/auth/locale/tk/LC_MESSAGES/django.po,sha256=HAcou6t1zkXVrzyau7gr4i_H0DYpT5HOh9AxV-tnKD0,7763 +django/contrib/auth/locale/tr/LC_MESSAGES/django.mo,sha256=1qo1gGcZFu3rZESoCGfZX97g8j50qLd8AKDhKvxCOjM,8662 +django/contrib/auth/locale/tr/LC_MESSAGES/django.po,sha256=0-q_75Eibqzcew9-t30cueOuPBpekepDi8edFlzzAcA,9236 +django/contrib/auth/locale/tt/LC_MESSAGES/django.mo,sha256=g4pTk8QLQFCOkU29RZvR1wOd1hkOZe_o5GV9Cg5u8N4,1371 +django/contrib/auth/locale/tt/LC_MESSAGES/django.po,sha256=owkJ7iPT-zJYkuKLykfWsw8j7O8hbgzVTOD0DVv956E,5222 +django/contrib/auth/locale/udm/LC_MESSAGES/django.mo,sha256=zey19UQmS79AJFxHGrOziExPDDpJ1AbUegbCRm0x0hM,462 +django/contrib/auth/locale/udm/LC_MESSAGES/django.po,sha256=gLVgaMGg0GA3Tey1_nWIjV1lnM7czLC0XR9NFBgL2Zk,3690 +django/contrib/auth/locale/ug/LC_MESSAGES/django.mo,sha256=XFiEQj2PPtLCPVa1Ecm-yM-G_vTSe_QIY0zkmxWTY5k,10714 +django/contrib/auth/locale/ug/LC_MESSAGES/django.po,sha256=kLIort7Rfnu4S95YXZ10UKX7G8BB5vI6iF6DQrSSizY,10972 +django/contrib/auth/locale/uk/LC_MESSAGES/django.mo,sha256=hjA-VzGMy8ReYSjuELwK3WEliLLjGsi0iRadzoX8UyU,10146 +django/contrib/auth/locale/uk/LC_MESSAGES/django.po,sha256=8R2bP3QC6jhcz_XSpK-GK1OPTCCb7PN6bz-1ZRX37fs,10850 +django/contrib/auth/locale/ur/LC_MESSAGES/django.mo,sha256=rippTNHoh49W19c4HDUF8G5Yo3SknL3C87Afu8YXxzA,698 +django/contrib/auth/locale/ur/LC_MESSAGES/django.po,sha256=gwSd8noEwbcvDE1Q4ZsrftvoWMwhw1J15gvdtK6E9ns,4925 +django/contrib/auth/locale/uz/LC_MESSAGES/django.mo,sha256=bDkhpvduocjekq6eZiuEfWJqnIt5hQmxxoIMhLQWzqM,2549 +django/contrib/auth/locale/uz/LC_MESSAGES/django.po,sha256=tPp8tRZwSMQCQ9AyAeUDtnRfmOk54UQMwok3HH8VNSQ,5742 +django/contrib/auth/locale/vi/LC_MESSAGES/django.mo,sha256=eBMTwnpRWRj8SZVZ1tN592Re_8CPyJzuF4Vtg9IMmFw,7892 +django/contrib/auth/locale/vi/LC_MESSAGES/django.po,sha256=mOr5WgFpwztdW-pEZ4O80MGlltYQyL2cAMhz6-Esfo0,8246 +django/contrib/auth/locale/zh_Hans/LC_MESSAGES/django.mo,sha256=buDfU6thF7o39eMCQadRxNKHprr-41PP-Qjdcp-a2m4,7741 +django/contrib/auth/locale/zh_Hans/LC_MESSAGES/django.po,sha256=qNsSA2WWmC9jrg6ABL9jVG3u95qq4ztnML4Nrh3Gugo,8507 +django/contrib/auth/locale/zh_Hant/LC_MESSAGES/django.mo,sha256=zSv5dAoJH39_y0rvB8TurVwgP3OnEozuOmtoImu5gzA,7683 +django/contrib/auth/locale/zh_Hant/LC_MESSAGES/django.po,sha256=XGPQJfi8A0wHVTkEuIZa6DPr0wLlZr06pMQeAuN12jc,8114 +django/contrib/auth/management/__init__.py,sha256=I_I5B5ym_x8_r5iFL9xm_zLwlqyljCJmcJ7KS4qx7QM,5249 +django/contrib/auth/management/__pycache__/__init__.cpython-312.pyc,, +django/contrib/auth/management/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/contrib/auth/management/commands/__pycache__/__init__.cpython-312.pyc,, +django/contrib/auth/management/commands/__pycache__/changepassword.cpython-312.pyc,, +django/contrib/auth/management/commands/__pycache__/createsuperuser.cpython-312.pyc,, +django/contrib/auth/management/commands/changepassword.py,sha256=H9onbQvVwzILiRK6Cg96qGrLi8_kdjoxBVMvupX18eI,2686 +django/contrib/auth/management/commands/createsuperuser.py,sha256=cSl8FeoXYBw5DUjtnHRYmybsYIx6WztUkYjgx4ZO1XI,13576 +django/contrib/auth/middleware.py,sha256=0u5YALdQ3V8uD4VMK1Bep5N00sRNn659mKX3djmi0HA,7726 +django/contrib/auth/migrations/0001_initial.py,sha256=hFz_MZYGMy9J7yDOFl0aF-UixCbF5W12FhM-nk6rpe8,7281 +django/contrib/auth/migrations/0002_alter_permission_name_max_length.py,sha256=_q-X4Oj30Ui-w9ubqyNJxeFYiBF8H_KCne_2PvnhbP8,346 +django/contrib/auth/migrations/0003_alter_user_email_max_length.py,sha256=nVZXtNuYctwmwtY0wvWRGj1pqx2FUq9MbWM7xAAd-r8,418 +django/contrib/auth/migrations/0004_alter_user_username_opts.py,sha256=lTjbNCyam-xMoSsxN_uAdyxOpK-4YehkeilisepYNEo,880 +django/contrib/auth/migrations/0005_alter_user_last_login_null.py,sha256=efYKNdwAD91Ce8BchSM65bnEraB4_waI_J94YEv36u4,410 +django/contrib/auth/migrations/0006_require_contenttypes_0002.py,sha256=AMsW40BfFLYtvv-hXGjJAwKR5N3VE9czZIukYNbF54E,369 +django/contrib/auth/migrations/0007_alter_validators_add_error_messages.py,sha256=EV24fcMnUw-14ZZLo9A_l0ZJL5BgBAaUe-OfVPbMBC8,802 +django/contrib/auth/migrations/0008_alter_user_username_max_length.py,sha256=AoV_ZffWSBR6XRJZayAKg-KRRTkdP5hs64SzuGWiw1E,814 +django/contrib/auth/migrations/0009_alter_user_last_name_max_length.py,sha256=GaiVAOfxCKc5famxczGB-SEF91hmOzaFtg9cLaOE124,415 +django/contrib/auth/migrations/0010_alter_group_name_max_length.py,sha256=CWPtZJisCzqEMLbKNMG0pLHV9VtD09uQLxWgP_dLFM0,378 +django/contrib/auth/migrations/0011_update_proxy_permissions.py,sha256=haXd5wjcS2ER4bxxznI-z7p7H4rt7P0TCQD_d4J2VDY,2860 +django/contrib/auth/migrations/0012_alter_user_first_name_max_length.py,sha256=bO-8n4CQN2P_hJKlN6IoNu9p8iJ-GdQCUJuAmdK67LA,411 +django/contrib/auth/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/contrib/auth/migrations/__pycache__/0001_initial.cpython-312.pyc,, +django/contrib/auth/migrations/__pycache__/0002_alter_permission_name_max_length.cpython-312.pyc,, +django/contrib/auth/migrations/__pycache__/0003_alter_user_email_max_length.cpython-312.pyc,, +django/contrib/auth/migrations/__pycache__/0004_alter_user_username_opts.cpython-312.pyc,, +django/contrib/auth/migrations/__pycache__/0005_alter_user_last_login_null.cpython-312.pyc,, +django/contrib/auth/migrations/__pycache__/0006_require_contenttypes_0002.cpython-312.pyc,, +django/contrib/auth/migrations/__pycache__/0007_alter_validators_add_error_messages.cpython-312.pyc,, +django/contrib/auth/migrations/__pycache__/0008_alter_user_username_max_length.cpython-312.pyc,, +django/contrib/auth/migrations/__pycache__/0009_alter_user_last_name_max_length.cpython-312.pyc,, +django/contrib/auth/migrations/__pycache__/0010_alter_group_name_max_length.cpython-312.pyc,, +django/contrib/auth/migrations/__pycache__/0011_update_proxy_permissions.cpython-312.pyc,, +django/contrib/auth/migrations/__pycache__/0012_alter_user_first_name_max_length.cpython-312.pyc,, +django/contrib/auth/migrations/__pycache__/__init__.cpython-312.pyc,, +django/contrib/auth/mixins.py,sha256=rHq9HsX4W8lKtfXsazxM3chhTFLqd3eKI-OVKpbeLjQ,4652 +django/contrib/auth/models.py,sha256=Ye2nx9-YkJI9iaE9jNF74y2N1zvJlwdtrWD-f_zy-ac,16508 +django/contrib/auth/password_validation.py,sha256=bcI_IpJGik69i5evI7ywa9bEPFRSkPTLJZ8Yf1y4mIE,9358 +django/contrib/auth/signals.py,sha256=BFks70O0Y8s6p1fr8SCD4-yk2kjucv7HwTcdRUzVDFM,118 +django/contrib/auth/templates/auth/widgets/read_only_password_hash.html,sha256=xBoBu4pWrFdMbEzkx_5hgVqBrqtrY3YwP3ay6AmXXUo,320 +django/contrib/auth/templates/registration/password_reset_subject.txt,sha256=-TZcy_r0vArBgdPK7feeUY6mr9EkYwy7esQ62_onbBk,132 +django/contrib/auth/tokens.py,sha256=ljqQWO0dAkd45-bBJ6W85oZZU9pEjzNh3VbZfeANwxQ,4328 +django/contrib/auth/urls.py,sha256=Uh8DrSqpJXDA5a17Br9fMmIbEcgLkxdN9FvCRg-vxyg,1185 +django/contrib/auth/validators.py,sha256=VO7MyackTaTiK8OjEm7YyLtsjKrteVjdzPbNZki0irU,722 +django/contrib/auth/views.py,sha256=iZgi5xK8K277BdSj2NIyC_41f1AlC89Ex7vpjZJ6fQ4,14084 +django/contrib/contenttypes/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/contrib/contenttypes/__pycache__/__init__.cpython-312.pyc,, +django/contrib/contenttypes/__pycache__/admin.cpython-312.pyc,, +django/contrib/contenttypes/__pycache__/apps.cpython-312.pyc,, +django/contrib/contenttypes/__pycache__/checks.cpython-312.pyc,, +django/contrib/contenttypes/__pycache__/fields.cpython-312.pyc,, +django/contrib/contenttypes/__pycache__/forms.cpython-312.pyc,, +django/contrib/contenttypes/__pycache__/models.cpython-312.pyc,, +django/contrib/contenttypes/__pycache__/prefetch.cpython-312.pyc,, +django/contrib/contenttypes/__pycache__/views.cpython-312.pyc,, +django/contrib/contenttypes/admin.py,sha256=a0KrlT8k2aPIKn54fNwCDTaAVdVr1fLY1BDz_FrE3ts,5200 +django/contrib/contenttypes/apps.py,sha256=1Q1mWjPvfYU7EaO50JvsWuDg_3uK8DoCwpvdIdT7iKY,846 +django/contrib/contenttypes/checks.py,sha256=KKB-4FOfPO60TM-uxqK8m9sIXzB3CRx7Imr-jaauM_U,1268 +django/contrib/contenttypes/fields.py,sha256=IKEJyMOlw5wkh0kFggXDml0M3nix_RbTQy8sLg8Lb4k,31144 +django/contrib/contenttypes/forms.py,sha256=zETkgsUcxavK9D78Cy27cwRs1LaGNKTiJfgy2vxYqjg,3944 +django/contrib/contenttypes/locale/af/LC_MESSAGES/django.mo,sha256=93nlniPFfVcxfBCs_PsLtMKrJ2BqpcofPRNYYTTlels,1070 +django/contrib/contenttypes/locale/af/LC_MESSAGES/django.po,sha256=SY04sW55-xpO_qBjv8pHoN7eqB2C5q_9CxQguMz7Q94,1244 +django/contrib/contenttypes/locale/ar/LC_MESSAGES/django.mo,sha256=2t3y_6wxi0khsYi6s9ZyJwjRB8bnRT1PKvazWOKhJcQ,1271 +django/contrib/contenttypes/locale/ar/LC_MESSAGES/django.po,sha256=t6M3XYQLotNMFCjzB8aWFXnlRI8fU744YZvAoFdScQY,1634 +django/contrib/contenttypes/locale/ar_DZ/LC_MESSAGES/django.mo,sha256=upFxoSvOvdmqCvC5irRV_8yYpFidanHfRk6i3tPrFAc,1233 +django/contrib/contenttypes/locale/ar_DZ/LC_MESSAGES/django.po,sha256=jUg-4BVi0arx5v-osaUDAfM6cQgaBh7mE8Mr8aVTp5A,1447 +django/contrib/contenttypes/locale/ast/LC_MESSAGES/django.mo,sha256=y88CPGGbwTVRmZYIipCNIWkn4OuzuxEk2QCYsBhc7RY,643 +django/contrib/contenttypes/locale/ast/LC_MESSAGES/django.po,sha256=H-qMo5ikva84ycnlmBT4XXEWhzMIw-r7J_zuqxo3wu4,1088 +django/contrib/contenttypes/locale/az/LC_MESSAGES/django.mo,sha256=eHIU-L0mRAlCpQaQzrShguFlYg5llOv89KEpj14p6-8,1058 +django/contrib/contenttypes/locale/az/LC_MESSAGES/django.po,sha256=h56r0_NK7YccHKrfBWUirSpkIBf4ckXyq1F8-YP1rvs,1375 +django/contrib/contenttypes/locale/be/LC_MESSAGES/django.mo,sha256=Kp1TpXX1v0IgGp9HZxleXJ6y5ZvMZ6AqJrSIVcDs7xA,1353 +django/contrib/contenttypes/locale/be/LC_MESSAGES/django.po,sha256=Oy5QXZBmBM_OYLT5OeXJQzTBCHXBp8NVMYuKmr_TUm0,1615 +django/contrib/contenttypes/locale/bg/LC_MESSAGES/django.mo,sha256=IFghXuYj0yxP5j-LfRsNJXlyS2b2dUNJXD01uhUqxLg,1225 +django/contrib/contenttypes/locale/bg/LC_MESSAGES/django.po,sha256=y-OpKdDHxHDYATSmi8DAUXuhpIwgujKZUe48G8So8AU,1613 +django/contrib/contenttypes/locale/bn/LC_MESSAGES/django.mo,sha256=2Z1GL6c1ukKQCMcls7R0_n4eNdH3YOXZSR8nCct7SLI,1201 +django/contrib/contenttypes/locale/bn/LC_MESSAGES/django.po,sha256=PLjnppx0FxfGBQMuWVjo0N4sW2QYc2DAEMK6ziGWUc8,1491 +django/contrib/contenttypes/locale/br/LC_MESSAGES/django.mo,sha256=kAlOemlwBvCdktgYoV-4NpC7XFDaIue_XN7GJYzDu88,1419 +django/contrib/contenttypes/locale/br/LC_MESSAGES/django.po,sha256=BQmHVQqOc6xJWJLeAo49rl_Ogfv-lFtx18mj82jT_to,1613 +django/contrib/contenttypes/locale/bs/LC_MESSAGES/django.mo,sha256=klj9n7AKBkTf7pIa9m9b-itsy4UlbYPnHiuvSLcFZXY,700 +django/contrib/contenttypes/locale/bs/LC_MESSAGES/django.po,sha256=pmJaMBLWbYtYFFXYBvPEvwXkTPdjQDv2WkFI5jNGmTI,1151 +django/contrib/contenttypes/locale/ca/LC_MESSAGES/django.mo,sha256=uYq1BXdw1AXjnLusUQfN7ox1ld6siiy41C8yKVTry7Q,1095 +django/contrib/contenttypes/locale/ca/LC_MESSAGES/django.po,sha256=-dsOzvzVzEPVvA9lYsIP-782BbtJxGRo-OHtS3fIjmU,1403 +django/contrib/contenttypes/locale/ckb/LC_MESSAGES/django.mo,sha256=_dJ-2B3tupoUHRS7HjC-EIlghIYLWebwsy4IvEXI13w,1213 +django/contrib/contenttypes/locale/ckb/LC_MESSAGES/django.po,sha256=SrQwgQTltnR7OExi6sP5JsnEOg6qDzd8dSPXjX92B-M,1419 +django/contrib/contenttypes/locale/cs/LC_MESSAGES/django.mo,sha256=QexBQDuGdMFhVBtA9XWUs2geFBROcxyzdU_IBUGQ7x4,1108 +django/contrib/contenttypes/locale/cs/LC_MESSAGES/django.po,sha256=8pdPwZmpGOeSZjILGLZEAzqvmmV69ogpkh0c3tukT2g,1410 +django/contrib/contenttypes/locale/cy/LC_MESSAGES/django.mo,sha256=2QyCWeXFyymoFu0Jz1iVFgOIdLtt4N1rCZATZAwiH-8,1159 +django/contrib/contenttypes/locale/cy/LC_MESSAGES/django.po,sha256=ZWDxQTHJcw1UYav1C3MX08wCFrSeJNNI2mKjzRVd6H0,1385 +django/contrib/contenttypes/locale/da/LC_MESSAGES/django.mo,sha256=EyancRrTWxM6KTpLq65gIQB0sO_PLtVr1ESN2v1pSNU,1038 +django/contrib/contenttypes/locale/da/LC_MESSAGES/django.po,sha256=J09u3IjLgv4g77Kea_WQAhevHb8DskGU-nVxyucYf_0,1349 +django/contrib/contenttypes/locale/de/LC_MESSAGES/django.mo,sha256=MGUZ4Gw8rSFjBO2OfFX9ooGGpJYwAapgNkc-GdBMXa0,1055 +django/contrib/contenttypes/locale/de/LC_MESSAGES/django.po,sha256=T5ucSqa6VyfUcoN6nFWBtjUkrSrz7wxr8t0NGTBrWow,1308 +django/contrib/contenttypes/locale/dsb/LC_MESSAGES/django.mo,sha256=QpdSZObmfb-DQZb3Oh6I1bFRnaPorXMznNZMyVIM7Hc,1132 +django/contrib/contenttypes/locale/dsb/LC_MESSAGES/django.po,sha256=_tNajamEnnf9FEjI-XBRraKjJVilwvpv2TBf9PAzPxw,1355 +django/contrib/contenttypes/locale/el/LC_MESSAGES/django.mo,sha256=1ySEbSEzhH1lDjHQK9Kv59PMA3ZPdqY8EJe6xEQejIM,1286 +django/contrib/contenttypes/locale/el/LC_MESSAGES/django.po,sha256=8rlMKE5SCLTtm1myjLFBtbEIFyuRmSrL9HS2PA7gneQ,1643 +django/contrib/contenttypes/locale/en/LC_MESSAGES/django.mo,sha256=U0OV81NfbuNL9ctF-gbGUG5al1StqN-daB-F-gFBFC8,356 +django/contrib/contenttypes/locale/en/LC_MESSAGES/django.po,sha256=BRgOISCCJb4TU0dNxG4eeQJFe-aIe7U3GKLPip03d_Q,1110 +django/contrib/contenttypes/locale/en_AU/LC_MESSAGES/django.mo,sha256=dTndJxA-F1IE_nMUOtf1sRr7Kq2s_8yjgKk6mkWkVu4,486 +django/contrib/contenttypes/locale/en_AU/LC_MESSAGES/django.po,sha256=wmxyIJtz628AbsxgkB-MjdImcIJWhcW7NV3tWbDpedg,1001 +django/contrib/contenttypes/locale/en_GB/LC_MESSAGES/django.mo,sha256=_uM-jg43W7Pz8RQhMcR_o15wRkDaYD8aRcl2_NFGoNs,1053 +django/contrib/contenttypes/locale/en_GB/LC_MESSAGES/django.po,sha256=SyzwSvqAgKF8BEhXYh4598GYP583OK2GUXH1lc4iDMk,1298 +django/contrib/contenttypes/locale/eo/LC_MESSAGES/django.mo,sha256=4EgHUHPb4TuK2DKf0dWOf7rNzJNsyT8CG39SQixI0oM,1072 +django/contrib/contenttypes/locale/eo/LC_MESSAGES/django.po,sha256=gbxNuagxW01xLd3DY0Lc5UNNSlw1nEiBExzcElrB61E,1350 +django/contrib/contenttypes/locale/es/LC_MESSAGES/django.mo,sha256=KzgypFDwIlVzr_h9Dq2X8dXu3XnsbdSaHwJKJWZ6qc8,1096 +django/contrib/contenttypes/locale/es/LC_MESSAGES/django.po,sha256=Dpn9dTvdy87bVf3It8pZFOdEEKnO91bDeYyY1YujkIA,1456 +django/contrib/contenttypes/locale/es_AR/LC_MESSAGES/django.mo,sha256=WkHABVDmtKidPyo6zaYGVGrgXpe6tZ69EkxaIBu6mtg,1084 +django/contrib/contenttypes/locale/es_AR/LC_MESSAGES/django.po,sha256=yVSu_fJSKwS4zTlRud9iDochIaY0zOPILF59biVfkeY,1337 +django/contrib/contenttypes/locale/es_CO/LC_MESSAGES/django.mo,sha256=aACo1rOrgs_BYK3AWzXEljCdAc4bC3BXpyXrwE4lzAs,1158 +django/contrib/contenttypes/locale/es_CO/LC_MESSAGES/django.po,sha256=vemhoL-sESessGmIlHoRvtWICqF2aO05WvcGesUZBRM,1338 +django/contrib/contenttypes/locale/es_MX/LC_MESSAGES/django.mo,sha256=vD9rSUAZC_rgkwiOOsrrra07Gnx7yEpNHI96tr8xD3U,840 +django/contrib/contenttypes/locale/es_MX/LC_MESSAGES/django.po,sha256=tLgjAi9Z1kZloJFVQuUdAvyiJy1J-5QHfoWmxbqQZCc,1237 +django/contrib/contenttypes/locale/es_VE/LC_MESSAGES/django.mo,sha256=TVGDydYVg_jGfnYghk_cUFjCCtpGchuoTB4Vf0XJPYk,1152 +django/contrib/contenttypes/locale/es_VE/LC_MESSAGES/django.po,sha256=vJW37vuKYb_KpXBPmoNSqtNstFgCDlKmw-8iOoSCenU,1342 +django/contrib/contenttypes/locale/et/LC_MESSAGES/django.mo,sha256=TE84lZl6EP54-pgmv275jiTOW0vIsnsGU97qmtxMEVg,1028 +django/contrib/contenttypes/locale/et/LC_MESSAGES/django.po,sha256=KO9fhmRCx25VeHNDGXVNhoFx3VFH-6PSLVXZJ6ohOSA,1368 +django/contrib/contenttypes/locale/eu/LC_MESSAGES/django.mo,sha256=K0f1cXEhfg_djPzgCL9wC0iHGWF_JGIhWGFL0Y970g0,1077 +django/contrib/contenttypes/locale/eu/LC_MESSAGES/django.po,sha256=sSuVV0o8MeWN6BxlaeKcjKA3h4H29fCo1kKEtkczEp4,1344 +django/contrib/contenttypes/locale/fa/LC_MESSAGES/django.mo,sha256=hW3A3_9b-NlLS4u6qDnPS1dmNdn1UJCt-nihXvnXywI,1130 +django/contrib/contenttypes/locale/fa/LC_MESSAGES/django.po,sha256=TPiYsGGN-j-VD--Rentx1p-IcrNJYoYxrxDO_5xeZHI,1471 +django/contrib/contenttypes/locale/fi/LC_MESSAGES/django.mo,sha256=dWar3g1rJAkUG1xRLlmGkH63Fy_h2YqzhMVv0Z25aWc,1036 +django/contrib/contenttypes/locale/fi/LC_MESSAGES/django.po,sha256=yALWMFU8-gFD2G0NdWqIDIenrAMUY4VCW1oi8TJXFAc,1325 +django/contrib/contenttypes/locale/fr/LC_MESSAGES/django.mo,sha256=CTOu_JOAQeC72VX5z9cg8Bn3HtZsdgbtjA7XKcy681o,1078 +django/contrib/contenttypes/locale/fr/LC_MESSAGES/django.po,sha256=6LArEWoBpdaJa7UPcyv4HJKD3YoKUxrwGQGd16bi9DM,1379 +django/contrib/contenttypes/locale/fy/LC_MESSAGES/django.mo,sha256=YQQy7wpjBORD9Isd-p0lLzYrUgAqv770_56-vXa0EOc,476 +django/contrib/contenttypes/locale/fy/LC_MESSAGES/django.po,sha256=SB07aEGG7n4oX_5rqHB6OnjpK_K0KwFM7YxaWYNpB_4,991 +django/contrib/contenttypes/locale/ga/LC_MESSAGES/django.mo,sha256=7E4WYsYrAh_NhlJva_R0dYG0uX9pTKkYdKRq5seoWAA,1081 +django/contrib/contenttypes/locale/ga/LC_MESSAGES/django.po,sha256=3GcPCINXueCiHWnWJACHrkhiMB07D-36ZkuAWkEBSlo,1425 +django/contrib/contenttypes/locale/gd/LC_MESSAGES/django.mo,sha256=dQz7j45qlY3M1rL2fCVdPnuHMUdUcJ0K6cKgRD7Js2w,1154 +django/contrib/contenttypes/locale/gd/LC_MESSAGES/django.po,sha256=_hwx9XqeX5QYRFtDpEYkChswn8WMdYTQlbzL1LjREbY,1368 +django/contrib/contenttypes/locale/gl/LC_MESSAGES/django.mo,sha256=OS8R8sck0Q__XBw3M9brT4jOHmXYUHH71zU2a0mY0vQ,1080 +django/contrib/contenttypes/locale/gl/LC_MESSAGES/django.po,sha256=i-kmfgIuDtreavYL3mCc_BSRi-GmTklAsqE4AhP3wgk,1417 +django/contrib/contenttypes/locale/he/LC_MESSAGES/django.mo,sha256=oaxWykyc3N63WpxyHPI5CyhCTBqhM5-2Sasp_DNm1xc,1219 +django/contrib/contenttypes/locale/he/LC_MESSAGES/django.po,sha256=wCm08UMCiCa6y1-5E-7bEz-8Kd0oMRMwgzoEJjMwFyw,1486 +django/contrib/contenttypes/locale/hi/LC_MESSAGES/django.mo,sha256=KAZuQMKOvIPj3a7GrNJE3yhT70O2abCEF2GOsbwTE5A,1321 +django/contrib/contenttypes/locale/hi/LC_MESSAGES/django.po,sha256=PcsNgu2YmT0biklhwOF_nSvoGTvWVKw2IsBxIwSVAtI,1577 +django/contrib/contenttypes/locale/hr/LC_MESSAGES/django.mo,sha256=DbOUA8ks3phsEwQvethkwZ9-ymrd36aQ6mP7OnGdpjU,1167 +django/contrib/contenttypes/locale/hr/LC_MESSAGES/django.po,sha256=722KxvayO6YXByAmO4gfsfzyVbT-HqqrLYQsr02KDc8,1445 +django/contrib/contenttypes/locale/hsb/LC_MESSAGES/django.mo,sha256=tPtv_lIzCPIUjGkAYalnNIUxVUQFE3MShhVXTnfVx3Q,1106 +django/contrib/contenttypes/locale/hsb/LC_MESSAGES/django.po,sha256=rbI3G8ARG7DF7uEe82SYCfotBnKTRJJ641bGhjdptTQ,1329 +django/contrib/contenttypes/locale/hu/LC_MESSAGES/django.mo,sha256=2nsylOwBIDOnkUjE2GYU-JRvgs_zxent7q3_PuscdXk,1102 +django/contrib/contenttypes/locale/hu/LC_MESSAGES/django.po,sha256=Dzcf94ZSvJtyNW9EUKpmyNJ1uZbXPvc7dIxCccZrDYc,1427 +django/contrib/contenttypes/locale/hy/LC_MESSAGES/django.mo,sha256=hKOErB5dzj44ThQ1_nZHak2-aXZlwMoxYcDWmPb3Xo8,1290 +django/contrib/contenttypes/locale/hy/LC_MESSAGES/django.po,sha256=UeGzaghsEt9Lt5DsEzRb9KCbuphWUQwLayt4AN194ao,1421 +django/contrib/contenttypes/locale/ia/LC_MESSAGES/django.mo,sha256=9B0XhxH0v3FvkEvS5MOHHqVbgV6KQITPrjzx1Sn76GA,1105 +django/contrib/contenttypes/locale/ia/LC_MESSAGES/django.po,sha256=NX8jpTaIhtVbVlwEsOl5aufZ80ljHZZwqtsVVozQb4M,1318 +django/contrib/contenttypes/locale/id/LC_MESSAGES/django.mo,sha256=4-6RBAvrtA1PY3LNxMrgwzBLZE0ZKwWaXa7SmtmAIyk,1031 +django/contrib/contenttypes/locale/id/LC_MESSAGES/django.po,sha256=xdxEOgfta1kaXyQAngmmbL8wDQzJU6boC9HdbmoM1iI,1424 +django/contrib/contenttypes/locale/io/LC_MESSAGES/django.mo,sha256=3SSRXx4tYiMUc00LZ9kGHuvTgaWpsICEf5G208CEqgg,1051 +django/contrib/contenttypes/locale/io/LC_MESSAGES/django.po,sha256=1ku9WPcenn47DOF05HL2eRqghZeRYfklo2huYUrkeJ0,1266 +django/contrib/contenttypes/locale/is/LC_MESSAGES/django.mo,sha256=ZYWbT4qeaco8h_J9SGF2Bs7Rdu3auZ969xZ0RQ_03go,1049 +django/contrib/contenttypes/locale/is/LC_MESSAGES/django.po,sha256=iNdghSbBVPZmfrHu52hRG8vHMgGUfOjLqie09fYcuso,1360 +django/contrib/contenttypes/locale/it/LC_MESSAGES/django.mo,sha256=GSP0BJc3bGLoNS0tnhiz_5dtSh5NXCrBiZbnwEhWbpk,1075 +django/contrib/contenttypes/locale/it/LC_MESSAGES/django.po,sha256=njEgvhDwWOc-CsGBDz1_mtEsXx2aTU6cP3jZzcLkkYk,1457 +django/contrib/contenttypes/locale/ja/LC_MESSAGES/django.mo,sha256=tVH6RvZ5tXz56lEM3aoJtFp5PKsSR-XXpi8ZNCHjiFw,1211 +django/contrib/contenttypes/locale/ja/LC_MESSAGES/django.po,sha256=5_-Uo7Ia3X9gAWm2f72ezQnNr_pQzf6Ax4AUutULuZU,1534 +django/contrib/contenttypes/locale/ka/LC_MESSAGES/django.mo,sha256=1_yGL68sK0QG_mhwFAVdksiDlB57_1W5QkL7NGGE5L0,1429 +django/contrib/contenttypes/locale/ka/LC_MESSAGES/django.po,sha256=6iUBbKjXsIgrq7Dj_xhxzoxItSSSKwQjIZsDayefGr8,1654 +django/contrib/contenttypes/locale/kk/LC_MESSAGES/django.mo,sha256=SNY0vydwLyR2ExofAHjmg1A2ykoLI7vU5Ryq-QFu5Gs,627 +django/contrib/contenttypes/locale/kk/LC_MESSAGES/django.po,sha256=PU-NAl6xUEeGV0jvJx9siVBTZIzHywL7oKc4DgUjNkc,1130 +django/contrib/contenttypes/locale/km/LC_MESSAGES/django.mo,sha256=BXifukxf48Lr0t0V3Y0GJUMhD1KiHN1wwbueoK0MW1A,678 +django/contrib/contenttypes/locale/km/LC_MESSAGES/django.po,sha256=fTPlBbnaNbLZxjzJutGvqe33t6dWsEKiHQYaw27m7KQ,1123 +django/contrib/contenttypes/locale/kn/LC_MESSAGES/django.mo,sha256=a4sDGaiyiWn-1jFozYI4vdAvuHXrs8gbZErP_SAUk9Y,714 +django/contrib/contenttypes/locale/kn/LC_MESSAGES/django.po,sha256=A6Vss8JruQcPUKQvY-zaubVZDTLEPwHsnd_rXcyzQUs,1168 +django/contrib/contenttypes/locale/ko/LC_MESSAGES/django.mo,sha256=myRfFxf2oKcbpmCboongTsL72RTM95nEmAC938M-ckE,1089 +django/contrib/contenttypes/locale/ko/LC_MESSAGES/django.po,sha256=uui_LhgGTrW0uo4p-oKr4JUzhjvkLbFCqRVLNMrptzY,1383 +django/contrib/contenttypes/locale/ky/LC_MESSAGES/django.mo,sha256=ULoIe36zGKPZZs113CenA6J9HviYcBOKagXrPGxyBUI,1182 +django/contrib/contenttypes/locale/ky/LC_MESSAGES/django.po,sha256=FnW5uO8OrTYqbvoRuZ6gnCD6CHnuLjN00s2Jo1HX1NE,1465 +django/contrib/contenttypes/locale/lb/LC_MESSAGES/django.mo,sha256=xokesKl7h7k9dXFKIJwGETgwx1Ytq6mk2erBSxkgY-o,474 +django/contrib/contenttypes/locale/lb/LC_MESSAGES/django.po,sha256=dwVKpCRYmXTD9h69v5ivkZe-yFtvdZNZ3VfuyIl4olY,989 +django/contrib/contenttypes/locale/lt/LC_MESSAGES/django.mo,sha256=HucsRl-eqfxw6ESTuXvl7IGjPGYSI9dxM5lMly_P1sc,1215 +django/contrib/contenttypes/locale/lt/LC_MESSAGES/django.po,sha256=odzYqHprxKFIrR8TzdxA4WeeMK0W0Nvn2gAVuzAsEqI,1488 +django/contrib/contenttypes/locale/lv/LC_MESSAGES/django.mo,sha256=nWfy7jv2VSsKYT6yhk_xqxjk1TlppJfsQcurC40CeTs,1065 +django/contrib/contenttypes/locale/lv/LC_MESSAGES/django.po,sha256=pHlbzgRpIJumDMp2rh1EKrxFBg_DRcvLLgkQ3mi_L0s,1356 +django/contrib/contenttypes/locale/mk/LC_MESSAGES/django.mo,sha256=KTFZWm0F4S6lmi1FX76YKOyJqIZN5cTsiTBI_D4ADHs,1258 +django/contrib/contenttypes/locale/mk/LC_MESSAGES/django.po,sha256=mQZosS90S-Bil6-EoGjs9BDWYlvOF6mtUDZ8h9NxEdE,1534 +django/contrib/contenttypes/locale/ml/LC_MESSAGES/django.mo,sha256=rtmLWfuxJED-1KuqkUT8F5CU1KGJP0Of718n2Gl_gI0,1378 +django/contrib/contenttypes/locale/ml/LC_MESSAGES/django.po,sha256=Z-kL9X9CD7rYfa4Uoykye2UgCNQlgyql0HTv1eUXAf4,1634 +django/contrib/contenttypes/locale/mn/LC_MESSAGES/django.mo,sha256=J6kKYjUOsQxptNXDcCaY4d3dHJio4HRibRk3qfwO6Xc,1225 +django/contrib/contenttypes/locale/mn/LC_MESSAGES/django.po,sha256=x8aRJH2WQvMBBWlQt3T3vpV4yHeZXLmRTT1U0at4ZIk,1525 +django/contrib/contenttypes/locale/mr/LC_MESSAGES/django.mo,sha256=G7yoBvkVNtyQxT2RCCPjBeI8C3lAzVcPxW0OkDeVyz0,1004 +django/contrib/contenttypes/locale/mr/LC_MESSAGES/django.po,sha256=BKgamLogZ-F3gBYeTZy1rGCkNe5AjOew8Nm1LTVkhEs,1348 +django/contrib/contenttypes/locale/ms/LC_MESSAGES/django.mo,sha256=EIwbOZ0QahW9AFFWRmRdKGKBtYYY_eTcfU4eqDVSVxw,1035 +django/contrib/contenttypes/locale/ms/LC_MESSAGES/django.po,sha256=t7nKsOMxycn_CsXw2nIfU-owJRge3FAixgbTsDhffvo,1225 +django/contrib/contenttypes/locale/my/LC_MESSAGES/django.mo,sha256=YYa2PFe9iJygqL-LZclfpgR6rBmIvx61JRpBkKS6Hrs,1554 +django/contrib/contenttypes/locale/my/LC_MESSAGES/django.po,sha256=6F3nXd9mBc-msMchkC8OwAHME1x1O90xrsZp7xmynpU,1732 +django/contrib/contenttypes/locale/nb/LC_MESSAGES/django.mo,sha256=EHU9Lm49U7WilR5u-Lq0Fg8ChR_OzOce4UyPlkZ6Zs4,1031 +django/contrib/contenttypes/locale/nb/LC_MESSAGES/django.po,sha256=lbktPYsJudrhe4vxnauzpzN9eNwyoVs0ZmZSdkwjkOk,1403 +django/contrib/contenttypes/locale/ne/LC_MESSAGES/django.mo,sha256=-zZAn5cex4PkScoZVqS74PUMThJJuovZSk3WUKZ8hnw,1344 +django/contrib/contenttypes/locale/ne/LC_MESSAGES/django.po,sha256=1ZCUkulQ9Gxb50yMKFKWaTJli2SinBeNj0KpXkKpsNE,1519 +django/contrib/contenttypes/locale/nl/LC_MESSAGES/django.mo,sha256=aXDHgg891TyTiMWNcbNaahfZQ2hqtl5yTkx5gNRocMU,1040 +django/contrib/contenttypes/locale/nl/LC_MESSAGES/django.po,sha256=zDJ_vyQxhP0mP06U-e4p6Uj6v1g863s8oaxc0JIAMjg,1396 +django/contrib/contenttypes/locale/nn/LC_MESSAGES/django.mo,sha256=a_X8e2lMieWwUtENJueBr8wMvkw6at0QSaWXd5AM6yQ,1040 +django/contrib/contenttypes/locale/nn/LC_MESSAGES/django.po,sha256=xFSirHUAKv78fWUpik6xv-6WQSEoUgN5jjPbTOy58C4,1317 +django/contrib/contenttypes/locale/os/LC_MESSAGES/django.mo,sha256=QV533Wu-UpjV3XiCe83jlz7XGuwgRviV0ggoeMaIOIY,1116 +django/contrib/contenttypes/locale/os/LC_MESSAGES/django.po,sha256=UZahnxo8z6oWJfEz4JNHGng0EAifXYtJupB6lx0JB60,1334 +django/contrib/contenttypes/locale/pa/LC_MESSAGES/django.mo,sha256=qacd7eywof8rvJpstNfEmbHgvDiQ9gmkcyG7gfato8s,697 +django/contrib/contenttypes/locale/pa/LC_MESSAGES/django.po,sha256=Kq2NTzdbgq8Q9jLLgV-ZJaSRj43D1dDHcRIgNnJXu-s,1145 +django/contrib/contenttypes/locale/pl/LC_MESSAGES/django.mo,sha256=J5sC36QwKLvrMB4adsojhuw2kYuEckHz6eoTrZwYcnI,1208 +django/contrib/contenttypes/locale/pl/LC_MESSAGES/django.po,sha256=gxP59PjlIHKSiYZcbgIY4PUZSoKYx4YKCpm4W4Gj22g,1577 +django/contrib/contenttypes/locale/pt/LC_MESSAGES/django.mo,sha256=k7cJHLP3avrBD50o5oxaZmLlT9Uv_XgxzDn4YhvNeDM,1154 +django/contrib/contenttypes/locale/pt/LC_MESSAGES/django.po,sha256=O087gXKjUtRwCrYHERr-m8smmuJg-eo4OAOL2vRDBj4,1446 +django/contrib/contenttypes/locale/pt_BR/LC_MESSAGES/django.mo,sha256=qjl-3fBqNcAuoviGejjILC7Z8XmrRd7gHwOgwu1x1zw,1117 +django/contrib/contenttypes/locale/pt_BR/LC_MESSAGES/django.po,sha256=Xp0iBhseS8v13zjDcNQv4BDaroMtDJVs4-BzNc0UOpU,1494 +django/contrib/contenttypes/locale/ro/LC_MESSAGES/django.mo,sha256=sCthDD10v7GY2cui9Jj9HK8cofVEg2WERCm6aktOM-4,1142 +django/contrib/contenttypes/locale/ro/LC_MESSAGES/django.po,sha256=n-BPEfua0Gd6FN0rsP7qAlTGbQEZ14NnDMA8jI2844Y,1407 +django/contrib/contenttypes/locale/ru/LC_MESSAGES/django.mo,sha256=OSf206SFmVLULHmwVhTaRhWTQtyDKsxe03gIzuvAUnY,1345 +django/contrib/contenttypes/locale/ru/LC_MESSAGES/django.po,sha256=xHyJYD66r8We3iN5Hqo69syWkjhz4zM7X9BWPIiI6mU,1718 +django/contrib/contenttypes/locale/sk/LC_MESSAGES/django.mo,sha256=osKXPEE0x-oahNDjgr4aea3dzmLddTT_RLQ8TnbsIOg,1115 +django/contrib/contenttypes/locale/sk/LC_MESSAGES/django.po,sha256=nZBxZH3r93fbtth15iP-Q2tNLrZrYqc8V0B9c4XMRNI,1433 +django/contrib/contenttypes/locale/sl/LC_MESSAGES/django.mo,sha256=sMML-ubI_9YdKptzeri1du8FOdKcEzJbe4Tt0J4ePFI,1147 +django/contrib/contenttypes/locale/sl/LC_MESSAGES/django.po,sha256=0zxiyzRWWDNVpNNLlcwl-OLh5sLukma1vm-kYrGHYrE,1392 +django/contrib/contenttypes/locale/sq/LC_MESSAGES/django.mo,sha256=jYDQH3OpY4Vx9hp6ISFMI88uxBa2GDQK0BkLGm8Qulk,1066 +django/contrib/contenttypes/locale/sq/LC_MESSAGES/django.po,sha256=JIvguXVOFpQ3MRqRXHpxlg8_YhEzCsZBBMdpekYTxlk,1322 +django/contrib/contenttypes/locale/sr/LC_MESSAGES/django.mo,sha256=GUXj97VN15HdY7XMy5jmMLEu13juD3To5NsztcoyPGs,1204 +django/contrib/contenttypes/locale/sr/LC_MESSAGES/django.po,sha256=T1w_EeB6yT-PXr7mrwzqu270linf_KY3_ZCgl4wfLAQ,1535 +django/contrib/contenttypes/locale/sr_Latn/LC_MESSAGES/django.mo,sha256=m2plistrI8O-ztAs5HmDYXG8N_wChaDfXFev0GYWVys,1102 +django/contrib/contenttypes/locale/sr_Latn/LC_MESSAGES/django.po,sha256=lJrhLPDbJAcXgBPco-_lfUXqs31imj_vGwE5p1EXZjk,1390 +django/contrib/contenttypes/locale/sv/LC_MESSAGES/django.mo,sha256=J5ha8X6jnQ4yuafk-JCqPM5eIGNwKpDOpTwIVCrnGNE,1055 +django/contrib/contenttypes/locale/sv/LC_MESSAGES/django.po,sha256=HeKnQJaRNflAbKxTiC_2EFAg2Sx-e3nDXrReJyVoNTQ,1400 +django/contrib/contenttypes/locale/sw/LC_MESSAGES/django.mo,sha256=XLPle0JYPPkmm5xpJRmWztMTF1_3a2ZubWE4ur2sav8,563 +django/contrib/contenttypes/locale/sw/LC_MESSAGES/django.po,sha256=jRc8Eh6VuWgqc4kM-rxjbVE3yV9uip6mOJLdD6yxGLM,1009 +django/contrib/contenttypes/locale/ta/LC_MESSAGES/django.mo,sha256=L3eF4z9QSmIPqzEWrNk8-2uLteQUMsuxiD9VZyRuSfo,678 +django/contrib/contenttypes/locale/ta/LC_MESSAGES/django.po,sha256=iDb9lRU_-YPmO5tEQeXEZeGeFe-wVZy4k444sp_vTgw,1123 +django/contrib/contenttypes/locale/te/LC_MESSAGES/django.mo,sha256=S_UF_mZbYfScD6Z36aB-kwtTflTeX3Wt4k7z_pEcOV8,690 +django/contrib/contenttypes/locale/te/LC_MESSAGES/django.po,sha256=aAGMMoJPg_pF9_rCNZmda5A_TvDCvQfYEL64Xdoa4jo,1135 +django/contrib/contenttypes/locale/tg/LC_MESSAGES/django.mo,sha256=dkLic6fD2EMzrB7m7MQazaGLoJ_pBw55O4nYZc5UYEs,864 +django/contrib/contenttypes/locale/tg/LC_MESSAGES/django.po,sha256=1nv1cVJewfr44gbQh1Szzy3DT4Y9Dy7rUgAZ81otJQs,1232 +django/contrib/contenttypes/locale/th/LC_MESSAGES/django.mo,sha256=qilt-uZMvt0uw-zFz7-eCmkGEx3XYz7NNo9Xbq3s7uI,1186 +django/contrib/contenttypes/locale/th/LC_MESSAGES/django.po,sha256=42F34fNEn_3yQKBBJnCLttNeyktuLVpilhMyepOd6dg,1444 +django/contrib/contenttypes/locale/tk/LC_MESSAGES/django.mo,sha256=0fuA3E487-pceoGpX9vMCwSnCItN_pbLUIUzzcrAGOE,1068 +django/contrib/contenttypes/locale/tk/LC_MESSAGES/django.po,sha256=pS8wX9dzxys3q8Vvz3PyoVJYqplXhNuAqfq7Dsb07fw,1283 +django/contrib/contenttypes/locale/tr/LC_MESSAGES/django.mo,sha256=gKg2FCxs2fHpDB1U6gh9xrP7mOpYG65pB4CNmdPYiDg,1057 +django/contrib/contenttypes/locale/tr/LC_MESSAGES/django.po,sha256=gmI3RDhq39IlDuvNohT_FTPY5QG8JD0gFxG5CTsvVZs,1345 +django/contrib/contenttypes/locale/tt/LC_MESSAGES/django.mo,sha256=_LQ1N04FgosdDLUYXJOEqpCB2Mg92q95cBRgYPi1MyY,659 +django/contrib/contenttypes/locale/tt/LC_MESSAGES/django.po,sha256=L7wMMpxGnpQiKd_mjv2bJpE2iqCJ8XwiXK0IN4EHSbM,1110 +django/contrib/contenttypes/locale/udm/LC_MESSAGES/django.mo,sha256=CNmoKj9Uc0qEInnV5t0Nt4ZnKSZCRdIG5fyfSsqwky4,462 +django/contrib/contenttypes/locale/udm/LC_MESSAGES/django.po,sha256=YVyej0nAhhEf7knk4vCeRQhmSQeGZLhMPPXyIyWObnM,977 +django/contrib/contenttypes/locale/ug/LC_MESSAGES/django.mo,sha256=hddqwGR9yrDZye5FZSatvlBBGerLsxS0x1HRodFmwkk,1182 +django/contrib/contenttypes/locale/ug/LC_MESSAGES/django.po,sha256=DoAswgu8-Ukl5e5TLhMcMQRuWEalnmokpKZsKSN9RYk,1397 +django/contrib/contenttypes/locale/uk/LC_MESSAGES/django.mo,sha256=GgAuuLexfhYl1fRKPfZI5uMTkt2H42Ogil6MQHcejkU,1404 +django/contrib/contenttypes/locale/uk/LC_MESSAGES/django.po,sha256=1HzO_Wmxqk0Kd5gtACKZODiH8ZEpOf5Eh8Mkrg3IMf8,1779 +django/contrib/contenttypes/locale/ur/LC_MESSAGES/django.mo,sha256=OJs_EmDBps-9a_KjFJnrS8IqtJfd25LaSWeyG8u8UfI,671 +django/contrib/contenttypes/locale/ur/LC_MESSAGES/django.po,sha256=f0FnsaAM_qrBuCXzLnkBrW5uFfVc6pUh7S-qp4918Ng,1122 +django/contrib/contenttypes/locale/vi/LC_MESSAGES/django.mo,sha256=kGYgEI1gHkyU4y_73mBJN1hlKC2JujVXMg6iCdWncDg,1155 +django/contrib/contenttypes/locale/vi/LC_MESSAGES/django.po,sha256=RIDUgsElfRF8bvBdUKtshizuMnupdMGAM896s7qZKD4,1439 +django/contrib/contenttypes/locale/zh_Hans/LC_MESSAGES/django.mo,sha256=RviK0bqLZzPrZ46xUpc0f8IKkw3JLtsrt0gNA74Ypj0,1015 +django/contrib/contenttypes/locale/zh_Hans/LC_MESSAGES/django.po,sha256=vSKJDEQ_ANTj3-W8BFJd9u_QGdTMF12iS15rVgeujOs,1380 +django/contrib/contenttypes/locale/zh_Hant/LC_MESSAGES/django.mo,sha256=NMumOJ9dPX-7YjQH5Obm4Yj0-lnGXJmCMN5DGbsLQG4,1046 +django/contrib/contenttypes/locale/zh_Hant/LC_MESSAGES/django.po,sha256=7WIqYRpcs986MjUsegqIido5k6HG8d3FVvkrOQCRVCI,1338 +django/contrib/contenttypes/management/__init__.py,sha256=ZVHVJAYi_jCIXxWUZSkxq0IDECe6bvbFsWayrqbutfc,4937 +django/contrib/contenttypes/management/__pycache__/__init__.cpython-312.pyc,, +django/contrib/contenttypes/management/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/contrib/contenttypes/management/commands/__pycache__/__init__.cpython-312.pyc,, +django/contrib/contenttypes/management/commands/__pycache__/remove_stale_contenttypes.cpython-312.pyc,, +django/contrib/contenttypes/management/commands/remove_stale_contenttypes.py,sha256=F6rm6MTMLuZVXCsn6L3ln3ouehsUTaVGaNeaZ4cRW7I,4643 +django/contrib/contenttypes/migrations/0001_initial.py,sha256=Ne2EiaFH4LQqFcIbXU8OiUDeb3P7Mm6dbeqRtNC5U8w,1434 +django/contrib/contenttypes/migrations/0002_remove_content_type_name.py,sha256=fTZJQHV1Dw7TwPaNDLFUjrpZzFk_UvaR9sw3oEMIN2Y,1199 +django/contrib/contenttypes/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/contrib/contenttypes/migrations/__pycache__/0001_initial.cpython-312.pyc,, +django/contrib/contenttypes/migrations/__pycache__/0002_remove_content_type_name.cpython-312.pyc,, +django/contrib/contenttypes/migrations/__pycache__/__init__.cpython-312.pyc,, +django/contrib/contenttypes/models.py,sha256=VKXWweIQQ6eX88YX96nlcMo9ESaW7p_wUPJSalGInsc,6844 +django/contrib/contenttypes/prefetch.py,sha256=cORwKClKS-wzGrmRj2BlSBuuJz6iRBWOVl4tBYHRrtA,1358 +django/contrib/contenttypes/views.py,sha256=HBoIbNpgHTQN5pH8mul77UMEMZHbbkEH_Qdln-XFgd0,3549 +django/contrib/flatpages/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/contrib/flatpages/__pycache__/__init__.cpython-312.pyc,, +django/contrib/flatpages/__pycache__/admin.cpython-312.pyc,, +django/contrib/flatpages/__pycache__/apps.cpython-312.pyc,, +django/contrib/flatpages/__pycache__/forms.cpython-312.pyc,, +django/contrib/flatpages/__pycache__/middleware.cpython-312.pyc,, +django/contrib/flatpages/__pycache__/models.cpython-312.pyc,, +django/contrib/flatpages/__pycache__/sitemaps.cpython-312.pyc,, +django/contrib/flatpages/__pycache__/urls.cpython-312.pyc,, +django/contrib/flatpages/__pycache__/views.cpython-312.pyc,, +django/contrib/flatpages/admin.py,sha256=ynemOSDgvKoCfRFLXZrPwj27U0mPUXmxdrue7SOZeqQ,701 +django/contrib/flatpages/apps.py,sha256=_OlaDxWbMrUmFNCS4u-RnBsg67rCWs8Qzh_c58wvtXA,252 +django/contrib/flatpages/forms.py,sha256=r9yUG_-zAnI7Ubr836aiWgScYpKxHhJbNLhHRkZQOzY,2492 +django/contrib/flatpages/locale/af/LC_MESSAGES/django.mo,sha256=AG2eKl6o50fG3wWYS7D4-m3gWi9_yfPwEHp-HjB4Sr8,2282 +django/contrib/flatpages/locale/af/LC_MESSAGES/django.po,sha256=EVgUOspHqS4FuFggANzWpyQEutGV4kSx2zUWoOjBF9w,2459 +django/contrib/flatpages/locale/ar/LC_MESSAGES/django.mo,sha256=dBHaqsaKH9QOIZ0h2lIDph8l9Bv2UAcD-Hr9TAxj8Ac,2636 +django/contrib/flatpages/locale/ar/LC_MESSAGES/django.po,sha256=-0ZdfA-sDU8fOucgT2Ow1iM3QnRMuQeslMOSwYhAH9M,2958 +django/contrib/flatpages/locale/ar_DZ/LC_MESSAGES/django.mo,sha256=jp6sS05alESJ4-SbEIf574UPVcbllAd_J-FW802lGyk,2637 +django/contrib/flatpages/locale/ar_DZ/LC_MESSAGES/django.po,sha256=yezpjWcROwloS08TEMo9oPXDKS1mfFE9NYI66FUuLaA,2799 +django/contrib/flatpages/locale/ast/LC_MESSAGES/django.mo,sha256=4SEsEE2hIZJwQUNs8jDgN6qVynnUYJUIE4w-usHKA6M,924 +django/contrib/flatpages/locale/ast/LC_MESSAGES/django.po,sha256=5UlyS59bVo1lccM6ZgdYSgHe9NLt_WeOdXX-swLKubU,1746 +django/contrib/flatpages/locale/az/LC_MESSAGES/django.mo,sha256=s3YhszIU5rdigUVVPB3Jpfn3jbH5L1NXWXky_Q3slvY,2378 +django/contrib/flatpages/locale/az/LC_MESSAGES/django.po,sha256=tDALtASG8n7uaJT7yFsM-rz7FN5rONXlCKqCQIrIcPY,2707 +django/contrib/flatpages/locale/be/LC_MESSAGES/django.mo,sha256=mOQlbfwwIZiwWCrFStwag2irCwsGYsXIn6wZDsPRvyA,2978 +django/contrib/flatpages/locale/be/LC_MESSAGES/django.po,sha256=wlIfhun5Jd6gxbkmmYPSIy_tzPVmSu4CjMwPzBNnvpo,3161 +django/contrib/flatpages/locale/bg/LC_MESSAGES/django.mo,sha256=9Un5mKtsAuNeYWFQKFkIyCpQquE6qVD3zIrFoq8sCDI,2802 +django/contrib/flatpages/locale/bg/LC_MESSAGES/django.po,sha256=Vr6d-9XjgK4_eXdWY3FEpdTlCEGgbCv93bLGyMTE9hs,3104 +django/contrib/flatpages/locale/bn/LC_MESSAGES/django.mo,sha256=2oK2Rm0UtAI7QFRwpUR5aE3-fOltE6kTilsTbah737Y,2988 +django/contrib/flatpages/locale/bn/LC_MESSAGES/django.po,sha256=QrbX69iqXOD6oByLcgPkD1QzAkfthpfTjezIFQ-6kVg,3172 +django/contrib/flatpages/locale/br/LC_MESSAGES/django.mo,sha256=SKbykdilX_NcpkVi_lHF8LouB2G49ZAzdF09xw49ERc,2433 +django/contrib/flatpages/locale/br/LC_MESSAGES/django.po,sha256=O_mwrHIiEwV4oB1gZ7Yua4nVKRgyIf3j5UtedZWAtwk,2783 +django/contrib/flatpages/locale/bs/LC_MESSAGES/django.mo,sha256=bd7ID7OsEhp57JRw_TXoTwsVQNkFYiR_sxSkgi4WvZU,1782 +django/contrib/flatpages/locale/bs/LC_MESSAGES/django.po,sha256=IyFvI5mL_qesEjf6NO1nNQbRHhCAZQm0UhIpmGjrSwQ,2233 +django/contrib/flatpages/locale/ca/LC_MESSAGES/django.mo,sha256=GcMVbg4i5zKCd2Su7oN30WVJN7Q9K7FsFifgTB8jDPI,2237 +django/contrib/flatpages/locale/ca/LC_MESSAGES/django.po,sha256=-aJHSbWPVyNha_uF6R35Q6yn4-Hse3jTInr9jtaxKOI,2631 +django/contrib/flatpages/locale/ckb/LC_MESSAGES/django.mo,sha256=ds26zJRsUHDNdhoUJ8nsLtBdKDhN29Kb51wNiB8Llgo,2716 +django/contrib/flatpages/locale/ckb/LC_MESSAGES/django.po,sha256=jqqMYjrplyX8jtyBLd1ObMEwoFmaETmNXrO3tg2S0BY,2918 +django/contrib/flatpages/locale/cs/LC_MESSAGES/django.mo,sha256=8nwep22P86bMCbW7sj4n0BMGl_XaJIJV0fjnVp-_dqY,2340 +django/contrib/flatpages/locale/cs/LC_MESSAGES/django.po,sha256=1agUeRthwpam1UvZY4vRnZtLLbiop75IEXb6ul_e3mg,2611 +django/contrib/flatpages/locale/cy/LC_MESSAGES/django.mo,sha256=zr_2vsDZsrby3U8AmvlJMU3q1U_4IrrTmz6oS29OWtQ,2163 +django/contrib/flatpages/locale/cy/LC_MESSAGES/django.po,sha256=E_NC_wtuhWKYKB3YvYGB9ccJgKI3AfIZlB2HpXSyOsk,2370 +django/contrib/flatpages/locale/da/LC_MESSAGES/django.mo,sha256=nALoI50EvFPa4f3HTuaHUHATF1zHMjo4v5zcHj4n6sA,2277 +django/contrib/flatpages/locale/da/LC_MESSAGES/django.po,sha256=j4dpnreB7LWdZO7Drj7E9zBwFx_Leuj7ZLyEPi-ccAQ,2583 +django/contrib/flatpages/locale/de/LC_MESSAGES/django.mo,sha256=I4CHFzjYM_Wd-vuIYOMf8E58ntOgkLmgOAg35Chdz3s,2373 +django/contrib/flatpages/locale/de/LC_MESSAGES/django.po,sha256=P6tPVPumP9JwBIv-XXi1QQYJyj1PY3OWoM4yOAmgTRE,2592 +django/contrib/flatpages/locale/dsb/LC_MESSAGES/django.mo,sha256=oTILSe5teHa9XTYWoamstpyPu02yb_xo8S0AtkP7WP8,2391 +django/contrib/flatpages/locale/dsb/LC_MESSAGES/django.po,sha256=1xD2aH5alerranvee6QLZqgxDVXxHThXCHR4kOJAV48,2576 +django/contrib/flatpages/locale/el/LC_MESSAGES/django.mo,sha256=LQ8qIGwzoKwewtLz_1NhnhEeR4dPx2rrQ_hAN4BF6Og,2864 +django/contrib/flatpages/locale/el/LC_MESSAGES/django.po,sha256=gbLO52fcZK7LoG5Rget2Aq5PTFoz467ackXpSsR81kY,3221 +django/contrib/flatpages/locale/en/LC_MESSAGES/django.mo,sha256=U0OV81NfbuNL9ctF-gbGUG5al1StqN-daB-F-gFBFC8,356 +django/contrib/flatpages/locale/en/LC_MESSAGES/django.po,sha256=0bNWKiu-1MkHFJ_UWrCLhp9ENr-pHzBz1lkhBkkrhJM,2169 +django/contrib/flatpages/locale/en_AU/LC_MESSAGES/django.mo,sha256=dTt7KtwiEyMEKYVzkPSqs6VS0CiUfK7ISz2c6rV2erA,2210 +django/contrib/flatpages/locale/en_AU/LC_MESSAGES/django.po,sha256=_V4RTf0JtmyU7DRQv7jIwtPJs05KA2THPid5nKQ0ego,2418 +django/contrib/flatpages/locale/en_GB/LC_MESSAGES/django.mo,sha256=7zyXYOsqFkUGxclW-VPPxrQTZKDuiYQ7MQJy4m8FClo,1989 +django/contrib/flatpages/locale/en_GB/LC_MESSAGES/django.po,sha256=oHrBd6lVnO7-SdnO-Taa7iIyiqp_q2mQZjkuuU3Qa_s,2232 +django/contrib/flatpages/locale/eo/LC_MESSAGES/django.mo,sha256=W8TkkQkV58oOvFdKCPAyoQNyCxSmfErwik1U8a_W5nE,2333 +django/contrib/flatpages/locale/eo/LC_MESSAGES/django.po,sha256=e54WOtIcIQLjB4bJGol51z6d6dwLBiiJN2k-nrTQlaI,2750 +django/contrib/flatpages/locale/es/LC_MESSAGES/django.mo,sha256=9Q7Qf1eSPvAfPTZSGWq7QMWrROY-CnpUkeRpiH8rpJw,2258 +django/contrib/flatpages/locale/es/LC_MESSAGES/django.po,sha256=3vGZ3uVCyWnIkDSUt6DMMOqyphv3EQteTPLx7e9J_sU,2663 +django/contrib/flatpages/locale/es_AR/LC_MESSAGES/django.mo,sha256=bUnFDa5vpxl27kn2ojTbNaCmwRkBCH-z9zKXAvXe3Z0,2275 +django/contrib/flatpages/locale/es_AR/LC_MESSAGES/django.po,sha256=vEg3wjL_7Ee-PK4FZTaGRCXFscthkoH9szJ7H01K8w8,2487 +django/contrib/flatpages/locale/es_CO/LC_MESSAGES/django.mo,sha256=jt8wzeYky5AEnoNuAv8W4nGgd45XsMbpEdRuLnptr3U,2140 +django/contrib/flatpages/locale/es_CO/LC_MESSAGES/django.po,sha256=xrbAayPoxT7yksXOGPb-0Nc-4g14UmWANaKTD4ItAFA,2366 +django/contrib/flatpages/locale/es_MX/LC_MESSAGES/django.mo,sha256=Y5IOKRzooJHIhJzD9q4PKOe39Z4Rrdz8dBKuvmGkqWU,2062 +django/contrib/flatpages/locale/es_MX/LC_MESSAGES/django.po,sha256=Y-EXhw-jISttA9FGMz7gY_kB-hQ3wEyKEaOc2gu2hKQ,2246 +django/contrib/flatpages/locale/es_VE/LC_MESSAGES/django.mo,sha256=EI6WskepXUmbwCPBNFKqLGNcWFVZIbvXayOHxOCLZKo,2187 +django/contrib/flatpages/locale/es_VE/LC_MESSAGES/django.po,sha256=ipG6a0A2d0Pyum8GcknA-aNExVLjSyuUqbgHM9VdRQo,2393 +django/contrib/flatpages/locale/et/LC_MESSAGES/django.mo,sha256=zriqETEWD-DDPiNzXgAzgEhjvPAaTo7KBosyvBebyc0,2233 +django/contrib/flatpages/locale/et/LC_MESSAGES/django.po,sha256=tMuITUlzy6LKJh3X3CxssFpTQogg8OaGHlKExzjwyOI,2525 +django/contrib/flatpages/locale/eu/LC_MESSAGES/django.mo,sha256=FoKazUkuPpDgsEEI6Gm-xnZYVHtxILiy6Yzvnu8y-L0,2244 +django/contrib/flatpages/locale/eu/LC_MESSAGES/django.po,sha256=POPFB5Jd8sE9Z_ivYSdnet14u-aaXneTUNDMuOrJy00,2478 +django/contrib/flatpages/locale/fa/LC_MESSAGES/django.mo,sha256=2rA7-OR8lQbl_ZhlAC4cmHEmQ9mwxnA8q5M-gx3NmVQ,2612 +django/contrib/flatpages/locale/fa/LC_MESSAGES/django.po,sha256=_-yKW2xIN9XSXEwZTdkhEpRHJoacN8f56D3AkCvlFs0,3006 +django/contrib/flatpages/locale/fi/LC_MESSAGES/django.mo,sha256=VsQdof8hE_AKQGS-Qp82o8PTN_7NxxEdxelGenIAE-8,2256 +django/contrib/flatpages/locale/fi/LC_MESSAGES/django.po,sha256=RL7eruNkgDjr1b3cF2yCqeM8eDKHwAqF6h8hYuxl6R4,2552 +django/contrib/flatpages/locale/fr/LC_MESSAGES/django.mo,sha256=ZqD4O3_Ny8p5i6_RVHlANCnPiowMd19Qi_LOPfTHav4,2430 +django/contrib/flatpages/locale/fr/LC_MESSAGES/django.po,sha256=liAoOgT2CfpANL_rYzyzsET1MhsM19o7wA2GBnoDvMA,2745 +django/contrib/flatpages/locale/fy/LC_MESSAGES/django.mo,sha256=DRsFoZKo36F34XaiQg_0KUOr3NS_MG3UHptzOI4uEAU,476 +django/contrib/flatpages/locale/fy/LC_MESSAGES/django.po,sha256=9JIrRVsPL1m0NPN6uHiaAYxJXHp5IghZmQhVSkGo5g8,1523 +django/contrib/flatpages/locale/ga/LC_MESSAGES/django.mo,sha256=f4552jyACX8w17CU4QAwoPmj05A8nNaTiy-2cbmegSk,2351 +django/contrib/flatpages/locale/ga/LC_MESSAGES/django.po,sha256=oPLJhdAZd2zwKo4o12vDJU-7MQ_CiC9wqszFHmV7LXo,2613 +django/contrib/flatpages/locale/gd/LC_MESSAGES/django.mo,sha256=KbaTL8kF9AxDBLDQWlxcP5hZ4zWnbkvY0l2xRKZ9Dg0,2469 +django/contrib/flatpages/locale/gd/LC_MESSAGES/django.po,sha256=DVY_1R0AhIaI1qXIeRej3XSHMtlimeKNUwzFjc4OmwA,2664 +django/contrib/flatpages/locale/gl/LC_MESSAGES/django.mo,sha256=e8hfOxRyLtCsvdd1FVGuI_dnsptVhfW_O9KyuPT0ENk,2256 +django/contrib/flatpages/locale/gl/LC_MESSAGES/django.po,sha256=YqyR8qnKho8jK03igqPv9KlJw5yVIIDCAGc5z2QxckE,2583 +django/contrib/flatpages/locale/he/LC_MESSAGES/django.mo,sha256=PbypHBhT3W_rp37u8wvaCJdtYB4IP-UeE02VUvSHPf0,2517 +django/contrib/flatpages/locale/he/LC_MESSAGES/django.po,sha256=f7phCRqJPFL7CsuSE1xg9xlaBoOpdd-0zoTYotff29M,2827 +django/contrib/flatpages/locale/hi/LC_MESSAGES/django.mo,sha256=w29ukoF48C7iJ6nE045YoWi7Zcrgu_oXoxT-r6gcQy8,2770 +django/contrib/flatpages/locale/hi/LC_MESSAGES/django.po,sha256=nXq5y1FqMGVhpXpQVdV3uU5JcUtBc2BIrf-n__C2q30,3055 +django/contrib/flatpages/locale/hr/LC_MESSAGES/django.mo,sha256=Mt4gpBuUXvcBl8K714ls4PimHQqee82jFxY1BEAYQOE,2188 +django/contrib/flatpages/locale/hr/LC_MESSAGES/django.po,sha256=ZbUMJY6a-os-xDmcDCJNrN4-YqRe9b_zJ4V5gt2wlGI,2421 +django/contrib/flatpages/locale/hsb/LC_MESSAGES/django.mo,sha256=Pk44puT-3LxzNdGYxMALWpFdw6j6W0G-dWwAfv8sopI,2361 +django/contrib/flatpages/locale/hsb/LC_MESSAGES/django.po,sha256=mhnBXgZSK19E4JU8p2qzqyZqozSzltK-3iY5glr9WG8,2538 +django/contrib/flatpages/locale/hu/LC_MESSAGES/django.mo,sha256=rZxICk460iWBubNq53g9j2JfKIw2W7OqyPG5ylGE92s,2363 +django/contrib/flatpages/locale/hu/LC_MESSAGES/django.po,sha256=DDP7OLBkNbWXr-wiulmQgG461qAubJ8VrfCCXbyPk2g,2700 +django/contrib/flatpages/locale/hy/LC_MESSAGES/django.mo,sha256=qocNtyLcQpjmGqQ130VGjJo-ruaOCtfmZehS9If_hWk,2536 +django/contrib/flatpages/locale/hy/LC_MESSAGES/django.po,sha256=WD8ohMnsaUGQItyqQmS46d76tKgzhQ17X_tGevqULO0,2619 +django/contrib/flatpages/locale/ia/LC_MESSAGES/django.mo,sha256=bochtCPlc268n0WLF0bJtUUT-XveZLPOZPQUetnOWfU,500 +django/contrib/flatpages/locale/ia/LC_MESSAGES/django.po,sha256=gOJ850e8sFcjR2G79zGn3_0-9-KSy591i7ketBRFjyw,1543 +django/contrib/flatpages/locale/id/LC_MESSAGES/django.mo,sha256=2kRHbcmfo09pIEuBb8q5AOkgC0sISJrAG37Rb5F0vts,2222 +django/contrib/flatpages/locale/id/LC_MESSAGES/django.po,sha256=1avfX88CkKMh2AjzN7dxRwj9pgohIBgKE0aXB_shZfc,2496 +django/contrib/flatpages/locale/io/LC_MESSAGES/django.mo,sha256=N8R9dXw_cnBSbZtwRbX6Tzw5XMr_ZdRkn0UmsQFDTi4,464 +django/contrib/flatpages/locale/io/LC_MESSAGES/django.po,sha256=_pJveonUOmMu3T6WS-tV1OFh-8egW0o7vU3i5YqgChA,1511 +django/contrib/flatpages/locale/is/LC_MESSAGES/django.mo,sha256=lFtP1N5CN-x2aMtBNpB6j5HsZYZIZYRm6Y-22gNe1Ek,2229 +django/contrib/flatpages/locale/is/LC_MESSAGES/django.po,sha256=9e132zDa-n6IZxB8jO5H8I0Wr7ubYxrFEMBYj2W49vI,2490 +django/contrib/flatpages/locale/it/LC_MESSAGES/django.mo,sha256=oOEG327VGpi0K5P2UOQgQa39ln15t0lAz2Z36MIQQAc,2209 +django/contrib/flatpages/locale/it/LC_MESSAGES/django.po,sha256=ar8i-bTtAKhiXLULCsKMddpmYBjKyg2paYxBI6ImY1s,2526 +django/contrib/flatpages/locale/ja/LC_MESSAGES/django.mo,sha256=Qax3t7FFRonMrszVEeiyQNMtYyWQB3dmOeeIklEmhAg,2469 +django/contrib/flatpages/locale/ja/LC_MESSAGES/django.po,sha256=N6PBvnXLEWELKTx8nHm5KwydDuFFKq5pn6AIHsBSM5M,2848 +django/contrib/flatpages/locale/ka/LC_MESSAGES/django.mo,sha256=R4OSbZ-lGxMdeJYsaXVXpo6-KSZWeKPuErKmEsUvEQE,3022 +django/contrib/flatpages/locale/ka/LC_MESSAGES/django.po,sha256=TWKtkRamM6YD-4WMoqfZ7KY-ZPs5ny7G82Wst6vQRko,3306 +django/contrib/flatpages/locale/kk/LC_MESSAGES/django.mo,sha256=lMPryzUQr21Uy-NAGQhuIZjHz-4LfBHE_zxEc2_UPaw,2438 +django/contrib/flatpages/locale/kk/LC_MESSAGES/django.po,sha256=3y9PbPw-Q8wM7tCq6u3KeYUT6pfTqcQwlNlSxpAXMxQ,2763 +django/contrib/flatpages/locale/km/LC_MESSAGES/django.mo,sha256=FYRfhNSqBtavYb10sHZNfB-xwLwdZEfVEzX116nBs-k,1942 +django/contrib/flatpages/locale/km/LC_MESSAGES/django.po,sha256=d2AfbR78U0rJqbFmJQvwiBl_QvYIeSwsPKEnfYM4JZA,2471 +django/contrib/flatpages/locale/kn/LC_MESSAGES/django.mo,sha256=n5HCZEPYN_YIVCXrgA1qhxvfhZtDbhfiannJy5EkHkI,1902 +django/contrib/flatpages/locale/kn/LC_MESSAGES/django.po,sha256=-CHwu13UuE2-Qg6poG949I_dw3YiPI9ZhMh5h2vP4xw,2443 +django/contrib/flatpages/locale/ko/LC_MESSAGES/django.mo,sha256=M-IInVdIH24ORarb-KgY60tEorJZgrThDfJQOxW-S0c,2304 +django/contrib/flatpages/locale/ko/LC_MESSAGES/django.po,sha256=DjAtWVAN_fwOvZb-7CUSLtO8WN0Sr08z3jQLNqZ98wY,2746 +django/contrib/flatpages/locale/ky/LC_MESSAGES/django.mo,sha256=WmdWR6dRgmJ-nqSzFDUETypf373fj62igDVHC4ww7hQ,2667 +django/contrib/flatpages/locale/ky/LC_MESSAGES/django.po,sha256=0XDF6CjQTGkuaHADytG95lpFRVndlf_136q0lrQiU1U,2907 +django/contrib/flatpages/locale/lb/LC_MESSAGES/django.mo,sha256=Wkvlh5L_7CopayfNM5Z_xahmyVje1nYOBfQJyqucI_0,502 +django/contrib/flatpages/locale/lb/LC_MESSAGES/django.po,sha256=gGeTuniu3ZZ835t9HR-UtwCcd2s_Yr7ihIUm3jgQ7Y0,1545 +django/contrib/flatpages/locale/lt/LC_MESSAGES/django.mo,sha256=es6xV6X1twtqhIMkV-MByA7KZ5SoVsrx5Qh8BuzJS0Q,2506 +django/contrib/flatpages/locale/lt/LC_MESSAGES/django.po,sha256=T__44veTC_u4hpPvkLekDOWfntXYAMzCd5bffRtGxWA,2779 +django/contrib/flatpages/locale/lv/LC_MESSAGES/django.mo,sha256=RJbVUR8qS8iLL3dD5x1TOau4hcdscHUJBfxge3p3dsM,2359 +django/contrib/flatpages/locale/lv/LC_MESSAGES/django.po,sha256=M6GT6S-5-7__RtSbJ9oqkIlxfU3FIWMlGAQ03NEfcKo,2610 +django/contrib/flatpages/locale/mk/LC_MESSAGES/django.mo,sha256=55H8w6fB-B-RYlKKkGw3fg2m-djxUoEp_XpupK-ZL70,2699 +django/contrib/flatpages/locale/mk/LC_MESSAGES/django.po,sha256=OhHJ5OVWb0jvNaOB3wip9tSIZ1yaPPLkfQR--uUEyUI,2989 +django/contrib/flatpages/locale/ml/LC_MESSAGES/django.mo,sha256=VMMeOujp5fiLzrrbDeH24O2qKBPUkvI_YTSPH-LQjZc,3549 +django/contrib/flatpages/locale/ml/LC_MESSAGES/django.po,sha256=KR2CGnZ1sVuRzSGaPj5IlspoAkVuVEdf48XsAzt1se0,3851 +django/contrib/flatpages/locale/mn/LC_MESSAGES/django.mo,sha256=tqwROY6D-bJ4gbDQIowKXfuLIIdCWksGwecL2sj_wco,2776 +django/contrib/flatpages/locale/mn/LC_MESSAGES/django.po,sha256=jqiBpFLXlptDyU4F8ZWbP61S4APSPh0-nuTpNOejA6c,3003 +django/contrib/flatpages/locale/mr/LC_MESSAGES/django.mo,sha256=fuDy9vFLn5Mb3wVNUg8IvLyTwmyPr3M-GThzgkphJjg,2040 +django/contrib/flatpages/locale/mr/LC_MESSAGES/django.po,sha256=L_1vnLh4AjoaXdb4p_XfDnbKAAWkdQFSpE_8cKGZSm8,2593 +django/contrib/flatpages/locale/ms/LC_MESSAGES/django.mo,sha256=5t_67bMQhux6v6SSWqHfzzCgc6hm3olxgHAsKOMGGZU,2184 +django/contrib/flatpages/locale/ms/LC_MESSAGES/django.po,sha256=-ZzZ8lfAglGkO_BRYz1lRlywxaF1zZ28-Xv74O2nT04,2336 +django/contrib/flatpages/locale/my/LC_MESSAGES/django.mo,sha256=OcbiA7tJPkyt_WNrqyvoFjHt7WL7tMGHV06AZSxzkho,507 +django/contrib/flatpages/locale/my/LC_MESSAGES/django.po,sha256=EPWE566Vn7tax0PYUKq93vtydvmt-A4ooIau9Cwcdfc,1550 +django/contrib/flatpages/locale/nb/LC_MESSAGES/django.mo,sha256=L_XICESZ0nywkk1dn6RqzdUbFTcR92ju-zHCT1g3iEg,2208 +django/contrib/flatpages/locale/nb/LC_MESSAGES/django.po,sha256=ZtcBVD0UqIcsU8iLu5a2wnHLqu5WRLLboVFye2IuQew,2576 +django/contrib/flatpages/locale/ne/LC_MESSAGES/django.mo,sha256=gDZKhcku1NVlSs5ZPPupc7RI8HOF7ex0R4Rs8tMmrYE,1500 +django/contrib/flatpages/locale/ne/LC_MESSAGES/django.po,sha256=GWlzsDaMsJkOvw2TidJOEf1Fvxx9WxGdGAtfZIHkHwk,2178 +django/contrib/flatpages/locale/nl/LC_MESSAGES/django.mo,sha256=_yV_-SYYjpbo-rOHp8NlRzVHFPOSrfS-ndHOEJ9JP3Y,2231 +django/contrib/flatpages/locale/nl/LC_MESSAGES/django.po,sha256=xUuxx2b4ZTCA-1RIdoMqykLgjLLkmpO4ur1Vh93IITU,2669 +django/contrib/flatpages/locale/nn/LC_MESSAGES/django.mo,sha256=sHkuZneEWo1TItSlarlnOUR7ERjc76bJfHUcuFgd9mQ,2256 +django/contrib/flatpages/locale/nn/LC_MESSAGES/django.po,sha256=MpI9qkWqj4rud__xetuqCP-eFHUgMYJpfBhDnWRKPK4,2487 +django/contrib/flatpages/locale/os/LC_MESSAGES/django.mo,sha256=cXGTA5M229UFsgc7hEiI9vI9SEBrNQ8d3A0XrtazO6w,2329 +django/contrib/flatpages/locale/os/LC_MESSAGES/django.po,sha256=m-qoTiKePeFviKGH1rJRjZRH-doJ2Fe4DcZ6W52rG8s,2546 +django/contrib/flatpages/locale/pa/LC_MESSAGES/django.mo,sha256=69_ZsZ4nWlQ0krS6Mx3oL6c4sP5W9mx-yAmOhZOnjPU,903 +django/contrib/flatpages/locale/pa/LC_MESSAGES/django.po,sha256=N6gkoRXP5MefEnjywzRiE3aeU6kHQ0TUG6IGdLV7uww,1780 +django/contrib/flatpages/locale/pl/LC_MESSAGES/django.mo,sha256=5M5-d-TOx2WHlD6BCw9BYIU6bYrSR0Wlem89ih5k3Pc,2448 +django/contrib/flatpages/locale/pl/LC_MESSAGES/django.po,sha256=oKeeo-vNfPaCYVUbufrJZGk0vsgzAE0kLQOTF5qHAK4,2793 +django/contrib/flatpages/locale/pt/LC_MESSAGES/django.mo,sha256=xD2pWdS3XMg7gAqBrUBmCEXFsOzEs0Npe8AJnlpueRY,2115 +django/contrib/flatpages/locale/pt/LC_MESSAGES/django.po,sha256=-K2jipPUWjXpfSPq3upnC_bvtaRAeOw0OLRFv03HWFY,2326 +django/contrib/flatpages/locale/pt_BR/LC_MESSAGES/django.mo,sha256=YGyagSFIc-ssFN8bnqVRce1_PsybvLmI8RVCygjow8E,2291 +django/contrib/flatpages/locale/pt_BR/LC_MESSAGES/django.po,sha256=pFA8RPNefZpuhbxBHLt9KrI2RiHxct5V-DnZA-XqBv0,2942 +django/contrib/flatpages/locale/ro/LC_MESSAGES/django.mo,sha256=oS3MXuRh2USyLOMrMH0WfMSFpgBcZWfrbCrovYgbONo,2337 +django/contrib/flatpages/locale/ro/LC_MESSAGES/django.po,sha256=UNKGNSZKS92pJDjxKDLqVUW87DKCWP4_Q51xS16IZl0,2632 +django/contrib/flatpages/locale/ru/LC_MESSAGES/django.mo,sha256=AACtHEQuytEohUZVgk-o33O7rJTFAluq22VJOw5JqII,2934 +django/contrib/flatpages/locale/ru/LC_MESSAGES/django.po,sha256=H6JOPAXNxji1oni9kfga_hNZevodStpEl0O6cDnZ148,3312 +django/contrib/flatpages/locale/sk/LC_MESSAGES/django.mo,sha256=P1192D_B2kDQ6nF_tGEW7WCoTodB3_9rMTaqEQSMO4E,2353 +django/contrib/flatpages/locale/sk/LC_MESSAGES/django.po,sha256=--_DaPB_aSZHn_uxzmCpITO7VPCpP4Nq2rdQGgN14r8,2638 +django/contrib/flatpages/locale/sl/LC_MESSAGES/django.mo,sha256=kOrhhBdM9nbQbCLN49bBn23hCrzpAPrfKvPs4QMHgvo,2301 +django/contrib/flatpages/locale/sl/LC_MESSAGES/django.po,sha256=oyTrOVH0v76Ttc93qfeyu3FHcWLh3tTiz2TefGkmoq4,2621 +django/contrib/flatpages/locale/sq/LC_MESSAGES/django.mo,sha256=Jv2sebdAM6CfiLzgi1b7rHo5hp-6_BFeeMQ4_BwYpjk,2328 +django/contrib/flatpages/locale/sq/LC_MESSAGES/django.po,sha256=Xm87FbWaQ1JGhhGx8uvtqwUltkTkwk5Oysagu8qIPUA,2548 +django/contrib/flatpages/locale/sr/LC_MESSAGES/django.mo,sha256=p--v7bpD8Pp6zeP3cdh8fnfC8g2nuhbzGJTdN9eoE58,2770 +django/contrib/flatpages/locale/sr/LC_MESSAGES/django.po,sha256=jxcyMN2Qh_osmo4Jf_6QUC2vW3KVKt1BupDWMMZyAXA,3071 +django/contrib/flatpages/locale/sr_Latn/LC_MESSAGES/django.mo,sha256=3N4mGacnZj0tI5tFniLqC2LQCPSopDEM1SGaw5N1bsw,2328 +django/contrib/flatpages/locale/sr_Latn/LC_MESSAGES/django.po,sha256=od7r3dPbZ7tRAJUW80Oe-nm_tHcmIiG6b2OZMsFg53s,2589 +django/contrib/flatpages/locale/sv/LC_MESSAGES/django.mo,sha256=1pFmNWiExWo5owNijZHZb8-Tbd0nYPqqvTmIitcFPbY,2252 +django/contrib/flatpages/locale/sv/LC_MESSAGES/django.po,sha256=l3anvdgLQJzYehCalwr1AAh8e-hRKrL_bSNwmkfgbbc,2613 +django/contrib/flatpages/locale/sw/LC_MESSAGES/django.mo,sha256=Lhf99AGmazKJHzWk2tkGrMInoYOq0mtdCd8SGblnVCQ,1537 +django/contrib/flatpages/locale/sw/LC_MESSAGES/django.po,sha256=cos3eahuznpTfTdl1Vj_07fCOSYE8C9CRYHCBLYZrVw,1991 +django/contrib/flatpages/locale/ta/LC_MESSAGES/django.mo,sha256=nNuoOX-FPAmTvM79o7colM4C7TtBroTFxYtETPPatcQ,1945 +django/contrib/flatpages/locale/ta/LC_MESSAGES/django.po,sha256=XE4SndPZPLf1yXGl5xQSb0uor4OE8CKJ0EIXBRDA3qU,2474 +django/contrib/flatpages/locale/te/LC_MESSAGES/django.mo,sha256=bMxhDMTQc_WseqoeqJMCSNy71o4U5tJZYgD2G0p-jD0,1238 +django/contrib/flatpages/locale/te/LC_MESSAGES/django.po,sha256=tmUWOrAZ98B9T6Cai8AgLCfb_rLeoPVGjDTgdsMOY1Y,2000 +django/contrib/flatpages/locale/tg/LC_MESSAGES/django.mo,sha256=gpzjf_LxwWX6yUrcUfNepK1LGez6yvnuYhmfULDPZ6E,2064 +django/contrib/flatpages/locale/tg/LC_MESSAGES/django.po,sha256=lZFLes8BWdJ-VbczHFDWCSKhKg0qmmk10hTjKcBNr5o,2572 +django/contrib/flatpages/locale/th/LC_MESSAGES/django.mo,sha256=mct17_099pUn0aGuHu8AlZG6UqdKDpYLojqGYDLRXRg,2698 +django/contrib/flatpages/locale/th/LC_MESSAGES/django.po,sha256=PEcRx5AtXrDZvlNGWFH-0arroD8nZbutdJBe8_I02ag,2941 +django/contrib/flatpages/locale/tk/LC_MESSAGES/django.mo,sha256=_AfI4FH0jkeeCDgujfkx4xHMGSwGi5fs9iqr3HLUVVs,835 +django/contrib/flatpages/locale/tk/LC_MESSAGES/django.po,sha256=28Af2gU6Wmo2DvjxLZrpbXq0HBFrcP7yzfh5IlL4DJg,1881 +django/contrib/flatpages/locale/tr/LC_MESSAGES/django.mo,sha256=pPNGylfG8S0iBI4ONZbky3V2Q5AG-M1njp27tFrhhZc,2290 +django/contrib/flatpages/locale/tr/LC_MESSAGES/django.po,sha256=0ULZu3Plp8H9zdirHy3MSduJ_QRdpoaaivf3bL9MCwA,2588 +django/contrib/flatpages/locale/tt/LC_MESSAGES/django.mo,sha256=9RfCKyn0ZNYsqLvFNmY18xVMl7wnmDq5uXscrsFfupk,2007 +django/contrib/flatpages/locale/tt/LC_MESSAGES/django.po,sha256=SUwalSl8JWI9tuDswmnGT8SjuWR3DQGND9roNxJtH1o,2402 +django/contrib/flatpages/locale/udm/LC_MESSAGES/django.mo,sha256=7KhzWgskBlHmi-v61Ax9fjc3NBwHB17WppdNMuz-rEc,490 +django/contrib/flatpages/locale/udm/LC_MESSAGES/django.po,sha256=zidjP05Hx1OpXGqWEmF2cg9SFxASM4loOV85uW7zV5U,1533 +django/contrib/flatpages/locale/ug/LC_MESSAGES/django.mo,sha256=FL8P63c7BRO5hNABEzurk91v01ceRBhC1DJyjFJkiwg,2644 +django/contrib/flatpages/locale/ug/LC_MESSAGES/django.po,sha256=TxlRCGW-6fyxOO3YzAzKJa4utQp4NOOZ08YZxSit9E8,2774 +django/contrib/flatpages/locale/uk/LC_MESSAGES/django.mo,sha256=r2RZT8xQ1Gi9Yp0nnoNALqQ4zrEJ0JC7m26E5gSeq4g,3002 +django/contrib/flatpages/locale/uk/LC_MESSAGES/django.po,sha256=qcVizoTiKYc1c9KwSTwSALHgjjSGVY2oito_bBRLVTE,3405 +django/contrib/flatpages/locale/ur/LC_MESSAGES/django.mo,sha256=Li4gVdFoNOskGKAKiNuse6B2sz6ePGqGvZu7aGXMNy0,1976 +django/contrib/flatpages/locale/ur/LC_MESSAGES/django.po,sha256=hDasKiKrYov9YaNIHIpoooJo0Bzba___IuN2Hl6ofSc,2371 +django/contrib/flatpages/locale/vi/LC_MESSAGES/django.mo,sha256=FsFUi96oGTWGlZwM4qSMpuL1M2TAxsW51qO70TrybSM,1035 +django/contrib/flatpages/locale/vi/LC_MESSAGES/django.po,sha256=ITX3MWd7nlWPxTCoNPl22_OMLTt0rfvajGvTVwo0QC8,1900 +django/contrib/flatpages/locale/zh_Hans/LC_MESSAGES/django.mo,sha256=UTCQr9t2wSj6dYLK1ftpF8-pZ25dAMYLRE2wEUQva-o,2124 +django/contrib/flatpages/locale/zh_Hans/LC_MESSAGES/django.po,sha256=loi9RvOnrgFs4qp8FW4RGis7wgDzBBXuwha5pFfLRxY,2533 +django/contrib/flatpages/locale/zh_Hant/LC_MESSAGES/django.mo,sha256=INt9_smj4Zwo3hkn3kemuE85lfvwjUrIxbkIHa7Cd_E,2176 +django/contrib/flatpages/locale/zh_Hant/LC_MESSAGES/django.po,sha256=d9De9F9YWkc8YZt51Cg5Xtslwg04G0aRMqxTMAXqQI8,2477 +django/contrib/flatpages/middleware.py,sha256=aXeOeOkUmpdkGOyqZnkR-l1VrDQ161RWIWa3WPBhGac,784 +django/contrib/flatpages/migrations/0001_initial.py,sha256=4xhMsKaXOycsfo9O1QIuknS9wf7r0uVsshAJ7opeqsM,2408 +django/contrib/flatpages/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/contrib/flatpages/migrations/__pycache__/0001_initial.cpython-312.pyc,, +django/contrib/flatpages/migrations/__pycache__/__init__.cpython-312.pyc,, +django/contrib/flatpages/models.py,sha256=3ugRRsDwB5C3GHOWvtOzjJl-y0yqqjYZBSOMt24QYuw,1764 +django/contrib/flatpages/sitemaps.py,sha256=CEhZOsLwv3qIJ1hs4eHlE_0AAtYjicb_yRzsstY19eg,584 +django/contrib/flatpages/templatetags/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/contrib/flatpages/templatetags/__pycache__/__init__.cpython-312.pyc,, +django/contrib/flatpages/templatetags/__pycache__/flatpages.cpython-312.pyc,, +django/contrib/flatpages/templatetags/flatpages.py,sha256=QH-suzsoPIMSrgyHR9O8uOdmfIkBv_w3LM-hGfQvnU8,3552 +django/contrib/flatpages/urls.py,sha256=Rs37Ij192SOtSBjd4Lx9YtpINfEMg7XRY01dEOY8Rgg,179 +django/contrib/flatpages/views.py,sha256=H4LG7Janb6Dcn-zINLmp358hR60JigAKGzh4A4PMPaM,2724 +django/contrib/gis/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/contrib/gis/__pycache__/__init__.cpython-312.pyc,, +django/contrib/gis/__pycache__/apps.cpython-312.pyc,, +django/contrib/gis/__pycache__/feeds.cpython-312.pyc,, +django/contrib/gis/__pycache__/geoip2.cpython-312.pyc,, +django/contrib/gis/__pycache__/geometry.cpython-312.pyc,, +django/contrib/gis/__pycache__/measure.cpython-312.pyc,, +django/contrib/gis/__pycache__/ptr.cpython-312.pyc,, +django/contrib/gis/__pycache__/shortcuts.cpython-312.pyc,, +django/contrib/gis/__pycache__/views.cpython-312.pyc,, +django/contrib/gis/admin/__init__.py,sha256=bCUsC6Hh7hztchqRKuaiTgk3nL0B4H053bVII-olB7k,486 +django/contrib/gis/admin/__pycache__/__init__.cpython-312.pyc,, +django/contrib/gis/admin/__pycache__/options.cpython-312.pyc,, +django/contrib/gis/admin/options.py,sha256=r60rycdAgcGSB21KQS_V0X78ulUjATYzws-JKLYd_lc,689 +django/contrib/gis/apps.py,sha256=dbAFKx9jj9_QdhdNfL5KCC47puH_ZTw098jsJFwDO9Y,417 +django/contrib/gis/db/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/contrib/gis/db/__pycache__/__init__.cpython-312.pyc,, +django/contrib/gis/db/backends/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/contrib/gis/db/backends/__pycache__/__init__.cpython-312.pyc,, +django/contrib/gis/db/backends/__pycache__/utils.cpython-312.pyc,, +django/contrib/gis/db/backends/base/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/contrib/gis/db/backends/base/__pycache__/__init__.cpython-312.pyc,, +django/contrib/gis/db/backends/base/__pycache__/adapter.cpython-312.pyc,, +django/contrib/gis/db/backends/base/__pycache__/features.cpython-312.pyc,, +django/contrib/gis/db/backends/base/__pycache__/models.cpython-312.pyc,, +django/contrib/gis/db/backends/base/__pycache__/operations.cpython-312.pyc,, +django/contrib/gis/db/backends/base/adapter.py,sha256=qbLG-sLB6EZ_sA6-E_uIClyp5E5hz9UQ-CsR3BWx8W8,592 +django/contrib/gis/db/backends/base/features.py,sha256=fF-AKB6__RjkxVRadNkOP7Av4wMaRGkXKybYV6ES2Gk,3718 +django/contrib/gis/db/backends/base/models.py,sha256=WqpmVLqK21m9J6k_N-SGPXq1VZMuNHafyB9xqxUwR4k,4009 +django/contrib/gis/db/backends/base/operations.py,sha256=_g_B-_AN1OVmarA3O8FdU7hnAgBCX0d4gvqalNRJAYg,6859 +django/contrib/gis/db/backends/mysql/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/contrib/gis/db/backends/mysql/__pycache__/__init__.cpython-312.pyc,, +django/contrib/gis/db/backends/mysql/__pycache__/base.cpython-312.pyc,, +django/contrib/gis/db/backends/mysql/__pycache__/features.cpython-312.pyc,, +django/contrib/gis/db/backends/mysql/__pycache__/introspection.cpython-312.pyc,, +django/contrib/gis/db/backends/mysql/__pycache__/operations.cpython-312.pyc,, +django/contrib/gis/db/backends/mysql/__pycache__/schema.cpython-312.pyc,, +django/contrib/gis/db/backends/mysql/base.py,sha256=z75wKhm-e9JfRLCvgDq-iv9OqOjBBAS238JTTrWfHRQ,498 +django/contrib/gis/db/backends/mysql/features.py,sha256=dVRo3CuV8Zp5822h9l48nApiXyn3lCuXQV3vsRZKeao,866 +django/contrib/gis/db/backends/mysql/introspection.py,sha256=ZihcSzwN0f8iqKOYKMHuQ_MY41ERSswjP46dvCF0v68,1602 +django/contrib/gis/db/backends/mysql/operations.py,sha256=FLm31EQ4dH5p94SIMaIBlIOWR6QQf7gmD-T9vSA-Pkg,4796 +django/contrib/gis/db/backends/mysql/schema.py,sha256=taCGJ5sEe8GJqd4bi1ODGWFJFCjYJq7rWjMaFeN3GSM,3051 +django/contrib/gis/db/backends/oracle/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/contrib/gis/db/backends/oracle/__pycache__/__init__.cpython-312.pyc,, +django/contrib/gis/db/backends/oracle/__pycache__/adapter.cpython-312.pyc,, +django/contrib/gis/db/backends/oracle/__pycache__/base.cpython-312.pyc,, +django/contrib/gis/db/backends/oracle/__pycache__/features.cpython-312.pyc,, +django/contrib/gis/db/backends/oracle/__pycache__/introspection.cpython-312.pyc,, +django/contrib/gis/db/backends/oracle/__pycache__/models.cpython-312.pyc,, +django/contrib/gis/db/backends/oracle/__pycache__/operations.cpython-312.pyc,, +django/contrib/gis/db/backends/oracle/__pycache__/schema.cpython-312.pyc,, +django/contrib/gis/db/backends/oracle/adapter.py,sha256=AjD0eMuptu8BqkE2LshTizkf5iv9ArYVP9PoOTHfNao,2066 +django/contrib/gis/db/backends/oracle/base.py,sha256=_7qhvEdbnrJQEKL51sg8YYu8kRYmQNAlBgNb2OUbBkw,507 +django/contrib/gis/db/backends/oracle/features.py,sha256=3yCDutKz4iX01eOjLf0CLe_cemMaRjDmH8ZKNy_Sbyk,1021 +django/contrib/gis/db/backends/oracle/introspection.py,sha256=fW9FTIW_yAQQZwk0LzdoTtj6QQpFN6fgUQzv8dCmFEo,1939 +django/contrib/gis/db/backends/oracle/models.py,sha256=AqtTfN04n3_3zYx79_nawy3CiIO47vqRq7MSiJ9-MaQ,2085 +django/contrib/gis/db/backends/oracle/operations.py,sha256=3-rl7MJQHEAYwpdGhvrgxWqoLubGqvE5pP6rxgsNWNg,8791 +django/contrib/gis/db/backends/oracle/schema.py,sha256=o7fa2jefeT0zajqkLtEwOnvtjuATwCiaIvpVnns4YR4,4271 +django/contrib/gis/db/backends/postgis/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/contrib/gis/db/backends/postgis/__pycache__/__init__.cpython-312.pyc,, +django/contrib/gis/db/backends/postgis/__pycache__/adapter.cpython-312.pyc,, +django/contrib/gis/db/backends/postgis/__pycache__/base.cpython-312.pyc,, +django/contrib/gis/db/backends/postgis/__pycache__/const.cpython-312.pyc,, +django/contrib/gis/db/backends/postgis/__pycache__/features.cpython-312.pyc,, +django/contrib/gis/db/backends/postgis/__pycache__/introspection.cpython-312.pyc,, +django/contrib/gis/db/backends/postgis/__pycache__/models.cpython-312.pyc,, +django/contrib/gis/db/backends/postgis/__pycache__/operations.cpython-312.pyc,, +django/contrib/gis/db/backends/postgis/__pycache__/pgraster.cpython-312.pyc,, +django/contrib/gis/db/backends/postgis/__pycache__/schema.cpython-312.pyc,, +django/contrib/gis/db/backends/postgis/adapter.py,sha256=3ytnzyTAqB8rmczZE-CPePoG4Pf7lo7glBHdENba6rg,1981 +django/contrib/gis/db/backends/postgis/base.py,sha256=37t0_fDD4IeFsQrMrKoQRW01e8KJeXCSkbv5sOpreR8,5793 +django/contrib/gis/db/backends/postgis/const.py,sha256=ekJc9pvJwQ0tmxENkJsZFdP03uEUEneloR23SJcnTIc,2008 +django/contrib/gis/db/backends/postgis/features.py,sha256=qOEJLQTIC1YdlDoJkpLCiVQU4GAy0d9_Dneui7w41bM,455 +django/contrib/gis/db/backends/postgis/introspection.py,sha256=ihrNd_qHQ64DRjoaPj9-1a0y3H8Ko4gWbK2N5fDA3_g,3164 +django/contrib/gis/db/backends/postgis/models.py,sha256=DfKkmur-8lvr_cflDKE3pTV_vH3Wtxr4bSiXuwPIWhU,2003 +django/contrib/gis/db/backends/postgis/operations.py,sha256=TSta36rbN3HGGG40zTD42oY_e8fwIgwzXPRky8LLyjY,16576 +django/contrib/gis/db/backends/postgis/pgraster.py,sha256=eCa2y-v3qGLeNbFI4ERFj2UmqgYAE19nuL3SgDFmm0o,4588 +django/contrib/gis/db/backends/postgis/schema.py,sha256=dU-o1GQh2lPdiNYmBgd7QTnKq3L3JYqZck5pKn-BA0o,3020 +django/contrib/gis/db/backends/spatialite/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/contrib/gis/db/backends/spatialite/__pycache__/__init__.cpython-312.pyc,, +django/contrib/gis/db/backends/spatialite/__pycache__/adapter.cpython-312.pyc,, +django/contrib/gis/db/backends/spatialite/__pycache__/base.cpython-312.pyc,, +django/contrib/gis/db/backends/spatialite/__pycache__/client.cpython-312.pyc,, +django/contrib/gis/db/backends/spatialite/__pycache__/features.cpython-312.pyc,, +django/contrib/gis/db/backends/spatialite/__pycache__/introspection.cpython-312.pyc,, +django/contrib/gis/db/backends/spatialite/__pycache__/models.cpython-312.pyc,, +django/contrib/gis/db/backends/spatialite/__pycache__/operations.cpython-312.pyc,, +django/contrib/gis/db/backends/spatialite/__pycache__/schema.cpython-312.pyc,, +django/contrib/gis/db/backends/spatialite/adapter.py,sha256=qTiA5BBGUFND3D7xGK_85oo__HSexTH32XF4uin3ZV0,318 +django/contrib/gis/db/backends/spatialite/base.py,sha256=wU1fgp68CLyKELsMfO6zYM85ox4g_GloWESEK8EPrfM,3218 +django/contrib/gis/db/backends/spatialite/client.py,sha256=dNM7mqDyTzFlgQR1XhqZIftnR9VRH7AfcSvvy4vucEs,138 +django/contrib/gis/db/backends/spatialite/features.py,sha256=zkmJPExFtRqjRj608ZTlsSpxkYaPbV3A3SEfX3PcaFY,876 +django/contrib/gis/db/backends/spatialite/introspection.py,sha256=V_iwkz0zyF1U-AKq-UlxvyDImqQCsitcmvxk2cUw81A,3118 +django/contrib/gis/db/backends/spatialite/models.py,sha256=mOQ1cNkmLFCiKYyDjkhbs6Gf20qeFC5joSk7RIdIk-s,1931 +django/contrib/gis/db/backends/spatialite/operations.py,sha256=jaLhSEYHqEewdx1AbaQpwy-S6lZOJiuY2ZwHb1euJ5M,8520 +django/contrib/gis/db/backends/spatialite/schema.py,sha256=URhFfLQM7FH39wmkViD8MZJ1qG3cixhNdWmjuM9ZB44,7340 +django/contrib/gis/db/backends/utils.py,sha256=rLwSv79tKJPxvDHACY8rhPDLFZC79mEIlIySTyl_qqc,785 +django/contrib/gis/db/models/__init__.py,sha256=TrCS27JdVa-Q7Hok-YaJxb4eLrPdyvRmasJGIu05fvA,865 +django/contrib/gis/db/models/__pycache__/__init__.cpython-312.pyc,, +django/contrib/gis/db/models/__pycache__/aggregates.cpython-312.pyc,, +django/contrib/gis/db/models/__pycache__/fields.cpython-312.pyc,, +django/contrib/gis/db/models/__pycache__/functions.cpython-312.pyc,, +django/contrib/gis/db/models/__pycache__/lookups.cpython-312.pyc,, +django/contrib/gis/db/models/__pycache__/proxy.cpython-312.pyc,, +django/contrib/gis/db/models/aggregates.py,sha256=ImbuX2AhL6PkEyrGDv_qKIgR9FSeIur7cIMIVKUYnlM,3147 +django/contrib/gis/db/models/fields.py,sha256=n40s9HYbqVpFKIW9b4X4IQ8INWUus7QZi5QdiWVPsTI,14312 +django/contrib/gis/db/models/functions.py,sha256=1zoJCVjBlFK6jjeOHVWHMLW1p1EHyoLM4DmspUqO94w,19606 +django/contrib/gis/db/models/lookups.py,sha256=FOb501DBuopcbLy175O1BwD2ZoaVa2optogbXmvwv3o,11797 +django/contrib/gis/db/models/proxy.py,sha256=qckCc10o_W1qJ7yH5VpNo6huhPfVMAz3nJSEyLfk4oo,3174 +django/contrib/gis/db/models/sql/__init__.py,sha256=-rzcC3izMJi2bnvyQUCMzIOrigBnY6N_5EQIim4wCSY,134 +django/contrib/gis/db/models/sql/__pycache__/__init__.cpython-312.pyc,, +django/contrib/gis/db/models/sql/__pycache__/conversion.cpython-312.pyc,, +django/contrib/gis/db/models/sql/conversion.py,sha256=ZiMRzEf7_kOWJ4IITXFq6dL-wDwMhIEwvbE705afgaU,2433 +django/contrib/gis/feeds.py,sha256=0vNVVScIww13bOxvlQfXAOCItIOGWSXroKKl6QXGB58,5995 +django/contrib/gis/forms/__init__.py,sha256=Zyid_YlZzHUcMYkfGX1GewmPPDNc0ni7HyXKDTeIkjo,318 +django/contrib/gis/forms/__pycache__/__init__.cpython-312.pyc,, +django/contrib/gis/forms/__pycache__/fields.cpython-312.pyc,, +django/contrib/gis/forms/__pycache__/widgets.cpython-312.pyc,, +django/contrib/gis/forms/fields.py,sha256=FrZaZWXFUdWK1QEu8wlda3u6EtqaVHjQRYrSKKu66PA,4608 +django/contrib/gis/forms/widgets.py,sha256=jV0TSxB6quB0rbkyAq4QJCdrZt4rA_LaZnO9CHRFdgI,3917 +django/contrib/gis/gdal/LICENSE,sha256=VwoEWoNyts1qAOMOuv6OPo38Cn_j1O8sxfFtQZ62Ous,1526 +django/contrib/gis/gdal/__init__.py,sha256=wpf_P8fG88Bg8vF9uyNfah5QKDD2L5mlFlIOlmwJibc,1828 +django/contrib/gis/gdal/__pycache__/__init__.cpython-312.pyc,, +django/contrib/gis/gdal/__pycache__/base.cpython-312.pyc,, +django/contrib/gis/gdal/__pycache__/datasource.cpython-312.pyc,, +django/contrib/gis/gdal/__pycache__/driver.cpython-312.pyc,, +django/contrib/gis/gdal/__pycache__/envelope.cpython-312.pyc,, +django/contrib/gis/gdal/__pycache__/error.cpython-312.pyc,, +django/contrib/gis/gdal/__pycache__/feature.cpython-312.pyc,, +django/contrib/gis/gdal/__pycache__/field.cpython-312.pyc,, +django/contrib/gis/gdal/__pycache__/geometries.cpython-312.pyc,, +django/contrib/gis/gdal/__pycache__/geomtype.cpython-312.pyc,, +django/contrib/gis/gdal/__pycache__/layer.cpython-312.pyc,, +django/contrib/gis/gdal/__pycache__/libgdal.cpython-312.pyc,, +django/contrib/gis/gdal/__pycache__/srs.cpython-312.pyc,, +django/contrib/gis/gdal/base.py,sha256=yymyL0vZRMBfiFUzrehvaeaunIxMH5ucGjPRfKj-rAo,181 +django/contrib/gis/gdal/datasource.py,sha256=tlbiem36QDKmWKSDD5uQFSY7kye8Q40gxXcE2EmdFmA,4669 +django/contrib/gis/gdal/driver.py,sha256=wu2m_-lGPO4MDmJrUPBYrGDUD7BnNPFx0RROeE3-qP0,2983 +django/contrib/gis/gdal/envelope.py,sha256=_dLqUUsQpU7WnmYwbkCQai1vkqu-i6NuKlF5BL8iV5U,7324 +django/contrib/gis/gdal/error.py,sha256=Vt-Uis9z786UGE3tD7fjiH8_0P5HSTO81n4fad4l6kw,1578 +django/contrib/gis/gdal/feature.py,sha256=HPWoCZjwzsUnhc7QmKh-BBMRqJCjj07RcFI6vjbdnp4,4017 +django/contrib/gis/gdal/field.py,sha256=EKE-Ioj5L79vo93Oixz_JE4TIZbDTRy0YVGvZH-I1z4,6886 +django/contrib/gis/gdal/geometries.py,sha256=JUnxiv1qVQC3LHiI7PZzqmODnTqXqHkvaSUU3OVM9cY,27567 +django/contrib/gis/gdal/geomtype.py,sha256=CWqbe5XtpgKiBP8Lbisbtb8o1FtuIUVb37Eb02i6TSE,4582 +django/contrib/gis/gdal/layer.py,sha256=PygAgsRZzWekp6kq6NEAZ6vhQTSo1Nk4c1Yi_pOdK58,8825 +django/contrib/gis/gdal/libgdal.py,sha256=AFNcrLSsryDKjmHzYccUXTkUmGMDuQqdfI2JhCcZT8g,3578 +django/contrib/gis/gdal/prototypes/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/contrib/gis/gdal/prototypes/__pycache__/__init__.cpython-312.pyc,, +django/contrib/gis/gdal/prototypes/__pycache__/ds.cpython-312.pyc,, +django/contrib/gis/gdal/prototypes/__pycache__/errcheck.cpython-312.pyc,, +django/contrib/gis/gdal/prototypes/__pycache__/generation.cpython-312.pyc,, +django/contrib/gis/gdal/prototypes/__pycache__/geom.cpython-312.pyc,, +django/contrib/gis/gdal/prototypes/__pycache__/raster.cpython-312.pyc,, +django/contrib/gis/gdal/prototypes/__pycache__/srs.cpython-312.pyc,, +django/contrib/gis/gdal/prototypes/ds.py,sha256=8YN4GkR3WD0DmvQbC0qSSapg82JIeZ_hev9qKZ5wHdk,4728 +django/contrib/gis/gdal/prototypes/errcheck.py,sha256=EJiU5xldKFzmaSG2ZAByogkEreG7jR0XKEfHnhhDVYw,4174 +django/contrib/gis/gdal/prototypes/generation.py,sha256=8m1MJ1WjAwlmZGWYzPr9imOMJAwHUtW4D81MEvj0Ako,4890 +django/contrib/gis/gdal/prototypes/geom.py,sha256=p0M5oQT_uqwrnvK6Rc08Xr-Z2W1OwD2ZbO0Q_kKtvk4,5951 +django/contrib/gis/gdal/prototypes/raster.py,sha256=jPOBqT6580qCThK5PhigyELzxMdp05RgI4hAKSlie_0,5571 +django/contrib/gis/gdal/prototypes/srs.py,sha256=52Aq0F7CT0_SqoMCaiIXVDVQ9dsnLGGIYXo5jf3EDDU,3677 +django/contrib/gis/gdal/raster/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/contrib/gis/gdal/raster/__pycache__/__init__.cpython-312.pyc,, +django/contrib/gis/gdal/raster/__pycache__/band.cpython-312.pyc,, +django/contrib/gis/gdal/raster/__pycache__/base.cpython-312.pyc,, +django/contrib/gis/gdal/raster/__pycache__/const.cpython-312.pyc,, +django/contrib/gis/gdal/raster/__pycache__/source.cpython-312.pyc,, +django/contrib/gis/gdal/raster/band.py,sha256=RPdut6BeQ9vW71rrPMwb2CnXrbCys8YAt1BA8Aholy0,8343 +django/contrib/gis/gdal/raster/base.py,sha256=2GGlL919lPr7YVGFtdIynLPIH-QKYhzrUpoXwVRlM1k,2882 +django/contrib/gis/gdal/raster/const.py,sha256=C_svBc-x052KJojH1t3pD1N29d67hQxyN8rm8u0141o,3283 +django/contrib/gis/gdal/raster/source.py,sha256=NmsCjTWDbNFt7oEWfSQSN7ZlofyDZ2yJ3ClSAfDjiW0,18394 +django/contrib/gis/gdal/srs.py,sha256=4if-eLG2V-G14subvHNZTZWG2I6nEC79exb4DdZpw3I,12350 +django/contrib/gis/geoip2.py,sha256=oBYj5dfizWvBtFwU-gdPOOsJe9zFjKw13CqKeiHqYz8,8884 +django/contrib/gis/geometry.py,sha256=oyapp3-FbCo1f2RQZhDwg-JD2sg1bq5Cgzpfxj-UmuE,788 +django/contrib/gis/geos/LICENSE,sha256=CL8kt1USOK4yUpUkVCWxyuua0PQvni0wPHs1NQJjIEU,1530 +django/contrib/gis/geos/__init__.py,sha256=7BIDN_LCzaNYi0RiDiPwxdm1G76cCiTBJLswcM6CMZI,661 +django/contrib/gis/geos/__pycache__/__init__.cpython-312.pyc,, +django/contrib/gis/geos/__pycache__/base.cpython-312.pyc,, +django/contrib/gis/geos/__pycache__/collections.cpython-312.pyc,, +django/contrib/gis/geos/__pycache__/coordseq.cpython-312.pyc,, +django/contrib/gis/geos/__pycache__/error.cpython-312.pyc,, +django/contrib/gis/geos/__pycache__/factory.cpython-312.pyc,, +django/contrib/gis/geos/__pycache__/geometry.cpython-312.pyc,, +django/contrib/gis/geos/__pycache__/io.cpython-312.pyc,, +django/contrib/gis/geos/__pycache__/libgeos.cpython-312.pyc,, +django/contrib/gis/geos/__pycache__/linestring.cpython-312.pyc,, +django/contrib/gis/geos/__pycache__/mutable_list.cpython-312.pyc,, +django/contrib/gis/geos/__pycache__/point.cpython-312.pyc,, +django/contrib/gis/geos/__pycache__/polygon.cpython-312.pyc,, +django/contrib/gis/geos/__pycache__/prepared.cpython-312.pyc,, +django/contrib/gis/geos/base.py,sha256=NdlFg5l9akvDp87aqzh9dk0A3ZH2TI3cOq10mmmuHBk,181 +django/contrib/gis/geos/collections.py,sha256=ucr2-UdxXWVV3EAqa9kDT4mpBbC1-4TOnWJPdg2Phiw,3941 +django/contrib/gis/geos/coordseq.py,sha256=urCtqscgvbkRObpWnFk92qALBd5nl4UPEItRp1kx7N4,6841 +django/contrib/gis/geos/error.py,sha256=r3SNTnwDBI6HtuyL3mQ_iEEeKlOqqqdkHnhNoUkMohw,104 +django/contrib/gis/geos/factory.py,sha256=KQF6lqAh5KRlFSDgN-BSXWojmWFabbEUFgz2IGYX_vk,961 +django/contrib/gis/geos/geometry.py,sha256=smf1Il8p-ZjtUIKNnO60-u2-G28FX7amxmjLqwU8UQ0,26652 +django/contrib/gis/geos/io.py,sha256=GCUL4p6B7FYAHOcPcbTc-QLuSJ3rtvKvU7vfzZpUlsg,800 +django/contrib/gis/geos/libgeos.py,sha256=dCyMvcqRixNpGKx3UyQntZgccGeRXMg7XBYXhIrrUko,4988 +django/contrib/gis/geos/linestring.py,sha256=BJAoWfHW08EX1UpNFVB09iSKXdTS6pZsTIBc6DcZcfc,6372 +django/contrib/gis/geos/mutable_list.py,sha256=nthCtQ0FsJrDGd29cSERwXb-tJkpK35Vc0T_ywCnXgc,10121 +django/contrib/gis/geos/point.py,sha256=bvatsdXTb1XYy1EaSZvp4Rnr2LwXZU12zILefLu6sRw,4781 +django/contrib/gis/geos/polygon.py,sha256=DZq6Ed9bJA3MqhpDQ9u926hHxcnxBjnbKSppHgbShxw,6710 +django/contrib/gis/geos/prepared.py,sha256=J5Dj6e3u3gEfVPNOM1E_rvcmcXR2-CdwtbAcoiDU5a0,1577 +django/contrib/gis/geos/prototypes/__init__.py,sha256=iAnsD0bg8u7Avo7Fmet4lkAo9lnsyyfZFa7k3IQ6T1w,1438 +django/contrib/gis/geos/prototypes/__pycache__/__init__.cpython-312.pyc,, +django/contrib/gis/geos/prototypes/__pycache__/coordseq.cpython-312.pyc,, +django/contrib/gis/geos/prototypes/__pycache__/errcheck.cpython-312.pyc,, +django/contrib/gis/geos/prototypes/__pycache__/geom.cpython-312.pyc,, +django/contrib/gis/geos/prototypes/__pycache__/io.cpython-312.pyc,, +django/contrib/gis/geos/prototypes/__pycache__/misc.cpython-312.pyc,, +django/contrib/gis/geos/prototypes/__pycache__/predicates.cpython-312.pyc,, +django/contrib/gis/geos/prototypes/__pycache__/prepared.cpython-312.pyc,, +django/contrib/gis/geos/prototypes/__pycache__/threadsafe.cpython-312.pyc,, +django/contrib/gis/geos/prototypes/__pycache__/topology.cpython-312.pyc,, +django/contrib/gis/geos/prototypes/coordseq.py,sha256=fIcSIzmyCbazQSR-XdvCwtP2YZItQur1Y27vfAKXNfw,3122 +django/contrib/gis/geos/prototypes/errcheck.py,sha256=t_904N1AiAHla7TiY0iLffIpRtlwNXs3gbvhsUP5Q4g,2789 +django/contrib/gis/geos/prototypes/geom.py,sha256=NlR-rUFCj_V3lppSmYSI2bapLim_VUJXABwElTldZM0,3398 +django/contrib/gis/geos/prototypes/io.py,sha256=j5379Sb-uLjW7SpxQiOeDvcJjrb1ZCa9bOa6IhD6sWI,11321 +django/contrib/gis/geos/prototypes/misc.py,sha256=m6gKAPD9B7Yukj4jbyAmqnuT5K5qahGS3MR9Kndd40c,1169 +django/contrib/gis/geos/prototypes/predicates.py,sha256=-NeNemaYkzlvHzcS1vXiBKPHuXj-WB4wE_xRCStWPoM,1662 +django/contrib/gis/geos/prototypes/prepared.py,sha256=4I9pS75Q5MZ1z8A1v0mKkmdCly33Kj_0sDcrqxOppzM,1175 +django/contrib/gis/geos/prototypes/threadsafe.py,sha256=n1yCYvQCtc7piFrhjeZCWH8Pf0-AiOGBH33VZusTgWI,2302 +django/contrib/gis/geos/prototypes/topology.py,sha256=MIpi03Vqn89Upx0sRDJp2B1Z3LpGnBmNQyEXHmquV5Y,2328 +django/contrib/gis/locale/af/LC_MESSAGES/django.mo,sha256=FWnPEpxhJG9xJ-uOTFryxIT6BFN3w-bsgqLn0IHF-Ew,518 +django/contrib/gis/locale/af/LC_MESSAGES/django.po,sha256=v5LXHABklHAVbfrPEx3xXGIHIZ4hz4MmfvZ6beC-XF4,1540 +django/contrib/gis/locale/ar/LC_MESSAGES/django.mo,sha256=5LCO903yJTtRVaaujBrmwMx8f8iLa3ihasgmj8te9eg,2301 +django/contrib/gis/locale/ar/LC_MESSAGES/django.po,sha256=pfUyK0VYgY0VC2_LvWZvG_EEIWa0OqIUfhiPT2Uov3Q,2569 +django/contrib/gis/locale/ar_DZ/LC_MESSAGES/django.mo,sha256=1e2lutVEjsa5vErMdjS6gaBbOLPTVIpDv15rax-wvKg,2403 +django/contrib/gis/locale/ar_DZ/LC_MESSAGES/django.po,sha256=dizXM36w-rUtI7Dv2mSoJDR5ouVR6Ar7zqjywX3xKr0,2555 +django/contrib/gis/locale/ast/LC_MESSAGES/django.mo,sha256=8o0Us4wR14bdv1M5oBeczYC4oW5uKnycWrj1-lMIqV4,850 +django/contrib/gis/locale/ast/LC_MESSAGES/django.po,sha256=0beyFcBkBOUNvPP45iqewTNv2ExvCPvDYwpafCJY5QM,1684 +django/contrib/gis/locale/az/LC_MESSAGES/django.mo,sha256=FOvFUN-kdoX5OvhaVJg3v4rOyQgAQ_YC--TCE3m4kXs,1901 +django/contrib/gis/locale/az/LC_MESSAGES/django.po,sha256=exlD78A7sUZBPuoLyQGZoYiBa2wWGWnsWKq0gUYUOng,2118 +django/contrib/gis/locale/be/LC_MESSAGES/django.mo,sha256=XcJGF9cH7M30Q8EwqovjAeiJFgB2PR4sXsbxdvVURjg,2389 +django/contrib/gis/locale/be/LC_MESSAGES/django.po,sha256=Cp_DXKCVHzYTA7v65TpjRhCJonkgI5Gy13Tfg1rkVp8,2596 +django/contrib/gis/locale/bg/LC_MESSAGES/django.mo,sha256=lLfpqEEEb1RYzy270gpDdEfv5k5jscyNgJv_Ok_BA_A,2323 +django/contrib/gis/locale/bg/LC_MESSAGES/django.po,sha256=hSxYwbKr-IqP5hJaPKQxoL1DkCIg60suHl1H8u8W7jQ,2586 +django/contrib/gis/locale/bn/LC_MESSAGES/django.mo,sha256=7oNsr_vHQfsanyP-o1FG8jZTSBK8jB3eK2fA9AqNOx4,1070 +django/contrib/gis/locale/bn/LC_MESSAGES/django.po,sha256=PTa9EFZdqfznUH7si3Rq3zp1kNkTOnn2HRTEYXQSOdM,1929 +django/contrib/gis/locale/br/LC_MESSAGES/django.mo,sha256=xN8hOvJi_gDlpdC5_lghXuX6yCBYDPfD_SQLjcvq8gU,1614 +django/contrib/gis/locale/br/LC_MESSAGES/django.po,sha256=LQw3Tp_ymJ_x7mJ6g4SOr6aP00bejkjuaxfFFRZnmaQ,2220 +django/contrib/gis/locale/bs/LC_MESSAGES/django.mo,sha256=9EdKtZkY0FX2NlX_q0tIxXD-Di0SNQJZk3jo7cend0A,1308 +django/contrib/gis/locale/bs/LC_MESSAGES/django.po,sha256=eu_qF8dbmlDiRKGNIz80XtIunrF8QIOcy8O28X02GvQ,1905 +django/contrib/gis/locale/ca/LC_MESSAGES/django.mo,sha256=6aq8xNlP95HRncIB6ThimqW14XFKp7OOjo0S0uT6d-Y,1948 +django/contrib/gis/locale/ca/LC_MESSAGES/django.po,sha256=0Tj64N9TVX-oDyq4srBCgqELmM8OjMgXC5Lci844Fvc,2298 +django/contrib/gis/locale/ckb/LC_MESSAGES/django.mo,sha256=tIH0KyO3XREfX8htOCAK6cJSZkS0BCE15AZngco_Vkw,2253 +django/contrib/gis/locale/ckb/LC_MESSAGES/django.po,sha256=krJj0SQiLAcc1uNA9Qazqy9Ty-7MhauoaIDHtjmPPfo,2442 +django/contrib/gis/locale/cs/LC_MESSAGES/django.mo,sha256=ia8l06-eW5VkQnNQU0aizio7pz_pSGA-KRk-liGRa2w,2026 +django/contrib/gis/locale/cs/LC_MESSAGES/django.po,sha256=8taX01JBHhr19_AKhfhbtlpt-TW1aOBwejN-o-HH5Xk,2274 +django/contrib/gis/locale/cy/LC_MESSAGES/django.mo,sha256=vUG_wzZaMumPwIlKwuN7GFcS9gnE5rpflxoA_MPM_po,1430 +django/contrib/gis/locale/cy/LC_MESSAGES/django.po,sha256=_QjXT6cySUXrjtHaJ3046z-5PoXkCqtOhvA7MCZsXxk,1900 +django/contrib/gis/locale/da/LC_MESSAGES/django.mo,sha256=eXid2KAU_8fd23jMFo41iJ3DntVNe0w939_UsBymGM4,1862 +django/contrib/gis/locale/da/LC_MESSAGES/django.po,sha256=9bSpjg9wv7nvWoaOfRhXKsuxVoMzOHU-fsnVNB8qbxM,2158 +django/contrib/gis/locale/de/LC_MESSAGES/django.mo,sha256=fECmj81LHOUcBcQ_PoQWlijVp3SjTG3GwsSRiUGMXOU,1930 +django/contrib/gis/locale/de/LC_MESSAGES/django.po,sha256=DB_2QZ0IHOxKJ51ZyJCNX24597W7DBc_DT1B-oId-bY,2129 +django/contrib/gis/locale/dsb/LC_MESSAGES/django.mo,sha256=YZOA1XJqoU3rI5REairrs9f36Cet75NmC8WXdApx0Mc,2016 +django/contrib/gis/locale/dsb/LC_MESSAGES/django.po,sha256=w36vo0t-HzjhslJLo5xesc1vVfl94sNP3XyyDcETDn0,2177 +django/contrib/gis/locale/el/LC_MESSAGES/django.mo,sha256=g3SeFfO8xTxsvs2jKG9CI99fTnVa-WuBMNG0FFGc0s8,2402 +django/contrib/gis/locale/el/LC_MESSAGES/django.po,sha256=7MATPbwGZGgWabd9BdmUCwxc2iAG2aeac9ltKsieuME,2853 +django/contrib/gis/locale/en/LC_MESSAGES/django.mo,sha256=U0OV81NfbuNL9ctF-gbGUG5al1StqN-daB-F-gFBFC8,356 +django/contrib/gis/locale/en/LC_MESSAGES/django.po,sha256=lXk5x3FBMnRKocOgqDiya7yKeXZqk9gkibxyADRQjOU,2074 +django/contrib/gis/locale/en_AU/LC_MESSAGES/django.mo,sha256=IPn5kRqOvv5S7jpbIUw8PEUkHlyjEL-4GuOANd1iAzI,486 +django/contrib/gis/locale/en_AU/LC_MESSAGES/django.po,sha256=x_58HmrHRia2LoYhmmN_NLb1J3f7oTDvwumgTo0LowI,1494 +django/contrib/gis/locale/en_GB/LC_MESSAGES/django.mo,sha256=WkORQDOsFuV2bI7hwVsJr_JTWnDQ8ZaK-VYugqnLv3w,1369 +django/contrib/gis/locale/en_GB/LC_MESSAGES/django.po,sha256=KWPMoX-X-gQhb47zoVsa79-16-SiCGpO0s4xkcGv9z0,1910 +django/contrib/gis/locale/eo/LC_MESSAGES/django.mo,sha256=FFSZ58VHOog4-tDy88OISaaLXMaHVuFsIr3uevM-LGc,1878 +django/contrib/gis/locale/eo/LC_MESSAGES/django.po,sha256=oyMvu7r3BKLV9VDYQI6IgjumYusSOgynlSdN3dDrcPo,2156 +django/contrib/gis/locale/es/LC_MESSAGES/django.mo,sha256=JTo6frVHdq3bDY7IwpP5K6Znbb0NXMyVBv-AOQ6gd9s,2005 +django/contrib/gis/locale/es/LC_MESSAGES/django.po,sha256=3xK9yehM6kTSbulhvTenKXmlBeUnfgqM3_a7waiNit4,2465 +django/contrib/gis/locale/es_AR/LC_MESSAGES/django.mo,sha256=Z_2xqsHzQNSQWphm6jV9efFFjzHmkmuk2KfLZXx5E1k,2006 +django/contrib/gis/locale/es_AR/LC_MESSAGES/django.po,sha256=_PHHHfzhzPI5xaZwDH6Rd35KEbj1l1-9IyPLEENaw6E,2161 +django/contrib/gis/locale/es_CO/LC_MESSAGES/django.mo,sha256=mMnOZTrmWutn2Lwv2Y7GuoZIhIbPsMCXJkdmeatXZaM,1817 +django/contrib/gis/locale/es_CO/LC_MESSAGES/django.po,sha256=JF0-_eNt-BPJ__GqNoEj7iKEOV8htZHyX5kZue-PZO4,2349 +django/contrib/gis/locale/es_MX/LC_MESSAGES/django.mo,sha256=bC-uMgJXdbKHQ-w7ez-6vh9E_2YSgCF_LkOQlvb60BU,1441 +django/contrib/gis/locale/es_MX/LC_MESSAGES/django.po,sha256=MYO9fGclp_VvLG5tXDjXY3J_1FXI4lDv23rGElXAyjA,1928 +django/contrib/gis/locale/es_VE/LC_MESSAGES/django.mo,sha256=5YVIO9AOtmjky90DAXVyU0YltfQ4NLEpVYRTTk7SZ5o,486 +django/contrib/gis/locale/es_VE/LC_MESSAGES/django.po,sha256=R8suLsdDnSUEKNlXzow3O6WIT5NcboZoCjir9GfSTSQ,1494 +django/contrib/gis/locale/et/LC_MESSAGES/django.mo,sha256=-Gn24H3qyIcf3ptRe7Iin8sHc6JtkkFsmJF4DI1Wwhs,1872 +django/contrib/gis/locale/et/LC_MESSAGES/django.po,sha256=c-8desC8uDUy9UrX3IicuGICF2xAWPudgAprvS3G7jY,2223 +django/contrib/gis/locale/eu/LC_MESSAGES/django.mo,sha256=c2YYr77DeKdHWhpq6T472Hc1wpzYQ1fgKXELx7GMW_U,1888 +django/contrib/gis/locale/eu/LC_MESSAGES/django.po,sha256=HVR7BSXjUy3pphfPKp2uapaKVnQeb3chQIxcG5bMxHY,2147 +django/contrib/gis/locale/fa/LC_MESSAGES/django.mo,sha256=oSM2n6s-E4eomcHHZT6gY0PrhUFDr7Wijs3Qkr62jX0,2155 +django/contrib/gis/locale/fa/LC_MESSAGES/django.po,sha256=uUaUbYmjFcZ3mp9-FmGVT3zv47n54sWtzaXHWFSpMik,2507 +django/contrib/gis/locale/fi/LC_MESSAGES/django.mo,sha256=A1QOLEk9dFKcxlE2puSLmdDdFWRwGbSKsDGbKemUsCM,1839 +django/contrib/gis/locale/fi/LC_MESSAGES/django.po,sha256=IbtvFNK1bXmck5zZQqXNCDSiuXcGonNl8UcN0BfopFQ,2064 +django/contrib/gis/locale/fr/LC_MESSAGES/django.mo,sha256=LXchLaOY_bGIf25s_rQgWHOvEMD-l8_HAT5WtC0irfs,2058 +django/contrib/gis/locale/fr/LC_MESSAGES/django.po,sha256=FVuGpVTPP2-f4CZKL0UZwLSxy2WiDczw9_q3KRTbclQ,2258 +django/contrib/gis/locale/fy/LC_MESSAGES/django.mo,sha256=2kCnWU_giddm3bAHMgDy0QqNwOb9qOiEyCEaYo1WdqQ,476 +django/contrib/gis/locale/fy/LC_MESSAGES/django.po,sha256=7ncWhxC5OLhXslQYv5unWurhyyu_vRsi4bGflZ6T2oQ,1484 +django/contrib/gis/locale/ga/LC_MESSAGES/django.mo,sha256=5oExwd6zeo9pBXhr1u_su8cllMEOQ-PnkUCkqFcQyYo,1957 +django/contrib/gis/locale/ga/LC_MESSAGES/django.po,sha256=CZngY66ohYP6Xr25Cghym_gW2AKpQlRRdIBYBMej5AY,2193 +django/contrib/gis/locale/gd/LC_MESSAGES/django.mo,sha256=w9d6GRaJMzeRVMzOuapvpPayOQmrFQEwPf8g4TXSatg,2022 +django/contrib/gis/locale/gd/LC_MESSAGES/django.po,sha256=2jXpd-BBQ7JVj2l9tWhIkUXw4ZZPnGJrvHjs442GEx8,2197 +django/contrib/gis/locale/gl/LC_MESSAGES/django.mo,sha256=vjZQqAw3rDSY8Tgv-12EOhsqfFlaEOB7mVBOH6YlXNo,1956 +django/contrib/gis/locale/gl/LC_MESSAGES/django.po,sha256=zhqF1InI8QaKhDLqjfTRUbMPaT9X3D1eI1ocV5FHGf4,2231 +django/contrib/gis/locale/he/LC_MESSAGES/django.mo,sha256=qaxQ0A76SO7GM5WDK0_3pAJDFzkvAtjSV8r1P4ySCVY,2135 +django/contrib/gis/locale/he/LC_MESSAGES/django.po,sha256=f8w5v4W7w47vH6Tq4HfMOX9jB4ab0oEXnpuJcDlk7Ak,2336 +django/contrib/gis/locale/hi/LC_MESSAGES/django.mo,sha256=3nsy5mxKTPtx0EpqBNA_TJXmLmVZ4BPUZG72ZEe8OPM,1818 +django/contrib/gis/locale/hi/LC_MESSAGES/django.po,sha256=jTFG2gqqYAQct9-to0xL2kUFQu-ebR4j7RGfxn4sBAg,2372 +django/contrib/gis/locale/hr/LC_MESSAGES/django.mo,sha256=0XrRj2oriNZxNhEwTryo2zdMf-85-4X7fy7OJhB5ub4,1549 +django/contrib/gis/locale/hr/LC_MESSAGES/django.po,sha256=iijzoBoD_EJ1n-a5ys5CKnjzZzG299zPoCN-REFkeqE,2132 +django/contrib/gis/locale/hsb/LC_MESSAGES/django.mo,sha256=oXaJFKOmRL_hRqAbghejIgZiq67bAnrOV0eFpoqmyW0,1991 +django/contrib/gis/locale/hsb/LC_MESSAGES/django.po,sha256=uktC4ibheBFFZVh0LVtRVUT3RnefGXVOVQddK70hdgg,2155 +django/contrib/gis/locale/hu/LC_MESSAGES/django.mo,sha256=dXlt0Oq_W45B_Foneh2FgpExduFanuG7ia0wKsYCUqs,1891 +django/contrib/gis/locale/hu/LC_MESSAGES/django.po,sha256=Ws1oB2MpVa90a0JNK2LxsZytKBuMMNwLx0DW1sem4Es,2210 +django/contrib/gis/locale/hy/LC_MESSAGES/django.mo,sha256=pi9oAP8fLCg8ssz7ADZ_p9HntyDtdQ1Mep6KsR5Glfs,2020 +django/contrib/gis/locale/hy/LC_MESSAGES/django.po,sha256=FKRbr93M2S4dLWes80CTZ1AucKW8MF5cw98i0s8qZo4,2260 +django/contrib/gis/locale/ia/LC_MESSAGES/django.mo,sha256=gSHcbhwZ2H1amTQbWw908L0aTniLzK8T2RVGsiHuKIY,1812 +django/contrib/gis/locale/ia/LC_MESSAGES/django.po,sha256=IyKoOfc6ZNtvpL8s-r4lv41wlsCyq8CGNoNp7uHWUGE,2122 +django/contrib/gis/locale/id/LC_MESSAGES/django.mo,sha256=dzDiuO47A6XWR3G-OrY-A2c-7ccp1oGLlKPyUO2Wlpg,1862 +django/contrib/gis/locale/id/LC_MESSAGES/django.po,sha256=KZVcWZ_X8x3LO5Z4V-hzSEsvE-BEHIZq5eWJlW1SwZs,2278 +django/contrib/gis/locale/io/LC_MESSAGES/django.mo,sha256=_yUgF2fBUxVAZAPNw2ROyWly5-Bq0niGdNEzo2qbp8k,464 +django/contrib/gis/locale/io/LC_MESSAGES/django.po,sha256=fgGJ1xzliMK0MlVoV9CQn_BuuS3Kl71Kh5YEybGFS0Y,1472 +django/contrib/gis/locale/is/LC_MESSAGES/django.mo,sha256=UQb3H5F1nUxJSrADpLiYe12TgRhYKCFQE5Xy13MzEqU,1350 +django/contrib/gis/locale/is/LC_MESSAGES/django.po,sha256=8QWtgdEZR7OUVXur0mBCeEjbXTBjJmE-DOiKe55FvMo,1934 +django/contrib/gis/locale/it/LC_MESSAGES/django.mo,sha256=8VddOMr-JMs5D-J5mq-UgNnhf98uutpoJYJKTr8E224,1976 +django/contrib/gis/locale/it/LC_MESSAGES/django.po,sha256=Vp1G-GChjjTsODwABsg5LbmR6_Z-KpslwkNUipuOqk4,2365 +django/contrib/gis/locale/ja/LC_MESSAGES/django.mo,sha256=SY1Kxu_gIqusDX5-4SvWmfGi5zG_-jG_98wbkkUyMfk,2052 +django/contrib/gis/locale/ja/LC_MESSAGES/django.po,sha256=tui2WDqNwYHiOkR9j9kl8YSs_kzZ5MTHAj9hniHKI_8,2357 +django/contrib/gis/locale/ka/LC_MESSAGES/django.mo,sha256=iqWQ9j8yanPjDhwi9cNSktYgfLVnofIsdICnAg2Y_to,1991 +django/contrib/gis/locale/ka/LC_MESSAGES/django.po,sha256=rkM7RG0zxDN8vqyAudmk5nocajhOYP6CTkdJKu21Pf4,2571 +django/contrib/gis/locale/kk/LC_MESSAGES/django.mo,sha256=NtgQONp0UncUNvrh0W2R7u7Ja8H33R-a-tsQShWq-QI,1349 +django/contrib/gis/locale/kk/LC_MESSAGES/django.po,sha256=78OMHuerBJZJZVo9GjGJ1h5fwdLuSc_X03ZhSRibtf4,1979 +django/contrib/gis/locale/km/LC_MESSAGES/django.mo,sha256=T0aZIZ_gHqHpQyejnBeX40jdcfhrCOjgKjNm2hLrpNE,459 +django/contrib/gis/locale/km/LC_MESSAGES/django.po,sha256=7ARjFcuPQJG0OGLJu9pVfSiAwc2Q-1tT6xcLeKeom1c,1467 +django/contrib/gis/locale/kn/LC_MESSAGES/django.mo,sha256=EkJRlJJSHZJvNZJuOLpO4IIUEoyi_fpKwNWe0OGFcy4,461 +django/contrib/gis/locale/kn/LC_MESSAGES/django.po,sha256=MnsSftGvmgJgGfgayQUVDMj755z8ItkM9vBehORfYbk,1475 +django/contrib/gis/locale/ko/LC_MESSAGES/django.mo,sha256=TyIytTrPe4GO6lRsK1CW0wIdhbrwDHxlO_29OX6MoH4,1888 +django/contrib/gis/locale/ko/LC_MESSAGES/django.po,sha256=V5OQ0oW3zU8MMdlOJXk-4RQo0UV3cCAhgSMOaQRgttM,2296 +django/contrib/gis/locale/ky/LC_MESSAGES/django.mo,sha256=nvMSOW77P-YCRkQgrQUpM94FexqLEt8Et0jri2nm_Ec,2157 +django/contrib/gis/locale/ky/LC_MESSAGES/django.po,sha256=0qqO8QWgJXPJpZ900MVsHdw6wMZBa0tE5GN3KSGa58E,2372 +django/contrib/gis/locale/lb/LC_MESSAGES/django.mo,sha256=XAyZQUi8jDr47VpSAHp_8nQb0KvSMJHo5THojsToFdk,474 +django/contrib/gis/locale/lb/LC_MESSAGES/django.po,sha256=5rfudPpH4snSq2iVm9E81EBwM0S2vbkY2WBGhpuga1Q,1482 +django/contrib/gis/locale/lt/LC_MESSAGES/django.mo,sha256=AD69M-SBrmQ5qaFKXX6FYOOXLfhuWlQdOYcMlV0UClo,2036 +django/contrib/gis/locale/lt/LC_MESSAGES/django.po,sha256=1yXUj9Hf4D2iyl97HoRuJLkfnR7Z-WmOoIJil98Cy-M,2366 +django/contrib/gis/locale/lv/LC_MESSAGES/django.mo,sha256=ZNt2B2qukArT3gRZE2SNsKna5pf9-UcsTUbQ3UbbQKA,1978 +django/contrib/gis/locale/lv/LC_MESSAGES/django.po,sha256=CM5WUeTmm4pp5Y4E1Cm3aCwGmTHNSyjSU3B44dRYdHA,2215 +django/contrib/gis/locale/mk/LC_MESSAGES/django.mo,sha256=fLSXxmJFE9kYsKMiwWAXS-9TweB_yuWzAjR-y0eysvI,2518 +django/contrib/gis/locale/mk/LC_MESSAGES/django.po,sha256=P2IKvpaMOj5UvJX_Lz-PE0-1D7Kt_fYM5Amm3d5g6t4,2918 +django/contrib/gis/locale/ml/LC_MESSAGES/django.mo,sha256=Kl9okrE3AzTPa5WQ-IGxYVNSRo2y_VEdgDcOyJ_Je78,2049 +django/contrib/gis/locale/ml/LC_MESSAGES/django.po,sha256=PWg8atPKfOsnVxg_uro8zYO9KCE1UVhfy_zmCWG0Bdk,2603 +django/contrib/gis/locale/mn/LC_MESSAGES/django.mo,sha256=DlGtHJJMKLVntNdaPBXZw9ApM_SjUYEYAgE9DpZv33w,2323 +django/contrib/gis/locale/mn/LC_MESSAGES/django.po,sha256=z9E7N3TXiMCd2FCunpMjS55-uamM_G4iQpI1MoTDSVY,2766 +django/contrib/gis/locale/mr/LC_MESSAGES/django.mo,sha256=3be2jV7c3MBww-fNMk8A9l9hWDwR4pgSmfztJj6cio0,510 +django/contrib/gis/locale/mr/LC_MESSAGES/django.po,sha256=dKaMdzicJqGwxA5VF1GeM3wGUQOtsnWCeHoGGcjFy-o,1530 +django/contrib/gis/locale/ms/LC_MESSAGES/django.mo,sha256=5_xS-XXVyw0cxvDzUIus5JImr0dkcswait04e7TrUtY,1828 +django/contrib/gis/locale/ms/LC_MESSAGES/django.po,sha256=I8rMkUEfsbjf-dWUuXyhYwCXhyX8AS3jjOKinAh7q2Q,1956 +django/contrib/gis/locale/my/LC_MESSAGES/django.mo,sha256=e6G8VbCCthUjV6tV6PRCy_ZzsXyZ-1OYjbYZIEShbXI,525 +django/contrib/gis/locale/my/LC_MESSAGES/django.po,sha256=R3v1S-904f8FWSVGHe822sWrOJI6cNJIk93-K7_E_1c,1580 +django/contrib/gis/locale/nb/LC_MESSAGES/django.mo,sha256=mx9uGqo5w_uRBWHswuEKoI-U-RX_Xvx_qck5ForI63Y,1808 +django/contrib/gis/locale/nb/LC_MESSAGES/django.po,sha256=LVjQsJxXdDBuKS5D7BEJ10C9OE8x3g0f9ewgjoG6fbY,2039 +django/contrib/gis/locale/ne/LC_MESSAGES/django.mo,sha256=nB-Ta8w57S6hIAhAdWZjDT0Dg6JYGbAt5FofIhJT7k8,982 +django/contrib/gis/locale/ne/LC_MESSAGES/django.po,sha256=eMH6uKZZZYn-P3kmHumiO4z9M4923s9tWGhHuJ0eWuI,1825 +django/contrib/gis/locale/nl/LC_MESSAGES/django.mo,sha256=ScPsjM7aMa8PwcbxliFgqfS7_WyOuTGmODGAZY85UM4,1897 +django/contrib/gis/locale/nl/LC_MESSAGES/django.po,sha256=zoUzuPhO4XGlrhmRluXNRMpjD7lEIjAW8TufBqAOO4o,2408 +django/contrib/gis/locale/nn/LC_MESSAGES/django.mo,sha256=P1RU0OICBDeHHtX6rCSB4xXgS4Qn97LqoxJ8phgiMDs,1830 +django/contrib/gis/locale/nn/LC_MESSAGES/django.po,sha256=-mkHmKp3b76uZlFOG3lFLp2nEFtBRV_4ThDPQmUWtX4,2027 +django/contrib/gis/locale/os/LC_MESSAGES/django.mo,sha256=02NpGC8WPjxmPqQkfv9Kj2JbtECdQCtgecf_Tjk1CZc,1594 +django/contrib/gis/locale/os/LC_MESSAGES/django.po,sha256=JBIsv5nJg3Wof7Xy7odCI_xKRBLN_Hlbb__kNqNW4Xw,2161 +django/contrib/gis/locale/pa/LC_MESSAGES/django.mo,sha256=JR1NxG5_h_dFE_7p6trBWWIx-QqWYIgfGomnjaCsWAA,1265 +django/contrib/gis/locale/pa/LC_MESSAGES/django.po,sha256=Ejd_8dq_M0E9XFijk0qj4oC-8_oe48GWWHXhvOrFlnY,1993 +django/contrib/gis/locale/pl/LC_MESSAGES/django.mo,sha256=KHar168QJ7Mj0419885rkyRXvWXkICAi0hUbb8KssY8,2045 +django/contrib/gis/locale/pl/LC_MESSAGES/django.po,sha256=cfeYjcF9R8VKujBMGLx_1z9zDY19DPCjUw5FpHuBIqs,2487 +django/contrib/gis/locale/pt/LC_MESSAGES/django.mo,sha256=sE5PPOHzfT8QQXuV5w0m2pnBTRhKYs_vFhk8p_A4Jg0,2036 +django/contrib/gis/locale/pt/LC_MESSAGES/django.po,sha256=TFt6Oj1NlCM3pgs2dIgFZR3S3y_g7oR7S-XRBlM4924,2443 +django/contrib/gis/locale/pt_BR/LC_MESSAGES/django.mo,sha256=5HGIao480s3B6kXtSmdy1AYjGUZqbYuZ9Eapho_jkTk,1976 +django/contrib/gis/locale/pt_BR/LC_MESSAGES/django.po,sha256=4-2WPZT15YZPyYbH7xnBRc7A8675875kVFjM9tr1o5U,2333 +django/contrib/gis/locale/ro/LC_MESSAGES/django.mo,sha256=jncf415WRI-GaemNGtbXITeYpx2zbokFNfQkONIOSO4,1770 +django/contrib/gis/locale/ro/LC_MESSAGES/django.po,sha256=5Xb2c11mwOdsd1D8SZC5u6nsuNjWEtdT1hslrQBfxP0,2181 +django/contrib/gis/locale/ru/LC_MESSAGES/django.mo,sha256=j9DEE5SVvEXWBj_PtR9_1IsaE-YCq4iOBcaiyHHqOEo,2481 +django/contrib/gis/locale/ru/LC_MESSAGES/django.po,sha256=fgj-PmNJ88IsjUUq7x9W6KSwXWdmnEq1PBlWsLFhzwE,2835 +django/contrib/gis/locale/sk/LC_MESSAGES/django.mo,sha256=FQy4gMIxrXNm42pvJ61q4ZfG0Ce98gv78b2I0vYN2CY,1980 +django/contrib/gis/locale/sk/LC_MESSAGES/django.po,sha256=z7uy3S2VXGZKMfgFLISYUPUb-zyEYXqlDgL_ODmb_4w,2315 +django/contrib/gis/locale/sl/LC_MESSAGES/django.mo,sha256=Ha88TShV2Bt_Jmvlkkc81CUkuV2iKfhGjzpD7KLMhv8,1972 +django/contrib/gis/locale/sl/LC_MESSAGES/django.po,sha256=B81yHSMjOYevk35kC4JEi4Ua3axjadkFW8aRuMnj6P0,2319 +django/contrib/gis/locale/sq/LC_MESSAGES/django.mo,sha256=hTehi3p1Qf7RCqK4vvcL-yoV7GVdbcokLN_5RGtmivE,1660 +django/contrib/gis/locale/sq/LC_MESSAGES/django.po,sha256=qnNVwZ69HLsTRC5GVYtVkIcZTCT_lNGjlDUibpCefr8,2037 +django/contrib/gis/locale/sr/LC_MESSAGES/django.mo,sha256=bM996RqI1wt4qHsUaGXoEO3fnaSZdjVD2TvUFDp5dVk,2365 +django/contrib/gis/locale/sr/LC_MESSAGES/django.po,sha256=hunakYgljjOiiYF98ZzFzIHTkIAGQM_IJLiLfmlR86Q,2628 +django/contrib/gis/locale/sr_Latn/LC_MESSAGES/django.mo,sha256=kniIObavM7XKqD5vcglrbcD8jqANKg7hN6AP4cIVAI0,1981 +django/contrib/gis/locale/sr_Latn/LC_MESSAGES/django.po,sha256=A2NsZJvk2Cckg8OS3yW_T11Tcv5-zgGEHcDRJpvE8Zg,2206 +django/contrib/gis/locale/sv/LC_MESSAGES/django.mo,sha256=CowUAoL4t4np5cBndBNM-a4Wu5oD899nVfifMOLz6xQ,1880 +django/contrib/gis/locale/sv/LC_MESSAGES/django.po,sha256=Xyzc8X3vwQ3wWfS4_5mpwFXPPAeCx4mODYFq3Kba04g,2252 +django/contrib/gis/locale/sw/LC_MESSAGES/django.mo,sha256=uBhpGHluGwYpODTE-xhdJD2e6PHleN07wLE-kjrXr_M,1426 +django/contrib/gis/locale/sw/LC_MESSAGES/django.po,sha256=nHXQQMYYXT1ec3lIBxQIDIAwLtXucX47M4Cozy08kko,1889 +django/contrib/gis/locale/ta/LC_MESSAGES/django.mo,sha256=Rboo36cGKwTebe_MiW4bOiMsRO2isB0EAyJJcoy_F6s,466 +django/contrib/gis/locale/ta/LC_MESSAGES/django.po,sha256=sLYW8_5BSVoSLWUr13BbKRe0hNJ_cBMEtmjCPBdTlAk,1474 +django/contrib/gis/locale/te/LC_MESSAGES/django.mo,sha256=xDkaSztnzQ33Oc-GxHoSuutSIwK9A5Bg3qXEdEvo4h4,824 +django/contrib/gis/locale/te/LC_MESSAGES/django.po,sha256=nYryhktJumcwtZDGZ43xBxWljvdd-cUeBrAYFZOryVg,1772 +django/contrib/gis/locale/tg/LC_MESSAGES/django.mo,sha256=6Jyeaq1ORsnE7Ceh_rrhbfslFskGe12Ar-dQl6NFyt0,611 +django/contrib/gis/locale/tg/LC_MESSAGES/django.po,sha256=9c1zPt7kz1OaRJPPLdqjQqO8MT99KtS9prUvoPa9qJk,1635 +django/contrib/gis/locale/th/LC_MESSAGES/django.mo,sha256=0kekAr7eXc_papwPAxEZ3TxHOBg6EPzdR3q4hmAxOjg,1835 +django/contrib/gis/locale/th/LC_MESSAGES/django.po,sha256=WJPdoZjLfvepGGMhfBB1EHCpxtxxfv80lRjPG9kGErM,2433 +django/contrib/gis/locale/tr/LC_MESSAGES/django.mo,sha256=5EKMteFT0WXGacwXnRt5Eak00kbtYmqskkuCg2rGvyc,1904 +django/contrib/gis/locale/tr/LC_MESSAGES/django.po,sha256=DSIty_3V3G_Pv498EU3H60-5jS0b1S5tPwR_fkwpq98,2180 +django/contrib/gis/locale/tt/LC_MESSAGES/django.mo,sha256=cGVPrWCe4WquVV77CacaJwgLSnJN0oEAepTzNMD-OWk,1470 +django/contrib/gis/locale/tt/LC_MESSAGES/django.po,sha256=98yeRs-JcMGTyizOpEuQenlnWJMYTR1-rG3HGhKCykk,2072 +django/contrib/gis/locale/udm/LC_MESSAGES/django.mo,sha256=I6bfLvRfMn79DO6bVIGfYSVeZY54N6c8BNO7OyyOOsw,462 +django/contrib/gis/locale/udm/LC_MESSAGES/django.po,sha256=B1PCuPYtNOrrhu4fKKJgkqxUrcEyifS2Y3kw-iTmSIk,1470 +django/contrib/gis/locale/ug/LC_MESSAGES/django.mo,sha256=cKr7ETLbYR1nMm2iJsQwZYKz8U5aP2CX5RdhbKW2gh4,2360 +django/contrib/gis/locale/ug/LC_MESSAGES/django.po,sha256=d1P7kH2ETJ9n34d9ALE0tHWw_1_fq7fuiLBNK2IlM10,2529 +django/contrib/gis/locale/uk/LC_MESSAGES/django.mo,sha256=jsJMgEt6VXoSjksQGngxaywARUsk5tiIKJfUw9kgEBw,2513 +django/contrib/gis/locale/uk/LC_MESSAGES/django.po,sha256=NNAUWdHmhsWtrPIgddjT03k4IeJUlUCYM7n78DisFQw,3015 +django/contrib/gis/locale/ur/LC_MESSAGES/django.mo,sha256=tB5tz7EscuE9IksBofNuyFjk89-h5X7sJhCKlIho5SY,1410 +django/contrib/gis/locale/ur/LC_MESSAGES/django.po,sha256=16m0t10Syv76UcI7y-EXfQHETePmrWX4QMVfyeuX1fQ,2007 +django/contrib/gis/locale/vi/LC_MESSAGES/django.mo,sha256=NT5T0FRCC2XINdtaCFCVUxb5VRv8ta62nE8wwSHGTrc,1384 +django/contrib/gis/locale/vi/LC_MESSAGES/django.po,sha256=y77GtqH5bv1wR78xN5JLHusmQzoENTH9kLf9Y3xz5xk,1957 +django/contrib/gis/locale/zh_Hans/LC_MESSAGES/django.mo,sha256=NvNiRwwuqrmOWqiiuYhoxTs3CXb9Zq0-R_2YVhY6n34,1760 +django/contrib/gis/locale/zh_Hans/LC_MESSAGES/django.po,sha256=jXKQKr3GOjL5LJ7Mv1O3zpn2hr_sA_31ote8Pzk9tOU,2232 +django/contrib/gis/locale/zh_Hant/LC_MESSAGES/django.mo,sha256=jbNgO-5ICEWlqu5BaaKrPQ5XIC1CDzpYbbXA6_Xo-D0,1811 +django/contrib/gis/locale/zh_Hant/LC_MESSAGES/django.po,sha256=h72hJ3socDnGCoPHREClni4DxDS0B-n-8EGAADlnmK4,2139 +django/contrib/gis/management/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/contrib/gis/management/__pycache__/__init__.cpython-312.pyc,, +django/contrib/gis/management/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/contrib/gis/management/commands/__pycache__/__init__.cpython-312.pyc,, +django/contrib/gis/management/commands/__pycache__/inspectdb.cpython-312.pyc,, +django/contrib/gis/management/commands/__pycache__/ogrinspect.cpython-312.pyc,, +django/contrib/gis/management/commands/inspectdb.py,sha256=8WhDOBICFAbLFu7kwAAS4I5pNs_p1BrCv8GJYI3S49k,760 +django/contrib/gis/management/commands/ogrinspect.py,sha256=XnWAbLxRxTSvbKSvjgePN7D1o_Ep4qWkvMwVrG1TpYY,6071 +django/contrib/gis/measure.py,sha256=3Kwchst6tJFwK9tMQb5oD6_eUVNnSMyKruOEDuxT7Rc,12573 +django/contrib/gis/ptr.py,sha256=NeIBB-plwO61wGOOxGg7fFyVXI4a5vbAGUdaJ_Fmjqo,1312 +django/contrib/gis/serializers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/contrib/gis/serializers/__pycache__/__init__.cpython-312.pyc,, +django/contrib/gis/serializers/__pycache__/geojson.cpython-312.pyc,, +django/contrib/gis/serializers/geojson.py,sha256=lgwJ0xh-mjMVwJi_UpHH7MTKtjH_7txIQyLG-G2C4-A,3000 +django/contrib/gis/shortcuts.py,sha256=aa9zFjVU38qaEvRc0vAH_j2AgAERlI01rphYLHbc7Tg,1027 +django/contrib/gis/sitemaps/__init__.py,sha256=Tjj057omOVcoC5Fb8ITEYVhLm0HcVjrZ1Mbz_tKoD1A,138 +django/contrib/gis/sitemaps/__pycache__/__init__.cpython-312.pyc,, +django/contrib/gis/sitemaps/__pycache__/kml.cpython-312.pyc,, +django/contrib/gis/sitemaps/__pycache__/views.cpython-312.pyc,, +django/contrib/gis/sitemaps/kml.py,sha256=CUn_KKVrwGg2ZmmDcWosBc0QFuJp8hHpeNRCcloVk1U,2573 +django/contrib/gis/sitemaps/views.py,sha256=AFV1ay-oFftFC-IszzeKz3JAGzE0TOCH8pN1cwtg7yI,2353 +django/contrib/gis/static/gis/css/ol3.css,sha256=DmCfOuPC1wUs0kioWxIpSausvF6AYUlURbJLNGyvngA,773 +django/contrib/gis/static/gis/img/draw_line_off.svg,sha256=6XW83xsR5-Guh27UH3y5UFn9y9FB9T_Zc4kSPA-xSOI,918 +django/contrib/gis/static/gis/img/draw_line_on.svg,sha256=Hx-pXu4ped11esG6YjXP1GfZC5q84zrFQDPUo1C7FGA,892 +django/contrib/gis/static/gis/img/draw_point_off.svg,sha256=PICrywZPwuBkaQAKxR9nBJ0AlfTzPHtVn_up_rSiHH4,803 +django/contrib/gis/static/gis/img/draw_point_on.svg,sha256=raGk3oc8w87rJfLdtZ4nIXJyU3OChCcTd4oH-XAMmmM,803 +django/contrib/gis/static/gis/img/draw_polygon_off.svg,sha256=gnVmjeZE2jOvjfyx7mhazMDBXJ6KtSDrV9f0nSzkv3A,981 +django/contrib/gis/static/gis/img/draw_polygon_on.svg,sha256=ybJ9Ww7-bsojKQJtjErLd2cCOgrIzyqgIR9QNhH_ZfA,982 +django/contrib/gis/static/gis/js/OLMapWidget.js,sha256=JdZJtX4EP_pphsjxs7EnZdfHGM1s5Zsn1MQ38JDU0JQ,9019 +django/contrib/gis/templates/gis/kml/base.kml,sha256=VYnJaGgFVHRzDjiFjbcgI-jxlUos4B4Z1hx_JeI2ZXU,219 +django/contrib/gis/templates/gis/kml/placemarks.kml,sha256=TEC81sDL9RK2FVeH0aFJTwIzs6_YWcMeGnHkACJV1Uc,360 +django/contrib/gis/templates/gis/openlayers-osm.html,sha256=TeiUqCjt73W8Hgrp_6zAtk_ZMBxskNN6KHSmnJ1-GD4,378 +django/contrib/gis/templates/gis/openlayers.html,sha256=J9e_MAMgfMR8NFH9bhQ_ZDIsjKCiCfRRp0__bKK6TK4,1418 +django/contrib/gis/utils/__init__.py,sha256=pnsvryh3ad9wlaf1r7srfi-OwQzktSZzHoaoVZyo14U,683 +django/contrib/gis/utils/__pycache__/__init__.cpython-312.pyc,, +django/contrib/gis/utils/__pycache__/layermapping.cpython-312.pyc,, +django/contrib/gis/utils/__pycache__/ogrinfo.cpython-312.pyc,, +django/contrib/gis/utils/__pycache__/ogrinspect.cpython-312.pyc,, +django/contrib/gis/utils/__pycache__/srs.cpython-312.pyc,, +django/contrib/gis/utils/layermapping.py,sha256=AgEgNEzIUUW0a482UW5iUfVbY1HlQPl8Q9YEuRMau_Q,29043 +django/contrib/gis/utils/ogrinfo.py,sha256=6m3KaRzLoZtQ0OSrpRkaFIQXi9YOXTkQcYeqYb0S0nw,1956 +django/contrib/gis/utils/ogrinspect.py,sha256=f31eRqR5ybC-QR2mOjNWszYDANCWdEEgyqeIcvBAC4g,9170 +django/contrib/gis/utils/srs.py,sha256=UXsbxW0cQzdnPKO0d9E5K2HPdekdab5NaLZWNOUq-zk,2962 +django/contrib/gis/views.py,sha256=zdCV8QfUVfxEFGxESsUtCicsbSVtZNI_IXybdmsHKiM,714 +django/contrib/humanize/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/contrib/humanize/__pycache__/__init__.cpython-312.pyc,, +django/contrib/humanize/__pycache__/apps.cpython-312.pyc,, +django/contrib/humanize/apps.py,sha256=LH3PTbB4V1gbBc8nmCw3BsSuA8La0fNOb4cSISvJAwI,194 +django/contrib/humanize/locale/af/LC_MESSAGES/django.mo,sha256=yFvTzvROTnoZF4ZPAs3z9ireOuOf5gTfECEUdGa4EkM,4224 +django/contrib/humanize/locale/af/LC_MESSAGES/django.po,sha256=m8GF4T4HY4aGsfadUdu04yc7cq9Sm-K5LM-OFjTrq5Y,7541 +django/contrib/humanize/locale/ar/LC_MESSAGES/django.mo,sha256=PokPfBR8w4AbRtNNabl5vO8r5E8_egHvFBjKp4CCvO4,7510 +django/contrib/humanize/locale/ar/LC_MESSAGES/django.po,sha256=QGW-kx-87DlPMGr5l_Eb6Ge-x4tkz2PuwHDe3EIkIQg,12326 +django/contrib/humanize/locale/ar_DZ/LC_MESSAGES/django.mo,sha256=NwCrL5FX_xdxYdqkW_S8tmU8ktDM8LqimmUvkt8me74,9155 +django/contrib/humanize/locale/ar_DZ/LC_MESSAGES/django.po,sha256=tt0AxhohGX79OQ_lX1S5soIo-iSCC07SdAhPpy0O7Q4,15234 +django/contrib/humanize/locale/ast/LC_MESSAGES/django.mo,sha256=WvBk8V6g1vgzGqZ_rR-4p7SMh43PFnDnRhIS9HSwdoQ,3468 +django/contrib/humanize/locale/ast/LC_MESSAGES/django.po,sha256=S9lcUf2y5wR8Ufa-Rlz-M73Z3bMo7zji_63cXwtDK2I,5762 +django/contrib/humanize/locale/az/LC_MESSAGES/django.mo,sha256=ukqeNWHDFXv3XhvfpX8ZU6sb-CrUIx_ks_gwNNWfiFw,4311 +django/contrib/humanize/locale/az/LC_MESSAGES/django.po,sha256=RLGjARRoX9wwBS8Y4EBiC_0iWig93qKaWel4sLOqLhM,7765 +django/contrib/humanize/locale/be/LC_MESSAGES/django.mo,sha256=7KyJKhNqMqv32CPdJi01RPLBefOVCQW-Gx6-Vf9JVrs,6653 +django/contrib/humanize/locale/be/LC_MESSAGES/django.po,sha256=2mbReEHyXhmZysqhSmaT6A2XCHn8mYb2R_O16TMGCAo,10666 +django/contrib/humanize/locale/bg/LC_MESSAGES/django.mo,sha256=jCdDIbqWlhOs-4gML44wSRIXJQxypfak6ByRG_reMsk,4823 +django/contrib/humanize/locale/bg/LC_MESSAGES/django.po,sha256=v2ih4-pL1cdDXaa3uXm9FxRjRKyULLGyz78Q91eKEG8,8267 +django/contrib/humanize/locale/bn/LC_MESSAGES/django.mo,sha256=jbL4ucZxxtexI10jgldtgnDie3I23XR3u-PrMMMqP6U,4026 +django/contrib/humanize/locale/bn/LC_MESSAGES/django.po,sha256=0l4yyy7q3OIWyFk_PW0y883Vw2Pmu48UcnLM9OBxB68,6545 +django/contrib/humanize/locale/br/LC_MESSAGES/django.mo,sha256=V_tPVAyQzVdDwWPNlVGWmlVJjmVZfbh35alkwsFlCNU,5850 +django/contrib/humanize/locale/br/LC_MESSAGES/django.po,sha256=BcAqEV2JpF0hiCQDttIMblp9xbB7zoHsmj7fJFV632k,12245 +django/contrib/humanize/locale/bs/LC_MESSAGES/django.mo,sha256=1-RNRHPgZR_9UyiEn9Djp4mggP3fywKZho45E1nGMjM,1416 +django/contrib/humanize/locale/bs/LC_MESSAGES/django.po,sha256=M017Iu3hyXmINZkhCmn2he-FB8rQ7rXN0KRkWgrp7LI,5498 +django/contrib/humanize/locale/ca/LC_MESSAGES/django.mo,sha256=WDvXis2Y1ivSq6NdJgddO_WKbz8w5MpVpkT4sq-pWXI,4270 +django/contrib/humanize/locale/ca/LC_MESSAGES/django.po,sha256=AD3h2guGADdp1f9EcbP1vc1lmfDOL8-1qQfwvXa6I04,7731 +django/contrib/humanize/locale/ckb/LC_MESSAGES/django.mo,sha256=Mqv3kRZrOjWtTstmtOEqIJsi3vevf_hZUfYEetGxO7w,5021 +django/contrib/humanize/locale/ckb/LC_MESSAGES/django.po,sha256=q_7p7pEyV_NTw9eBvcztKlSFW7ykl0CIsNnA9g5oy20,8317 +django/contrib/humanize/locale/cs/LC_MESSAGES/django.mo,sha256=VFyZcn19aQUXhVyh2zo2g3PAuzOO38Kx9fMFOCCxzMc,5479 +django/contrib/humanize/locale/cs/LC_MESSAGES/django.po,sha256=mq3LagwA9hyWOGy76M9n_rD4p3wuVk6oQsneB9CF99w,9527 +django/contrib/humanize/locale/cy/LC_MESSAGES/django.mo,sha256=VjJiaUUhvX9tjOEe6x2Bdp7scvZirVcUsA4-iE2-ElQ,5241 +django/contrib/humanize/locale/cy/LC_MESSAGES/django.po,sha256=sylmceSq-NPvtr_FjklQXoBAfueKu7hrjEpMAsVbQC4,7813 +django/contrib/humanize/locale/da/LC_MESSAGES/django.mo,sha256=vfDHopmWFAomwqmmCX3wfmX870-zzVbgUFC6I77n9tE,4316 +django/contrib/humanize/locale/da/LC_MESSAGES/django.po,sha256=v7Al6UOkbYB1p7m8kOe-pPRIAoyWemoyg_Pm9bD5Ldc,7762 +django/contrib/humanize/locale/de/LC_MESSAGES/django.mo,sha256=aOUax9csInbXnjAJc3jq4dcW_9H-6ueVI-TtKz2b9q0,4364 +django/contrib/humanize/locale/de/LC_MESSAGES/django.po,sha256=gW3OfOfoVMvpVudwghKCYztkLrCIPbbcriZjBNnRyGo,7753 +django/contrib/humanize/locale/dsb/LC_MESSAGES/django.mo,sha256=OVKcuW9ZXosNvP_3A98WsIIk_Jl6U_kv3zOx4pvwh-g,5588 +django/contrib/humanize/locale/dsb/LC_MESSAGES/django.po,sha256=VimcsmobK3VXTbbTasg6osWDPOIZ555uimbUoUfNco4,9557 +django/contrib/humanize/locale/el/LC_MESSAGES/django.mo,sha256=o-yjhpzyGRbbdMzwUcG_dBP_FMEMZevm7Wz1p4Wd-pg,6740 +django/contrib/humanize/locale/el/LC_MESSAGES/django.po,sha256=UbD5QEw_-JNoNETaOyDfSReirkRsHnlHeSsZF5hOSkI,10658 +django/contrib/humanize/locale/en/LC_MESSAGES/django.mo,sha256=U0OV81NfbuNL9ctF-gbGUG5al1StqN-daB-F-gFBFC8,356 +django/contrib/humanize/locale/en/LC_MESSAGES/django.po,sha256=PKUuSyK8VzVdyyCpOXAffSBK7mFSiGuumzMmttS5yfM,9057 +django/contrib/humanize/locale/en_AU/LC_MESSAGES/django.mo,sha256=QFf4EgAsGprbFetnwogmj8vDV7SfGq1E3vhL9D8xTTM,918 +django/contrib/humanize/locale/en_AU/LC_MESSAGES/django.po,sha256=Bnfesr1_T9sa31qkKOMunwKKXbnFzZJhzV8rYC_pdSE,6532 +django/contrib/humanize/locale/en_GB/LC_MESSAGES/django.mo,sha256=mkx192XQM3tt1xYG8EOacMfa-BvgzYCbSsJQsWZGeAo,3461 +django/contrib/humanize/locale/en_GB/LC_MESSAGES/django.po,sha256=MArKzXxY1104jxaq3kvDZs2WzOGYxicfJxFKsLzFavw,5801 +django/contrib/humanize/locale/eo/LC_MESSAGES/django.mo,sha256=b47HphXBi0cax_reCZiD3xIedavRHcH2iRG8pcwqb54,5386 +django/contrib/humanize/locale/eo/LC_MESSAGES/django.po,sha256=oN1YqOZgxKY3L1a1liluhM6X5YA5bawg91mHF_Vfqx8,9095 +django/contrib/humanize/locale/es/LC_MESSAGES/django.mo,sha256=z5ZCmAG4jGYleEE6pESMXihlESRQPkTEo2vIedXdjjI,5005 +django/contrib/humanize/locale/es/LC_MESSAGES/django.po,sha256=WwykwsBM_Q_xtA2vllIbcFSO7eUB72r56AG4ITwM5VM,8959 +django/contrib/humanize/locale/es_AR/LC_MESSAGES/django.mo,sha256=-btiXH3B5M1qkAsW9D5I742Gt9GcJs5VC8ZhJ_DKkGY,4425 +django/contrib/humanize/locale/es_AR/LC_MESSAGES/django.po,sha256=UsiuRj-eq-Vl41wNZGw9XijCMEmcXhcGrMTPWgZn4LA,7858 +django/contrib/humanize/locale/es_CO/LC_MESSAGES/django.mo,sha256=2GhQNtNOjK5mTov5RvnuJFTYbdoGBkDGLxzvJ8Vsrfs,4203 +django/contrib/humanize/locale/es_CO/LC_MESSAGES/django.po,sha256=JBf2fHO8jWi6dFdgZhstKXwyot_qT3iJBixQZc3l330,6326 +django/contrib/humanize/locale/es_MX/LC_MESSAGES/django.mo,sha256=82DL2ztdq10X5RIceshK1nO99DW5628ZIjaN8Xzp9ok,3939 +django/contrib/humanize/locale/es_MX/LC_MESSAGES/django.po,sha256=-O7AQluA5Kce9-bd04GN4tfQKoCxb8Sa7EZR6TZBCdM,6032 +django/contrib/humanize/locale/es_VE/LC_MESSAGES/django.mo,sha256=cJECzKpD99RRIpVFKQW65x0Nvpzrm5Fuhfi-nxOWmkM,942 +django/contrib/humanize/locale/es_VE/LC_MESSAGES/django.po,sha256=tDdYtvRILgeDMgZqKHSebe7Z5ZgI1bZhDdvGVtj_anM,4832 +django/contrib/humanize/locale/et/LC_MESSAGES/django.mo,sha256=_vLDxD-e-pBY7vs6gNkhFZNGYu_dAeETVMKGsjjWOHg,4406 +django/contrib/humanize/locale/et/LC_MESSAGES/django.po,sha256=u0tSkVYckwXUv1tVfe1ODdZ8tJ2wUkS0Vv8pakJ8eBM,7915 +django/contrib/humanize/locale/eu/LC_MESSAGES/django.mo,sha256=rz3Lz209GneozN4v_19qTGysOL55x7jK2uoB2YsKSMQ,4315 +django/contrib/humanize/locale/eu/LC_MESSAGES/django.po,sha256=lWOx7rpaj2U7czrZmdxVo3kB2aGt-2GDyWO0NLvP-A0,7760 +django/contrib/humanize/locale/fa/LC_MESSAGES/django.mo,sha256=N32l1DsPALoSGe9GtJ5baIo0XUDm8U09JhcHr0lXtw4,4656 +django/contrib/humanize/locale/fa/LC_MESSAGES/django.po,sha256=YsYRnmvABepSAOgEj6dRvdY_jYZqJb0_dbQ_6daiJAQ,8228 +django/contrib/humanize/locale/fi/LC_MESSAGES/django.mo,sha256=FJfyLFkz-oAz9e15e1aQUct7CJ2EJqSkZKh_ztDxtic,4425 +django/contrib/humanize/locale/fi/LC_MESSAGES/django.po,sha256=j5Z5t9zX1kePdM_Es1hu9AKOpOrijVWTsS2t19CIiaE,7807 +django/contrib/humanize/locale/fr/LC_MESSAGES/django.mo,sha256=pHHD7DV36bC86CKXWUpWUp3NtKuqWu9_YXU04sE6ib4,5125 +django/contrib/humanize/locale/fr/LC_MESSAGES/django.po,sha256=SyN1vUt8zDG-iSTDR4OH1B_CbvKMM2YaMJ2_s-FEyog,8812 +django/contrib/humanize/locale/fy/LC_MESSAGES/django.mo,sha256=YQQy7wpjBORD9Isd-p0lLzYrUgAqv770_56-vXa0EOc,476 +django/contrib/humanize/locale/fy/LC_MESSAGES/django.po,sha256=pPvcGgBWiZwQ5yh30OlYs-YZUd_XsFro71T9wErVv0M,4732 +django/contrib/humanize/locale/ga/LC_MESSAGES/django.mo,sha256=8V-8BJdubpBPT_AMHHdifgPangJw_TY3WtSQxaGNCGw,6346 +django/contrib/humanize/locale/ga/LC_MESSAGES/django.po,sha256=Y_6wRPWasABq-6B3WjzEObSk860fExiQ_OVbh8i1j44,10784 +django/contrib/humanize/locale/gd/LC_MESSAGES/django.mo,sha256=wHsBVluXm4DW7iWxGHMHexqG9ovXEvgcaXvsmvkNHSE,5838 +django/contrib/humanize/locale/gd/LC_MESSAGES/django.po,sha256=CmmpKK7me-Ujitgx2IVkOcJyZOvie6XEBS7wCY4xZQ0,9802 +django/contrib/humanize/locale/gl/LC_MESSAGES/django.mo,sha256=LbJABG0-USW2C5CQro6WcPlPwT7I1BfuKGi_VFNhJIU,4345 +django/contrib/humanize/locale/gl/LC_MESSAGES/django.po,sha256=caidyTAFJ5iZ-tpEp0bflpUx0xlaH2jIYmPKxCVzlGE,7772 +django/contrib/humanize/locale/he/LC_MESSAGES/django.mo,sha256=phFZMDohKT86DUtiAlnZslPFwSmpcpxTgZaXb8pGohc,5875 +django/contrib/humanize/locale/he/LC_MESSAGES/django.po,sha256=xhEZYcK-fg_mHMyGCEZXEwbd6FvutaGvkDyHTET-sic,9970 +django/contrib/humanize/locale/hi/LC_MESSAGES/django.mo,sha256=qrzm-6vXIUsxA7nOxa-210-6iO-3BPBj67vKfhTOPrY,4131 +django/contrib/humanize/locale/hi/LC_MESSAGES/django.po,sha256=BrypbKaQGOyY_Gl1-aHXiBVlRqrbSjGfZ2OK8omj_9M,6527 +django/contrib/humanize/locale/hr/LC_MESSAGES/django.mo,sha256=29XTvFJHex31hbu2qsOfl5kOusz-zls9eqlxtvw_H0s,1274 +django/contrib/humanize/locale/hr/LC_MESSAGES/django.po,sha256=OuEH4fJE6Fk-s0BMqoxxdlUAtndvvKK7N8Iy-9BP3qA,5424 +django/contrib/humanize/locale/hsb/LC_MESSAGES/django.mo,sha256=a1DqdiuRfFSfSrD8IvzQmZdzE0dhkxDChFddrmt3fjA,5679 +django/contrib/humanize/locale/hsb/LC_MESSAGES/django.po,sha256=V5aRblcqKii4RXSQO87lyoQwwvxL59T3m4-KOBTx4bc,9648 +django/contrib/humanize/locale/hu/LC_MESSAGES/django.mo,sha256=7ZMxGa5FaUdjRtbawYzwwhWIroON8NNXknQ3frKUabw,4313 +django/contrib/humanize/locale/hu/LC_MESSAGES/django.po,sha256=5yWfXwvJQQuDoENkiytuKXFjsNW-lS2-EFThVnYWHbI,7672 +django/contrib/humanize/locale/hy/LC_MESSAGES/django.mo,sha256=YN4XSM-NGXNJb2R0SMwC8Zk6r7F6LOfFvRgvc4fUNCM,3810 +django/contrib/humanize/locale/hy/LC_MESSAGES/django.po,sha256=JZZibNtKEOepsf5xf495lmCBk8jji5RUJETZlQpxrMo,7597 +django/contrib/humanize/locale/ia/LC_MESSAGES/django.mo,sha256=d0m-FddFnKp08fQYQSC9Wr6M4THVU7ibt3zkIpx_Y_A,4167 +django/contrib/humanize/locale/ia/LC_MESSAGES/django.po,sha256=qX6fAZyn54hmtTU62oJcHF8p4QcYnoO2ZNczVjvjOeE,6067 +django/contrib/humanize/locale/id/LC_MESSAGES/django.mo,sha256=AdUmhfkQOV9Le4jXQyQSyd5f2GqwNt-oqnJV-WVELVw,3885 +django/contrib/humanize/locale/id/LC_MESSAGES/django.po,sha256=lMnTtM27j1EWg1i9d7NzAeueo7mRztGVfNOXtXdZVjw,7021 +django/contrib/humanize/locale/io/LC_MESSAGES/django.mo,sha256=nMu5JhIy8Fjie0g5bT8-h42YElCiS00b4h8ej_Ie-w0,464 +django/contrib/humanize/locale/io/LC_MESSAGES/django.po,sha256=RUs8JkpT0toKOLwdv1oCbcBP298EOk02dkdNSJiC-_A,4720 +django/contrib/humanize/locale/is/LC_MESSAGES/django.mo,sha256=D6ElUYj8rODRsZwlJlH0QyBSM44sVmuBCNoEkwPVxko,3805 +django/contrib/humanize/locale/is/LC_MESSAGES/django.po,sha256=1VddvtkhsK_5wmpYIqEFqFOo-NxIBnL9wwW74Tw9pbw,8863 +django/contrib/humanize/locale/it/LC_MESSAGES/django.mo,sha256=Zw8reudMUlPGC3eQ-CpsGYHX-FtNrAc5SxgTdmIrUC0,5374 +django/contrib/humanize/locale/it/LC_MESSAGES/django.po,sha256=wJzT-2ygufGLMIULd7afg1sZLQKnwQ55NZ2eAnwIY8M,9420 +django/contrib/humanize/locale/ja/LC_MESSAGES/django.mo,sha256=x8AvfUPBBJkGtE0jvAP4tLeZEByuyo2H4V_UuLoCEmw,3907 +django/contrib/humanize/locale/ja/LC_MESSAGES/django.po,sha256=G2yTPZq6DxgzPV5uJ6zvMK4o3aiuLWbl4vXPH7ylUhc,6919 +django/contrib/humanize/locale/ka/LC_MESSAGES/django.mo,sha256=UeUbonYTkv1d2ljC0Qj8ZHw-59zHu83fuMvnME9Fkmw,4878 +django/contrib/humanize/locale/ka/LC_MESSAGES/django.po,sha256=-eAMexwjm8nSB4ARJU3f811UZnuatHKIFf8FevpJEpo,9875 +django/contrib/humanize/locale/kk/LC_MESSAGES/django.mo,sha256=jujbUM0jOpt3Mw8zN4LSIIkxCJ0ihk_24vR0bXoux78,2113 +django/contrib/humanize/locale/kk/LC_MESSAGES/django.po,sha256=hjZg_NRE9xMA5uEa2mVSv1Hr4rv8inG9es1Yq7uy9Zc,8283 +django/contrib/humanize/locale/km/LC_MESSAGES/django.mo,sha256=mfXs9p8VokORs6JqIfaSSnQshZEhS90rRFhOIHjW7CI,459 +django/contrib/humanize/locale/km/LC_MESSAGES/django.po,sha256=JQBEHtcy-hrV_GVWIjvUJyOf3dZ5jUzzN8DUTAbHKUg,4351 +django/contrib/humanize/locale/kn/LC_MESSAGES/django.mo,sha256=Oq3DIPjgCqkn8VZMb6ael7T8fQ7LnWobPPAZKQSFHl4,461 +django/contrib/humanize/locale/kn/LC_MESSAGES/django.po,sha256=CAJ0etMlQF3voPYrxIRr5ChAwUYO7wI42n5kjpIEVjA,4359 +django/contrib/humanize/locale/ko/LC_MESSAGES/django.mo,sha256=mWmQEoe0MNVn3sNqsz6CBc826x3KIpOL53ziv6Ekf7c,3891 +django/contrib/humanize/locale/ko/LC_MESSAGES/django.po,sha256=UUxIUYM332DOZinJrqOUtQvHfCCHkodFhENDVWj3dpk,7003 +django/contrib/humanize/locale/ky/LC_MESSAGES/django.mo,sha256=jDu1bVgJMDpaZ0tw9-wdkorvZxDdRzcuzdeC_Ot7rUs,4177 +django/contrib/humanize/locale/ky/LC_MESSAGES/django.po,sha256=MEHbKMLIiFEG7BlxsNVF60viXSnlk5iqlFCH3hgamH0,7157 +django/contrib/humanize/locale/lb/LC_MESSAGES/django.mo,sha256=xokesKl7h7k9dXFKIJwGETgwx1Ytq6mk2erBSxkgY-o,474 +django/contrib/humanize/locale/lb/LC_MESSAGES/django.po,sha256=_y0QFS5Kzx6uhwOnzmoHtCrbufMrhaTLsHD0LfMqtcM,4730 +django/contrib/humanize/locale/lt/LC_MESSAGES/django.mo,sha256=O0C-tPhxWNW5J4tCMlB7c7shVjNO6dmTURtIpTVO9uc,7333 +django/contrib/humanize/locale/lt/LC_MESSAGES/django.po,sha256=M5LlRxC1KWh1-3fwS93UqTijFuyRENmQJXfpxySSKik,12086 +django/contrib/humanize/locale/lv/LC_MESSAGES/django.mo,sha256=3gEzmKBtYsFz9wvLw0ltiir91CDLxhK3IG2j55-uM7Y,5033 +django/contrib/humanize/locale/lv/LC_MESSAGES/django.po,sha256=yfeBxpH2J49xHDzZUZI3cK5ms4QbWq0gtTmhj8ejAjE,8836 +django/contrib/humanize/locale/mk/LC_MESSAGES/django.mo,sha256=htUgd6rcaeRPDf6UrEb18onz-Ayltw9LTvWRgEkXm08,4761 +django/contrib/humanize/locale/mk/LC_MESSAGES/django.po,sha256=Wl9Rt8j8WA_0jyxKCswIovSiCQD-ZWFYXbhFsCUKIWo,6665 +django/contrib/humanize/locale/ml/LC_MESSAGES/django.mo,sha256=5As-FXkEJIYetmV9dMtzLtsRPTOm1oUgyx-oeTH_guY,4655 +django/contrib/humanize/locale/ml/LC_MESSAGES/django.po,sha256=I9_Ln0C1nSj188_Zdq9Vy6lC8aLzg_YdNc5gy9hNGjE,10065 +django/contrib/humanize/locale/mn/LC_MESSAGES/django.mo,sha256=MSw9wpCRQAX7lLWEW-Mamk_bR5R8lE_WqcD1G2mKbxI,4863 +django/contrib/humanize/locale/mn/LC_MESSAGES/django.po,sha256=xA4gODU33-hK6BXdqUun7qfjNuv6Dzq63FPVSQImfK4,8241 +django/contrib/humanize/locale/mr/LC_MESSAGES/django.mo,sha256=sJAjSaUecl5hdetpBm-rCjVrkWxNhq3IFsE1MEYmq7c,1506 +django/contrib/humanize/locale/mr/LC_MESSAGES/django.po,sha256=lHmcv7LnyXWBdh_WRsL4GPUybIMLRlIoJlHBM3_3EWA,6693 +django/contrib/humanize/locale/ms/LC_MESSAGES/django.mo,sha256=Bcictup-1bGKm0FIa3CeGNvrHg8VyxsqUHzWI7UMscs,3839 +django/contrib/humanize/locale/ms/LC_MESSAGES/django.po,sha256=UQEUC2iZxhtrWim96GaEK1VAKxAC0fTQIghg4Zx4R3Q,6774 +django/contrib/humanize/locale/my/LC_MESSAGES/django.mo,sha256=55CWHz34sy9k6TfOeVI9GYvE9GRa3pjSRE6DSPk9uQ8,3479 +django/contrib/humanize/locale/my/LC_MESSAGES/django.po,sha256=jCiDhSqARfqKcMLEHJd-Xe6zo3Uc9QpiCh3BbAAA5UE,5433 +django/contrib/humanize/locale/nb/LC_MESSAGES/django.mo,sha256=957mOf_wFBOTjpcevsRz5tQ6IQ4PJnZZfJUETUgF23s,4318 +django/contrib/humanize/locale/nb/LC_MESSAGES/django.po,sha256=G_4pAxT3QZhC-wmWKIhEkFf0IRBn6gKRQZvx0spqjuk,7619 +django/contrib/humanize/locale/ne/LC_MESSAGES/django.mo,sha256=YFT2D-yEkUdJBO2GfuUowau1OZQA5mS86CZvMzH38Rk,3590 +django/contrib/humanize/locale/ne/LC_MESSAGES/django.po,sha256=SN7yH65hthOHohnyEmQUjXusRTDRjxWJG_kuv5g2Enk,9038 +django/contrib/humanize/locale/nl/LC_MESSAGES/django.mo,sha256=RxwgVgdHvfFirimjPrpDhzqmI1Z9soDC--raoAzgBkw,4311 +django/contrib/humanize/locale/nl/LC_MESSAGES/django.po,sha256=M7dVQho17p71Ud6imsQLGMiBisLrVNEZNP4ufpkEJnM,7872 +django/contrib/humanize/locale/nn/LC_MESSAGES/django.mo,sha256=wyJDAGJWgvyBYZ_-UQnBQ84-Jelk5forKfk7hMFDGpQ,4336 +django/contrib/humanize/locale/nn/LC_MESSAGES/django.po,sha256=zuKg53XCX-C6Asc9M04BKZVVw1X6u5p5hvOXxc0AXnM,7651 +django/contrib/humanize/locale/os/LC_MESSAGES/django.mo,sha256=BwS3Mj7z_Fg5s7Qm-bGLVhzYLZ8nPgXoB0gXLnrMGWc,3902 +django/contrib/humanize/locale/os/LC_MESSAGES/django.po,sha256=CGrxyL5l-5HexruOc7QDyRbum7piADf-nY8zjDP9wVM,6212 +django/contrib/humanize/locale/pa/LC_MESSAGES/django.mo,sha256=TH1GkAhaVVLk2jrcqAmdxZprWyikAX6qMP0eIlr2tWM,1569 +django/contrib/humanize/locale/pa/LC_MESSAGES/django.po,sha256=_7oP0Hn-IU7IPLv_Qxg_wstLEdhgWNBBTCWYwSycMb0,5200 +django/contrib/humanize/locale/pl/LC_MESSAGES/django.mo,sha256=0QheMbF3Y0Q_sxZlN2wAYJRQyK3K_uq6ttVr7wCc33w,5596 +django/contrib/humanize/locale/pl/LC_MESSAGES/django.po,sha256=6wX50O68aIyKiP6CcyLMXZ3xuUnAzasFPIg_8deJQBY,9807 +django/contrib/humanize/locale/pt/LC_MESSAGES/django.mo,sha256=El9Sdr3kXS-yTol_sCg1dquxf0ThDdWyrWGjjim9Dj4,5408 +django/contrib/humanize/locale/pt/LC_MESSAGES/django.po,sha256=XudOc67ybF_fminrTR2XOCKEKwqB5FX14pl3clCNXGE,9281 +django/contrib/humanize/locale/pt_BR/LC_MESSAGES/django.mo,sha256=F5-AD4Fohf9wDyP_mqSJHvcKqIKIJsaxGuXGiHYGLHQ,5092 +django/contrib/humanize/locale/pt_BR/LC_MESSAGES/django.po,sha256=O1eVw8R8hL0N_XtTp4sdZbc5MxUNdxfGPzCT3U7QcxM,9089 +django/contrib/humanize/locale/ro/LC_MESSAGES/django.mo,sha256=vP6o72bsgKPsbKGwH0PU8Xyz9BnQ_sPWT3EANLT2wRk,6188 +django/contrib/humanize/locale/ro/LC_MESSAGES/django.po,sha256=JZiW6Y9P5JdQe4vgCvcFg35kFa8bSX0lU_2zdeudQP0,10575 +django/contrib/humanize/locale/ru/LC_MESSAGES/django.mo,sha256=tVtMvbDmHtoXFav2cXzhHpHmT-4-593Vo7kE5sd-Agc,6733 +django/contrib/humanize/locale/ru/LC_MESSAGES/django.po,sha256=0OWESEN33yMIcRUaX_oSQUuDidhbzgKpdivwAS7kNgs,11068 +django/contrib/humanize/locale/sk/LC_MESSAGES/django.mo,sha256=6l7T4rvVb8dPl0-6vwrq5K1QqJ06IdFKxEl4EGzN8Ns,5541 +django/contrib/humanize/locale/sk/LC_MESSAGES/django.po,sha256=Edsza_V5MJD_HadigUZWZoFLjl8556KFW9tbuHVHL3g,9657 +django/contrib/humanize/locale/sl/LC_MESSAGES/django.mo,sha256=yonGwvQKyqpZ_NLTpynDdS6q4yg3eafL1K5MFmnGw7o,4967 +django/contrib/humanize/locale/sl/LC_MESSAGES/django.po,sha256=-nzc9Rk9f3U_Rpze_fdJrKR-_CglPJ0_GryNUDD80jI,9580 +django/contrib/humanize/locale/sq/LC_MESSAGES/django.mo,sha256=1XXRe0nurGUUxI7r7gbSIuluRuza7VOeNdkIVX3LIFU,5280 +django/contrib/humanize/locale/sq/LC_MESSAGES/django.po,sha256=BS-5o3aG8Im9dWTkx4E_IbbeTRFcjjohinz1823ZepI,9127 +django/contrib/humanize/locale/sr/LC_MESSAGES/django.mo,sha256=Zsv4ajqk9baWkNItJjkEsZP-OO-LuIg_5QopKgVesUw,5718 +django/contrib/humanize/locale/sr/LC_MESSAGES/django.po,sha256=AZddC4WvARQd3Qd-atFONB8KbzrNJCfiQcdP16m-EyM,9363 +django/contrib/humanize/locale/sr_Latn/LC_MESSAGES/django.mo,sha256=8TIBiJ_6G0MTfEw8mTYHhig8dLZCpdjOBzP2ivQcSJ4,2613 +django/contrib/humanize/locale/sr_Latn/LC_MESSAGES/django.po,sha256=2pj14ryWKbxvcznBSK83hFvGJ_kn2EEr3w0Jhu1lVXI,10316 +django/contrib/humanize/locale/sv/LC_MESSAGES/django.mo,sha256=7OABdxvdZvKB9j1o99UiecoTXaVGn3XmXnU5xCNov8s,4333 +django/contrib/humanize/locale/sv/LC_MESSAGES/django.po,sha256=71tFrQzwtwzYfeC2BG0v8dZNkSEMbM-tAC5_z2AElLM,7876 +django/contrib/humanize/locale/sw/LC_MESSAGES/django.mo,sha256=cxjSUqegq1JX08xIAUgqq9ByP-HuqaXuxWM8Y2gHdB4,4146 +django/contrib/humanize/locale/sw/LC_MESSAGES/django.po,sha256=bPYrLJ2yY_lZ3y1K-RguNi-qrxq2r-GLlsz1gZcm2A8,6031 +django/contrib/humanize/locale/ta/LC_MESSAGES/django.mo,sha256=1X2vH0iZOwM0uYX9BccJUXqK-rOuhcu5isRzMpnjh2o,466 +django/contrib/humanize/locale/ta/LC_MESSAGES/django.po,sha256=8x1lMzq2KOJveX92ADSuqNmXGIEYf7fZ1JfIJPysS04,4722 +django/contrib/humanize/locale/te/LC_MESSAGES/django.mo,sha256=iKd4dW9tan8xPxgaSoenIGp1qQpvSHHXUw45Tj2ATKQ,1327 +django/contrib/humanize/locale/te/LC_MESSAGES/django.po,sha256=FQdjWKMsiv-qehYZ4AtN9iKRf8Rifzcm5TZzMkQVfQI,5103 +django/contrib/humanize/locale/tg/LC_MESSAGES/django.mo,sha256=1Fiqat0CZSyExRXRjRCBS0AFzwy0q1Iba-2RVnrXoZQ,1580 +django/contrib/humanize/locale/tg/LC_MESSAGES/django.po,sha256=j2iczgQDbqzpthKAAlMt1Jk7gprYLqZ1Ya0ASr2SgD0,7852 +django/contrib/humanize/locale/th/LC_MESSAGES/django.mo,sha256=jT7wGhYWP9HHwOvtr2rNPStiOgZW-rGMcO36w1U8Y4c,3709 +django/contrib/humanize/locale/th/LC_MESSAGES/django.po,sha256=ZO3_wU7z0VASS5E8RSLEtmTveMDjJ0O8QTynb2-jjt0,8318 +django/contrib/humanize/locale/tk/LC_MESSAGES/django.mo,sha256=cI2Ukp5kVTsUookoxyDD9gZKdxh4YezfRWYFBL7KuRU,4419 +django/contrib/humanize/locale/tk/LC_MESSAGES/django.po,sha256=6Qaxa03R4loH0FWQ6PCytT3Yz3LZt7UGTd01WVnHOIk,7675 +django/contrib/humanize/locale/tr/LC_MESSAGES/django.mo,sha256=D4ChMLE1Uz921NIF_Oe1vNkYAGfRpQuC8xANFwtlygE,4319 +django/contrib/humanize/locale/tr/LC_MESSAGES/django.po,sha256=4PjW65seHF9SsWnLv47JhgYPt0Gvzr-7_Ejech3d3ak,7754 +django/contrib/humanize/locale/tt/LC_MESSAGES/django.mo,sha256=z8VgtMhlfyDo7bERDfrDmcYV5aqOeBY7LDgqa5DRxDM,3243 +django/contrib/humanize/locale/tt/LC_MESSAGES/django.po,sha256=j_tRbg1hzLBFAmPQt0HoN-_WzWFtA07PloCkqhvNkcY,5201 +django/contrib/humanize/locale/udm/LC_MESSAGES/django.mo,sha256=CNmoKj9Uc0qEInnV5t0Nt4ZnKSZCRdIG5fyfSsqwky4,462 +django/contrib/humanize/locale/udm/LC_MESSAGES/django.po,sha256=AR55jQHmMrbA6RyHGOtqdvUtTFlxWnqvfMy8vZK25Bo,4354 +django/contrib/humanize/locale/ug/LC_MESSAGES/django.mo,sha256=_GtRGNtdwZ6lU2gZc5jN9nSDB15bLBMYdhiwHlKxOOc,4883 +django/contrib/humanize/locale/ug/LC_MESSAGES/django.po,sha256=x9DJRBObVq8C3orGfj737v2gCHcpqaWUXMEeCMkumco,8156 +django/contrib/humanize/locale/uk/LC_MESSAGES/django.mo,sha256=wQOJu-zKyuCazul-elFLZc-iKw2Zea7TGb90OVGZYkQ,6991 +django/contrib/humanize/locale/uk/LC_MESSAGES/django.po,sha256=hxEufGt-NOgSFc5T9OzxCibcfqkhWD7zxhQljoUQssQ,11249 +django/contrib/humanize/locale/ur/LC_MESSAGES/django.mo,sha256=MF9uX26-4FFIz-QpDUbUHUNLQ1APaMLQmISMIaPsOBE,1347 +django/contrib/humanize/locale/ur/LC_MESSAGES/django.po,sha256=D5UhcPEcQ16fsBEdkk_zmpjIF6f0gEv0P86z_pK_1eA,5015 +django/contrib/humanize/locale/uz/LC_MESSAGES/django.mo,sha256=HDah_1qqUz5m_ABBVIEML3WMR2xyomFckX82i6b3n4k,1915 +django/contrib/humanize/locale/uz/LC_MESSAGES/django.po,sha256=Ql3GZOhuoVgS0xHEzxjyYkOWQUyi_jiizfAXBp2Y4uw,7296 +django/contrib/humanize/locale/vi/LC_MESSAGES/django.mo,sha256=ZUK_Na0vnfdhjo0MgnBWnGFU34sxcMf_h0MeyuysKG8,3646 +django/contrib/humanize/locale/vi/LC_MESSAGES/django.po,sha256=DzRpXObt9yP5RK_slWruaIhnVI0-JXux2hn_uGsVZiE,5235 +django/contrib/humanize/locale/zh_Hans/LC_MESSAGES/django.mo,sha256=YgeAjXHMV1rXNNIrlDu_haxnKB0hxU5twJ86LMR10k8,3844 +django/contrib/humanize/locale/zh_Hans/LC_MESSAGES/django.po,sha256=JGfRVW_5UqwyI2mK_WRK8xDPzwBAO2q_mGsGzf89a88,7122 +django/contrib/humanize/locale/zh_Hant/LC_MESSAGES/django.mo,sha256=JQmImGUND9MONKqqLSCvvbbIT_TigIU6h-twN1qlfJc,3737 +django/contrib/humanize/locale/zh_Hant/LC_MESSAGES/django.po,sha256=u_JB8_pFJofUoiGtcGh1xemLouLePvHua5J_npnJ_Q8,6826 +django/contrib/humanize/templatetags/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/contrib/humanize/templatetags/__pycache__/__init__.cpython-312.pyc,, +django/contrib/humanize/templatetags/__pycache__/humanize.cpython-312.pyc,, +django/contrib/humanize/templatetags/humanize.py,sha256=1vF9UeTaKuJSswwHxZvcb2Dx2rv6SFLGGcJ3AyzMLfc,12350 +django/contrib/messages/__init__.py,sha256=_5b6kMxWt0TqW5ze5vZ-iqYEQfaQiAl28x2q9KRaMz4,171 +django/contrib/messages/__pycache__/__init__.cpython-312.pyc,, +django/contrib/messages/__pycache__/api.cpython-312.pyc,, +django/contrib/messages/__pycache__/apps.cpython-312.pyc,, +django/contrib/messages/__pycache__/constants.cpython-312.pyc,, +django/contrib/messages/__pycache__/context_processors.cpython-312.pyc,, +django/contrib/messages/__pycache__/middleware.cpython-312.pyc,, +django/contrib/messages/__pycache__/test.cpython-312.pyc,, +django/contrib/messages/__pycache__/utils.cpython-312.pyc,, +django/contrib/messages/__pycache__/views.cpython-312.pyc,, +django/contrib/messages/api.py,sha256=3DbnVG5oOBdg499clMU8l2hxCXMXB6S03-HCKVuBXjA,3250 +django/contrib/messages/apps.py,sha256=W_nya0lzXYBew83hqP6I8gg6XnaRlh-gmN-pYpDGN84,611 +django/contrib/messages/constants.py,sha256=JD4TpaR4C5G0oxIh4BmrWiVmCACv7rnVgZSpJ8Rmzeg,312 +django/contrib/messages/context_processors.py,sha256=xMrgYeX6AcT_WwS9AYKNDDstbvAwE7_u1ssDVLN_bbg,354 +django/contrib/messages/middleware.py,sha256=2mxncCpJVUgLtjouUGSVl39mTF-QskQpWo2jCOOqV8A,986 +django/contrib/messages/storage/__init__.py,sha256=gXDHbQ9KgQdfhYOla9Qj59_SlE9WURQiKzIA0cFH0DQ,392 +django/contrib/messages/storage/__pycache__/__init__.cpython-312.pyc,, +django/contrib/messages/storage/__pycache__/base.cpython-312.pyc,, +django/contrib/messages/storage/__pycache__/cookie.cpython-312.pyc,, +django/contrib/messages/storage/__pycache__/fallback.cpython-312.pyc,, +django/contrib/messages/storage/__pycache__/session.cpython-312.pyc,, +django/contrib/messages/storage/base.py,sha256=T-bcy6HdwRbEKNIuO5fEJZ1EUj3rTHWXRg1oxqRahGc,6082 +django/contrib/messages/storage/cookie.py,sha256=6r-z_MyYImgEC5LPvjOdp64xwkiV_ib97Sg4N4eXjxY,8678 +django/contrib/messages/storage/fallback.py,sha256=K5CrVJfUDakMjIcqSRt1WZd_1Xco1Bc2AQM3O3ld9aA,2093 +django/contrib/messages/storage/session.py,sha256=kvdVosbBAvI3XBA0G4AFKf0vxLleyzlwbGEgl60DfMQ,1764 +django/contrib/messages/test.py,sha256=8PJVFT2ICdptbMZSBrZC0ZLC3AJzL7XUK2Vz4f4wXuk,332 +django/contrib/messages/utils.py,sha256=_oItQILchdwdXH08SIyZ-DBdYi7q_uobHQajWwmAeUw,256 +django/contrib/messages/views.py,sha256=I_7C4yr-YLkhTEWx3iuhixG7NrKuyuSDG_CVg-EYRD8,524 +django/contrib/postgres/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/contrib/postgres/__pycache__/__init__.cpython-312.pyc,, +django/contrib/postgres/__pycache__/apps.cpython-312.pyc,, +django/contrib/postgres/__pycache__/constraints.cpython-312.pyc,, +django/contrib/postgres/__pycache__/expressions.cpython-312.pyc,, +django/contrib/postgres/__pycache__/functions.cpython-312.pyc,, +django/contrib/postgres/__pycache__/indexes.cpython-312.pyc,, +django/contrib/postgres/__pycache__/lookups.cpython-312.pyc,, +django/contrib/postgres/__pycache__/operations.cpython-312.pyc,, +django/contrib/postgres/__pycache__/search.cpython-312.pyc,, +django/contrib/postgres/__pycache__/serializers.cpython-312.pyc,, +django/contrib/postgres/__pycache__/signals.cpython-312.pyc,, +django/contrib/postgres/__pycache__/utils.cpython-312.pyc,, +django/contrib/postgres/__pycache__/validators.cpython-312.pyc,, +django/contrib/postgres/aggregates/__init__.py,sha256=QCznqMKqPbpraxSi1Y8-B7_MYlL42F1kEWZ1HeLgTKs,65 +django/contrib/postgres/aggregates/__pycache__/__init__.cpython-312.pyc,, +django/contrib/postgres/aggregates/__pycache__/general.cpython-312.pyc,, +django/contrib/postgres/aggregates/__pycache__/mixins.cpython-312.pyc,, +django/contrib/postgres/aggregates/__pycache__/statistics.cpython-312.pyc,, +django/contrib/postgres/aggregates/general.py,sha256=lFZkt_iDSlfXQ2SrcVj1Xr6h_GA4npskBJYzWuBF-kE,1496 +django/contrib/postgres/aggregates/mixins.py,sha256=7do4eji0SpVqvlLsI4E_Ap8EV6tfK39ybN5caV9wDLo,1716 +django/contrib/postgres/aggregates/statistics.py,sha256=xSWk5Z5ZVpM2LSaMgP97pxcijOnPHiPATe3X45poXCI,1511 +django/contrib/postgres/apps.py,sha256=sfjoL-2VJrFzrv0CC3S4WGWZblzR_4BwFDm9bEHs8B0,3692 +django/contrib/postgres/constraints.py,sha256=qWcKCH3_5mYLooCgq173UQGXSHMlhupB9dyOq_rsNs0,9789 +django/contrib/postgres/expressions.py,sha256=fo5YASHJtIjexadqskuhYYk4WutofxzymYsivWWJS84,405 +django/contrib/postgres/fields/__init__.py,sha256=Xo8wuWPwVNOkKY-EwV9U1zusQ2DjMXXtL7_8R_xAi5s,148 +django/contrib/postgres/fields/__pycache__/__init__.cpython-312.pyc,, +django/contrib/postgres/fields/__pycache__/array.cpython-312.pyc,, +django/contrib/postgres/fields/__pycache__/citext.cpython-312.pyc,, +django/contrib/postgres/fields/__pycache__/hstore.cpython-312.pyc,, +django/contrib/postgres/fields/__pycache__/jsonb.cpython-312.pyc,, +django/contrib/postgres/fields/__pycache__/ranges.cpython-312.pyc,, +django/contrib/postgres/fields/__pycache__/utils.cpython-312.pyc,, +django/contrib/postgres/fields/array.py,sha256=SsEBOHkrwr_ery0-GipbKbnK3IcmmoX9BQLHOMq-J-A,12682 +django/contrib/postgres/fields/citext.py,sha256=ytV2yAIwGvElHTAfH4BiLV-2DZ5otff8SmwmcqF2MVE,1363 +django/contrib/postgres/fields/hstore.py,sha256=WWWEoBfMtAjd226vvjFtGqbHMHFCjSly-BEhm9UN1qQ,3276 +django/contrib/postgres/fields/jsonb.py,sha256=ncMGT6WY70lCbcmhwtu2bjRmfDMUIvCr76foUv7tqv0,406 +django/contrib/postgres/fields/ranges.py,sha256=IbjAQC7IdWuISqHdBXrraiOGPzUP_4pHHcnL8VuYZRs,11417 +django/contrib/postgres/fields/utils.py,sha256=TV-Aj9VpBb13I2iuziSDURttZtz355XakxXnFwvtGio,95 +django/contrib/postgres/forms/__init__.py,sha256=NjENn2-C6BcXH4T8YeC0K2AbDk8MVT8tparL3Q4OF6g,89 +django/contrib/postgres/forms/__pycache__/__init__.cpython-312.pyc,, +django/contrib/postgres/forms/__pycache__/array.cpython-312.pyc,, +django/contrib/postgres/forms/__pycache__/hstore.cpython-312.pyc,, +django/contrib/postgres/forms/__pycache__/ranges.cpython-312.pyc,, +django/contrib/postgres/forms/array.py,sha256=LRUU3fxXePptMh3lolxhX4sbMjNSvnzMvNgcJolKfZc,8401 +django/contrib/postgres/forms/hstore.py,sha256=MXXS4LdrueKIlM3w-_QGVvV3MZXMx1TR_4NrpChAtQo,1787 +django/contrib/postgres/forms/ranges.py,sha256=cKAeWvRISPLXIPhm2C57Lu9GoIlAd1xiRxzns69XehA,3652 +django/contrib/postgres/functions.py,sha256=7v6J01QQvX70KFyg9hDc322PgvT62xZqWlzp_vrl8bA,252 +django/contrib/postgres/indexes.py,sha256=pKkozoRHWZYMml8SSbLJ5KBJGnsi36wrXu6fvg1hBdg,8535 +django/contrib/postgres/jinja2/postgres/widgets/split_array.html,sha256=AzaPLlNLg91qkVQwwtAJxwOqDemrtt_btSkWLpboJDs,54 +django/contrib/postgres/locale/af/LC_MESSAGES/django.mo,sha256=kDeL_SZezO8DRNMRh2oXz94YtAK1ZzPiK5dftqAonKI,2841 +django/contrib/postgres/locale/af/LC_MESSAGES/django.po,sha256=ALKUHbZ8DE6IH80STMJhGOoyHB8HSSxI4PlX_SfxJWc,3209 +django/contrib/postgres/locale/ar/LC_MESSAGES/django.mo,sha256=UTBknYC-W7nclTrBCEiCpTglZxZQY80UqGki8I6j3EM,4294 +django/contrib/postgres/locale/ar/LC_MESSAGES/django.po,sha256=_PgF2T3ylO4vnixVoKRsgmpPDHO-Qhj3mShHtHeSna0,4821 +django/contrib/postgres/locale/ar_DZ/LC_MESSAGES/django.mo,sha256=fND1NtGTmEl7Rukt_VlqJeExdJjphBygmI-qJmE83P0,4352 +django/contrib/postgres/locale/ar_DZ/LC_MESSAGES/django.po,sha256=Z9y3h6lDnbwD4JOn7OACLjEZqNY8OpEwuzoUD8FSdwA,4868 +django/contrib/postgres/locale/az/LC_MESSAGES/django.mo,sha256=85wf8nNlReuPu89B_kb632QFKEdtL8ZVyQdlV_f-Sdo,2899 +django/contrib/postgres/locale/az/LC_MESSAGES/django.po,sha256=HRF6LxxcKtmLEA1dsYQMU4oG3P61jbQbwG6x_Wy0t4w,3284 +django/contrib/postgres/locale/be/LC_MESSAGES/django.mo,sha256=tYaaEbBaVxIgxC9qUAuE3YpHJa-aUu9ufFuJLa8my-s,4143 +django/contrib/postgres/locale/be/LC_MESSAGES/django.po,sha256=CL9BslCvHOvwjTBbCEswW8ISH72gSAyW5Dc-zoXI670,4643 +django/contrib/postgres/locale/bg/LC_MESSAGES/django.mo,sha256=A_WOYkzm2QwAo8ZXCKg7jOOiM7bEwUT4cSsSlyC6sWQ,3529 +django/contrib/postgres/locale/bg/LC_MESSAGES/django.po,sha256=TEDRfX5DWADwlgYqScP1hGm2hq2_zUGzIBmKY8WLVLQ,3993 +django/contrib/postgres/locale/ca/LC_MESSAGES/django.mo,sha256=XR1UEZV9AXKFz7XrchjRkd-tEdjnlmccW_I7XANyMns,2904 +django/contrib/postgres/locale/ca/LC_MESSAGES/django.po,sha256=5wPLvkODU_501cHPZ7v0n89rmFrsuctt7T8dUBMfQ0Q,3430 +django/contrib/postgres/locale/ckb/LC_MESSAGES/django.mo,sha256=FQsR4nG0r8RfJ4rkD58XyWX-x7ZLkeg0VbZbSzDB2L0,3414 +django/contrib/postgres/locale/ckb/LC_MESSAGES/django.po,sha256=YStPyf6Gy68ydbzvtYcU6b_CV3h4JzJ3aYOQqccI9zI,3764 +django/contrib/postgres/locale/cs/LC_MESSAGES/django.mo,sha256=BgNruyg0gX0DNZ3mqFerVd2JcSmi4ARRWRhJKlcRhDw,3418 +django/contrib/postgres/locale/cs/LC_MESSAGES/django.po,sha256=evU4mQ9EOQJSxHF0dx_axiU59ptW0xVjIIxTgQCkUJU,3957 +django/contrib/postgres/locale/da/LC_MESSAGES/django.mo,sha256=VaTePWY3W7YRW-CkTUx6timYDXEYOFRFCkg3F36_k_I,2886 +django/contrib/postgres/locale/da/LC_MESSAGES/django.po,sha256=5j5xI-yKORhnywIACpjvMQA6yHj4aHMYiiN4KVSmBMM,3344 +django/contrib/postgres/locale/de/LC_MESSAGES/django.mo,sha256=iTfG4OxvwSG32U_PQ0Tmtl38v83hSjFa2W0J8Sw0NUE,3078 +django/contrib/postgres/locale/de/LC_MESSAGES/django.po,sha256=GkF6wBg7JAvAB8YExwOx4hzpLr1r2K6HsvSLYfyojow,3611 +django/contrib/postgres/locale/dsb/LC_MESSAGES/django.mo,sha256=zZa1kLFCKar4P1xVNpJ0BTXm4I-xcNi_e8IY7n8Aa4w,3605 +django/contrib/postgres/locale/dsb/LC_MESSAGES/django.po,sha256=5vnAeH9tF9H9xL2nqfwc0MLlhI4hnNr45x2NXlw8owo,4061 +django/contrib/postgres/locale/el/LC_MESSAGES/django.mo,sha256=NmzROkTfSbioGv8exM3UdMDnRAxR65YMteGv9Nhury4,3583 +django/contrib/postgres/locale/el/LC_MESSAGES/django.po,sha256=4WuswUwrInAh-OPX9k7gDdLb-oMKp1vQFUGvfm0ej00,4144 +django/contrib/postgres/locale/en/LC_MESSAGES/django.mo,sha256=U0OV81NfbuNL9ctF-gbGUG5al1StqN-daB-F-gFBFC8,356 +django/contrib/postgres/locale/en/LC_MESSAGES/django.po,sha256=jrbHgf4TLTbEAaYV9-briB5JoE7sBWTn9r6aaRtpn54,2862 +django/contrib/postgres/locale/en_AU/LC_MESSAGES/django.mo,sha256=WA0RSssD8ljI16g6DynQZQLQhd_0XR8ilrnJnepsIFg,2839 +django/contrib/postgres/locale/en_AU/LC_MESSAGES/django.po,sha256=4JASYUpYlQlSPREPvMxFBqDpDhprlkI1GpAqTJrmb10,3215 +django/contrib/postgres/locale/eo/LC_MESSAGES/django.mo,sha256=1wqM_IVO8Dl9AefzvWYuoS4eNTrBg7LDH6XUMovKi9A,2742 +django/contrib/postgres/locale/eo/LC_MESSAGES/django.po,sha256=r2tpOblfLAAHMacDWU-OVXTQus_vvAPMjUzVfrV_T7U,3217 +django/contrib/postgres/locale/es/LC_MESSAGES/django.mo,sha256=O2Tdel44oxmQ13ZcwMwK3QPxUPChHdUzVKg2pLCPoqo,3163 +django/contrib/postgres/locale/es/LC_MESSAGES/django.po,sha256=YPjvjmvpS69FuNmPm-7Z1K1Eg_W01JwRHNrWkbKzVZ8,3794 +django/contrib/postgres/locale/es_AR/LC_MESSAGES/django.mo,sha256=zIN-1vsrChWXLDuGrzs61LbBuOwsyifWcvo9NrYCy2k,3140 +django/contrib/postgres/locale/es_AR/LC_MESSAGES/django.po,sha256=1seAy6OHEKG4fDV4NwKQyGfkjT29zjgwvXZ85u1VNtw,3506 +django/contrib/postgres/locale/es_CO/LC_MESSAGES/django.mo,sha256=Q2eOegYKQFY3fAKZCX7VvZAN6lT304W51aGl0lzkbLU,2484 +django/contrib/postgres/locale/es_CO/LC_MESSAGES/django.po,sha256=bbgOn34B7CSq1Kf2IrJh6oRJWPur_Smc4ebljIxAFGE,3233 +django/contrib/postgres/locale/es_MX/LC_MESSAGES/django.mo,sha256=l6WdS59mDfjsV9EMULjKP2DhXR7x3bYax1iokL-AXcU,689 +django/contrib/postgres/locale/es_MX/LC_MESSAGES/django.po,sha256=_-jzhIT71zV539_4SUbwvOXfDHkxRy1FDGdx23iB7B4,2283 +django/contrib/postgres/locale/et/LC_MESSAGES/django.mo,sha256=oPGqGUQhU9xE7j6hQZSVdC-be2WV-_BNrSAaN4csFR4,2886 +django/contrib/postgres/locale/et/LC_MESSAGES/django.po,sha256=xKkb-0CQCAn37xe0G2jfQmjg2kuYBmXB5yBpTA5lYNI,3404 +django/contrib/postgres/locale/eu/LC_MESSAGES/django.mo,sha256=UG7x642-n3U7mamXuNHD66a_mR0agX72xSwBD3PpyJU,2883 +django/contrib/postgres/locale/eu/LC_MESSAGES/django.po,sha256=dAx6nlRd4FF_8i7Xeylwvj4HkEDKi3swFenkdJkDawU,3321 +django/contrib/postgres/locale/fa/LC_MESSAGES/django.mo,sha256=uLh9fJtCSKg5eaj9uGP2muN_71aFxpZwOjRHtnZhPik,3308 +django/contrib/postgres/locale/fa/LC_MESSAGES/django.po,sha256=adN7bh9Q_R0Wzlf2fWaQnTtvxo0NslyoHH5t5V0eeMM,3845 +django/contrib/postgres/locale/fi/LC_MESSAGES/django.mo,sha256=gB2z3nI8Bz-km3DngYfJulwelHSlWgZeBXlj5yWyA08,2943 +django/contrib/postgres/locale/fi/LC_MESSAGES/django.po,sha256=LNVTHv4-FWT5KOre5qTwLEpKIQbaSIusFH2uUmbwYBg,3315 +django/contrib/postgres/locale/fr/LC_MESSAGES/django.mo,sha256=02ug8j0VpkPC2tRDkXrK2snj91M68Ju29PUiv4UhAsQ,3391 +django/contrib/postgres/locale/fr/LC_MESSAGES/django.po,sha256=5T_wkYoHJcpzemKqR-7apZ11Pas4dZhnAitHOgT8gRc,3759 +django/contrib/postgres/locale/ga/LC_MESSAGES/django.mo,sha256=wVzUMn8xlOxfL2vn94fSQ73QGTSbTBG6_6kfQbDPQYM,3652 +django/contrib/postgres/locale/ga/LC_MESSAGES/django.po,sha256=OEuRFUSNTJJlJAg7mvXpratMipVeCovYsH9pTssNGI0,4122 +django/contrib/postgres/locale/gd/LC_MESSAGES/django.mo,sha256=okWU_Ke95EG2pm8rZ4PT5ScO-8f0Hqg65lYZgSid8tM,3541 +django/contrib/postgres/locale/gd/LC_MESSAGES/django.po,sha256=tjt5kfkUGryU3hFzPuAly2DBDLuLQTTD5p-XrxryFEI,4013 +django/contrib/postgres/locale/gl/LC_MESSAGES/django.mo,sha256=1Od7e0SG9tEeTefFLLWkU38tlk5PL5aRF1GTlKkfTAs,2912 +django/contrib/postgres/locale/gl/LC_MESSAGES/django.po,sha256=tE2-GX2OH06krOFxvzdJeYWC7a57QYNFx5OtMXFWTdQ,3316 +django/contrib/postgres/locale/he/LC_MESSAGES/django.mo,sha256=znkNJeCKSSA4DPdvN5LCj5tdcWvRJQKRLWMXqSIO4FI,3757 +django/contrib/postgres/locale/he/LC_MESSAGES/django.po,sha256=oVJ0bfd9gH3aF3lo6rCMbA_9_3nhLWKBqfVj-H220F0,4234 +django/contrib/postgres/locale/hr/LC_MESSAGES/django.mo,sha256=vdm5GxgpKuVdGoVl3VreD8IB1Mq5HGWuq-2YDeDrNnU,929 +django/contrib/postgres/locale/hr/LC_MESSAGES/django.po,sha256=8TxEnVH2yIQWbmbmDOpR7kksNFSaUGVhimRPQgSgDkM,2501 +django/contrib/postgres/locale/hsb/LC_MESSAGES/django.mo,sha256=SSZpG-PSeVCHrzB-wzW4wRHxIEt7hqobzvRLB-9tu8Y,3518 +django/contrib/postgres/locale/hsb/LC_MESSAGES/django.po,sha256=UQUlfpJsgd-0qa6hZhUkTAi6VF5ZYiygSMrLcsiEC4k,3971 +django/contrib/postgres/locale/hu/LC_MESSAGES/django.mo,sha256=o6JDAFIN7i21GE2N0q98SiqIdvGYPLLdDiMLC_UE5hM,2892 +django/contrib/postgres/locale/hu/LC_MESSAGES/django.po,sha256=yUcbOn1k08aqhkODsrQfLR3qk-UnEEbEYuP3JyQ3eCU,3432 +django/contrib/postgres/locale/hy/LC_MESSAGES/django.mo,sha256=2QFIJdmh47IGPqI-8rvuHR0HdH2LOAmaYqEeCwUpRuw,3234 +django/contrib/postgres/locale/hy/LC_MESSAGES/django.po,sha256=MLHMbdwdo1txzFOG-fVK4VUvAoDtrLA8CdpQThybSCQ,3825 +django/contrib/postgres/locale/ia/LC_MESSAGES/django.mo,sha256=gn8lf-gOP4vv-iiqnkcxvjzhJ8pTdetBhHyjl4TapXo,582 +django/contrib/postgres/locale/ia/LC_MESSAGES/django.po,sha256=FsqhPQf0j4g06rGuWSTn8A1kJ7E5U9rX16mtB8CAiIE,2251 +django/contrib/postgres/locale/id/LC_MESSAGES/django.mo,sha256=vWCSZJBmKu5uGS8KvQIJSMZA1YTwdbbJP4-OBhTmAwQ,2737 +django/contrib/postgres/locale/id/LC_MESSAGES/django.po,sha256=Z5TrRpCOv6Mgb2YFU84vE8cT_3W7flFwA8BUMm4VvO0,3308 +django/contrib/postgres/locale/is/LC_MESSAGES/django.mo,sha256=rNL5Un5K_iRAZDtpHo4egcySaaBnNEirYDuWw0eI7gk,2931 +django/contrib/postgres/locale/is/LC_MESSAGES/django.po,sha256=UO53ciyI0jCVtBOXWkaip2AbPE2Hd2YhzK1RAlcxyQ8,3313 +django/contrib/postgres/locale/it/LC_MESSAGES/django.mo,sha256=dsn-Xuhg1WeRkJVGHHdoPz-KobYsS8A41BUdnM4wQQ8,3210 +django/contrib/postgres/locale/it/LC_MESSAGES/django.po,sha256=2RpaA-mmvXcYkYTu_y0u3p32aAhP9DyAy641ZJL79sk,3874 +django/contrib/postgres/locale/ja/LC_MESSAGES/django.mo,sha256=IC9mYW8gXWNGuXeh8gGxGFvrjfxiSpj57E63Ka47pkM,3046 +django/contrib/postgres/locale/ja/LC_MESSAGES/django.po,sha256=IPnDsh8rtq158a63zQJekJ0LJlR3uj6KAjx4omc7XN0,3437 +django/contrib/postgres/locale/ka/LC_MESSAGES/django.mo,sha256=A_VhLUZbocGNF5_5mMoYfB3l654MrPIW4dL1ywd3Tw8,713 +django/contrib/postgres/locale/ka/LC_MESSAGES/django.po,sha256=kRIwQ1Nrzdf5arHHxOPzQcB-XwPNK5lUFKU0L3QHfC8,2356 +django/contrib/postgres/locale/kk/LC_MESSAGES/django.mo,sha256=xMc-UwyP1_jBHcGIAGWmDAjvSL50jJaiZbcT5TmzDOg,665 +django/contrib/postgres/locale/kk/LC_MESSAGES/django.po,sha256=f6Z3VUFRJ3FgSReC0JItjA0RaYbblqDb31lbJ3RRExQ,2327 +django/contrib/postgres/locale/ko/LC_MESSAGES/django.mo,sha256=G9Cl4uFost_c2y-3dBEF5ODuOe2BLThiXcEMEMXQQE8,2905 +django/contrib/postgres/locale/ko/LC_MESSAGES/django.po,sha256=JXqG3VCGEhBzAxGzOBb9w6oflaX4duhxNVht69ytOQY,3481 +django/contrib/postgres/locale/ky/LC_MESSAGES/django.mo,sha256=F0Ws34MbE7zJa8FNxA-9rFm5sNLL22D24LyiBb927lE,3101 +django/contrib/postgres/locale/ky/LC_MESSAGES/django.po,sha256=yAzSeT2jBm7R2ZXiuYBQFSKQ_uWIUfNTAobE1UYnlPs,3504 +django/contrib/postgres/locale/lt/LC_MESSAGES/django.mo,sha256=kJ3ih8HrHt2M_hFW0H9BZg7zcj6sXy6H_fD1ReIzngM,3452 +django/contrib/postgres/locale/lt/LC_MESSAGES/django.po,sha256=PNADIV8hdpLoqwW4zpIhxtWnQN8cPkdcoXYngyjFeFw,3972 +django/contrib/postgres/locale/lv/LC_MESSAGES/django.mo,sha256=UwBbbIbC_MO6xhB66UzO80XFcmlyv8-mfFEK4kQd6fE,3153 +django/contrib/postgres/locale/lv/LC_MESSAGES/django.po,sha256=phDSZnB5JeCoCi0f_MYCjQiwhE00gcVl5urOFiAKmkU,3768 +django/contrib/postgres/locale/mk/LC_MESSAGES/django.mo,sha256=WE4nRJKWAZvXuyU2qT2_FGqGlKYsP1KSACCtT10gQQY,3048 +django/contrib/postgres/locale/mk/LC_MESSAGES/django.po,sha256=CQX91LP1Gbkazpt4hTownJtSqZGR1OJfoD-1MCo6C1Y,3783 +django/contrib/postgres/locale/ml/LC_MESSAGES/django.mo,sha256=N47idWIsmtghZ_D5325TRsDFeoUa0MIvMFtdx7ozAHc,1581 +django/contrib/postgres/locale/ml/LC_MESSAGES/django.po,sha256=lt_7fGZV7BCB2XqFWIQQtH4niU4oMBfGzQQuN5sD0fo,2947 +django/contrib/postgres/locale/mn/LC_MESSAGES/django.mo,sha256=VWeXaMvdqhW0GHs1Irb1ikTceH7jMKH_xMzKLH0vKZg,3310 +django/contrib/postgres/locale/mn/LC_MESSAGES/django.po,sha256=p3141FJiYrkV8rocgqdxnV05FReQYZmosv9LI46FlfE,3867 +django/contrib/postgres/locale/mr/LC_MESSAGES/django.mo,sha256=vVYwi51As7ovNuvoGU96oL3uryKHGVPCJXS2rRrkZ2o,1132 +django/contrib/postgres/locale/mr/LC_MESSAGES/django.po,sha256=DHSatTEPlPRSH_qXXBXKeyHB1X7YQ0UhkUc-j92iAyY,2595 +django/contrib/postgres/locale/ms/LC_MESSAGES/django.mo,sha256=m3JZm1IIMZwmpvIs3oV0roYCeR_UlswHyCpZjjE6-A8,2712 +django/contrib/postgres/locale/ms/LC_MESSAGES/django.po,sha256=HCMBA1fxKLJct14ywap0PYVBi2bDp2F97Ms5_-G_Pwg,3025 +django/contrib/postgres/locale/nb/LC_MESSAGES/django.mo,sha256=3h8DqEFG39i6uHY0vpXuGFmoJnAxTtRFy1RazcYIXfg,2849 +django/contrib/postgres/locale/nb/LC_MESSAGES/django.po,sha256=gDUg-HDg3LiYMKzb2QaDrYopqaJmbvnw2Fo-qhUHFuI,3252 +django/contrib/postgres/locale/ne/LC_MESSAGES/django.mo,sha256=5XdBLGMkn20qeya3MgTCpsIDxLEa7PV-i2BmK993iRc,875 +django/contrib/postgres/locale/ne/LC_MESSAGES/django.po,sha256=1QLLfbrHneJmxM_5UTpNIYalP-qX7Bn7bmj4AfDLIzE,2421 +django/contrib/postgres/locale/nl/LC_MESSAGES/django.mo,sha256=XK0L91JYDbkgw45eJysai_3u28KqZ5UFPTYaCTMiDPA,2993 +django/contrib/postgres/locale/nl/LC_MESSAGES/django.po,sha256=qU17zpXRHSoBQIkcP-Cm1GFh0BcpUTJsdh277P8dYG0,3565 +django/contrib/postgres/locale/nn/LC_MESSAGES/django.mo,sha256=RdMFozwxYIckBY40mJhN-jjkghztKn0-ytCtqxFHBMY,2836 +django/contrib/postgres/locale/nn/LC_MESSAGES/django.po,sha256=vl8NkY342eonqbrj89eCR_8PsJpeQuaRjxems-OPIBk,3184 +django/contrib/postgres/locale/pl/LC_MESSAGES/django.mo,sha256=Wox9w-HN7Guf8N1nkgemuDVs0LQxxTmEqQDOxriKy60,3462 +django/contrib/postgres/locale/pl/LC_MESSAGES/django.po,sha256=pxm_IKMg8g5qfg19CKc5JEdK6IMnhyeSPHd7THUb1GY,4217 +django/contrib/postgres/locale/pt/LC_MESSAGES/django.mo,sha256=KZvJXjrIdtxbffckcrRV3nJ5GnID6PvqAb7vpOiWpHE,2745 +django/contrib/postgres/locale/pt/LC_MESSAGES/django.po,sha256=2gIDOjnFo6Iom-oTkQek4IX6FYPI9rNp9V-6sJ55aL8,3281 +django/contrib/postgres/locale/pt_BR/LC_MESSAGES/django.mo,sha256=PVEiflh0v3AqVOC0S85XO-V3xDU3d8UwS31lzGrLoi8,3143 +django/contrib/postgres/locale/pt_BR/LC_MESSAGES/django.po,sha256=onF2K6s-McAXDSRzQ50EpGrKAIv89vvRWjCjsLCVXvs,3896 +django/contrib/postgres/locale/ro/LC_MESSAGES/django.mo,sha256=w4tyByrZlba_Ju_F2OzD52ut5JSD6UGJfjt3A7CG_uc,3188 +django/contrib/postgres/locale/ro/LC_MESSAGES/django.po,sha256=hnotgrr-zeEmE4lgpqDDiJ051GoGbL_2GVs4O9dVLXI,3700 +django/contrib/postgres/locale/ru/LC_MESSAGES/django.mo,sha256=LKkZs-TvPFTSrXVVaaoZ-Ec0kL_E9_5vTaExVxlr_rk,4732 +django/contrib/postgres/locale/ru/LC_MESSAGES/django.po,sha256=mnmVUlwZqn9QwdMx4g0D9xYxxKw_4pMFslwT2c4AjuE,5488 +django/contrib/postgres/locale/sk/LC_MESSAGES/django.mo,sha256=dRnTFkvRMbq5QnVEtrQ9Of9MxKTFYPP8sE7kbvUEjug,3381 +django/contrib/postgres/locale/sk/LC_MESSAGES/django.po,sha256=OwKv_mc9cuwt_YGnoVQLF3t2RsIbFyG_k3NKoIMAMoY,3899 +django/contrib/postgres/locale/sl/LC_MESSAGES/django.mo,sha256=JM9YZagjHIIrCxOKkR4d4oKaEXKJU7bfVdM3_uzSTAE,2810 +django/contrib/postgres/locale/sl/LC_MESSAGES/django.po,sha256=1jI2zXSU4LWxfLEUL-FXpldCExZJLD53Jy7VnA258xs,3602 +django/contrib/postgres/locale/sq/LC_MESSAGES/django.mo,sha256=slZq_bGPIzF8AlmtsfIqo65B14YYfw_uYKNcw_Tun0g,2958 +django/contrib/postgres/locale/sq/LC_MESSAGES/django.po,sha256=TPmtauQdDYM5QIOhGj2EwjRBQ3qOiRmvPMpUavUqh9A,3394 +django/contrib/postgres/locale/sr/LC_MESSAGES/django.mo,sha256=OfsUq8rZdD2NP7NQjBoatSXATxc8d6QL-nxmlPp5QSc,3775 +django/contrib/postgres/locale/sr/LC_MESSAGES/django.po,sha256=vUvFaIp8renqgGs-VgrtPNu7IBkcB38mlTBJ0xxXTaI,4214 +django/contrib/postgres/locale/sr_Latn/LC_MESSAGES/django.mo,sha256=2nDFP43vk1Jih35jns8vSbOhhLq_w7t_2vJHg-crfxY,3112 +django/contrib/postgres/locale/sr_Latn/LC_MESSAGES/django.po,sha256=QN4NEy0zFaPNjTCBrT9TydedWG7w4QBPm-pO7cKvSjg,3510 +django/contrib/postgres/locale/sv/LC_MESSAGES/django.mo,sha256=AkUgWYRBGNJYg5QDPJR3qu4BA_XF9xaZA__3m_KF4hk,2918 +django/contrib/postgres/locale/sv/LC_MESSAGES/django.po,sha256=hhJBRobgyHkLeKxdDxNkEl9XKkDXkrlx6PjyWcERp7I,3487 +django/contrib/postgres/locale/tg/LC_MESSAGES/django.mo,sha256=3yW5NKKsa2f2qDGZ4NGlSn4DHatLOYEv5SEwB9voraA,2688 +django/contrib/postgres/locale/tg/LC_MESSAGES/django.po,sha256=Zuix5sJH5Fz9-joe_ivMRpNz2Fbzefsxz3OOoDV0o1c,3511 +django/contrib/postgres/locale/tk/LC_MESSAGES/django.mo,sha256=ytivs6cnECDuyVKToFQMRnH_RPr4PlVepg8xFHnr0W4,2789 +django/contrib/postgres/locale/tk/LC_MESSAGES/django.po,sha256=bfXIyKNOFRC3U34AEKCsYQn3XMBGtgqHsXpboHvRQq0,3268 +django/contrib/postgres/locale/tr/LC_MESSAGES/django.mo,sha256=hZ2pxkYNOGE4BX--QmDlzqXxT21gHaPGA6CmXDODzhI,2914 +django/contrib/postgres/locale/tr/LC_MESSAGES/django.po,sha256=fzQsDL_wSO62qUaXCutRgq0ifrQ9oOaaxVQRyfnvV7Y,3288 +django/contrib/postgres/locale/ug/LC_MESSAGES/django.mo,sha256=ClLFBgCNopAREx7jy9WRbEASJERWJO8WZHriZrPtDZU,3938 +django/contrib/postgres/locale/ug/LC_MESSAGES/django.po,sha256=Ldd11fS8-D6ZeannnC6pCmBk7fmtqR_RXaeaNZQtU6M,4323 +django/contrib/postgres/locale/uk/LC_MESSAGES/django.mo,sha256=Jg6nM7ah7hEv7eqpe11e0e_MvRaMAQW3mdHTj9hqyG8,4406 +django/contrib/postgres/locale/uk/LC_MESSAGES/django.po,sha256=6gBP1xKxK9hf8ISCR1wABxkKXEUTx2CUYHGr6RVPI94,5100 +django/contrib/postgres/locale/uz/LC_MESSAGES/django.mo,sha256=PcmhhVC1spz3EFrQ2qdhfPFcA1ELHtBhHGWk9Z868Ss,703 +django/contrib/postgres/locale/uz/LC_MESSAGES/django.po,sha256=lbQxX2cmueGCT8sl6hsNWcrf9H-XEUbioP4L7JHGqiU,2291 +django/contrib/postgres/locale/zh_Hans/LC_MESSAGES/django.mo,sha256=ln_p6MRs5JPvTAXFzegXYnCCKki-LEr_YiOw6sK8oPA,2560 +django/contrib/postgres/locale/zh_Hans/LC_MESSAGES/django.po,sha256=7YZE8B0c1HuKVjGzreY7iiyuFeyPgqzKIwzxe5YOKb4,3084 +django/contrib/postgres/locale/zh_Hant/LC_MESSAGES/django.mo,sha256=7-gE2HUKbQwMwzMXT3_sMbI2GbuS2uzciNnJgKOMZUQ,2563 +django/contrib/postgres/locale/zh_Hant/LC_MESSAGES/django.po,sha256=nkYgbfQNoa3eYNCYMPgGVhtGWScjWtP2rjlV8nAXgH0,2973 +django/contrib/postgres/lookups.py,sha256=J50bsr8rLjp_zzdViSVDDcTLfDkY21fEUoyqCgeHauI,1991 +django/contrib/postgres/operations.py,sha256=SI3VgaNJqrZi6ZyTlZ1QclHUYix3VXUV15SmODIFg_0,12072 +django/contrib/postgres/search.py,sha256=bIXux7NXgsVTVAauvScWUPtYNR4E2u1D1Rd6PNf2s6Y,11732 +django/contrib/postgres/serializers.py,sha256=wCg0IzTNeuVOiC2cdy1wio6gChjqVvH6Ri4hkCkEeXU,435 +django/contrib/postgres/signals.py,sha256=cpkaedbyvajpN4NNAYLA6TfKI_4fe9AU40CeYhYmS8Q,2870 +django/contrib/postgres/templates/postgres/widgets/split_array.html,sha256=AzaPLlNLg91qkVQwwtAJxwOqDemrtt_btSkWLpboJDs,54 +django/contrib/postgres/utils.py,sha256=32nCnzdMZ7Ra4dDonbIdv1aCppV3tnQnoEX9AhCJe38,1187 +django/contrib/postgres/validators.py,sha256=GCJtwISehlhcqQhR5JEfrcwPUcCJqtpFV_fu4aRLb34,2801 +django/contrib/redirects/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/contrib/redirects/__pycache__/__init__.cpython-312.pyc,, +django/contrib/redirects/__pycache__/admin.cpython-312.pyc,, +django/contrib/redirects/__pycache__/apps.cpython-312.pyc,, +django/contrib/redirects/__pycache__/middleware.cpython-312.pyc,, +django/contrib/redirects/__pycache__/models.cpython-312.pyc,, +django/contrib/redirects/admin.py,sha256=1bPOgeZYRYCHdh7s2SpXnuL2WsfdQjD96U5Y3xhRY8g,314 +django/contrib/redirects/apps.py,sha256=1uS5EBp7WwDnY0WHeaRYo7VW9j-s20h4KDdImodjCNg,251 +django/contrib/redirects/locale/af/LC_MESSAGES/django.mo,sha256=p1jR8LLNrzuDM6gvYBzQAS5xg7X8O17301Fo5xEU2yI,1151 +django/contrib/redirects/locale/af/LC_MESSAGES/django.po,sha256=wkVhdkjL6kI-0uxzWPCrEMhf_iUSbbHV1D0dFPIw1eU,1385 +django/contrib/redirects/locale/ar/LC_MESSAGES/django.mo,sha256=FfPauXNUmQxq0R1-eQ2xw2WY1Oi33sLwVhyKX10_zFw,1336 +django/contrib/redirects/locale/ar/LC_MESSAGES/django.po,sha256=X0xX51asSDWedd56riJ4UrsCGEjH-lZdkcilIg4amgI,1595 +django/contrib/redirects/locale/ar_DZ/LC_MESSAGES/django.mo,sha256=hg1lkBEORP2vgLPRbuKcXiIFUcTvAO7KrjbPXlWhvqY,1379 +django/contrib/redirects/locale/ar_DZ/LC_MESSAGES/django.po,sha256=O4quBKA1jHATGGeDqCONDFfAqvDvOAATIBvueeMphyY,1581 +django/contrib/redirects/locale/ast/LC_MESSAGES/django.mo,sha256=a1ixBQQIdBZ7o-ADnF2r74CBtPLsuatG7txjc05_GXI,1071 +django/contrib/redirects/locale/ast/LC_MESSAGES/django.po,sha256=PguAqeIUeTMWsADOYLTxoC6AuKrCloi8HN18hbm3pZ0,1266 +django/contrib/redirects/locale/az/LC_MESSAGES/django.mo,sha256=IBIB2EW9ZYQTD0x4d8VadXY0lFx-XYtKCd1F_e72ibA,1106 +django/contrib/redirects/locale/az/LC_MESSAGES/django.po,sha256=D3ZGFhKeMTjJ4YtUOTRjBCvZ2cofqfksbk39mvHDemw,1384 +django/contrib/redirects/locale/be/LC_MESSAGES/django.mo,sha256=fVqy28ml508UJf5AA-QVsS5dzKI8Q_ugZZ34WjTpJ-s,1426 +django/contrib/redirects/locale/be/LC_MESSAGES/django.po,sha256=zHBVewcpt0KoavV96v3F4wybqtkGb1jUuPz7sbiWWDI,1662 +django/contrib/redirects/locale/bg/LC_MESSAGES/django.mo,sha256=o-ETSDGtAFZRo3SPd_IHe0mJ3R0RHA32KpgfOmUH11M,1279 +django/contrib/redirects/locale/bg/LC_MESSAGES/django.po,sha256=9qm8s6vj-0LStnyEJ8iYVi13_MfugVAAs2RHvIi7kW8,1587 +django/contrib/redirects/locale/bn/LC_MESSAGES/django.mo,sha256=SbQh_pgxNCogvUFud7xW9T6NTAvpaQb2jngXCtpjICM,1319 +django/contrib/redirects/locale/bn/LC_MESSAGES/django.po,sha256=LgUuiPryDLSXxo_4KMCdjM5XC3BiRfINuEk0s5PUQYQ,1511 +django/contrib/redirects/locale/br/LC_MESSAGES/django.mo,sha256=Yt8xo5B5LJ9HB8IChCkj5mljFQAAKlaW_gurtF8q8Yw,1429 +django/contrib/redirects/locale/br/LC_MESSAGES/django.po,sha256=L2qPx6mZEVUNay1yYEweKBLr_fXVURCnACfsezfP_pI,1623 +django/contrib/redirects/locale/bs/LC_MESSAGES/django.mo,sha256=0Yak4rXHjRRXLu3oYYzvS8qxvk2v4IFvUiDPA68a5YI,1115 +django/contrib/redirects/locale/bs/LC_MESSAGES/django.po,sha256=s9Nhx3H4074hlSqo1zgQRJbozakdJTwA1aTuMSqEJWw,1316 +django/contrib/redirects/locale/ca/LC_MESSAGES/django.mo,sha256=VHE6qHCEoA7rQk0fMUpoTfwqSfu63-CiOFvhvKp5DMQ,1136 +django/contrib/redirects/locale/ca/LC_MESSAGES/django.po,sha256=PSMb_7iZBuYhtdR8byh9zr9dr50Z_tQ518DUlqoEA_M,1484 +django/contrib/redirects/locale/ckb/LC_MESSAGES/django.mo,sha256=23RM9kso65HHxGHQ_DKxGDaUkmdX72DfYvqQfhr7JKw,1340 +django/contrib/redirects/locale/ckb/LC_MESSAGES/django.po,sha256=cGrAq3e6h3vbYrtyi0oFSfZmLlJ0-Y3uqrvFon48n80,1521 +django/contrib/redirects/locale/cs/LC_MESSAGES/django.mo,sha256=UwYsoEHsg7FJLVe0JxdOa1cTGypqJFienAbWe7Vldf0,1229 +django/contrib/redirects/locale/cs/LC_MESSAGES/django.po,sha256=hnWJLXX7IjwZK7_8L3p-dpj5XpDmEo7lQ7-F4upjn7U,1504 +django/contrib/redirects/locale/cy/LC_MESSAGES/django.mo,sha256=NSGoK12A7gbtuAuzQEVFPNSZMqqmhHyRvTEn9PUm9So,1132 +django/contrib/redirects/locale/cy/LC_MESSAGES/django.po,sha256=jDmC64z5exPnO9zwRkBmpa9v3DBlaeHRhqZYPoWqiIY,1360 +django/contrib/redirects/locale/da/LC_MESSAGES/django.mo,sha256=_UVfTMRG__5j7Ak8Q3HtXSy_DPGpZ1XvKj9MHdmR_xI,1132 +django/contrib/redirects/locale/da/LC_MESSAGES/django.po,sha256=RAWWbZXbJciNSdw4skUEoTnOb19iKXAe1KXJLWi0zPQ,1418 +django/contrib/redirects/locale/de/LC_MESSAGES/django.mo,sha256=uh-ldy-QkWS5-ARX6cLyzxzdhbTb_chyEbBPFCvCKuE,1155 +django/contrib/redirects/locale/de/LC_MESSAGES/django.po,sha256=hhGNnVCRV4HNxhCYfmVXTOIkabD7qsVQccwxKa5Tz9g,1424 +django/contrib/redirects/locale/dsb/LC_MESSAGES/django.mo,sha256=LXgczA38RzrN7zSWpxKy8_RY4gPg5tZLl30CJGjJ63s,1236 +django/contrib/redirects/locale/dsb/LC_MESSAGES/django.po,sha256=rI9dyDp7zuZ6CjvFyo2OkGUDK5XzdvdI0ma8IGVkjp4,1431 +django/contrib/redirects/locale/el/LC_MESSAGES/django.mo,sha256=sD3HT4e53Yd3HmQap_Mqlxkm0xF98A6PFW8Lil0PihI,1395 +django/contrib/redirects/locale/el/LC_MESSAGES/django.po,sha256=puhVCcshg5HaPHsVAOucneVgBYT6swhCCBpVGOZykgA,1716 +django/contrib/redirects/locale/en/LC_MESSAGES/django.mo,sha256=U0OV81NfbuNL9ctF-gbGUG5al1StqN-daB-F-gFBFC8,356 +django/contrib/redirects/locale/en/LC_MESSAGES/django.po,sha256=u4RcMkFmNvlG9Bv6kM0a0scWUMDUbTEDJGR90-G8C0E,1123 +django/contrib/redirects/locale/en_AU/LC_MESSAGES/django.mo,sha256=wxCpSLGl_zsE47kDwilDkpihazwHkA363PvtGOLWhdk,1127 +django/contrib/redirects/locale/en_AU/LC_MESSAGES/django.po,sha256=zujH1WuxoHw_32flptG0x2Ob_BlilLKXuMjQxVbZmgw,1307 +django/contrib/redirects/locale/en_GB/LC_MESSAGES/django.mo,sha256=VscL30uJnV-eiQZITpBCy0xk_FfKdnMh4O9Hk4HGxww,1053 +django/contrib/redirects/locale/en_GB/LC_MESSAGES/django.po,sha256=loe8xIVjZ7eyteQNLPoa-QceBZdgky22dR6deK5ubmA,1246 +django/contrib/redirects/locale/eo/LC_MESSAGES/django.mo,sha256=WZ3NHrS0qMoCJER5jWnGI12bvY5wH0yytM8F7BFTgYc,712 +django/contrib/redirects/locale/eo/LC_MESSAGES/django.po,sha256=T-Gw75sOjZgqpwjIfieIrLxbg1kekWzjrJYSMld2OEQ,1299 +django/contrib/redirects/locale/es/LC_MESSAGES/django.mo,sha256=xyeIQL_pHFyo7p7SkeuxzKdDsma2EXhvnPNDHUhaBv8,1159 +django/contrib/redirects/locale/es/LC_MESSAGES/django.po,sha256=Y3hPQrcbhLtR-pPYRJJXkJME5M8Enr20j9D63hhe9ZA,1490 +django/contrib/redirects/locale/es_AR/LC_MESSAGES/django.mo,sha256=JdKzpdyf9W2m_0_NguvXvyciOh6LAATfE6lqcsp45To,1144 +django/contrib/redirects/locale/es_AR/LC_MESSAGES/django.po,sha256=3zrKJXLh_mrjc4A6g9O6ePyFz8PNUMYTPjNFpvEhaDo,1364 +django/contrib/redirects/locale/es_CO/LC_MESSAGES/django.mo,sha256=wcAMOiqsgz2KEpRwirRH9FNoto6vmo_hxthrQJi0IHU,1147 +django/contrib/redirects/locale/es_CO/LC_MESSAGES/django.po,sha256=n8DM14vHekZRayH0B6Pm3L5XnSo4lto4ZAdu4OhcOmc,1291 +django/contrib/redirects/locale/es_MX/LC_MESSAGES/django.mo,sha256=38fbiReibMAmC75BCCbyo7pA2VA3QvmRqVEo_K6Ejow,1116 +django/contrib/redirects/locale/es_MX/LC_MESSAGES/django.po,sha256=t7R6PiQ1bCc7jhfMrjHlZxVQ6BRlWT2Vv4XXhxBD_Oo,1397 +django/contrib/redirects/locale/es_VE/LC_MESSAGES/django.mo,sha256=59fZBDut-htCj38ZUoqPjhXJPjZBz-xpU9__QFr3kLs,486 +django/contrib/redirects/locale/es_VE/LC_MESSAGES/django.po,sha256=f4XZW8OHjRJoztMJtSDCxd2_Mfy-XK44hLtigjGSsZY,958 +django/contrib/redirects/locale/et/LC_MESSAGES/django.mo,sha256=34-Z1s9msdnj6U7prMctEWCxAR8TNnP44MIoyUuFsls,1131 +django/contrib/redirects/locale/et/LC_MESSAGES/django.po,sha256=1VWcUbM9z_nNmiGnT9Mka3Y3ZLRVHuJdS_j_yNXvmQ0,1479 +django/contrib/redirects/locale/eu/LC_MESSAGES/django.mo,sha256=yHlAEz01pWse4ZworAj7JiATUam5Fp20EZd_3PRgSNw,1126 +django/contrib/redirects/locale/eu/LC_MESSAGES/django.po,sha256=zAvSdahjvq727hXeGjHJ_R5L5meCrOv98tbH3rwlBcE,1404 +django/contrib/redirects/locale/fa/LC_MESSAGES/django.mo,sha256=vZa1KKm2y8duEv9UbJMyiM8WO2EAXcevdR3Lj1ISgLU,1234 +django/contrib/redirects/locale/fa/LC_MESSAGES/django.po,sha256=1quB0Wx5VTIjX2QUCpENl1GA2hpSdsRpgK931jr20B0,1541 +django/contrib/redirects/locale/fi/LC_MESSAGES/django.mo,sha256=xJEd4M2IowXxKBlaGuOEgFKA9OuihcgPoK07Beat4cc,1164 +django/contrib/redirects/locale/fi/LC_MESSAGES/django.po,sha256=1I7AoXMPRDMY6TCjPkQh0Q9g68r9BwKOwki9DybcFWc,1429 +django/contrib/redirects/locale/fr/LC_MESSAGES/django.mo,sha256=YhVNoNaHdSOp2P2F7xfo2MHCd2KkHiehpVjLyJ4VLuw,1155 +django/contrib/redirects/locale/fr/LC_MESSAGES/django.po,sha256=-ljzEKiU05annJ8DHw4OOg8eDCAnWLV2V33R-tQn9dE,1391 +django/contrib/redirects/locale/fy/LC_MESSAGES/django.mo,sha256=YQQy7wpjBORD9Isd-p0lLzYrUgAqv770_56-vXa0EOc,476 +django/contrib/redirects/locale/fy/LC_MESSAGES/django.po,sha256=D7xverCbf3kTCcFM8h7EKWM5DcxZRqeOSKDB1irbKeE,948 +django/contrib/redirects/locale/ga/LC_MESSAGES/django.mo,sha256=DMxYLCVQl6qtLf8SXpcy1u9DLbTVFM-03Q2iXjNxNs0,1182 +django/contrib/redirects/locale/ga/LC_MESSAGES/django.po,sha256=HL2vCAoXAj0pk4MkrriUY_Jp2xvDaMqJo8i1z2MkKT8,1497 +django/contrib/redirects/locale/gd/LC_MESSAGES/django.mo,sha256=baZXdulbPZwe4_Q3OwfHFl4GJ4hCYtoZz-lE4wcdJvg,1250 +django/contrib/redirects/locale/gd/LC_MESSAGES/django.po,sha256=M4E2giFgzRowd3OsvhD389MyJmT5osKz1Vs1sEfmUpU,1428 +django/contrib/redirects/locale/gl/LC_MESSAGES/django.mo,sha256=au4ulT76A8cd_C_DmtEdiuQ14dIJaprVvFbS9_hYRNk,1131 +django/contrib/redirects/locale/gl/LC_MESSAGES/django.po,sha256=r2t9gHhIvPb8d9XR8fG0b_eW5xkkQswuj4ekJI9x90w,1393 +django/contrib/redirects/locale/he/LC_MESSAGES/django.mo,sha256=Yu8KTmY0mJEcxhkhTEVElPBaWwO9Zj4NqC8eopW0cRc,1278 +django/contrib/redirects/locale/he/LC_MESSAGES/django.po,sha256=UcCd_BqHOkTV1dP0hgJ4dNQzBZ4p8TujwSjF3FWAMjo,1513 +django/contrib/redirects/locale/hi/LC_MESSAGES/django.mo,sha256=onR8L7Kvkx6HgFLK7jT-wA_zjarBN8pyltG6BbKFIWU,1409 +django/contrib/redirects/locale/hi/LC_MESSAGES/django.po,sha256=fNv9_qwR9iS-pjWNXnrUFIqvc10lwg3bfj5lgdQOy1U,1649 +django/contrib/redirects/locale/hr/LC_MESSAGES/django.mo,sha256=7wHi6Uu0czZhI6v0ndJJ1wSkalTRfn7D5ovyw8tr4U4,1207 +django/contrib/redirects/locale/hr/LC_MESSAGES/django.po,sha256=HtxZwZ-ymmf-XID0z5s7nGYg-4gJL8i6FDGWt9i4Wns,1406 +django/contrib/redirects/locale/hsb/LC_MESSAGES/django.mo,sha256=6lfIW4LcMGvuLOY0U4w1V6Xwcd_TsUC3r-QzZOOLwys,1221 +django/contrib/redirects/locale/hsb/LC_MESSAGES/django.po,sha256=l5pATo8NHa8ypB8dCigRwqpLZvV8W0v2vPh60oAeGn0,1420 +django/contrib/redirects/locale/hu/LC_MESSAGES/django.mo,sha256=4oYBNGEmFMISzw3LExVf6CHsJD_o20mMy132pwzM-wk,1111 +django/contrib/redirects/locale/hu/LC_MESSAGES/django.po,sha256=UYJ_ZrAnOqA6S8nkkfN_FBLxCyPHJjOMd1OSIUVc8aY,1383 +django/contrib/redirects/locale/hy/LC_MESSAGES/django.mo,sha256=gT5x1TZXMNyBwfmQ-C_cOB60JGYdKIM7tVb3-J5d6nw,1261 +django/contrib/redirects/locale/hy/LC_MESSAGES/django.po,sha256=40QTpth2AVeoy9P36rMJC2C82YsBh_KYup19WL6zM6w,1359 +django/contrib/redirects/locale/ia/LC_MESSAGES/django.mo,sha256=PDB5ZQP6iH31xN6N2YmPZYjt6zzc88TRmh9_gAWH2U0,1152 +django/contrib/redirects/locale/ia/LC_MESSAGES/django.po,sha256=GXjbzY-cQz2QLx_iuqgijT7VUMcoNKL7prbP6yIbj8E,1297 +django/contrib/redirects/locale/id/LC_MESSAGES/django.mo,sha256=XEsvVWMR9As9csO_6iXNAcLZrErxz3HfDj5GTe06fJU,1105 +django/contrib/redirects/locale/id/LC_MESSAGES/django.po,sha256=t8FoC1xIB-XHDplyDJByQGFnHggxR0LSfUMGwWoAKWE,1410 +django/contrib/redirects/locale/io/LC_MESSAGES/django.mo,sha256=vz7TWRML-DFDFapbEXTByb9-pRQwoeJ0ApSdh6nOzXY,1019 +django/contrib/redirects/locale/io/LC_MESSAGES/django.po,sha256=obStuMYYSQ7x2utkGS3gekdPfnsNAwp3DcNwlwdg1sI,1228 +django/contrib/redirects/locale/is/LC_MESSAGES/django.mo,sha256=aMjlGilYfP7clGriAp1Za60uCD40rvLt9sKXuYX3ABg,1040 +django/contrib/redirects/locale/is/LC_MESSAGES/django.po,sha256=nw5fxVV20eQqsk4WKg6cIiKttG3zsITSVzH4p5xBV8s,1299 +django/contrib/redirects/locale/it/LC_MESSAGES/django.mo,sha256=bBj6dvhZSpxojLZ0GiMBamh1xiluxAYMt6RHubi9CxU,1092 +django/contrib/redirects/locale/it/LC_MESSAGES/django.po,sha256=NHSVus7ixtrB7JDIrYw22srZcse5i4Z9y8Ply_-Jcts,1390 +django/contrib/redirects/locale/ja/LC_MESSAGES/django.mo,sha256=XSJw3iLK0gYVjZ86MYuV4jfoiN_-WkH--oMK5uW9cs8,1193 +django/contrib/redirects/locale/ja/LC_MESSAGES/django.po,sha256=SlYrmC3arGgS7SL8cCnq7d37P-bQGcmpgUXAwVC2eRw,1510 +django/contrib/redirects/locale/ka/LC_MESSAGES/django.mo,sha256=0aOLKrhUX6YAIMNyt6KES9q2iFk2GupEr76WeGlJMkk,1511 +django/contrib/redirects/locale/ka/LC_MESSAGES/django.po,sha256=AQWIEdhxp55XnJwwHrUxxQaGbLJPmdo1YLeT86IJqnY,1725 +django/contrib/redirects/locale/kab/LC_MESSAGES/django.mo,sha256=Ogx9NXK1Nfw4ctZfp-slIL81ziDX3f4DZ01OkVNY5Tw,699 +django/contrib/redirects/locale/kab/LC_MESSAGES/django.po,sha256=gI6aUPkXH-XzKrStDsMCMNfQKDEc-D1ffqE-Z-ItQuI,1001 +django/contrib/redirects/locale/kk/LC_MESSAGES/django.mo,sha256=KVLc6PKL1MP_Px0LmpoW2lIvgLiSzlvoJ9062F-s3Zw,1261 +django/contrib/redirects/locale/kk/LC_MESSAGES/django.po,sha256=Xoy4mnOT51F_GS1oIO91EAuwt-ZfePKh-sutedo6D_g,1478 +django/contrib/redirects/locale/km/LC_MESSAGES/django.mo,sha256=tcW1s7jvTG0cagtdRNT0jSNkhX-B903LKl7bK31ZvJU,1248 +django/contrib/redirects/locale/km/LC_MESSAGES/django.po,sha256=KJ4h1umpfFLdsWZtsfXoeOl6cUPUD97U4ISWt80UZ2U,1437 +django/contrib/redirects/locale/kn/LC_MESSAGES/django.mo,sha256=24GHcQlEoCDri-98eLtqLbGjtJz9cTPAfYdAijsL5ck,788 +django/contrib/redirects/locale/kn/LC_MESSAGES/django.po,sha256=xkH24itr2fpuCQMGQ3xssOqaN_7KzM-GLy0u00ti27I,1245 +django/contrib/redirects/locale/ko/LC_MESSAGES/django.mo,sha256=_m-8YdcKaUqQ-O-ioyJqlvD3d4pT9KEES-_U5v32tVo,1152 +django/contrib/redirects/locale/ko/LC_MESSAGES/django.po,sha256=6m_YYMBCPXdKzk0mN4MdHzroU78uDRp70B67qMu0Ew8,1564 +django/contrib/redirects/locale/ky/LC_MESSAGES/django.mo,sha256=4jX_g-hledmjWEx0RvY99G5QcBj_mQt_HZzpd000J44,1265 +django/contrib/redirects/locale/ky/LC_MESSAGES/django.po,sha256=yvx21nxsqqVzPyyxX9_rF-oeaY2WszXrG4ZDSZTW6-4,1522 +django/contrib/redirects/locale/lb/LC_MESSAGES/django.mo,sha256=xokesKl7h7k9dXFKIJwGETgwx1Ytq6mk2erBSxkgY-o,474 +django/contrib/redirects/locale/lb/LC_MESSAGES/django.po,sha256=Hv1CF9CC78YuVVNpklDtPJDU5-iIUeuXcljewmc9akg,946 +django/contrib/redirects/locale/lt/LC_MESSAGES/django.mo,sha256=reiFMXJnvE4XUosbKjyvUFzl4IKjlJoFK1gVJE9Tbnc,1191 +django/contrib/redirects/locale/lt/LC_MESSAGES/django.po,sha256=G56UIYuuVLgwzHCIj_suHNYPe1z76Y_cauWfGEs4nKI,1448 +django/contrib/redirects/locale/lv/LC_MESSAGES/django.mo,sha256=slGK6O2tYD5yciS8m_7h2WA4LOPf05nQ4oTRKB63etE,1175 +django/contrib/redirects/locale/lv/LC_MESSAGES/django.po,sha256=GUDn1IYQ5UMOQUBvGfuVOeVb-bpf5FHVigqTt_N0I0M,1442 +django/contrib/redirects/locale/mk/LC_MESSAGES/django.mo,sha256=3XGgf2K60LclScPKcgw07TId6x535AW5jtGVJ9lC01A,1353 +django/contrib/redirects/locale/mk/LC_MESSAGES/django.po,sha256=Smsdpid5VByoxvnfzju_XOlp6aTPl8qshFptot3cRYM,1596 +django/contrib/redirects/locale/ml/LC_MESSAGES/django.mo,sha256=IhSkvbgX9xfE4GypOQ7W7SDM-wOOqx1xgSTW7L1JofU,1573 +django/contrib/redirects/locale/ml/LC_MESSAGES/django.po,sha256=9KpXf88GRUB5I51Rj3q9qhvhjHFINuiJ9ig0SZdYE6k,1755 +django/contrib/redirects/locale/mn/LC_MESSAGES/django.mo,sha256=14fdHC_hZrRaA0EAFzBJy8BHj4jMMX6l2e6rLLBtJ8E,1274 +django/contrib/redirects/locale/mn/LC_MESSAGES/django.po,sha256=7_QzUWf5l0P-7gM35p9UW7bOj33NabQq_zSrekUeZsY,1502 +django/contrib/redirects/locale/mr/LC_MESSAGES/django.mo,sha256=KWFQR7X6niKMWIqY93sKtS6o41hsG4pEGLhXwC6MmDI,1530 +django/contrib/redirects/locale/mr/LC_MESSAGES/django.po,sha256=UZp4529Fm4US-Yi5eOlT6Ja7S_s1pc73LqNwEvaxXGw,1687 +django/contrib/redirects/locale/ms/LC_MESSAGES/django.mo,sha256=WUk6hvvHPWuylCGiDvy0MstWoQ1mdmwwfqlms1Nv4Ng,1094 +django/contrib/redirects/locale/ms/LC_MESSAGES/django.po,sha256=bsQDwxqtS5FgPCqTrfm9kw2hH_R2y44DnI5nluUgduc,1255 +django/contrib/redirects/locale/my/LC_MESSAGES/django.mo,sha256=H5-y9A3_1yIXJzC4sSuHqhURxhOlnYEL8Nvc0IF4zUE,549 +django/contrib/redirects/locale/my/LC_MESSAGES/django.po,sha256=MZGNt0jMQA6aHA6OmjvaC_ajvRWfUfDiKkV0j3_E480,1052 +django/contrib/redirects/locale/nb/LC_MESSAGES/django.mo,sha256=pxRtj5VFxTQBbi_mDS05iGoQs4BZ4y6LLJZ9pozJezY,1110 +django/contrib/redirects/locale/nb/LC_MESSAGES/django.po,sha256=ALYXciVa0d0sG70dqjtk17Yh_qwzKAzTXDlEZSU9kc0,1392 +django/contrib/redirects/locale/ne/LC_MESSAGES/django.mo,sha256=TxTnBGIi5k0PKAjADeCuOAJQV5dtzLrsFRXBXtfszWI,1420 +django/contrib/redirects/locale/ne/LC_MESSAGES/django.po,sha256=5b5R-6AlSIQrDyTtcmquoW5xrQRGZwlxZpBpZfVo5t4,1607 +django/contrib/redirects/locale/nl/LC_MESSAGES/django.mo,sha256=Xeh1YbEAu7Lhz07RXPTMDyv7AyWF9Bhe-9oHdWT74mo,1129 +django/contrib/redirects/locale/nl/LC_MESSAGES/django.po,sha256=QuNgrX7w2wO15KPEe3ogVhXbkt0v60EwKmKfD7-PedU,1476 +django/contrib/redirects/locale/nn/LC_MESSAGES/django.mo,sha256=8TQXBF2mzENl7lFpcrsKxkJ4nKySTOgXJM5_I2OD7q8,1143 +django/contrib/redirects/locale/nn/LC_MESSAGES/django.po,sha256=pfrKVQd1wLKKpq-b7CBpc-rZnEEgyZFDSjbipsEiwxM,1344 +django/contrib/redirects/locale/os/LC_MESSAGES/django.mo,sha256=joQ-ibV9_6ctGMNPLZQLCx5fUamRQngs6_LDd_s9sMQ,1150 +django/contrib/redirects/locale/os/LC_MESSAGES/django.po,sha256=ZwFWiuGS9comy7r2kMnKuqaPOvVehVdAAuFvXM5ldxM,1358 +django/contrib/redirects/locale/pa/LC_MESSAGES/django.mo,sha256=MY-OIDNXlZth-ZRoOJ52nlUPg_51_F5k0NBIpc7GZEw,748 +django/contrib/redirects/locale/pa/LC_MESSAGES/django.po,sha256=TPDTK2ZvDyvO1ob8Qfr64QDbHVWAREfEeBO5w9jf63E,1199 +django/contrib/redirects/locale/pl/LC_MESSAGES/django.mo,sha256=9Sc_8aDC8-PADnr4hYdat6iRUXj0QxsWR1RGWKIQP3M,1285 +django/contrib/redirects/locale/pl/LC_MESSAGES/django.po,sha256=RLuSAlWQPvxDGSNHL3j5ohMdf4IZL-g21-_QIuTdY4c,1605 +django/contrib/redirects/locale/pt/LC_MESSAGES/django.mo,sha256=WocPaVk3fQEz_MLmGVtFBGwsThD-gNU7GDocqEbeaBA,1129 +django/contrib/redirects/locale/pt/LC_MESSAGES/django.po,sha256=ptCzoE41c9uFAbgSjb6VHSFYPEUv_51YyBdoThXN3XA,1350 +django/contrib/redirects/locale/pt_BR/LC_MESSAGES/django.mo,sha256=adnRlAeOrULZkdpZGhHbb4D5A-hzJxeYlkfcbarx7pE,1224 +django/contrib/redirects/locale/pt_BR/LC_MESSAGES/django.po,sha256=DLTeZs_Xng3j8bveJizEIBLBjd4lJH_a-TzZxJgtu20,1703 +django/contrib/redirects/locale/ro/LC_MESSAGES/django.mo,sha256=D8FkmV6IxZOn5QAPBu9PwhStBpVQWudU62wKa7ADfJY,1158 +django/contrib/redirects/locale/ro/LC_MESSAGES/django.po,sha256=Z_-pDi2-A7_KXrEQtFlAJ_KLO0vXFKCbMphsNlqfNJk,1477 +django/contrib/redirects/locale/ru/LC_MESSAGES/django.mo,sha256=IvO0IXq1xuX0wpo2hV8po1AMifLS3ElGyQal0vmC_Jw,1457 +django/contrib/redirects/locale/ru/LC_MESSAGES/django.po,sha256=FHb4L3RMVV5ajxGj9y6ZymPtO_XjZrhHmvCZBPwwzmQ,1762 +django/contrib/redirects/locale/sk/LC_MESSAGES/django.mo,sha256=TTgi-SVyS9nbBCsI6NPbg-QA-GMc_-ciYewOUHDb1bM,1222 +django/contrib/redirects/locale/sk/LC_MESSAGES/django.po,sha256=yDuSGdVfHhsorxQNQ6S7ocyJfrI07pcLzyhkvXNCZXk,1506 +django/contrib/redirects/locale/sl/LC_MESSAGES/django.mo,sha256=GAZtOFSUxsOHdXs3AzT40D-3JFWIlNDZU_Z-cMvdaHo,1173 +django/contrib/redirects/locale/sl/LC_MESSAGES/django.po,sha256=gkZTyxNh8L2gNxyLVzm-M1HTiK8KDvughTa2MK9NzWo,1351 +django/contrib/redirects/locale/sq/LC_MESSAGES/django.mo,sha256=f2HyVjWFGnjNXV-EIk0YMFaMH6_ZwYLYgSDwU4fIJfM,1165 +django/contrib/redirects/locale/sq/LC_MESSAGES/django.po,sha256=gbd4JxoevGfDTRx3iYfDtlnh54EwyRKYXxs4XagHvRM,1453 +django/contrib/redirects/locale/sr/LC_MESSAGES/django.mo,sha256=OK90avxrpYxBcvPIZ_tDlSZP6PyRCzFg_7h0F_JlMy8,1367 +django/contrib/redirects/locale/sr/LC_MESSAGES/django.po,sha256=Ipi7j7q5N8aNGWmkz5XGlOPqpD46xCLKarfs-lNbKqM,1629 +django/contrib/redirects/locale/sr_Latn/LC_MESSAGES/django.mo,sha256=qYXT0j80c7a5jMsxeezncAL9Gff2Pb7eJz8iTX0TRX4,1210 +django/contrib/redirects/locale/sr_Latn/LC_MESSAGES/django.po,sha256=CL3ij3uGK8UOMggLXf0MctEydLbyi-9zvkXN5Teuu9c,1424 +django/contrib/redirects/locale/sv/LC_MESSAGES/django.mo,sha256=2j_IyOgbM_yED5lF10r7KGguEC2qX58dRIVogWj5PVY,1134 +django/contrib/redirects/locale/sv/LC_MESSAGES/django.po,sha256=lIFNLfEondtzlwlG3tDf3AH59uEotLtj-XdL87c-QUo,1404 +django/contrib/redirects/locale/sw/LC_MESSAGES/django.mo,sha256=qQjxB8Z6uKoNOa3wI6aDiAYLpWhx7z2yI7nEbXtMOXc,1165 +django/contrib/redirects/locale/sw/LC_MESSAGES/django.po,sha256=rAAmAwjvy69tVeB-QeccIS8CMA96XLeWdfRwDy3_QA0,1385 +django/contrib/redirects/locale/ta/LC_MESSAGES/django.mo,sha256=AE6Py2_CV2gQKjKQAa_UgkLT9i61x3i1hegQpRGuZZM,1502 +django/contrib/redirects/locale/ta/LC_MESSAGES/django.po,sha256=ojdq8p4HnwtK0n6By2I6_xuucOpJIobJEGRMGc_TrS8,1700 +django/contrib/redirects/locale/te/LC_MESSAGES/django.mo,sha256=Gtcs4cbgrD7-bSkPKiPbM5DcjONS2fSdHhvWdbs_E1M,467 +django/contrib/redirects/locale/te/LC_MESSAGES/django.po,sha256=RT-t3TjcOLyNQQWljVrIcPWErKssh_HQMyGujloy-EI,939 +django/contrib/redirects/locale/tg/LC_MESSAGES/django.mo,sha256=6e4Pk9vX1csvSz80spVLhNTd3N251JrXaCga9n60AP8,782 +django/contrib/redirects/locale/tg/LC_MESSAGES/django.po,sha256=2Cmle5usoNZBo8nTfAiqCRq3KqN1WKKdc-mogUOJm9I,1177 +django/contrib/redirects/locale/th/LC_MESSAGES/django.mo,sha256=1l6eO0k1KjcmuRJKUS4ZdtJGhAUmUDMAMIeNwEobQqY,1331 +django/contrib/redirects/locale/th/LC_MESSAGES/django.po,sha256=DVVqpGC6zL8Hy8e6P8ZkhKbvcMJmXV5euLxmfoTCtms,1513 +django/contrib/redirects/locale/tk/LC_MESSAGES/django.mo,sha256=NkxO6C7s1HHT1Jrmwad9zaD3pPyW_sPuZz3F2AGUD7M,1155 +django/contrib/redirects/locale/tk/LC_MESSAGES/django.po,sha256=0EQj1I1oNbAovKmF7o2rQ8_QsQiYqEFDab2KlCFw0s0,1373 +django/contrib/redirects/locale/tr/LC_MESSAGES/django.mo,sha256=-qySxKYwxfFO79cBytvzTBeFGdio1wJlM5DeBBfdxns,1133 +django/contrib/redirects/locale/tr/LC_MESSAGES/django.po,sha256=-03z3YMI6tlt12xwFI2lWchOxiIVbkdVRhghaCoMKlk,1408 +django/contrib/redirects/locale/tt/LC_MESSAGES/django.mo,sha256=Hf1JXcCGNwedxy1nVRM_pQ0yUebC-tvOXr7P0h86JyI,1178 +django/contrib/redirects/locale/tt/LC_MESSAGES/django.po,sha256=2WCyBQtqZk-8GXgtu-x94JYSNrryy2QoMnirhiBrgV0,1376 +django/contrib/redirects/locale/udm/LC_MESSAGES/django.mo,sha256=CNmoKj9Uc0qEInnV5t0Nt4ZnKSZCRdIG5fyfSsqwky4,462 +django/contrib/redirects/locale/udm/LC_MESSAGES/django.po,sha256=xsxlm4itpyLlLdPQRIHLuvTYRvruhM3Ezc9jtp3XSm4,934 +django/contrib/redirects/locale/ug/LC_MESSAGES/django.mo,sha256=qV4UXMJUeNM2vw0LWn-YR9TDn1sQVvnEUcXh7_AX3Jo,1409 +django/contrib/redirects/locale/ug/LC_MESSAGES/django.po,sha256=dilTTU3q5BCYiUIgpjncD3ijPaQgp1l73poSrsZiUUc,1633 +django/contrib/redirects/locale/uk/LC_MESSAGES/django.mo,sha256=QbN1ABfbr2YbZQXz2U4DI-6iTvWoKPrLAn5tGq57G5Y,1569 +django/contrib/redirects/locale/uk/LC_MESSAGES/django.po,sha256=pH9M4ilsJneoHw6E1E3T54QCHGS_i4tlhDc0nbAJP8I,1949 +django/contrib/redirects/locale/ur/LC_MESSAGES/django.mo,sha256=CQkt-yxyAaTd_Aj1ZZC8s5-4fI2TRyTEZ-SYJZgpRrQ,1138 +django/contrib/redirects/locale/ur/LC_MESSAGES/django.po,sha256=CkhmN49PvYTccvlSRu8qGpcbx2C-1aY7K3Lq1VC2fuM,1330 +django/contrib/redirects/locale/uz/LC_MESSAGES/django.mo,sha256=vD0Y920SSsRsLROKFaU6YM8CT5KjQxJcgMh5bZ4Pugo,743 +django/contrib/redirects/locale/uz/LC_MESSAGES/django.po,sha256=G2Rj-6g8Vse2Bp8L_hGIO84S--akagMXj8gSa7F2lK4,1195 +django/contrib/redirects/locale/vi/LC_MESSAGES/django.mo,sha256=BquXycJKh-7-D9p-rGUNnjqzs1d6S1YhEJjFW8_ARFA,1106 +django/contrib/redirects/locale/vi/LC_MESSAGES/django.po,sha256=xsCASrGZNbQk4d1mhsTZBcCpPJ0KO6Jr4Zz1wfnL67s,1301 +django/contrib/redirects/locale/zh_Hans/LC_MESSAGES/django.mo,sha256=iftb_HccNV383_odHbB6Tikn2h7EtP_9QK-Plq2xwTY,1100 +django/contrib/redirects/locale/zh_Hans/LC_MESSAGES/django.po,sha256=xZmfuCEYx7ou_qvtxBcBly5mBmkSBEhnx0xqJj3nvMw,1490 +django/contrib/redirects/locale/zh_Hant/LC_MESSAGES/django.mo,sha256=Dj3gCstbzcxZyR6iL-U_ridpKcyDI8UIAohw8Rq82bM,1108 +django/contrib/redirects/locale/zh_Hant/LC_MESSAGES/django.po,sha256=UvNH_gQtAhWqN-d3qGOB3nuqrKqFhxjIGu09WsZ7_oQ,1413 +django/contrib/redirects/middleware.py,sha256=ydqidqi5JTaoguEFQBRzLEkU3HeiohgVsFglHUE-HIU,1921 +django/contrib/redirects/migrations/0001_initial.py,sha256=0mXB5TgK_fwYbmbB_e7tKSjgOvpHWnZXg0IFcVtnmfU,2101 +django/contrib/redirects/migrations/0002_alter_redirect_new_path_help_text.py,sha256=RXPdSbYewnW1bjjXxNqUIL-qIeSxdBUehBp0BjfRl8o,635 +django/contrib/redirects/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/contrib/redirects/migrations/__pycache__/0001_initial.cpython-312.pyc,, +django/contrib/redirects/migrations/__pycache__/0002_alter_redirect_new_path_help_text.cpython-312.pyc,, +django/contrib/redirects/migrations/__pycache__/__init__.cpython-312.pyc,, +django/contrib/redirects/models.py,sha256=KJ6mj0BS243BNPKp26K7OSqcT9j49FPth5m0gNWWxFM,1083 +django/contrib/sessions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/contrib/sessions/__pycache__/__init__.cpython-312.pyc,, +django/contrib/sessions/__pycache__/apps.cpython-312.pyc,, +django/contrib/sessions/__pycache__/base_session.cpython-312.pyc,, +django/contrib/sessions/__pycache__/exceptions.cpython-312.pyc,, +django/contrib/sessions/__pycache__/middleware.cpython-312.pyc,, +django/contrib/sessions/__pycache__/models.cpython-312.pyc,, +django/contrib/sessions/__pycache__/serializers.cpython-312.pyc,, +django/contrib/sessions/apps.py,sha256=5WIMqa3ymqEvYMnFHe3uWZB8XSijUF_NSgaorRD50Lg,194 +django/contrib/sessions/backends/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/contrib/sessions/backends/__pycache__/__init__.cpython-312.pyc,, +django/contrib/sessions/backends/__pycache__/base.cpython-312.pyc,, +django/contrib/sessions/backends/__pycache__/cache.cpython-312.pyc,, +django/contrib/sessions/backends/__pycache__/cached_db.cpython-312.pyc,, +django/contrib/sessions/backends/__pycache__/db.cpython-312.pyc,, +django/contrib/sessions/backends/__pycache__/file.cpython-312.pyc,, +django/contrib/sessions/backends/__pycache__/signed_cookies.cpython-312.pyc,, +django/contrib/sessions/backends/base.py,sha256=uw4jDJHvBQLI1XJCru-_fYZ2Pzfz1U-iiN8sJxNNaVs,16958 +django/contrib/sessions/backends/cache.py,sha256=m9WMB8we8T1j0k9rHP9_7nBuGzDVap3rGMjoM7N5Xe4,4674 +django/contrib/sessions/backends/cached_db.py,sha256=m348hgYLr-rl760T-Yxm2FJmQ6vbI-nZ2vi5QhIybCI,4148 +django/contrib/sessions/backends/db.py,sha256=qoFg94ju0_KtsPUgFCiKAvxbMOXc1YdGAfjktn00nyA,6907 +django/contrib/sessions/backends/file.py,sha256=FtK6zcbQGwLxtINvqTRHNovLHTDuyk61Y7zwNndSUyg,8200 +django/contrib/sessions/backends/signed_cookies.py,sha256=Al_HQ7OnDs77U9AgTcjN5VUVst5dTP-ZUbhuj6Bgsk0,3218 +django/contrib/sessions/base_session.py,sha256=euTO04sxDEk0lovU38a2TLYXJBA-g6nze9asqK2PoNU,1491 +django/contrib/sessions/exceptions.py,sha256=KhkhXiFwfUflSP_t6wCLOEXz1YjBRTKVNbrLmGhOTLo,359 +django/contrib/sessions/locale/af/LC_MESSAGES/django.mo,sha256=0DS0pgVrMN-bUimDfesgHs8Lgr0loz2c6nJdz58RxyQ,717 +django/contrib/sessions/locale/af/LC_MESSAGES/django.po,sha256=ZJRLBshQCAiTTAUycdB3MZIadLeHR5LxbSlDvSWLnEo,838 +django/contrib/sessions/locale/ar/LC_MESSAGES/django.mo,sha256=yoepqaR68PTGLx--cAOzP94Sqyl5xIYpeQ0IFWgY380,846 +django/contrib/sessions/locale/ar/LC_MESSAGES/django.po,sha256=ZgwtBYIdtnqp_8nKHXF1NVJFzQU81-3yv9b7STrQHMc,995 +django/contrib/sessions/locale/ar_DZ/LC_MESSAGES/django.mo,sha256=_iSasR22CxvNWfei6aE_24woPhhhvNzQl5FUO_649dc,817 +django/contrib/sessions/locale/ar_DZ/LC_MESSAGES/django.po,sha256=vop5scstamgFSnO_FWXCEnI7R1N26t7jy_mZUAfETcY,978 +django/contrib/sessions/locale/ast/LC_MESSAGES/django.mo,sha256=hz2m-PkrHby2CKfIOARj6kCzisT-Vs0syfDSTx_iVVw,702 +django/contrib/sessions/locale/ast/LC_MESSAGES/django.po,sha256=M90j1Nx6oDJ16hguUkfKYlyb5OymUeZ5xzPixWxSC7I,846 +django/contrib/sessions/locale/az/LC_MESSAGES/django.mo,sha256=_4XcYdtRasbCjRoaWGoULsXX2cEa--KdRdqbnGoaRuM,731 +django/contrib/sessions/locale/az/LC_MESSAGES/django.po,sha256=qYd7vz6A-hHQNwewzI6wEsxRVLdoc2xLGm1RPW0Hxc4,891 +django/contrib/sessions/locale/be/LC_MESSAGES/django.mo,sha256=FHZ72QuOd-vAOjOXisLs4CaEk7uZuzjO_EfUSB6754M,854 +django/contrib/sessions/locale/be/LC_MESSAGES/django.po,sha256=tHsYVn3XNTcukB0SrHUWP1iV763rrQHCimOyJHRPiek,1023 +django/contrib/sessions/locale/bg/LC_MESSAGES/django.mo,sha256=fFZ8EgRlJ1Z-IP8gPtsUXAnqVHbqQRZpYv6PLWNlNVA,759 +django/contrib/sessions/locale/bg/LC_MESSAGES/django.po,sha256=tXcaDPNmFIv0RU-7sGscRkLCbKEgTBowzVj3AYymarY,997 +django/contrib/sessions/locale/bn/LC_MESSAGES/django.mo,sha256=0BdFN7ou9tmoVG00fCA-frb1Tri3iKz43W7SWal398s,762 +django/contrib/sessions/locale/bn/LC_MESSAGES/django.po,sha256=LycmTel6LXV2HGGN6qzlAfID-cVEQCNnW1Nv_hbWXJk,909 +django/contrib/sessions/locale/br/LC_MESSAGES/django.mo,sha256=6ubPQUyXX08KUssyVZBMMkTlD94mlA6wzsteAMiZ8C8,1027 +django/contrib/sessions/locale/br/LC_MESSAGES/django.po,sha256=LKxGGHOQejKpUp18rCU2FXW8D_H3WuP_P6dPlEluwcE,1201 +django/contrib/sessions/locale/bs/LC_MESSAGES/django.mo,sha256=M7TvlJMrSUAFhp7oUSpUKejnbTuIK-19yiGBBECl9Sc,759 +django/contrib/sessions/locale/bs/LC_MESSAGES/django.po,sha256=Ur0AeRjXUsLgDJhcGiw75hRk4Qe98DzPBOocD7GFDRQ,909 +django/contrib/sessions/locale/ca/LC_MESSAGES/django.mo,sha256=tbaZ48PaihGGD9-2oTKiMFY3kbXjU59nNciCRINOBNk,738 +django/contrib/sessions/locale/ca/LC_MESSAGES/django.po,sha256=tJuJdehKuD9aXOauWOkE5idQhsVsLbeg1Usmc6N_SP0,906 +django/contrib/sessions/locale/ckb/LC_MESSAGES/django.mo,sha256=qTCUlxmStU9w1nXRAc_gRodaN6ojJK_XAxDXoYC5vQI,741 +django/contrib/sessions/locale/ckb/LC_MESSAGES/django.po,sha256=F2bHLL66fWF5_VTM5QvNUFakY7gPRDr1qCjW6AkYxec,905 +django/contrib/sessions/locale/cs/LC_MESSAGES/django.mo,sha256=wEFP4NNaRQDbcbw96UC906jN4rOrlPJMn60VloXr944,759 +django/contrib/sessions/locale/cs/LC_MESSAGES/django.po,sha256=7XkKESwfOmbDRDbUYr1f62-fDOuyI-aCqLGaEiDrmX8,962 +django/contrib/sessions/locale/cy/LC_MESSAGES/django.mo,sha256=GeWVeV2PvgLQV8ecVUA2g3-VvdzMsedgIDUSpn8DByk,774 +django/contrib/sessions/locale/cy/LC_MESSAGES/django.po,sha256=zo18MXtkEdO1L0Q6ewFurx3lsEWTCdh0JpQJTmvw5bY,952 +django/contrib/sessions/locale/da/LC_MESSAGES/django.mo,sha256=7_YecCzfeYQp9zVYt2B7MtjhAAuVb0BcK2D5Qv_uAbg,681 +django/contrib/sessions/locale/da/LC_MESSAGES/django.po,sha256=qX_Oo7niVo57bazlIYFA6bnVmPBclUUTWvZFYNLaG04,880 +django/contrib/sessions/locale/de/LC_MESSAGES/django.mo,sha256=N3kTal0YK9z7Te3zYGLbJmoSB6oWaviWDLGdPlsPa9g,721 +django/contrib/sessions/locale/de/LC_MESSAGES/django.po,sha256=0qnfDeCUQN2buKn6R0MvwhQP05XWxSu-xgvfxvnJe3k,844 +django/contrib/sessions/locale/dsb/LC_MESSAGES/django.mo,sha256=RABl3WZmY6gLh4IqmTUhoBEXygDzjp_5lLF1MU9U5fA,810 +django/contrib/sessions/locale/dsb/LC_MESSAGES/django.po,sha256=cItKs5tASYHzDxfTg0A_dgBQounpzoGyOEFn18E_W_g,934 +django/contrib/sessions/locale/el/LC_MESSAGES/django.mo,sha256=QbTbmcfgc8_4r5hFrIghDhk2XQ4f8_emKmqupMG2ah0,809 +django/contrib/sessions/locale/el/LC_MESSAGES/django.po,sha256=HeaEbpVmFhhrZt2NsZteYaYoeo8FYKZF0IoNJwtzZkc,971 +django/contrib/sessions/locale/en/LC_MESSAGES/django.mo,sha256=U0OV81NfbuNL9ctF-gbGUG5al1StqN-daB-F-gFBFC8,356 +django/contrib/sessions/locale/en/LC_MESSAGES/django.po,sha256=afaM-IIUZtcRZduojUTS8tT0w7C4Ya9lXgReOvq_iF0,804 +django/contrib/sessions/locale/en_AU/LC_MESSAGES/django.mo,sha256=FgY1K6IVyQjMjXqVZxcsyWW_Tu5ckfrbmIfNYq5P-_E,693 +django/contrib/sessions/locale/en_AU/LC_MESSAGES/django.po,sha256=cMV15gJq8jNSUzkhn7uyOf2JYMFx7BNH1oFYa1vISnc,853 +django/contrib/sessions/locale/en_GB/LC_MESSAGES/django.mo,sha256=T5NQCTYkpERfP9yKbUvixT0VdBt1zGmGB8ITlkVc420,707 +django/contrib/sessions/locale/en_GB/LC_MESSAGES/django.po,sha256=1ks_VE1qpEfPcyKg0HybkTG0-DTttTHTfUPhQCR53sw,849 +django/contrib/sessions/locale/eo/LC_MESSAGES/django.mo,sha256=eBvYQbZS_WxVV3QCSZAOyHNIljC2ZXxVc4mktUuXVjI,727 +django/contrib/sessions/locale/eo/LC_MESSAGES/django.po,sha256=Ru9xicyTgHWVHh26hO2nQNFRQmwBnYKEagsS8TZRv3E,917 +django/contrib/sessions/locale/es/LC_MESSAGES/django.mo,sha256=jbHSvHjO2OCLlBD66LefocKOEbefWbPhj-l3NugiWuc,734 +django/contrib/sessions/locale/es/LC_MESSAGES/django.po,sha256=fY5WXeONEXHeuBlH0LkvzdZ2CSgbvLZ8BJc429aIbhI,909 +django/contrib/sessions/locale/es_AR/LC_MESSAGES/django.mo,sha256=_8icF2dMUWj4WW967rc5npgndXBAdJrIiz_VKf5D-Rw,694 +django/contrib/sessions/locale/es_AR/LC_MESSAGES/django.po,sha256=AnmvjeOA7EBTJ6wMOkCl8JRLVYRU8KS0egPijcKutns,879 +django/contrib/sessions/locale/es_CO/LC_MESSAGES/django.mo,sha256=UP7ia0gV9W-l0Qq5AS4ZPadJtml8iuzzlS5C9guMgh8,754 +django/contrib/sessions/locale/es_CO/LC_MESSAGES/django.po,sha256=_XeiiRWvDaGjofamsRHr5up_EQvcw0w-GLLeWK27Af8,878 +django/contrib/sessions/locale/es_MX/LC_MESSAGES/django.mo,sha256=MDM0K3xMvyf8ymvAurHYuacpxfG_YfJFyNnp1uuc6yY,756 +django/contrib/sessions/locale/es_MX/LC_MESSAGES/django.po,sha256=Y7VNa16F_yyK7_XJvF36rR2XNW8aBJK4UDweufyXpxE,892 +django/contrib/sessions/locale/es_VE/LC_MESSAGES/django.mo,sha256=59fZBDut-htCj38ZUoqPjhXJPjZBz-xpU9__QFr3kLs,486 +django/contrib/sessions/locale/es_VE/LC_MESSAGES/django.po,sha256=zWjgB0AmsmhX2tjk1PgldttqY56Czz8epOVCaYWXTLU,761 +django/contrib/sessions/locale/et/LC_MESSAGES/django.mo,sha256=aL1jZWourEC7jtjsuBZHD-Gw9lpL6L1SoqjTtzguxD0,737 +django/contrib/sessions/locale/et/LC_MESSAGES/django.po,sha256=VNBYohAOs59jYWkjVMY-v2zwVy5AKrtBbFRJZLwdCFg,899 +django/contrib/sessions/locale/eu/LC_MESSAGES/django.mo,sha256=M9piOB_t-ZnfN6pX-jeY0yWh2S_5cCuo1oGiy7X65A4,728 +django/contrib/sessions/locale/eu/LC_MESSAGES/django.po,sha256=bHdSoknoH0_dy26e93tWVdO4TT7rnCPXlSLPsYAhwyw,893 +django/contrib/sessions/locale/fa/LC_MESSAGES/django.mo,sha256=6DdJcqaYuBnhpFFHR42w-RqML0eQPFMAUEEDY0Redy8,755 +django/contrib/sessions/locale/fa/LC_MESSAGES/django.po,sha256=rklhNf0UFl2bM6mt7x9lWvfzPH4XWGbrW9Gc2w-9rzg,922 +django/contrib/sessions/locale/fi/LC_MESSAGES/django.mo,sha256=oAugvlTEvJmG8KsZw09WcfnifYY5oHnGo4lxcxqKeaY,721 +django/contrib/sessions/locale/fi/LC_MESSAGES/django.po,sha256=BVVrjbZZtLGAuZ9HK63p769CbjZFZMlS4BewSMfNMKU,889 +django/contrib/sessions/locale/fr/LC_MESSAGES/django.mo,sha256=aDGYdzx2eInF6IZ-UzPDEJkuYVPnvwVND3qVuSfJNWw,692 +django/contrib/sessions/locale/fr/LC_MESSAGES/django.po,sha256=hARxGdtBOzEZ_iVyzkNvcKlgyM8fOkdXTH3upj2XFYM,893 +django/contrib/sessions/locale/fy/LC_MESSAGES/django.mo,sha256=YQQy7wpjBORD9Isd-p0lLzYrUgAqv770_56-vXa0EOc,476 +django/contrib/sessions/locale/fy/LC_MESSAGES/django.po,sha256=U-VEY4WbmIkmrnPK4Mv-B-pbdtDzusBCVmE8iHyvzFU,751 +django/contrib/sessions/locale/ga/LC_MESSAGES/django.mo,sha256=zTrydRCRDiUQwF4tQ3cN1-5w36i6KptagsdA5_SaGy0,747 +django/contrib/sessions/locale/ga/LC_MESSAGES/django.po,sha256=Qpk1JaUWiHSEPdgBk-O_KfvGzwlZ4IAA6c6-nsJe400,958 +django/contrib/sessions/locale/gd/LC_MESSAGES/django.mo,sha256=Yi8blY_fUD5YTlnUD6YXZvv1qjm4QDriO6CJIUe1wIk,791 +django/contrib/sessions/locale/gd/LC_MESSAGES/django.po,sha256=fEa40AUqA5vh743Zqv0FO2WxSFXGYk4IzUR4BoaP-C4,890 +django/contrib/sessions/locale/gl/LC_MESSAGES/django.mo,sha256=lC8uu-mKxt48DLzRvaxz-mOqR0ZfvEuaBI1Hi_nuMpo,692 +django/contrib/sessions/locale/gl/LC_MESSAGES/django.po,sha256=L34leIfwmRJoqX0jfefbNHz0CmON5cSaRXeh7pmFqCY,943 +django/contrib/sessions/locale/he/LC_MESSAGES/django.mo,sha256=qhgjSWfGAOgl-i7iwzSrJttx88xcj1pB0iLkEK64mJU,809 +django/contrib/sessions/locale/he/LC_MESSAGES/django.po,sha256=KvQG6wOpokM-2JkhWnB2UUQacy5Ie1402K_pH2zUOu0,1066 +django/contrib/sessions/locale/hi/LC_MESSAGES/django.mo,sha256=naqxOjfAnNKy3qqnUG-4LGf9arLRJpjyWWmSj5tEfao,759 +django/contrib/sessions/locale/hi/LC_MESSAGES/django.po,sha256=WnTGvOz9YINMcUJg2BYCaHceZLKaTfsba_0AZtRNP38,951 +django/contrib/sessions/locale/hr/LC_MESSAGES/django.mo,sha256=axyJAmXmadpFxIhu8rroVD8NsGGadQemh9-_ZDo7L1U,819 +django/contrib/sessions/locale/hr/LC_MESSAGES/django.po,sha256=3G-qOYXBO-eMWWsa5LwTCW9M1oF0hlWgEz7hAK8hJqI,998 +django/contrib/sessions/locale/hsb/LC_MESSAGES/django.mo,sha256=_OXpOlCt4KU0i65Iw4LMjSsyn__E9wH20l9vDNBSEzw,805 +django/contrib/sessions/locale/hsb/LC_MESSAGES/django.po,sha256=yv3vX_UCDrdl07GQ79Mnytwgz2oTvySYOG9enzMpFJA,929 +django/contrib/sessions/locale/hu/LC_MESSAGES/django.mo,sha256=ik40LnsWkKYEUioJB9e11EX9XZ-qWMa-S7haxGhM-iI,727 +django/contrib/sessions/locale/hu/LC_MESSAGES/django.po,sha256=1-UWEEsFxRwmshP2x4pJbitWIGZ1YMeDDxnAX-XGNxc,884 +django/contrib/sessions/locale/hy/LC_MESSAGES/django.mo,sha256=x6VQWGdidRJFUJme-6jf1pcitktcQHQ7fhmw2UBej1Q,815 +django/contrib/sessions/locale/hy/LC_MESSAGES/django.po,sha256=eRMa3_A2Vx195mx2lvza1v-wcEcEeMrU63f0bgPPFjc,893 +django/contrib/sessions/locale/ia/LC_MESSAGES/django.mo,sha256=-o4aQPNJeqSDRSLqcKuYvJuKNBbFqDJDe3IzHgSgZeQ,744 +django/contrib/sessions/locale/ia/LC_MESSAGES/django.po,sha256=PULLDd3QOIU03kgradgQzT6IicoPhLPlUvFgRl-tGbA,869 +django/contrib/sessions/locale/id/LC_MESSAGES/django.mo,sha256=mOaIF0NGOO0-dt-nhHL-i3cfvt9-JKTbyUkFWPqDS9Y,705 +django/contrib/sessions/locale/id/LC_MESSAGES/django.po,sha256=EA6AJno3CaFOO-dEU9VQ_GEI-RAXS0v0uFqn1RJGjEs,914 +django/contrib/sessions/locale/io/LC_MESSAGES/django.mo,sha256=_rqAY6reegqmxmWc-pW8_kDaG9zflZuD-PGOVFsjRHo,683 +django/contrib/sessions/locale/io/LC_MESSAGES/django.po,sha256=tbKMxGuB6mh_m0ex9rO9KkTy6qyuRW2ERrQsGwmPiaw,840 +django/contrib/sessions/locale/is/LC_MESSAGES/django.mo,sha256=3QeMl-MCnBie9Sc_aQ1I7BrBhkbuArpoSJP95UEs4lg,706 +django/contrib/sessions/locale/is/LC_MESSAGES/django.po,sha256=LADIFJv8L5vgDJxiQUmKPSN64zzzrIKImh8wpLBEVWQ,853 +django/contrib/sessions/locale/it/LC_MESSAGES/django.mo,sha256=qTY3O-0FbbpZ5-BR5xOJWP0rlnIkBZf-oSawW_YJWlk,726 +django/contrib/sessions/locale/it/LC_MESSAGES/django.po,sha256=hEv0iTGLuUvEBk-lF-w7a9P3ifC0-eiodNtuSc7cXhg,869 +django/contrib/sessions/locale/ja/LC_MESSAGES/django.mo,sha256=hbv9FzWzXRIGRh_Kf_FLQB34xfmPU_9RQKn9u1kJqGU,757 +django/contrib/sessions/locale/ja/LC_MESSAGES/django.po,sha256=ppGx5ekOWGgDF3vzyrWsqnFUZ-sVZZhiOhvAzl_8v54,920 +django/contrib/sessions/locale/ka/LC_MESSAGES/django.mo,sha256=VZ-ysrDbea_-tMV-1xtlTeW62IAy2RWR94V3Y1iSh4U,803 +django/contrib/sessions/locale/ka/LC_MESSAGES/django.po,sha256=hqiWUiATlrc7qISF7ndlelIrFwc61kzhKje9l-DY6V4,955 +django/contrib/sessions/locale/kab/LC_MESSAGES/django.mo,sha256=W_yE0NDPJrVznA2Qb89VuprJNwyxSg59ovvjkQe6mAs,743 +django/contrib/sessions/locale/kab/LC_MESSAGES/django.po,sha256=FJeEuv4P3NT_PpWHEUsQVSWXu65nYkJ6Z2AlbSKb0ZA,821 +django/contrib/sessions/locale/kk/LC_MESSAGES/django.mo,sha256=FROGz_MuIhsIU5_-EYV38cHnRZrc3-OxxkBeK0ax9Rk,810 +django/contrib/sessions/locale/kk/LC_MESSAGES/django.po,sha256=P-oHO3Oi3V_RjWHjEAHdTrDfTwKP2xh3yJh7BlXL1VQ,1029 +django/contrib/sessions/locale/km/LC_MESSAGES/django.mo,sha256=VOuKsIG2DEeCA5JdheuMIeJlpmAhKrI6lD4KWYqIIPk,929 +django/contrib/sessions/locale/km/LC_MESSAGES/django.po,sha256=09i6Nd_rUK7UqFpJ70LMXTR6xS0NuGETRLe0CopMVBk,1073 +django/contrib/sessions/locale/kn/LC_MESSAGES/django.mo,sha256=TMZ71RqNR6zI20BeozyLa9cjYrWlvfIajGDfpnHd3pQ,810 +django/contrib/sessions/locale/kn/LC_MESSAGES/django.po,sha256=whdM8P74jkAAHvjgJN8Q77dYd9sIsf_135ID8KBu-a8,990 +django/contrib/sessions/locale/ko/LC_MESSAGES/django.mo,sha256=MAgc0EkV0IrWjC6bSvKiyRlGXtgjhZF-ltTuyAFNDUk,653 +django/contrib/sessions/locale/ko/LC_MESSAGES/django.po,sha256=Fn9KkX9fEOKu2WjUYsP_xHEBbdoDeFHSoE096ctnFFc,874 +django/contrib/sessions/locale/ky/LC_MESSAGES/django.mo,sha256=ME7YUgKOYQz9FF_IdrqHImieEONDrkcn4T3HxTZKSV0,742 +django/contrib/sessions/locale/ky/LC_MESSAGES/django.po,sha256=JZHTs9wYmlWzilRMyp-jZWFSzGxWtPiQefPmLL9yhtM,915 +django/contrib/sessions/locale/lb/LC_MESSAGES/django.mo,sha256=xokesKl7h7k9dXFKIJwGETgwx1Ytq6mk2erBSxkgY-o,474 +django/contrib/sessions/locale/lb/LC_MESSAGES/django.po,sha256=3igeAnQjDg6D7ItBkQQhyBoFJOZlBxT7NoZiExwD-Fo,749 +django/contrib/sessions/locale/lt/LC_MESSAGES/django.mo,sha256=L9w8-qxlDlCqR_2P0PZegfhok_I61n0mJ1koJxzufy4,786 +django/contrib/sessions/locale/lt/LC_MESSAGES/django.po,sha256=dEefLGtg5flFr_v4vHS5HhK1kxx9WYWTw98cvEn132M,1023 +django/contrib/sessions/locale/lv/LC_MESSAGES/django.mo,sha256=exEzDUNwNS0GLsUkKPu_SfqBxU7T6VRA_T2schIQZ88,753 +django/contrib/sessions/locale/lv/LC_MESSAGES/django.po,sha256=fBgQEbsGg1ECVm1PFDrS2sfKs2eqmsqrSYzx9ELotNQ,909 +django/contrib/sessions/locale/mk/LC_MESSAGES/django.mo,sha256=4oTWp8-qzUQBiqG32hNieABgT3O17q2C4iEhcFtAxLA,816 +django/contrib/sessions/locale/mk/LC_MESSAGES/django.po,sha256=afApb5YRhPXUWR8yF_TTym73u0ov7lWiwRda1-uNiLY,988 +django/contrib/sessions/locale/ml/LC_MESSAGES/django.mo,sha256=tff5TsHILSV1kAAB3bzHQZDB9fgMglZJTofzCunGBzc,854 +django/contrib/sessions/locale/ml/LC_MESSAGES/django.po,sha256=eRkeupt42kUey_9vJmlH8USshnXPZ8M7aYHq88u-5iY,1016 +django/contrib/sessions/locale/mn/LC_MESSAGES/django.mo,sha256=CcCH2ggVYrD29Q11ZMthcscBno2ePkQDbZfoYquTRPM,784 +django/contrib/sessions/locale/mn/LC_MESSAGES/django.po,sha256=nvcjbJzXiDvWFXrM5CxgOQIq8XucsZEUVdYkY8LnCRE,992 +django/contrib/sessions/locale/mr/LC_MESSAGES/django.mo,sha256=rFOGgJ9q9AUlEV_XT-Sycs9eaDtD9so7ZNBTkI-E-Ew,768 +django/contrib/sessions/locale/mr/LC_MESSAGES/django.po,sha256=ZMojWauBzqXR7YSTJ5eAVAX4Xqbv6WEoYOpNL4GQaqU,907 +django/contrib/sessions/locale/ms/LC_MESSAGES/django.mo,sha256=rFi4D_ZURYUPjs5AqJ66bW70yL7AekAKWnrZRBvGPiE,649 +django/contrib/sessions/locale/ms/LC_MESSAGES/django.po,sha256=nZuJ_D0JZUzmGensLa7tSgzbBo05qgQcuHmte2oU6WQ,786 +django/contrib/sessions/locale/my/LC_MESSAGES/django.mo,sha256=8zzzyfJYok969YuAwDUaa6YhxaSi3wcXy3HRNXDb_70,872 +django/contrib/sessions/locale/my/LC_MESSAGES/django.po,sha256=mfs0zRBI0tugyyEfXBZzZ_FMIohydq6EYPZGra678pw,997 +django/contrib/sessions/locale/nb/LC_MESSAGES/django.mo,sha256=hfJ1NCFgcAAtUvNEpaZ9b31PyidHxDGicifUWANIbM8,717 +django/contrib/sessions/locale/nb/LC_MESSAGES/django.po,sha256=yXr6oYuiu01oELdQKuztQFWz8x5C2zS5OzEfU9MHJsU,908 +django/contrib/sessions/locale/ne/LC_MESSAGES/django.mo,sha256=slFgMrqGVtLRHdGorLGPpB09SM92_WnbnRR0rlpNlPQ,802 +django/contrib/sessions/locale/ne/LC_MESSAGES/django.po,sha256=1vyoiGnnaB8f9SFz8PGfzpw6V_NoL78DQwjjnB6fS98,978 +django/contrib/sessions/locale/nl/LC_MESSAGES/django.mo,sha256=84BTlTyxa409moKbQMFyJisI65w22p09qjJHBAmQe-g,692 +django/contrib/sessions/locale/nl/LC_MESSAGES/django.po,sha256=smRr-QPGm6h6hdXxghggWES8b2NnL7yDQ07coUypa8g,909 +django/contrib/sessions/locale/nn/LC_MESSAGES/django.mo,sha256=cytH72J3yS1PURcgyrD8R2PV5d3SbPE73IAqOMBPPVg,667 +django/contrib/sessions/locale/nn/LC_MESSAGES/django.po,sha256=y9l60yy_W3qjxWzxgJg5VgEH9KAIHIQb5hv7mgnep9w,851 +django/contrib/sessions/locale/os/LC_MESSAGES/django.mo,sha256=xVux1Ag45Jo9HQBbkrRzcWrNjqP09nMQl16jIh0YVlo,732 +django/contrib/sessions/locale/os/LC_MESSAGES/django.po,sha256=1hG5Vsz2a2yW05_Z9cTNrBKtK9VRPZuQdx4KJ_0n98o,892 +django/contrib/sessions/locale/pa/LC_MESSAGES/django.mo,sha256=qEx4r_ONwXK1-qYD5uxxXEQPqK5I6rf38QZoUSm7UVA,771 +django/contrib/sessions/locale/pa/LC_MESSAGES/django.po,sha256=M7fmVGP8DtZGEuTV3iJhuWWqILVUTDZvUey_mrP4_fM,918 +django/contrib/sessions/locale/pl/LC_MESSAGES/django.mo,sha256=F9CQb7gQ1ltP6B82JNKu8IAsTdHK5TNke0rtDIgNz3c,828 +django/contrib/sessions/locale/pl/LC_MESSAGES/django.po,sha256=C_MJBB-vwTZbx-t4-mzun-RxHhdOVv04b6xrWdnTv8E,1084 +django/contrib/sessions/locale/pt/LC_MESSAGES/django.mo,sha256=dlJF7hF4GjLmQPdAJhtf-FCKX26XsOmZlChOcxxIqPk,738 +django/contrib/sessions/locale/pt/LC_MESSAGES/django.po,sha256=cOycrw3HCHjSYBadpalyrg5LdRTlqZCTyMh93GOQ8O0,896 +django/contrib/sessions/locale/pt_BR/LC_MESSAGES/django.mo,sha256=XHNF5D8oXIia3e3LYwxd46a2JOgDc_ykvc8yuo21fT0,757 +django/contrib/sessions/locale/pt_BR/LC_MESSAGES/django.po,sha256=K_zxKaUKngWPFpvHgXOcymJEsiONSw-OrVrroRXmUUk,924 +django/contrib/sessions/locale/ro/LC_MESSAGES/django.mo,sha256=WR9I9Gum_pq7Qg2Gzhf-zAv43OwR_uDtsbhtx4Ta5gE,776 +django/contrib/sessions/locale/ro/LC_MESSAGES/django.po,sha256=fEgVxL_0Llnjspu9EsXBf8AVL0DGdfF7NgV88G7WN1E,987 +django/contrib/sessions/locale/ru/LC_MESSAGES/django.mo,sha256=n-8vXR5spEbdfyeWOYWC_6kBbAppNoRrWYgqKFY6gJA,913 +django/contrib/sessions/locale/ru/LC_MESSAGES/django.po,sha256=sNqNGdoof6eXzFlh4YIp1O54MdDOAFDjD3GvAFsNP8k,1101 +django/contrib/sessions/locale/sk/LC_MESSAGES/django.mo,sha256=Yntm624Wt410RwuNPU1c-WwQoyrRrBs69VlKMlNUHeQ,766 +django/contrib/sessions/locale/sk/LC_MESSAGES/django.po,sha256=wt7BJk6RpFogJ2Wwa9Mh0mJi9YMpNYKTUSDuDuv1Ong,975 +django/contrib/sessions/locale/sl/LC_MESSAGES/django.mo,sha256=EE6mB8BiYRyAxK6qzurRWcaYVs96FO_4rERYQdtIt3k,770 +django/contrib/sessions/locale/sl/LC_MESSAGES/django.po,sha256=KTjBWyvaNCHbpV9K6vbnavwxxXqf2DlIqVPv7MVFcO8,928 +django/contrib/sessions/locale/sq/LC_MESSAGES/django.mo,sha256=eRaTy3WOC76EYLtMSD4xtJj2h8eE4W-TS4VvCVxI5bw,683 +django/contrib/sessions/locale/sq/LC_MESSAGES/django.po,sha256=9pzp7834LQKafe5fJzC4OKsAd6XfgtEQl6K6hVLaBQM,844 +django/contrib/sessions/locale/sr/LC_MESSAGES/django.mo,sha256=ZDBOYmWIoSyDeT0nYIIFeMtW5jwpr257CbdTZlkVeRQ,855 +django/contrib/sessions/locale/sr/LC_MESSAGES/django.po,sha256=OXQOYeac0ghuzLrwaErJGr1FczuORTu2yroFX5hvRnk,1027 +django/contrib/sessions/locale/sr_Latn/LC_MESSAGES/django.mo,sha256=f3x9f9hTOsJltghjzJMdd8ueDwzxJex6zTXsU-_Hf_Y,757 +django/contrib/sessions/locale/sr_Latn/LC_MESSAGES/django.po,sha256=HKjo7hjSAvgrIvlI0SkgF3zxz8TtKWyBT51UGNhDwek,946 +django/contrib/sessions/locale/sv/LC_MESSAGES/django.mo,sha256=SGbr0K_5iAMA22MfseAldMDgLSEBrI56pCtyV8tMAPc,707 +django/contrib/sessions/locale/sv/LC_MESSAGES/django.po,sha256=vraY3915wBYGeYu9Ro0-TlBeLWqGZP1fbckLv8y47Ys,853 +django/contrib/sessions/locale/sw/LC_MESSAGES/django.mo,sha256=Edhqp8yuBnrGtJqPO7jxobeXN4uU5wKSLrOsFO1F23k,743 +django/contrib/sessions/locale/sw/LC_MESSAGES/django.po,sha256=iY4rN4T-AA2FBQA7DiWWFvrclqKiDYQefqwwVw61-f8,858 +django/contrib/sessions/locale/ta/LC_MESSAGES/django.mo,sha256=qLIThhFQbJKc1_UVr7wVIm1rJfK2rO5m84BCB_oKq7s,801 +django/contrib/sessions/locale/ta/LC_MESSAGES/django.po,sha256=bYqtYf9XgP9IKKFJXh0u64JhRhDvPPUliI1J-NeRpKE,945 +django/contrib/sessions/locale/te/LC_MESSAGES/django.mo,sha256=kteZeivEckt4AmAeKgmgouMQo1qqSQrI8M42B16gMnQ,786 +django/contrib/sessions/locale/te/LC_MESSAGES/django.po,sha256=dQgiNS52RHrL6bV9CEO7Jk9lk3YUQrUBDCg_bP2OSZc,980 +django/contrib/sessions/locale/tg/LC_MESSAGES/django.mo,sha256=N6AiKfV47QTlO5Z_r4SQZXVLtouu-NVSwWkePgD17Tc,747 +django/contrib/sessions/locale/tg/LC_MESSAGES/django.po,sha256=wvvDNu060yqlTxy3swM0x3v6QpvCB9DkfNm0Q-kb9Xk,910 +django/contrib/sessions/locale/th/LC_MESSAGES/django.mo,sha256=D41vbkoYMdYPj3587p-c5yytLVi9pE5xvRZEYhZrxPs,814 +django/contrib/sessions/locale/th/LC_MESSAGES/django.po,sha256=43704TUv4ysKhL8T5MowZwlyv1JZrPyVGrpdIyb3r40,988 +django/contrib/sessions/locale/tk/LC_MESSAGES/django.mo,sha256=pT_hpKCwFT60GUXzD_4z8JOhmh1HRnkZj-QSouVEgUA,699 +django/contrib/sessions/locale/tk/LC_MESSAGES/django.po,sha256=trqXxfyIbh4V4szol0pXETmEWRxAAKywPZ9EzVMVE-I,865 +django/contrib/sessions/locale/tr/LC_MESSAGES/django.mo,sha256=STDnYOeO1d9nSCVf7pSkMq8R7z1aeqq-xAuIYjsofuE,685 +django/contrib/sessions/locale/tr/LC_MESSAGES/django.po,sha256=XYKo0_P5xitYehvjMzEw2MTp_Nza-cIXEECV3dA6BmY,863 +django/contrib/sessions/locale/tt/LC_MESSAGES/django.mo,sha256=Q-FGu_ljTsxXO_EWu7zCzGwoqFXkeoTzWSlvx85VLGc,806 +django/contrib/sessions/locale/tt/LC_MESSAGES/django.po,sha256=UC85dFs_1836noZTuZEzPqAjQMFfSvj7oGmEWOGcfCA,962 +django/contrib/sessions/locale/udm/LC_MESSAGES/django.mo,sha256=CNmoKj9Uc0qEInnV5t0Nt4ZnKSZCRdIG5fyfSsqwky4,462 +django/contrib/sessions/locale/udm/LC_MESSAGES/django.po,sha256=CPml2Fn9Ax_qO5brCFDLPBoTiNdvsvJb1btQ0COwUfY,737 +django/contrib/sessions/locale/ug/LC_MESSAGES/django.mo,sha256=HMwjTByc3HrhFvCt_iOioYZE7JEKLzNlb2DTu6TCgto,748 +django/contrib/sessions/locale/ug/LC_MESSAGES/django.po,sha256=QEdIUuvVMFbOPSCYs6k-61rBwmTUXFCcR1pKn53dXtQ,864 +django/contrib/sessions/locale/uk/LC_MESSAGES/django.mo,sha256=jzNrLuFghQMCHNRQ0ihnKMCicgear0yWiTOLnvdPszw,841 +django/contrib/sessions/locale/uk/LC_MESSAGES/django.po,sha256=4K2geuGjRpJCtNfGPMhYWZlGxUy5xzIoDKA2jL2iGos,1171 +django/contrib/sessions/locale/ur/LC_MESSAGES/django.mo,sha256=FkGIiHegr8HR8zjVyJ9TTW1T9WYtAL5Mg77nRKnKqWk,729 +django/contrib/sessions/locale/ur/LC_MESSAGES/django.po,sha256=qR4QEBTP6CH09XFCzsPSPg2Dv0LqzbRV_I67HO2OUwk,879 +django/contrib/sessions/locale/uz/LC_MESSAGES/django.mo,sha256=asPu0RhMB_Ui1li-OTVL4qIXnM9XpjsYyx5yJldDYBY,744 +django/contrib/sessions/locale/uz/LC_MESSAGES/django.po,sha256=KsHuLgGJt-KDH0h6ND7JLP2dDJAdLVHSlau4DkkfqA8,880 +django/contrib/sessions/locale/vi/LC_MESSAGES/django.mo,sha256=KriTpT-Hgr10DMnY5Bmbd4isxmSFLmav8vg2tuL2Bb8,679 +django/contrib/sessions/locale/vi/LC_MESSAGES/django.po,sha256=M7S46Q0Q961ykz_5FCAN8SXQ54w8tp4rZeZpy6bPtXs,909 +django/contrib/sessions/locale/zh_Hans/LC_MESSAGES/django.mo,sha256=zsbhIMocgB8Yn1XEBxbIIbBh8tLifvvYNlhe5U61ch8,722 +django/contrib/sessions/locale/zh_Hans/LC_MESSAGES/django.po,sha256=tPshgXjEv6pME4N082ztamJhd5whHB2_IV_egdP-LlQ,889 +django/contrib/sessions/locale/zh_Hant/LC_MESSAGES/django.mo,sha256=l6mWJJ_Lbfn3GsvmblZMtyXzgzqgIgroAOCg3DdzQyI,676 +django/contrib/sessions/locale/zh_Hant/LC_MESSAGES/django.po,sha256=MRV_86xy4ILP46qZtxkHGJwWEvXwF5XAvJ16LNMdx3Q,904 +django/contrib/sessions/management/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/contrib/sessions/management/__pycache__/__init__.cpython-312.pyc,, +django/contrib/sessions/management/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/contrib/sessions/management/commands/__pycache__/__init__.cpython-312.pyc,, +django/contrib/sessions/management/commands/__pycache__/clearsessions.cpython-312.pyc,, +django/contrib/sessions/management/commands/clearsessions.py,sha256=pAiO5o7zgButVlYAV93bPnmiwzWP7V5N7-xPtxSkjJg,661 +django/contrib/sessions/middleware.py,sha256=ziZex9xiqxBYl9SC91i4QIDYuoenz4OoKaNO7sXu8kQ,3483 +django/contrib/sessions/migrations/0001_initial.py,sha256=KqQ44jk-5RNcTdqUv95l_UnoMA8cP5O-0lrjoJ8vabk,1148 +django/contrib/sessions/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/contrib/sessions/migrations/__pycache__/0001_initial.cpython-312.pyc,, +django/contrib/sessions/migrations/__pycache__/__init__.cpython-312.pyc,, +django/contrib/sessions/models.py,sha256=BguwuQSDzpeTNXhteYRAcspg1rop431tjFeZUVWZNYc,1250 +django/contrib/sessions/serializers.py,sha256=S9oDsUAjFv2MTlLQA6AoehggKyHXpu6-Qnrqybhgvkg,106 +django/contrib/sitemaps/__init__.py,sha256=hZuWQsKCQHfgPOx1GQPETMzTT9oqzcpp2wDMfGiLhp8,6923 +django/contrib/sitemaps/__pycache__/__init__.cpython-312.pyc,, +django/contrib/sitemaps/__pycache__/apps.cpython-312.pyc,, +django/contrib/sitemaps/__pycache__/views.cpython-312.pyc,, +django/contrib/sitemaps/apps.py,sha256=xYE-mAs37nL8ZAnv052LhUKVUwGYKB3xyPy4t8pwOpw,249 +django/contrib/sitemaps/templates/sitemap.xml,sha256=L092SHTtwtmNJ_Lj_jLrzHhfI0-OKKIw5fpyOfr4qRs,683 +django/contrib/sitemaps/templates/sitemap_index.xml,sha256=SQf9avfFmnT8j-nLEc8lVQQcdhiy_qhnqjssIMti3oU,360 +django/contrib/sitemaps/views.py,sha256=WoBVQN0jHzjrhuB-_tMdbC8S1Hb9TAnVyL1Kk3CcGM4,4657 +django/contrib/sites/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/contrib/sites/__pycache__/__init__.cpython-312.pyc,, +django/contrib/sites/__pycache__/admin.cpython-312.pyc,, +django/contrib/sites/__pycache__/apps.cpython-312.pyc,, +django/contrib/sites/__pycache__/checks.cpython-312.pyc,, +django/contrib/sites/__pycache__/management.cpython-312.pyc,, +django/contrib/sites/__pycache__/managers.cpython-312.pyc,, +django/contrib/sites/__pycache__/middleware.cpython-312.pyc,, +django/contrib/sites/__pycache__/models.cpython-312.pyc,, +django/contrib/sites/__pycache__/requests.cpython-312.pyc,, +django/contrib/sites/__pycache__/shortcuts.cpython-312.pyc,, +django/contrib/sites/admin.py,sha256=IWvGDQUTDPEUsd-uuxfHxJq4syGtddNKUdkP0nmVUMA,214 +django/contrib/sites/apps.py,sha256=uBLHUyQoSuo1Q7NwLTwlvsTuRU1MXwj4t6lRUnIBdwk,562 +django/contrib/sites/checks.py,sha256=AydGM1G1L9mvmTbNMTXRbZzPbHpIiknkRzLh5uFQLLI,366 +django/contrib/sites/locale/af/LC_MESSAGES/django.mo,sha256=A10bZFMs-wUetVfF5UrFwmuiKnN4ZnlrR4Rx8U4Ut1A,786 +django/contrib/sites/locale/af/LC_MESSAGES/django.po,sha256=O0-ZRvmXvV_34kONuqakuXV5OmYbQ569K1Puj3qQNac,907 +django/contrib/sites/locale/ar/LC_MESSAGES/django.mo,sha256=kLoytp2jvhWn6p1c8kNVua2sYAMnrpS4xnbluHD22Vs,947 +django/contrib/sites/locale/ar/LC_MESSAGES/django.po,sha256=HYA3pA29GktzXBP-soUEn9VP2vkZuhVIXVA8TNPCHCs,1135 +django/contrib/sites/locale/ar_DZ/LC_MESSAGES/django.mo,sha256=-ltwY57Th6LNqU3bgOPPP7qWtII5c6rj8Dv8eY7PZ84,918 +django/contrib/sites/locale/ar_DZ/LC_MESSAGES/django.po,sha256=KRTjZ2dFRWVPmE_hC5Hq8eDv3GQs3yQKCgV5ISFmEKk,1079 +django/contrib/sites/locale/ast/LC_MESSAGES/django.mo,sha256=eEvaeiGnZFBPGzKLlRz4M9AHemgJVAb-yNpbpxRqtd0,774 +django/contrib/sites/locale/ast/LC_MESSAGES/django.po,sha256=huBohKzLpdaJRFMFXXSDhDCUOqVqyWXfxb8_lLOkUd0,915 +django/contrib/sites/locale/az/LC_MESSAGES/django.mo,sha256=CjAGI4qGoXN95q4LpCLXLKvaNB33Ocf5SfXdurFBkas,773 +django/contrib/sites/locale/az/LC_MESSAGES/django.po,sha256=E84kNPFhgHmIfYT0uzCnTPGwPkAqKzqwFvJB7pETbVo,933 +django/contrib/sites/locale/be/LC_MESSAGES/django.mo,sha256=HGh78mI50ZldBtQ8jId26SI-lSHv4ZLcveRN2J8VzH8,983 +django/contrib/sites/locale/be/LC_MESSAGES/django.po,sha256=W5FhVJKcmd3WHl2Lpd5NJUsc7_sE_1Pipk3CVPoGPa4,1152 +django/contrib/sites/locale/bg/LC_MESSAGES/django.mo,sha256=a2R52umIQIhnzFaFYSRhQ6nBlywE8RGMj2FUOFmyb0A,904 +django/contrib/sites/locale/bg/LC_MESSAGES/django.po,sha256=awB8RMS-qByhNB6eH2f0Oyxb3SH8waLhrZ--rokGfaI,1118 +django/contrib/sites/locale/bn/LC_MESSAGES/django.mo,sha256=cI3a9_L-OC7gtdyRNaGX7A5w0Za0M4ERnYB7rSNkuRU,925 +django/contrib/sites/locale/bn/LC_MESSAGES/django.po,sha256=8ZxYF16bgtTZSZRZFok6IJxUV02vIztoVx2qXqwO8NM,1090 +django/contrib/sites/locale/br/LC_MESSAGES/django.mo,sha256=rI_dIznbwnadZbxOPtQxZ1pGYePNwcNNXt05iiPkchU,1107 +django/contrib/sites/locale/br/LC_MESSAGES/django.po,sha256=7Ein5Xw73DNGGtdd595Bx6ixfSD-dBXZNBUU44pSLuQ,1281 +django/contrib/sites/locale/bs/LC_MESSAGES/django.mo,sha256=bDeqQNme586LnQRQdvOWaLGZssjOoECef3vMq_OCXno,692 +django/contrib/sites/locale/bs/LC_MESSAGES/django.po,sha256=xRTWInDNiLxikjwsjgW_pYjhy24zOro90-909ns9fig,923 +django/contrib/sites/locale/ca/LC_MESSAGES/django.mo,sha256=lEUuQEpgDY3bVWzRONrPzYlojRoNduT16_oYDkkbdfk,791 +django/contrib/sites/locale/ca/LC_MESSAGES/django.po,sha256=aORAoVn69iG1ynmEfnkBzBO-UZOzzbkPVOU-ZvfMtZg,996 +django/contrib/sites/locale/ckb/LC_MESSAGES/django.mo,sha256=Chp4sX73l_RFw4aaf9x67vEO1_cM8eh5c0URKBgMU-Q,843 +django/contrib/sites/locale/ckb/LC_MESSAGES/django.po,sha256=2NPav4574kEwTS_nZTUoVbYxJFzsaC5MdQUCD9iqC6E,1007 +django/contrib/sites/locale/cs/LC_MESSAGES/django.mo,sha256=mnXnpU7sLDTJ3OrIUTnGarPYsupNIUPV4ex_BPWU8fk,827 +django/contrib/sites/locale/cs/LC_MESSAGES/django.po,sha256=ONzFlwzmt7p5jdp6111qQkkevckRrd7GNS0lkDPKu-4,1035 +django/contrib/sites/locale/cy/LC_MESSAGES/django.mo,sha256=70pOie0K__hkmM9oBUaQfVwHjK8Cl48E26kRQL2mtew,835 +django/contrib/sites/locale/cy/LC_MESSAGES/django.po,sha256=FAZrVc72x-4R1A-1qYOBwADoXngC_F6FO8nRjr5-Z6g,1013 +django/contrib/sites/locale/da/LC_MESSAGES/django.mo,sha256=FTOyV1DIH9sMldyjgPw98d2HCotoO4zJ_KY_C9DCB7Y,753 +django/contrib/sites/locale/da/LC_MESSAGES/django.po,sha256=Po1Z6u52CFCyz9hLfK009pMbZzZgHrBse0ViX8wCYm8,957 +django/contrib/sites/locale/de/LC_MESSAGES/django.mo,sha256=5Q6X0_bDQ1ZRpkTy7UpPNzrhmQsB9Q0P1agB7koRyzs,792 +django/contrib/sites/locale/de/LC_MESSAGES/django.po,sha256=aD0wBinqtDUPvBbwtHrLEhFdoVRx1nOh17cJFuWhN3U,980 +django/contrib/sites/locale/dsb/LC_MESSAGES/django.mo,sha256=pPpWYsYp81MTrqCsGF0QnGktZNIll70bdBwSkuVE8go,868 +django/contrib/sites/locale/dsb/LC_MESSAGES/django.po,sha256=IA3G8AKJls20gzfxnrfPzivMNpL8A0zBQBg7OyzrP6g,992 +django/contrib/sites/locale/el/LC_MESSAGES/django.mo,sha256=G9o1zLGysUePGzZRicQ2aIIrc2UXMLTQmdpbrUMfWBU,878 +django/contrib/sites/locale/el/LC_MESSAGES/django.po,sha256=RBi_D-_znYuV6LXfTlSOf1Mvuyl96fIyEoiZ-lgeyWs,1133 +django/contrib/sites/locale/en/LC_MESSAGES/django.mo,sha256=U0OV81NfbuNL9ctF-gbGUG5al1StqN-daB-F-gFBFC8,356 +django/contrib/sites/locale/en/LC_MESSAGES/django.po,sha256=tSjfrNZ_FqLHsXjm5NuTyo5-JpdlPLsPZjFqF2APhy8,817 +django/contrib/sites/locale/en_AU/LC_MESSAGES/django.mo,sha256=G--2j_CR99JjRgVIX2Y_5pDfO7IgIkvK4kYHZtGzpxU,753 +django/contrib/sites/locale/en_AU/LC_MESSAGES/django.po,sha256=Giw634r94MJT1Q3qgqM7gZakQCasRM9Dm7MDkb9JOc8,913 +django/contrib/sites/locale/en_GB/LC_MESSAGES/django.mo,sha256=FbSh7msJdrHsXr0EtDMuODFzSANG_HJ3iBlW8ePpqFs,639 +django/contrib/sites/locale/en_GB/LC_MESSAGES/django.po,sha256=Ib-DIuTWlrN3kg99kLCuqWJVtt1NWaFD4UbDFK6d4KY,862 +django/contrib/sites/locale/eo/LC_MESSAGES/django.mo,sha256=N4KkH12OHxic3pp1okeBhpfDx8XxxpULk3UC219vjWU,792 +django/contrib/sites/locale/eo/LC_MESSAGES/django.po,sha256=ymXSJaFJWGBO903ObqR-ows-p4T3KyUplc_p_3r1uk8,1043 +django/contrib/sites/locale/es/LC_MESSAGES/django.mo,sha256=qLN1uoCdslxdYWgdjgSBi7szllP-mQZtHbuZnNOthsQ,804 +django/contrib/sites/locale/es/LC_MESSAGES/django.po,sha256=QClia2zY39269VSQzkQsLwwukthN6u2JBsjbLNxA1VQ,1066 +django/contrib/sites/locale/es_AR/LC_MESSAGES/django.mo,sha256=_O4rVk7IM2BBlZvjDP2SvTOo8WWqthQi5exQzt027-s,776 +django/contrib/sites/locale/es_AR/LC_MESSAGES/django.po,sha256=RwyNylXbyxdSXn6qRDXd99-GaEPlmr6TicHTUW0boaQ,969 +django/contrib/sites/locale/es_CO/LC_MESSAGES/django.mo,sha256=a4Xje2M26wyIx6Wlg6puHo_OXjiDEy7b0FquT9gbThA,825 +django/contrib/sites/locale/es_CO/LC_MESSAGES/django.po,sha256=9bnRhVD099JzkheO80l65dufjuawsj9aSFgFu5A-lnM,949 +django/contrib/sites/locale/es_MX/LC_MESSAGES/django.mo,sha256=AtGta5jBL9XNBvfSpsCcnDtDhvcb89ALl4hNjSPxibM,809 +django/contrib/sites/locale/es_MX/LC_MESSAGES/django.po,sha256=TnkpQp-7swH-x9cytUJe-QJRd2n_pYMVo0ltDw9Pu8o,991 +django/contrib/sites/locale/es_VE/LC_MESSAGES/django.mo,sha256=59fZBDut-htCj38ZUoqPjhXJPjZBz-xpU9__QFr3kLs,486 +django/contrib/sites/locale/es_VE/LC_MESSAGES/django.po,sha256=8PWXy2L1l67wDIi98Q45j7OpVITr0Lt4zwitAnB-d_o,791 +django/contrib/sites/locale/et/LC_MESSAGES/django.mo,sha256=I2E-49UQsG-F26OeAfnKlfUdA3YCkUSV8ffA-GMSkE0,788 +django/contrib/sites/locale/et/LC_MESSAGES/django.po,sha256=mEfD6EyQ15PPivb5FTlkabt3Lo_XGtomI9XzHrrh34Y,992 +django/contrib/sites/locale/eu/LC_MESSAGES/django.mo,sha256=1HTAFI3DvTAflLJsN7NVtSd4XOTlfoeLGFyYCOX69Ec,807 +django/contrib/sites/locale/eu/LC_MESSAGES/django.po,sha256=NWxdE5-mF6Ak4nPRpCFEgAMIsVDe9YBEZl81v9kEuX8,1023 +django/contrib/sites/locale/fa/LC_MESSAGES/django.mo,sha256=odtsOpZ6noNqwDb18HDc2e6nz3NMsa-wrTN-9dk7d9w,872 +django/contrib/sites/locale/fa/LC_MESSAGES/django.po,sha256=-DirRvcTqcpIy90QAUiCSoNkCDRifqpWSzLriJ4cwQU,1094 +django/contrib/sites/locale/fi/LC_MESSAGES/django.mo,sha256=I5DUeLk1ChUC32q5uzriABCLLJpJKNbEK4BfqylPQzg,786 +django/contrib/sites/locale/fi/LC_MESSAGES/django.po,sha256=LH2sFIKM3YHPoz9zIu10z1DFv1svXphBdOhXNy4a17s,929 +django/contrib/sites/locale/fr/LC_MESSAGES/django.mo,sha256=W7Ne5HqgnRcl42njzbUaDSY059jdhwvr0tgZzecVWD8,756 +django/contrib/sites/locale/fr/LC_MESSAGES/django.po,sha256=u24rHDJ47AoBgcmBwI1tIescAgbjFxov6y906H_uhK0,999 +django/contrib/sites/locale/fy/LC_MESSAGES/django.mo,sha256=YQQy7wpjBORD9Isd-p0lLzYrUgAqv770_56-vXa0EOc,476 +django/contrib/sites/locale/fy/LC_MESSAGES/django.po,sha256=Yh6Lw0QI2Me0zCtlyXraFLjERKqklB6-IJLDTjH_jTs,781 +django/contrib/sites/locale/ga/LC_MESSAGES/django.mo,sha256=RKnHbMHTD4CAxNU6SXQ6jCbgzqDIZZuGOFcdX_baCA4,814 +django/contrib/sites/locale/ga/LC_MESSAGES/django.po,sha256=fqY_eHIE04JxXXyi5ZECLMzcfyG0ZXasxG6ZIErkcrQ,1058 +django/contrib/sites/locale/gd/LC_MESSAGES/django.mo,sha256=df4XIGGD6FIyMUXsb-SoSqNfBFAsRXf4qYtolh_C964,858 +django/contrib/sites/locale/gd/LC_MESSAGES/django.po,sha256=NPKp7A5-y-MR7r8r4WqtcVQJEHCIOP5mLTd0cIfUsug,957 +django/contrib/sites/locale/gl/LC_MESSAGES/django.mo,sha256=tiRYDFC1_V2n1jkEQqhjjQBdZzFkhxzNfHIzG2l3PX4,728 +django/contrib/sites/locale/gl/LC_MESSAGES/django.po,sha256=DNY_rv6w6VrAu3hMUwx3cgLLyH4PFfgaJ9dSKfLBrpI,979 +django/contrib/sites/locale/he/LC_MESSAGES/django.mo,sha256=L3bganfG4gHqp2WXGh4rfWmmbaIxHaGc7-ypAqjSL_E,820 +django/contrib/sites/locale/he/LC_MESSAGES/django.po,sha256=iO3OZwz2aiuAzugkKp5Hxonwdg3kKjBurxR685J2ZMk,1082 +django/contrib/sites/locale/hi/LC_MESSAGES/django.mo,sha256=J4oIS1vJnCvdCCUD4tlTUVyTe4Xn0gKcWedfhH4C0t0,665 +django/contrib/sites/locale/hi/LC_MESSAGES/django.po,sha256=INBrm37jL3okBHuzX8MSN1vMptj77a-4kwQkAyt8w_8,890 +django/contrib/sites/locale/hr/LC_MESSAGES/django.mo,sha256=KjDUhEaOuYSMexcURu2UgfkatN2rrUcAbCUbcpVSInk,876 +django/contrib/sites/locale/hr/LC_MESSAGES/django.po,sha256=-nFMFkVuDoKYDFV_zdNULOqQlnqtiCG57aakN5hqlmg,1055 +django/contrib/sites/locale/hsb/LC_MESSAGES/django.mo,sha256=RyHVb7u9aRn5BXmWzR1gApbZlOioPDJ59ufR1Oo3e8Y,863 +django/contrib/sites/locale/hsb/LC_MESSAGES/django.po,sha256=Aq54y5Gb14bIt28oDDrFltnSOk31Z2YalwaJMDMXfWc,987 +django/contrib/sites/locale/hu/LC_MESSAGES/django.mo,sha256=P--LN84U2BeZAvRVR-OiWl4R02cTTBi2o8XR2yHIwIU,796 +django/contrib/sites/locale/hu/LC_MESSAGES/django.po,sha256=b0VhyFdNaZZR5MH1vFsLL69FmICN8Dz-sTRk0PdK49E,953 +django/contrib/sites/locale/hy/LC_MESSAGES/django.mo,sha256=Hs9XwRHRkHicLWt_NvWvr7nMocmY-Kc8XphhVSAMQRc,906 +django/contrib/sites/locale/hy/LC_MESSAGES/django.po,sha256=MU4hXXGfjXKfYcjxDYzFfsEUIelz5ZzyQLkeSrUQKa0,1049 +django/contrib/sites/locale/ia/LC_MESSAGES/django.mo,sha256=gRMs-W5EiY26gqzwnDXEMbeb1vs0bYZ2DC2a9VCciew,809 +django/contrib/sites/locale/ia/LC_MESSAGES/django.po,sha256=HXZzn9ACIqfR2YoyvpK2FjZ7QuEq_RVZ1kSC4nxMgeg,934 +django/contrib/sites/locale/id/LC_MESSAGES/django.mo,sha256=__2E_2TmVUcbf1ygxtS1lHvkhv8L0mdTAtJpBsdH24Y,791 +django/contrib/sites/locale/id/LC_MESSAGES/django.po,sha256=e5teAHiMjLR8RDlg8q99qtW-K81ltcIiBIdb1MZw2sE,1000 +django/contrib/sites/locale/io/LC_MESSAGES/django.mo,sha256=W-NP0b-zR1oWUZnHZ6fPu5AC2Q6o7nUNoxssgeguUBo,760 +django/contrib/sites/locale/io/LC_MESSAGES/django.po,sha256=G4GUUz3rxoBjWTs-j5RFCvv52AEHiwrCBwom5hYeBSE,914 +django/contrib/sites/locale/is/LC_MESSAGES/django.mo,sha256=lkJgTzDjh5PNfIJpOS2DxKmwVUs9Sl5XwFHv4YdCB30,812 +django/contrib/sites/locale/is/LC_MESSAGES/django.po,sha256=1DVgAcHSZVyDd5xn483oqICIG4ooyZY8ko7A3aDogKM,976 +django/contrib/sites/locale/it/LC_MESSAGES/django.mo,sha256=6NQjjtDMudnAgnDCkemOXinzX0J-eAE5gSq1F8kjusY,795 +django/contrib/sites/locale/it/LC_MESSAGES/django.po,sha256=zxavlLMmp1t1rCDsgrw12kVgxiK5EyR_mOalSu8-ws8,984 +django/contrib/sites/locale/ja/LC_MESSAGES/django.mo,sha256=RNuCS6wv8uK5TmXkSH_7SjsbUFkf24spZfTsvfoTKro,814 +django/contrib/sites/locale/ja/LC_MESSAGES/django.po,sha256=e-cj92VOVc5ycIY6NwyFh5bO7Q9q5vp5CG4dOzd_eWQ,982 +django/contrib/sites/locale/ka/LC_MESSAGES/django.mo,sha256=m8GTqr9j0ijn0YJhvnsYwlk5oYcASKbHg_5hLqZ91TI,993 +django/contrib/sites/locale/ka/LC_MESSAGES/django.po,sha256=1upohcHrQH9T34b6lW09MTtFkk5WswdYOLs2vMAJIuE,1160 +django/contrib/sites/locale/kab/LC_MESSAGES/django.mo,sha256=Utdj5gH5YPeaYMjeMzF-vjqYvYTCipre2qCBkEJSc-Y,808 +django/contrib/sites/locale/kab/LC_MESSAGES/django.po,sha256=d78Z-YanYZkyP5tpasj8oAa5RimVEmce6dlq5vDSscA,886 +django/contrib/sites/locale/kk/LC_MESSAGES/django.mo,sha256=T2dTZ83vBRfQb2dRaKOrhvO00BHQu_2bu0O0k7RsvGA,895 +django/contrib/sites/locale/kk/LC_MESSAGES/django.po,sha256=HvdSFqsumyNurDJ6NKVLjtDdSIg0KZN2v29dM748GtU,1062 +django/contrib/sites/locale/km/LC_MESSAGES/django.mo,sha256=Q7pn5E4qN957j20-iCHgrfI-p8sm3Tc8O2DWeuH0By8,701 +django/contrib/sites/locale/km/LC_MESSAGES/django.po,sha256=TOs76vlCMYOZrdHgXPWZhQH1kTBQTpzsDJ8N4kbJQ7E,926 +django/contrib/sites/locale/kn/LC_MESSAGES/django.mo,sha256=_jl_4_39oe940UMyb15NljGOd45kkCeVNpJy6JvGWTE,673 +django/contrib/sites/locale/kn/LC_MESSAGES/django.po,sha256=cMPXF2DeiQuErhyFMe4i7swxMoqoz1sqtBEXf4Ghx1c,921 +django/contrib/sites/locale/ko/LC_MESSAGES/django.mo,sha256=OSr4OPZCkJqp2ymg32reatGzafM5Qq8fY4D4Dl21Cqk,744 +django/contrib/sites/locale/ko/LC_MESSAGES/django.po,sha256=Lekvcfi1xH8QVwFeSbKU3i26w71ALRy5rbPi3xS03Bw,1052 +django/contrib/sites/locale/ky/LC_MESSAGES/django.mo,sha256=IYxp8jG5iyN81h7YJqOiSQdOH7DnwOiIvelKZfzP6ZA,811 +django/contrib/sites/locale/ky/LC_MESSAGES/django.po,sha256=rxPdgQoBtGQSi5diOy3MXyoM4ffpwdWCc4WE3pjIHEI,927 +django/contrib/sites/locale/lb/LC_MESSAGES/django.mo,sha256=xokesKl7h7k9dXFKIJwGETgwx1Ytq6mk2erBSxkgY-o,474 +django/contrib/sites/locale/lb/LC_MESSAGES/django.po,sha256=1yRdK9Zyh7kcWG7wUexuF9-zxEaKLS2gG3ggVOHbRJ8,779 +django/contrib/sites/locale/lt/LC_MESSAGES/django.mo,sha256=bK6PJtd7DaOgDukkzuqos5ktgdjSF_ffL9IJTQY839s,869 +django/contrib/sites/locale/lt/LC_MESSAGES/django.po,sha256=T-vdVqs9KCz9vMs9FfushgZN9z7LQOT-C86D85H2X8c,1195 +django/contrib/sites/locale/lv/LC_MESSAGES/django.mo,sha256=t9bQiVqpAmXrq8QijN4Lh0n6EGUGQjnuH7hDcu21z4c,823 +django/contrib/sites/locale/lv/LC_MESSAGES/django.po,sha256=vMaEtXGosD3AcTomiuctbOpjLes8TRBnumLe8DC4yq4,1023 +django/contrib/sites/locale/mk/LC_MESSAGES/django.mo,sha256=_YXasRJRWjYmmiEWCrAoqnrKuHHPBG_v_EYTUe16Nfo,885 +django/contrib/sites/locale/mk/LC_MESSAGES/django.po,sha256=AgdIjiSpN0P5o5rr5Ie4sFhnmS5d4doB1ffk91lmOvY,1062 +django/contrib/sites/locale/ml/LC_MESSAGES/django.mo,sha256=axNQVBY0nbR7hYa5bzNtdxB17AUOs2WXhu0Rg--FA3Q,1007 +django/contrib/sites/locale/ml/LC_MESSAGES/django.po,sha256=Sg7hHfK8OMs05ebtTv8gxS6_2kZv-OODwf7okP95Jtk,1169 +django/contrib/sites/locale/mn/LC_MESSAGES/django.mo,sha256=w2sqJRAe0wyz_IuCZ_Ocubs_VHL6wV1BcutWPz0dseQ,867 +django/contrib/sites/locale/mn/LC_MESSAGES/django.po,sha256=Zh_Eao0kLZsrQ8wkL1f-pRrsAtNJOspu45uStq5t8Mo,1127 +django/contrib/sites/locale/mr/LC_MESSAGES/django.mo,sha256=CudEHmP5qNvQ-BfEBOoYMh0qGVw80m-wgeu7eh7zaCQ,884 +django/contrib/sites/locale/mr/LC_MESSAGES/django.po,sha256=FtdCo3O-35EIuOP5OOQU8afWDCbn4ge2lmxjVAYtbGU,1023 +django/contrib/sites/locale/ms/LC_MESSAGES/django.mo,sha256=GToJlS8yDNEy-D3-p7p8ZlWEZYHlSzZAcVIH5nQEkkI,727 +django/contrib/sites/locale/ms/LC_MESSAGES/django.po,sha256=_4l4DCIqSWZtZZNyfzpBA0V-CbAaHe9Ckz06VLbTjFo,864 +django/contrib/sites/locale/my/LC_MESSAGES/django.mo,sha256=jN59e9wRheZYx1A4t_BKc7Hx11J5LJg2wQRd21aQv08,961 +django/contrib/sites/locale/my/LC_MESSAGES/django.po,sha256=EhqYIW5-rX33YjsDsBwfiFb3BK6fZKVc3CRYeJpZX1E,1086 +django/contrib/sites/locale/nb/LC_MESSAGES/django.mo,sha256=AaiHGcmcciy5IMBPVAShcc1OQOETJvBCv7GYHMcIQMA,793 +django/contrib/sites/locale/nb/LC_MESSAGES/django.po,sha256=936zoN1sPSiiq7GuH01umrw8W6BtymYEU3bCfOQyfWE,1000 +django/contrib/sites/locale/ne/LC_MESSAGES/django.mo,sha256=n96YovpBax3T5VZSmIfGmd7Zakn9FJShJs5rvUX7Kf0,863 +django/contrib/sites/locale/ne/LC_MESSAGES/django.po,sha256=B14rhDd8GAaIjxd1sYjxO2pZfS8gAwZ1C-kCdVkRXho,1078 +django/contrib/sites/locale/nl/LC_MESSAGES/django.mo,sha256=ghu-tNPNZuE4sVRDWDVmmmVNPYZLWYm_UPJRqh8wmec,735 +django/contrib/sites/locale/nl/LC_MESSAGES/django.po,sha256=1DCQNzMRhy4vW-KkmlPGy58UR27Np5ilmYhmjaq-8_k,1030 +django/contrib/sites/locale/nn/LC_MESSAGES/django.mo,sha256=eSW8kwbzm2HsE9s9IRCsAo9juimVQjcfdd8rtl3TQJM,731 +django/contrib/sites/locale/nn/LC_MESSAGES/django.po,sha256=OOyvE7iji9hwvz8Z_OxWoKw2e3ptk3dqeqlriXgilSc,915 +django/contrib/sites/locale/os/LC_MESSAGES/django.mo,sha256=Su06FkWMOPzBxoung3bEju_EnyAEAXROoe33imO65uQ,806 +django/contrib/sites/locale/os/LC_MESSAGES/django.po,sha256=4i4rX6aXDUKjq64T02iStqV2V2erUsSVnTivh2XtQeY,963 +django/contrib/sites/locale/pa/LC_MESSAGES/django.mo,sha256=tOHiisOtZrTyIFoo4Ipn_XFH9hhu-ubJLMdOML5ZUgk,684 +django/contrib/sites/locale/pa/LC_MESSAGES/django.po,sha256=ztGyuqvzxRfNjqDG0rMLCu_oQ8V3Dxdsx0WZoYUyNv8,912 +django/contrib/sites/locale/pl/LC_MESSAGES/django.mo,sha256=lo5K262sZmo-hXvcHoBsEDqX8oJEPSxJY5EfRIqHZh0,903 +django/contrib/sites/locale/pl/LC_MESSAGES/django.po,sha256=-kQ49UvXITMy1vjJoN_emuazV_EjNDQnZDERXWNoKvw,1181 +django/contrib/sites/locale/pt/LC_MESSAGES/django.mo,sha256=PrcFQ04lFJ7mIYThXbW6acmDigEFIoLAC0PYk5hfaJs,797 +django/contrib/sites/locale/pt/LC_MESSAGES/django.po,sha256=Aj8hYI9W5nk5uxKHj1oE-b9bxmmuoeXLKaJDPfI2x2o,993 +django/contrib/sites/locale/pt_BR/LC_MESSAGES/django.mo,sha256=BsFfarOR6Qk67fB-tTWgGhuOReJSgjwJBkIzZsv28vo,824 +django/contrib/sites/locale/pt_BR/LC_MESSAGES/django.po,sha256=jfvgelpWn2VQqYe2_CE39SLTsscCckvjuZo6dWII28c,1023 +django/contrib/sites/locale/ro/LC_MESSAGES/django.mo,sha256=oGsZw4_uYpaH6adMxnAuifJgHeZ_ytRZ4rFhiNfRQkQ,857 +django/contrib/sites/locale/ro/LC_MESSAGES/django.po,sha256=tWbWVbjFFELNzSXX4_5ltmzEeEJsY3pKwgEOjgV_W_8,1112 +django/contrib/sites/locale/ru/LC_MESSAGES/django.mo,sha256=bIZJWMpm2O5S6RC_2cfkrp5NXaTU2GWSsMr0wHVEmcw,1016 +django/contrib/sites/locale/ru/LC_MESSAGES/django.po,sha256=jHy5GR05ZSjLmAwaVNq3m0WdhO9GYxge3rDBziqesA8,1300 +django/contrib/sites/locale/sk/LC_MESSAGES/django.mo,sha256=-EYdm14ZjoR8bd7Rv2b5G7UJVSKmZa1ItLsdATR3-Cg,822 +django/contrib/sites/locale/sk/LC_MESSAGES/django.po,sha256=VSRlsq8uk-hP0JI94iWsGX8Al76vvGK4N1xIoFtoRQM,1070 +django/contrib/sites/locale/sl/LC_MESSAGES/django.mo,sha256=JmkpTKJGWgnBM3CqOUriGvrDnvg2YWabIU2kbYAOM4s,845 +django/contrib/sites/locale/sl/LC_MESSAGES/django.po,sha256=qWrWrSz5r3UOVraX08ILt3TTmfyTDGKbJKbTlN9YImU,1059 +django/contrib/sites/locale/sq/LC_MESSAGES/django.mo,sha256=DMLN1ZDJeDnslavjcKloXSXn6IvangVliVP3O6U8dAY,769 +django/contrib/sites/locale/sq/LC_MESSAGES/django.po,sha256=zg3ALcMNZErAS_xFxmtv6TmXZ0vxobX5AzCwOSRSwc8,930 +django/contrib/sites/locale/sr/LC_MESSAGES/django.mo,sha256=8kfi9IPdB2reF8C_eC2phaP6qonboHPwes_w3UgNtzw,935 +django/contrib/sites/locale/sr/LC_MESSAGES/django.po,sha256=A7xaen8H1W4uMBRAqCXT_0KQMoA2-45AUNDfGo9FydI,1107 +django/contrib/sites/locale/sr_Latn/LC_MESSAGES/django.mo,sha256=jMXiq18efq0wErJAQfJR1fCnkYcEb7OYXg8sv6kzP0s,815 +django/contrib/sites/locale/sr_Latn/LC_MESSAGES/django.po,sha256=9jkWYcZCTfQr2UZtyvhWDAmEHBrzunJUZcx7FlrFOis,1004 +django/contrib/sites/locale/sv/LC_MESSAGES/django.mo,sha256=1AttMJ2KbQQgJVH9e9KuCKC0UqDHvWSPcKkbPkSLphQ,768 +django/contrib/sites/locale/sv/LC_MESSAGES/django.po,sha256=N7wqrcFb5ZNX83q1ZCkpkP94Lb3ZIBUATDssNT8F51c,1028 +django/contrib/sites/locale/sw/LC_MESSAGES/django.mo,sha256=cWjjDdFXBGmpUm03UDtgdDrREa2r75oMsXiEPT_Bx3g,781 +django/contrib/sites/locale/sw/LC_MESSAGES/django.po,sha256=oOKNdztQQU0sd6XmLI-n3ONmTL7jx3Q0z1YD8673Wi8,901 +django/contrib/sites/locale/ta/LC_MESSAGES/django.mo,sha256=CLO41KsSKqBrgtrHi6fmXaBk-_Y2l4KBLDJctZuZyWY,714 +django/contrib/sites/locale/ta/LC_MESSAGES/django.po,sha256=YsTITHg7ikkNcsP29tDgkZrUdtO0s9PrV1XPu4mgqCw,939 +django/contrib/sites/locale/te/LC_MESSAGES/django.mo,sha256=GmIWuVyIOcoQoAmr2HxCwBDE9JUYEktzYig93H_4v50,687 +django/contrib/sites/locale/te/LC_MESSAGES/django.po,sha256=jbncxU9H3EjXxWPsEoCKJhKi392XXTGvWyuenqLDxps,912 +django/contrib/sites/locale/tg/LC_MESSAGES/django.mo,sha256=wiWRlf3AN5zlFMNyP_rSDZS7M5rHQJ2DTUHARtXjim8,863 +django/contrib/sites/locale/tg/LC_MESSAGES/django.po,sha256=VBGZfJIw40JZe15ghsk-n3qUVX0VH2nFQQhpBy_lk1Y,1026 +django/contrib/sites/locale/th/LC_MESSAGES/django.mo,sha256=dQOp4JoP3gvfsxqEQ73L6F8FgH1YtAA9hYY-Uz5sv6Y,898 +django/contrib/sites/locale/th/LC_MESSAGES/django.po,sha256=auZBoKKKCHZbbh0PaUr9YKiWB1TEYZoj4bE7efAonV8,1077 +django/contrib/sites/locale/tk/LC_MESSAGES/django.mo,sha256=YhzSiVb_NdG1s7G1-SGGd4R3uweZQgnTs3G8Lv9r5z0,755 +django/contrib/sites/locale/tk/LC_MESSAGES/django.po,sha256=sigmzH3Ni2vJwLJ7ba8EeB4wnDXsg8rQRFExZAGycF4,917 +django/contrib/sites/locale/tr/LC_MESSAGES/django.mo,sha256=ryf01jcvvBMGPKkdViieDuor-Lr2KRXZeFF1gPupCOA,758 +django/contrib/sites/locale/tr/LC_MESSAGES/django.po,sha256=L9tsnwxw1BEJD-Nm3m1RAS7ekgdmyC0ETs_mr7tQw1E,1043 +django/contrib/sites/locale/tt/LC_MESSAGES/django.mo,sha256=gmmjXeEQUlBpfDmouhxE-qpEtv-iWdQSobYL5MWprZc,706 +django/contrib/sites/locale/tt/LC_MESSAGES/django.po,sha256=yj49TjwcZ4YrGqnJrKh3neKydlTgwYduto9KsmxI_eI,930 +django/contrib/sites/locale/udm/LC_MESSAGES/django.mo,sha256=CNmoKj9Uc0qEInnV5t0Nt4ZnKSZCRdIG5fyfSsqwky4,462 +django/contrib/sites/locale/udm/LC_MESSAGES/django.po,sha256=vrLZ0XJF63CO3IucbQpd12lxuoM9S8tTUv6cpu3g81c,767 +django/contrib/sites/locale/ug/LC_MESSAGES/django.mo,sha256=EBWMPAJLaxkIPQ5hm_nMRxs7Y0SEEgu6zcDM4jBUAt8,868 +django/contrib/sites/locale/ug/LC_MESSAGES/django.po,sha256=9a0kmoIxg-KMu5faIjcRgWehr3Ild-stVZsBdDrzHV0,1030 +django/contrib/sites/locale/uk/LC_MESSAGES/django.mo,sha256=H4806mPqOoHJFm549F7drzsfkvAXWKmn1w_WVwQx9rk,960 +django/contrib/sites/locale/uk/LC_MESSAGES/django.po,sha256=CJZTOaurDXwpgBiwXx3W7juaF0EctEImPhJdDn8j1xU,1341 +django/contrib/sites/locale/ur/LC_MESSAGES/django.mo,sha256=s6QL8AB_Mp9haXS4n1r9b0YhEUECPxUyPrHTMI3agts,654 +django/contrib/sites/locale/ur/LC_MESSAGES/django.po,sha256=R9tv3qtett8CUGackoHrc5XADeygVKAE0Fz8YzK2PZ4,885 +django/contrib/sites/locale/uz/LC_MESSAGES/django.mo,sha256=OsuqnLEDl9gUAwsmM2s1KH7VD74ID-k7JXcjGhjFlEY,799 +django/contrib/sites/locale/uz/LC_MESSAGES/django.po,sha256=RoaOwLDjkqqIJTuxpuY7eMLo42n6FoYAYutCfMaDk4I,935 +django/contrib/sites/locale/vi/LC_MESSAGES/django.mo,sha256=YOaKcdrN1238Zdm81jUkc2cpxjInAbdnhsSqHP_jQsI,762 +django/contrib/sites/locale/vi/LC_MESSAGES/django.po,sha256=AHcqR2p0fdscLvzbJO_a-CzMzaeRL4LOw4HB9K3noVQ,989 +django/contrib/sites/locale/zh_Hans/LC_MESSAGES/django.mo,sha256=7D9_pDY5lBRpo1kfzIQL-PNvIg-ofCm7cBHE1-JWlMk,779 +django/contrib/sites/locale/zh_Hans/LC_MESSAGES/django.po,sha256=xI_N00xhV8dWDp4fg5Mmj9ivOBBdHP79T3-JYXPyc5M,946 +django/contrib/sites/locale/zh_Hant/LC_MESSAGES/django.mo,sha256=C4ZEuruq2Qnj7Zk-ZUfPWjLHcbNaC0V9MlDs8Go9Ieo,736 +django/contrib/sites/locale/zh_Hant/LC_MESSAGES/django.po,sha256=wGZCUT4Yg8FJLZZ6C_mf5Lly3YkPIhbTBiyTmj5emj8,1055 +django/contrib/sites/management.py,sha256=AElGktvFhWXJtlJwOKpUlIeuv2thkNM8F6boliML84U,1646 +django/contrib/sites/managers.py,sha256=uqD_Cu3P4NCp7VVdGn0NvHfhsZB05MLmiPmgot-ygz4,1994 +django/contrib/sites/middleware.py,sha256=qYcVHsHOg0VxQNS4saoLHkdF503nJR-D7Z01vE0SvUM,309 +django/contrib/sites/migrations/0001_initial.py,sha256=8fY63Z5DwbKQ1HtvAajKDhBLEufigRTsoRazyEf5RU4,1361 +django/contrib/sites/migrations/0002_alter_domain_unique.py,sha256=llK7IKQKnFCK5viHLew2ZMdV9e1sHy0H1blszEu_NKs,549 +django/contrib/sites/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/contrib/sites/migrations/__pycache__/0001_initial.cpython-312.pyc,, +django/contrib/sites/migrations/__pycache__/0002_alter_domain_unique.cpython-312.pyc,, +django/contrib/sites/migrations/__pycache__/__init__.cpython-312.pyc,, +django/contrib/sites/models.py,sha256=0DWVfDGMYqTZgs_LP6hlVxY3ztbwPzulE9Dos8z6M3Q,3695 +django/contrib/sites/requests.py,sha256=baABc6fmTejNmk8M3fcoQ1cuI2qpJzF8Y47A1xSt8gY,641 +django/contrib/sites/shortcuts.py,sha256=nekVQADJROFYwKCD7flmWDMQ9uLAaaKztHVKl5emuWc,573 +django/contrib/staticfiles/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/contrib/staticfiles/__pycache__/__init__.cpython-312.pyc,, +django/contrib/staticfiles/__pycache__/apps.cpython-312.pyc,, +django/contrib/staticfiles/__pycache__/checks.cpython-312.pyc,, +django/contrib/staticfiles/__pycache__/finders.cpython-312.pyc,, +django/contrib/staticfiles/__pycache__/handlers.cpython-312.pyc,, +django/contrib/staticfiles/__pycache__/storage.cpython-312.pyc,, +django/contrib/staticfiles/__pycache__/testing.cpython-312.pyc,, +django/contrib/staticfiles/__pycache__/urls.cpython-312.pyc,, +django/contrib/staticfiles/__pycache__/utils.cpython-312.pyc,, +django/contrib/staticfiles/__pycache__/views.cpython-312.pyc,, +django/contrib/staticfiles/apps.py,sha256=8G9HetU3WBNDfXKfzYfyXjZ--X3loBkkQSB7xfleIl4,504 +django/contrib/staticfiles/checks.py,sha256=FPzYotgRzxqWYDnjIK78bgQAfBSFqeJB04RDVMxlhng,846 +django/contrib/staticfiles/finders.py,sha256=_mfSsh1rOFW_ZHzX__fug0yGAuBqdXI-v0cG1aTRMEE,10996 +django/contrib/staticfiles/handlers.py,sha256=DeDbXvIUeSs0icls4e1HQ3y-6-agjO_c2O5ufkSnuls,4035 +django/contrib/staticfiles/management/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/contrib/staticfiles/management/__pycache__/__init__.cpython-312.pyc,, +django/contrib/staticfiles/management/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/contrib/staticfiles/management/commands/__pycache__/__init__.cpython-312.pyc,, +django/contrib/staticfiles/management/commands/__pycache__/collectstatic.cpython-312.pyc,, +django/contrib/staticfiles/management/commands/__pycache__/findstatic.cpython-312.pyc,, +django/contrib/staticfiles/management/commands/__pycache__/runserver.cpython-312.pyc,, +django/contrib/staticfiles/management/commands/collectstatic.py,sha256=Zd65dgKD8JlXmoDb3ig6tvZka4gMV_6egbLcoRLJ1SA,15137 +django/contrib/staticfiles/management/commands/findstatic.py,sha256=TMMGlbV-B1aq1b27nA6Otu6hV44pqAzeuEtTV2DPmp0,1638 +django/contrib/staticfiles/management/commands/runserver.py,sha256=U_7oCY8LJX5Jn1xlMv-qF4EQoUvlT0ldB5E_0sJmRtw,1373 +django/contrib/staticfiles/storage.py,sha256=ZI_qo3HWJ64rXMExqay2XXlzviqsy7Yy4mU9Zv5jvfM,21036 +django/contrib/staticfiles/testing.py,sha256=4X-EtOfXnwkJAyFT8qe4H4sbVTKgM65klLUtY81KHiE,463 +django/contrib/staticfiles/urls.py,sha256=owDM_hdyPeRmxYxZisSMoplwnzWrptI_W8-3K2f7ITA,498 +django/contrib/staticfiles/utils.py,sha256=iPXHA0yMXu37PQwCrq9zjhSzjZf_zEBXJ-dHGsqZoX8,2279 +django/contrib/staticfiles/views.py,sha256=mX70oejBU2FPZ9_idkI0EiRBkTjKcCD7JJ34gYxhM2M,1262 +django/contrib/syndication/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/contrib/syndication/__pycache__/__init__.cpython-312.pyc,, +django/contrib/syndication/__pycache__/apps.cpython-312.pyc,, +django/contrib/syndication/__pycache__/views.cpython-312.pyc,, +django/contrib/syndication/apps.py,sha256=7IpHoihPWtOcA6S4O6VoG0XRlqEp3jsfrNf-D-eluic,203 +django/contrib/syndication/views.py,sha256=c8T8V49cyTMk6KLna8fbULOr3aMjkqye6C5lMAFofUU,9309 +django/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/core/__pycache__/__init__.cpython-312.pyc,, +django/core/__pycache__/asgi.cpython-312.pyc,, +django/core/__pycache__/exceptions.cpython-312.pyc,, +django/core/__pycache__/paginator.cpython-312.pyc,, +django/core/__pycache__/signals.cpython-312.pyc,, +django/core/__pycache__/signing.cpython-312.pyc,, +django/core/__pycache__/validators.cpython-312.pyc,, +django/core/__pycache__/wsgi.cpython-312.pyc,, +django/core/asgi.py,sha256=N2L3GS6F6oL-yD9Tu2otspCi2UhbRQ90LEx3ExOP1m0,386 +django/core/cache/__init__.py,sha256=Z1LsL-TNTNVU5X3CLeHeK4Fbfar76n4zwBr4aC9kxuI,1929 +django/core/cache/__pycache__/__init__.cpython-312.pyc,, +django/core/cache/__pycache__/utils.cpython-312.pyc,, +django/core/cache/backends/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/core/cache/backends/__pycache__/__init__.cpython-312.pyc,, +django/core/cache/backends/__pycache__/base.cpython-312.pyc,, +django/core/cache/backends/__pycache__/db.cpython-312.pyc,, +django/core/cache/backends/__pycache__/dummy.cpython-312.pyc,, +django/core/cache/backends/__pycache__/filebased.cpython-312.pyc,, +django/core/cache/backends/__pycache__/locmem.cpython-312.pyc,, +django/core/cache/backends/__pycache__/memcached.cpython-312.pyc,, +django/core/cache/backends/__pycache__/redis.cpython-312.pyc,, +django/core/cache/backends/base.py,sha256=n7j5e0LbCYY3y6mv96_qEqPW1g5a_Ogp6J98dqtScv0,14291 +django/core/cache/backends/db.py,sha256=HlTGDpZugousm1JUeT9HCdp1_leMdKihOJu8cWyIqfg,11372 +django/core/cache/backends/dummy.py,sha256=fQbFiL72DnVKP9UU4WDsZYaxYKx7FlMOJhtP8aky2ic,1043 +django/core/cache/backends/filebased.py,sha256=NCV0UEKnPt8Esfd4ItW7nV9w1LNavIAy_qB02tx1By0,5788 +django/core/cache/backends/locmem.py,sha256=cqdFgPxYrfEKDvKR2IYiFV7-MwhM0CIHPxLTBxJMDTQ,4035 +django/core/cache/backends/memcached.py,sha256=cB5QRCdr9uocB-tWA1FMBQtWQRqHSRpE7UcIMYI86gI,6776 +django/core/cache/backends/redis.py,sha256=TB1bw1JK7jmUMLlu-nzuuMhtUp0JXBxzFOX149RVeFc,7924 +django/core/cache/utils.py,sha256=3ZLYgUDD6iLiLMC6vjXKfUQigsoU23ffpJx8e71M4XA,397 +django/core/checks/__init__.py,sha256=gFG0gY0C0L-akCrk1F0Q_WmkptYDLXYdyzr3wNJVIi4,1195 +django/core/checks/__pycache__/__init__.cpython-312.pyc,, +django/core/checks/__pycache__/async_checks.cpython-312.pyc,, +django/core/checks/__pycache__/caches.cpython-312.pyc,, +django/core/checks/__pycache__/database.cpython-312.pyc,, +django/core/checks/__pycache__/files.cpython-312.pyc,, +django/core/checks/__pycache__/messages.cpython-312.pyc,, +django/core/checks/__pycache__/model_checks.cpython-312.pyc,, +django/core/checks/__pycache__/registry.cpython-312.pyc,, +django/core/checks/__pycache__/templates.cpython-312.pyc,, +django/core/checks/__pycache__/translation.cpython-312.pyc,, +django/core/checks/__pycache__/urls.cpython-312.pyc,, +django/core/checks/async_checks.py,sha256=A9p_jebELrf4fiD6jJtBM6Gvm8cMb03sSuW9Ncx3-vU,403 +django/core/checks/caches.py,sha256=hbcIFD_grXUQR2lGAzzlCX6qMJfkXj02ZDJElgdT5Yg,2643 +django/core/checks/compatibility/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/core/checks/compatibility/__pycache__/__init__.cpython-312.pyc,, +django/core/checks/compatibility/__pycache__/django_4_0.cpython-312.pyc,, +django/core/checks/compatibility/django_4_0.py,sha256=2s7lm9LZ0NrhaYSrw1Y5mMkL5BC68SS-TyD-TKczbEI,657 +django/core/checks/database.py,sha256=sBj-8o4DmpG5QPy1KXgXtZ0FZ0T9xdlT4XBIc70wmEQ,341 +django/core/checks/files.py,sha256=W4yYHiWrqi0d_G6tDWTw79pr2dgJY41rOv7mRpbtp2Q,522 +django/core/checks/messages.py,sha256=vIJtvmeafgwFzwcXaoRBWkcL_t2gLTLjstWSw5xCtjQ,2241 +django/core/checks/model_checks.py,sha256=8aK5uit9yP_lDfdXBJPlz_r-46faP_gIOXLszXqLQqY,8830 +django/core/checks/registry.py,sha256=Qqig55OhANmA-QBQBSTLuy64Z2VqPT97lLlSHBgyq9g,3456 +django/core/checks/security/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/core/checks/security/__pycache__/__init__.cpython-312.pyc,, +django/core/checks/security/__pycache__/base.cpython-312.pyc,, +django/core/checks/security/__pycache__/csrf.cpython-312.pyc,, +django/core/checks/security/__pycache__/sessions.cpython-312.pyc,, +django/core/checks/security/base.py,sha256=I0Gm446twRIhbRopEmKsdsYW_NdI7_nK_ZV28msRPEo,9140 +django/core/checks/security/csrf.py,sha256=hmFJ4m9oxDGwhDAWedmtpnIYQcI8Mxcge1D6CCoOBbc,2055 +django/core/checks/security/sessions.py,sha256=Qyb93CJeQBM5LLhhrqor4KQJR2tSpFklS-p7WltXcHc,2554 +django/core/checks/templates.py,sha256=leQ8nyjQBzofWFTo6YH9NkLmt582OlG2p8sFw00sbew,296 +django/core/checks/translation.py,sha256=it7VjXf10-HBdCc3z55_lSxwok9qEncdojRBG74d4FA,1990 +django/core/checks/urls.py,sha256=-H945kSYVe_am-2XJI_T4c2V34lySfA6ZHnEEW8USJ8,4917 +django/core/exceptions.py,sha256=eMWYfZAUY9xvOIVm41ByemPfXNIY59xxO6-vT5oNWIE,6577 +django/core/files/__init__.py,sha256=Rhz5Jm9BM6gy_nf5yMtswN1VsTIILYUL7Z-5edjh_HI,60 +django/core/files/__pycache__/__init__.cpython-312.pyc,, +django/core/files/__pycache__/base.cpython-312.pyc,, +django/core/files/__pycache__/images.cpython-312.pyc,, +django/core/files/__pycache__/locks.cpython-312.pyc,, +django/core/files/__pycache__/move.cpython-312.pyc,, +django/core/files/__pycache__/temp.cpython-312.pyc,, +django/core/files/__pycache__/uploadedfile.cpython-312.pyc,, +django/core/files/__pycache__/uploadhandler.cpython-312.pyc,, +django/core/files/__pycache__/utils.cpython-312.pyc,, +django/core/files/base.py,sha256=MKNxxgiuwHHwGifpydBgjfZpTzdF7VxCQnVV-w8bqhg,4845 +django/core/files/images.py,sha256=Yms--hugUWcpsZJJJ0-UwkIe3PVZ4LjMFz4O7Ew9FBE,2644 +django/core/files/locks.py,sha256=mp96hc8nMob8cMESiASFWUTUn_afW8A4ag_viWz0ojU,3614 +django/core/files/move.py,sha256=Xv8ejaYIITJzLN2NlCE0MhFqalBYUIZiyYbjMIblkAo,2919 +django/core/files/storage/__init__.py,sha256=EosmC1_WLaAFOuapjyoKFNudQiyRIW8C2hx90oQaVD4,622 +django/core/files/storage/__pycache__/__init__.cpython-312.pyc,, +django/core/files/storage/__pycache__/base.cpython-312.pyc,, +django/core/files/storage/__pycache__/filesystem.cpython-312.pyc,, +django/core/files/storage/__pycache__/handler.cpython-312.pyc,, +django/core/files/storage/__pycache__/memory.cpython-312.pyc,, +django/core/files/storage/__pycache__/mixins.cpython-312.pyc,, +django/core/files/storage/base.py,sha256=83MumBD3zLS_tegimD51Oh9yQsIL4cYbW9dduhRnHqI,8296 +django/core/files/storage/filesystem.py,sha256=s0leHXerlPHf_VbnV-WC3YN88rOecmdjXb-k5T5lIvk,9572 +django/core/files/storage/handler.py,sha256=ntOJZ2nf2VUaUY7tKH0mndORFiGKSdh_16o3OtilIBI,1507 +django/core/files/storage/memory.py,sha256=Mz27sDPbeRXGjh77id2LHt8sErp5WAmNj89NBNRDA3I,9745 +django/core/files/storage/mixins.py,sha256=j_Y3unzk9Ccmx-QQjj4AoC3MUhXIw5nFbDYF3Qn_Fh0,700 +django/core/files/temp.py,sha256=iUegEgQ3UyUrDN10SgvKIrHfBPSej1lk-LAgJqMZBcU,2503 +django/core/files/uploadedfile.py,sha256=6hBjxmx8P0fxmZQbtj4OTsXtUk9GdIA7IUcv_KwSI08,4189 +django/core/files/uploadhandler.py,sha256=tMzeS-FJOMQBYQm2ORsLwltwZZrdOizyJSmdFjer_Sw,7180 +django/core/files/utils.py,sha256=tBT8c8wCObMmiVF4BpBpCV5_hhgMKxe2poiunwFpIcw,2602 +django/core/handlers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/core/handlers/__pycache__/__init__.cpython-312.pyc,, +django/core/handlers/__pycache__/asgi.cpython-312.pyc,, +django/core/handlers/__pycache__/base.cpython-312.pyc,, +django/core/handlers/__pycache__/exception.cpython-312.pyc,, +django/core/handlers/__pycache__/wsgi.cpython-312.pyc,, +django/core/handlers/asgi.py,sha256=-lHVt6z6ioCs0CgGIrsPVXvpqqdaH-Lc3Xb99RdSbu4,13839 +django/core/handlers/base.py,sha256=j7ScIbMLKYa52HqwHYhIfMWWAG749natcsBsVQsvBjc,14813 +django/core/handlers/exception.py,sha256=Qa03HgQpLx7nqp5emF0bwdiemE0X7U9FfuLfoOHMf_4,5922 +django/core/handlers/wsgi.py,sha256=81DErgzHAaZcw2UivrKqwS69QpoRF8tm0ASEc4v3uQ4,7315 +django/core/mail/__init__.py,sha256=gSCtVTSbqIqkHMK7no1mIqrcircH1fuIuqZmXONayuY,4959 +django/core/mail/__pycache__/__init__.cpython-312.pyc,, +django/core/mail/__pycache__/message.cpython-312.pyc,, +django/core/mail/__pycache__/utils.cpython-312.pyc,, +django/core/mail/backends/__init__.py,sha256=VJ_9dBWKA48MXBZXVUaTy9NhgfRonapA6UAjVFEPKD8,37 +django/core/mail/backends/__pycache__/__init__.cpython-312.pyc,, +django/core/mail/backends/__pycache__/base.cpython-312.pyc,, +django/core/mail/backends/__pycache__/console.cpython-312.pyc,, +django/core/mail/backends/__pycache__/dummy.cpython-312.pyc,, +django/core/mail/backends/__pycache__/filebased.cpython-312.pyc,, +django/core/mail/backends/__pycache__/locmem.cpython-312.pyc,, +django/core/mail/backends/__pycache__/smtp.cpython-312.pyc,, +django/core/mail/backends/base.py,sha256=Cljbb7nil40Dfpob2R8iLmlO0Yv_wlOCBA9hF2Z6W54,1683 +django/core/mail/backends/console.py,sha256=H6lWE18H8uSxj7LB1SGTqQ7UFpk9gWLZYq6reowixLU,1427 +django/core/mail/backends/dummy.py,sha256=sI7tAa3MfG43UHARduttBvEAYYfiLasgF39jzaZPu9E,234 +django/core/mail/backends/filebased.py,sha256=AbEBL9tXr6WIhuSQvm3dHoCpuMoDTSIkx6qFb4GMUe4,2353 +django/core/mail/backends/locmem.py,sha256=95yAcfid-4akp2Eq1DkNrHiYF2-0pKR2N7VCPxMu_50,913 +django/core/mail/backends/smtp.py,sha256=vYF03edaHedkcZqoKaSL38B2BFwuzA_uPXeMdPrDFBo,5803 +django/core/mail/message.py,sha256=QxGgpJfOGQYdHDtRvX57bTfhM_4CzR4S3lSIj0bBszA,17849 +django/core/mail/utils.py,sha256=Wf-pdSdv0WLREYzI7EVWr59K6o7tfb3d2HSbAyE3SOE,506 +django/core/management/__init__.py,sha256=gkXgKuqIpyFauk2-kgOgU-IDxcw8TjAKM_MU-erraE0,17407 +django/core/management/__pycache__/__init__.cpython-312.pyc,, +django/core/management/__pycache__/base.cpython-312.pyc,, +django/core/management/__pycache__/color.cpython-312.pyc,, +django/core/management/__pycache__/sql.cpython-312.pyc,, +django/core/management/__pycache__/templates.cpython-312.pyc,, +django/core/management/__pycache__/utils.cpython-312.pyc,, +django/core/management/base.py,sha256=zJ5lX6qXvsKBWWiBIGmDm8eSJPyiCqdWoSXPbHV_qyE,24392 +django/core/management/color.py,sha256=KXdNATK5AvxVK8wtKH2GTWApnLGCZ_1NKewTsLWCBc0,3168 +django/core/management/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/core/management/commands/__pycache__/__init__.cpython-312.pyc,, +django/core/management/commands/__pycache__/check.cpython-312.pyc,, +django/core/management/commands/__pycache__/compilemessages.cpython-312.pyc,, +django/core/management/commands/__pycache__/createcachetable.cpython-312.pyc,, +django/core/management/commands/__pycache__/dbshell.cpython-312.pyc,, +django/core/management/commands/__pycache__/diffsettings.cpython-312.pyc,, +django/core/management/commands/__pycache__/dumpdata.cpython-312.pyc,, +django/core/management/commands/__pycache__/flush.cpython-312.pyc,, +django/core/management/commands/__pycache__/inspectdb.cpython-312.pyc,, +django/core/management/commands/__pycache__/loaddata.cpython-312.pyc,, +django/core/management/commands/__pycache__/makemessages.cpython-312.pyc,, +django/core/management/commands/__pycache__/makemigrations.cpython-312.pyc,, +django/core/management/commands/__pycache__/migrate.cpython-312.pyc,, +django/core/management/commands/__pycache__/optimizemigration.cpython-312.pyc,, +django/core/management/commands/__pycache__/runserver.cpython-312.pyc,, +django/core/management/commands/__pycache__/sendtestemail.cpython-312.pyc,, +django/core/management/commands/__pycache__/shell.cpython-312.pyc,, +django/core/management/commands/__pycache__/showmigrations.cpython-312.pyc,, +django/core/management/commands/__pycache__/sqlflush.cpython-312.pyc,, +django/core/management/commands/__pycache__/sqlmigrate.cpython-312.pyc,, +django/core/management/commands/__pycache__/sqlsequencereset.cpython-312.pyc,, +django/core/management/commands/__pycache__/squashmigrations.cpython-312.pyc,, +django/core/management/commands/__pycache__/startapp.cpython-312.pyc,, +django/core/management/commands/__pycache__/startproject.cpython-312.pyc,, +django/core/management/commands/__pycache__/test.cpython-312.pyc,, +django/core/management/commands/__pycache__/testserver.cpython-312.pyc,, +django/core/management/commands/check.py,sha256=X68B4VTS8i-3LPY0TjuQOc9AM5m9HOMBNPGbzv3FDfA,2832 +django/core/management/commands/compilemessages.py,sha256=gblYId4asdPcuP2tlw5IqpIblKLB9zeW2qzjA4q-fFw,7076 +django/core/management/commands/createcachetable.py,sha256=bdKfxftffjoKQgSJfCBJRgVCwzhqnUn88MvAMPNTits,4656 +django/core/management/commands/dbshell.py,sha256=0ZofTU8SWm7M-vimeLJvRzN5YVEZ7-U-BgZTqXhHjUM,1781 +django/core/management/commands/diffsettings.py,sha256=NNL_J0P3HRzAZd9XcW7Eo_iE_lNliIpKtdcarDbBRpc,3554 +django/core/management/commands/dumpdata.py,sha256=eGPBqrzdk4YZpyRaIUQWKfxe7qprKBYY_jC8DcuJILw,11180 +django/core/management/commands/flush.py,sha256=1LRuBYcWCqIKa23IHLEdtIZzgUGGDGw0YSb6RTX1SaE,3651 +django/core/management/commands/inspectdb.py,sha256=PJ-zDxhwWY3suqZ4odnWyDLry0wy_i3CzMS1JubzNw0,17372 +django/core/management/commands/loaddata.py,sha256=8odpvT9UxaJuHA7ze5dDUHzFeq-dhdbH9Lk19JY3QZo,16008 +django/core/management/commands/makemessages.py,sha256=2wWAiFl-S9SRY5qgBU1GCB68EjnnfVhp_zzv6Jo6q8s,29423 +django/core/management/commands/makemigrations.py,sha256=gxIR6-Dc3OyaW2VrN8j4hVAql8OSN7tZ38x-bjagRpU,22466 +django/core/management/commands/migrate.py,sha256=-r78CKcgXqmFTK_ZGkmqLTgZr6UGAv_kZ7hyVsiFL1M,21415 +django/core/management/commands/optimizemigration.py,sha256=GVWIhX94tOLHEx53w-VrUc48euVWpKCLMw-BbpiQgIg,5224 +django/core/management/commands/runserver.py,sha256=Ax-IvMnZAleIhXdFJlU10YT5pPpXvjSaYbxZvygUMTI,6913 +django/core/management/commands/sendtestemail.py,sha256=sF5TUMbD_tlGBnUsn9t-oFVGNSyeiWRIrgyPbJE88cs,1518 +django/core/management/commands/shell.py,sha256=LKmj6KYv6zpJzQ2mWtR4-u2CDSQL-_Na6TsT4JLYsi4,4613 +django/core/management/commands/showmigrations.py,sha256=24s51EzwIhL6lIpumivpaixQTDGx7I1qJ0wKFNGaEMU,6847 +django/core/management/commands/sqlflush.py,sha256=7KiAXzUqqE3IeGresT-kVzyk_i8XP2NTsIBmYt30D3Y,1031 +django/core/management/commands/sqlmigrate.py,sha256=uMz1V1AZxyyo9UNs4x_vMh3_-aCcYLVxy0VHILtKBLU,3348 +django/core/management/commands/sqlsequencereset.py,sha256=cdnbbd7y81CAYK9KX-V6Ho8KJIO_mVtG3V6tftIBp6g,1101 +django/core/management/commands/squashmigrations.py,sha256=ltDbyWCCLwNknkjG9rZG7DpLl7XgQKXJN7F31uVY5z8,10862 +django/core/management/commands/startapp.py,sha256=Dhllhaf1q3EKVnyBLhJ9QsWf6JmjAtYnVLruHsmMlcQ,503 +django/core/management/commands/startproject.py,sha256=Iv7KOco1GkzGqUEME_LCx5vGi4JfY8-lzdkazDqF7k8,789 +django/core/management/commands/test.py,sha256=UXxsInhGqrcsMMiHk6uBvAwMMzCZDwJl5_Ql3L6lkx8,2367 +django/core/management/commands/testserver.py,sha256=aiS0tCe6uXp9hjcE1LUfZ118xAcMa28ImHL4ynQSqO8,2238 +django/core/management/sql.py,sha256=fP6Bvq4NrQB_9Tb6XsYeCg57xs2Ck6uaCXq0ojFOSvA,1851 +django/core/management/templates.py,sha256=PlaxlTex6m1d42f_HT-B2nhittfw6RmjkIphVlQ558c,15415 +django/core/management/utils.py,sha256=VbXTgGLO7HYzg3Y93nt8VkHbPOBWWyojVHDMfdyzcyc,5434 +django/core/paginator.py,sha256=YFR2EE0W2cLhEuXSWI67c33DreVVSxlz9xRjqGs50zc,7905 +django/core/serializers/__init__.py,sha256=gaH58ip_2dyUFDlfOPenMkVJftQQOBvXqCcZBjAKwTA,8772 +django/core/serializers/__pycache__/__init__.cpython-312.pyc,, +django/core/serializers/__pycache__/base.cpython-312.pyc,, +django/core/serializers/__pycache__/json.cpython-312.pyc,, +django/core/serializers/__pycache__/jsonl.cpython-312.pyc,, +django/core/serializers/__pycache__/python.cpython-312.pyc,, +django/core/serializers/__pycache__/pyyaml.cpython-312.pyc,, +django/core/serializers/__pycache__/xml_serializer.cpython-312.pyc,, +django/core/serializers/base.py,sha256=6LnbPCb4wbDYsE3svEztt2AlS5hZx3NmIdM_0uRijh0,12631 +django/core/serializers/json.py,sha256=dP-VqkWpam7kZxTTPqnB5nZY9CEgS48bi1JAm27jwUo,3464 +django/core/serializers/jsonl.py,sha256=671JRbWRgOH3-oeD3auK9QCziwtrcdbyCIRDy5s4Evw,1879 +django/core/serializers/python.py,sha256=Sokl0FEwRwgKV7hKDAOZL30-Si6DWs9_kANyt7mFjss,6866 +django/core/serializers/pyyaml.py,sha256=77zu6PCfJg_75m36lX9X5018ADcux5qsDGajKNh4pI8,2955 +django/core/serializers/xml_serializer.py,sha256=HL7H3zByt0YhhoAAAzWiIq_zWG6R_byKDdBINX0v79g,18323 +django/core/servers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/core/servers/__pycache__/__init__.cpython-312.pyc,, +django/core/servers/__pycache__/basehttp.cpython-312.pyc,, +django/core/servers/basehttp.py,sha256=0XtDP4SDBGovGKe6oXBba6-qgBJK2lw1umB8RXSOtUo,9995 +django/core/signals.py,sha256=5vh1e7IgPN78WXPo7-hEMPN9tQcqJSZHu0WCibNgd-E,151 +django/core/signing.py,sha256=5-uDACJ8WxTJmwfwPoXRIO4nSr2v4032aTVwPaPLxWA,8772 +django/core/validators.py,sha256=SSPEX_MqfIovToXrXEyq8mkG7zznaQUUCxIei-HjDC0,23281 +django/core/wsgi.py,sha256=2sYMSe3IBrENeQT7rys-04CRmf8hW2Q2CjlkBUIyjHk,388 +django/db/__init__.py,sha256=CBuehITrkVMn02P63M0GY1MnZuC0GefA1MAoxlVo3b4,1533 +django/db/__pycache__/__init__.cpython-312.pyc,, +django/db/__pycache__/transaction.cpython-312.pyc,, +django/db/__pycache__/utils.cpython-312.pyc,, +django/db/backends/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/db/backends/__pycache__/__init__.cpython-312.pyc,, +django/db/backends/__pycache__/ddl_references.cpython-312.pyc,, +django/db/backends/__pycache__/signals.cpython-312.pyc,, +django/db/backends/__pycache__/utils.cpython-312.pyc,, +django/db/backends/base/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/db/backends/base/__pycache__/__init__.cpython-312.pyc,, +django/db/backends/base/__pycache__/base.cpython-312.pyc,, +django/db/backends/base/__pycache__/client.cpython-312.pyc,, +django/db/backends/base/__pycache__/creation.cpython-312.pyc,, +django/db/backends/base/__pycache__/features.cpython-312.pyc,, +django/db/backends/base/__pycache__/introspection.cpython-312.pyc,, +django/db/backends/base/__pycache__/operations.cpython-312.pyc,, +django/db/backends/base/__pycache__/schema.cpython-312.pyc,, +django/db/backends/base/__pycache__/validation.cpython-312.pyc,, +django/db/backends/base/base.py,sha256=MHWLJhA7-1OyOs9-L0CQLBoH8_Iw1_VOTZw1xJSP6GU,28603 +django/db/backends/base/client.py,sha256=90Ffs6zZYCli3tJjwsPH8TItZ8tz1Pp-zhQa-EpsNqc,937 +django/db/backends/base/creation.py,sha256=AFQL_xz48jYzZTdHl3r3d_2v_xGyJMMENXmEUcbRv48,15847 +django/db/backends/base/features.py,sha256=ijP81ZHfZPlUMKVHTjNxZ3IRWmwPdy4hpE6CxJSKZk8,15914 +django/db/backends/base/introspection.py,sha256=CJG3MUmR-wJpNm-gNWuMRMNknWp3ZdZ9DRUbKxcnwuo,7900 +django/db/backends/base/operations.py,sha256=j3OSjD1goRgNntZGnQ15-A7IKj9vV6rFrp338uqNLS8,30229 +django/db/backends/base/schema.py,sha256=mOcKOflaMQgRQ0I6IrOwbN6ET74F1rvm6Davghr3jYY,82021 +django/db/backends/base/validation.py,sha256=2zpI11hyUJr0I0cA1xmvoFwQVdZ-7_1T2F11TpQ0Rkk,1067 +django/db/backends/ddl_references.py,sha256=dUlkGLGdjOnacR_8PaweA5XSwgD8wojMTJUVOCOKVLY,8619 +django/db/backends/dummy/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/db/backends/dummy/__pycache__/__init__.cpython-312.pyc,, +django/db/backends/dummy/__pycache__/base.cpython-312.pyc,, +django/db/backends/dummy/__pycache__/features.cpython-312.pyc,, +django/db/backends/dummy/base.py,sha256=im1_ubNhbY6cP8yNntqDr6Hlg5d5c_5r5IUCPCDfv28,2181 +django/db/backends/dummy/features.py,sha256=Pg8_jND-aoJomTaBBXU3hJEjzpB-rLs6VwpoKkOYuQg,181 +django/db/backends/mysql/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/db/backends/mysql/__pycache__/__init__.cpython-312.pyc,, +django/db/backends/mysql/__pycache__/base.cpython-312.pyc,, +django/db/backends/mysql/__pycache__/client.cpython-312.pyc,, +django/db/backends/mysql/__pycache__/compiler.cpython-312.pyc,, +django/db/backends/mysql/__pycache__/creation.cpython-312.pyc,, +django/db/backends/mysql/__pycache__/features.cpython-312.pyc,, +django/db/backends/mysql/__pycache__/introspection.cpython-312.pyc,, +django/db/backends/mysql/__pycache__/operations.cpython-312.pyc,, +django/db/backends/mysql/__pycache__/schema.cpython-312.pyc,, +django/db/backends/mysql/__pycache__/validation.cpython-312.pyc,, +django/db/backends/mysql/base.py,sha256=QgYv7BTHG1vGAGo6kQA27ihnyPhlxLzOPf3pBLuxpME,16861 +django/db/backends/mysql/client.py,sha256=IpwdI-H5r-QUoM8ZvPXHykNxKb2wevcUx8HvxTn_otU,2988 +django/db/backends/mysql/compiler.py,sha256=SPhbsHi8x_r4ZG8U7-Tnqr6F0G4rsxOyJjITKPHz3zE,3333 +django/db/backends/mysql/creation.py,sha256=8BV8YHk3qEq555nH3NHukxpZZgxtvXFvkv7XvkRlhKA,3449 +django/db/backends/mysql/features.py,sha256=IgbPUyEdeaUjQyo-_gbxMOtnkC-QCn1CPBe21CMRSwU,11998 +django/db/backends/mysql/introspection.py,sha256=AY06ZLynWypYTEGAsR-t4F9Uj7Fb0Hqi-QNW1YwRnEQ,14498 +django/db/backends/mysql/operations.py,sha256=R6dNA_IV4_o4e2gq8kh2kfqu4yoYoZVw_LGrqwNBxtQ,18437 +django/db/backends/mysql/schema.py,sha256=gT0N65db0omSMm4w09CccIN44cPbXzocL0ptzbUpWtc,11259 +django/db/backends/mysql/validation.py,sha256=XERj0lPEihKThPvzoVJmNpWdPOun64cRF3gHv-zmCGk,3093 +django/db/backends/oracle/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/db/backends/oracle/__pycache__/__init__.cpython-312.pyc,, +django/db/backends/oracle/__pycache__/base.cpython-312.pyc,, +django/db/backends/oracle/__pycache__/client.cpython-312.pyc,, +django/db/backends/oracle/__pycache__/creation.cpython-312.pyc,, +django/db/backends/oracle/__pycache__/features.cpython-312.pyc,, +django/db/backends/oracle/__pycache__/functions.cpython-312.pyc,, +django/db/backends/oracle/__pycache__/introspection.cpython-312.pyc,, +django/db/backends/oracle/__pycache__/operations.cpython-312.pyc,, +django/db/backends/oracle/__pycache__/oracledb_any.cpython-312.pyc,, +django/db/backends/oracle/__pycache__/schema.cpython-312.pyc,, +django/db/backends/oracle/__pycache__/utils.cpython-312.pyc,, +django/db/backends/oracle/__pycache__/validation.cpython-312.pyc,, +django/db/backends/oracle/base.py,sha256=Cu9jrGmB_6GlRIJjagt584MnhxO-8aoMtiL1Dt4bE-0,24171 +django/db/backends/oracle/client.py,sha256=DfDURfno8Sek13M8r5S2t2T8VUutx2hBT9DZRfow9VQ,784 +django/db/backends/oracle/creation.py,sha256=yHymYOsth1y8jxiyP5k7MZQeatKw75XvTT3J88vNLkE,20840 +django/db/backends/oracle/features.py,sha256=vZVkuIvOFqadou2pxSyhjIHqIjGLaZvAYi0UmV75vts,8530 +django/db/backends/oracle/functions.py,sha256=2OoBYyY1Lb4B5hYbkRHjd8YY_artr3QeGu2hlojC-vc,812 +django/db/backends/oracle/introspection.py,sha256=MjjO-PqpcfiUd9WkLqiC8XGgbC4gocvymqQ1bh-ceKk,15474 +django/db/backends/oracle/operations.py,sha256=IVYHcknSUT0OEjnmmJV0yUFZTm-kDUuaJU97_7hGkBk,30008 +django/db/backends/oracle/oracledb_any.py,sha256=dZY337k3TH1JfZaXZR6HmDy6roolJrj50Sbv-27neFg,550 +django/db/backends/oracle/schema.py,sha256=M_Zuts3EQHIm966nK5rLIfxMYcNBc9i8QCePAdsBmKw,10700 +django/db/backends/oracle/utils.py,sha256=C9gumfPZAToaBg3HgsUoH5EU-_goM8ZrL_7VI5yw098,2753 +django/db/backends/oracle/validation.py,sha256=cq-Bvy5C0_rmkgng0SSQ4s74FKg2yTM1N782Gfz86nY,860 +django/db/backends/postgresql/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/db/backends/postgresql/__pycache__/__init__.cpython-312.pyc,, +django/db/backends/postgresql/__pycache__/base.cpython-312.pyc,, +django/db/backends/postgresql/__pycache__/client.cpython-312.pyc,, +django/db/backends/postgresql/__pycache__/creation.cpython-312.pyc,, +django/db/backends/postgresql/__pycache__/features.cpython-312.pyc,, +django/db/backends/postgresql/__pycache__/introspection.cpython-312.pyc,, +django/db/backends/postgresql/__pycache__/operations.cpython-312.pyc,, +django/db/backends/postgresql/__pycache__/psycopg_any.cpython-312.pyc,, +django/db/backends/postgresql/__pycache__/schema.cpython-312.pyc,, +django/db/backends/postgresql/base.py,sha256=1ztHLo0_MVteU_WoEOXoDWoDEDBfpmjHoNDzRQOKr6c,23486 +django/db/backends/postgresql/client.py,sha256=BxpiOYe2hzg4tWjPKHDJxa8zdr6S7CN9YiaOhTDJUOo,2044 +django/db/backends/postgresql/creation.py,sha256=pZYCzq893jcMd8jhnUH2suBaOC9LrkTtpBn9gdpqxTY,3886 +django/db/backends/postgresql/features.py,sha256=fkA6TruxChcZP2Q2r1fJTzXXIek57XKXIkhusWUphe4,6378 +django/db/backends/postgresql/introspection.py,sha256=0j4Y5ZAuSk8iaMbDBjUF9zHTcL3C5WibIiJygOvZMP8,11604 +django/db/backends/postgresql/operations.py,sha256=4wtKho3nrvigXJ1ymSmsJw1blPEhcRCjYAqeajd1iRE,15473 +django/db/backends/postgresql/psycopg_any.py,sha256=X2aU-MHfDNbXaKT2-2VC3mhiAVxYth_uMJPKoAPLsKQ,3885 +django/db/backends/postgresql/schema.py,sha256=TQM6fsyMssSEs5HiqoIL1hRaZAHB1b3Gg5bLYuTKEh8,14339 +django/db/backends/signals.py,sha256=Yl14KjYJijTt1ypIZirp90lS7UTJ8UogPFI_DwbcsSc,66 +django/db/backends/sqlite3/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/db/backends/sqlite3/__pycache__/__init__.cpython-312.pyc,, +django/db/backends/sqlite3/__pycache__/_functions.cpython-312.pyc,, +django/db/backends/sqlite3/__pycache__/base.cpython-312.pyc,, +django/db/backends/sqlite3/__pycache__/client.cpython-312.pyc,, +django/db/backends/sqlite3/__pycache__/creation.cpython-312.pyc,, +django/db/backends/sqlite3/__pycache__/features.cpython-312.pyc,, +django/db/backends/sqlite3/__pycache__/introspection.cpython-312.pyc,, +django/db/backends/sqlite3/__pycache__/operations.cpython-312.pyc,, +django/db/backends/sqlite3/__pycache__/schema.cpython-312.pyc,, +django/db/backends/sqlite3/_functions.py,sha256=4rwADvq4dJu8EAzUXPnrmN_lDcfg_Xf0w7DRHgj8faw,14559 +django/db/backends/sqlite3/base.py,sha256=osegQjtwLOGgblJCVfLNjzaJQ5br7hAC6i3GRZxtjto,15000 +django/db/backends/sqlite3/client.py,sha256=Eb_-P1w0aTbZGVNYkv7KA1ku5Il1N2RQov2lc3v0nho,321 +django/db/backends/sqlite3/creation.py,sha256=Ib9pfwA53G4wZpLZgh7EvdipoSdvhg-wxKSP2ZowwFM,6849 +django/db/backends/sqlite3/features.py,sha256=Fsqn-weI5SGOE4M7MfOtaDJhWUwaOMSzE_xOBVsfaJw,6295 +django/db/backends/sqlite3/introspection.py,sha256=tW6u4aGhbTUQ0AxK3xgJPU7weA9BGkBTXelFtWRh5ow,17551 +django/db/backends/sqlite3/operations.py,sha256=paIHeI57f7wImFr6sdt9EYLMPcK875Y3fp4LW-0H7jU,16880 +django/db/backends/sqlite3/schema.py,sha256=GuyAJRj5iunzQZturcnxHN7_BPtsqrsxMA8URFO0tAA,20215 +django/db/backends/utils.py,sha256=wFyQVfVs1AxR48yQIVQ-ll1sC9GUeCxdP-aavYL0lrs,11137 +django/db/migrations/__init__.py,sha256=Oa4RvfEa6hITCqdcqwXYC66YknFKyluuy7vtNbSc-L4,97 +django/db/migrations/__pycache__/__init__.cpython-312.pyc,, +django/db/migrations/__pycache__/autodetector.cpython-312.pyc,, +django/db/migrations/__pycache__/exceptions.cpython-312.pyc,, +django/db/migrations/__pycache__/executor.cpython-312.pyc,, +django/db/migrations/__pycache__/graph.cpython-312.pyc,, +django/db/migrations/__pycache__/loader.cpython-312.pyc,, +django/db/migrations/__pycache__/migration.cpython-312.pyc,, +django/db/migrations/__pycache__/optimizer.cpython-312.pyc,, +django/db/migrations/__pycache__/questioner.cpython-312.pyc,, +django/db/migrations/__pycache__/recorder.cpython-312.pyc,, +django/db/migrations/__pycache__/serializer.cpython-312.pyc,, +django/db/migrations/__pycache__/state.cpython-312.pyc,, +django/db/migrations/__pycache__/utils.cpython-312.pyc,, +django/db/migrations/__pycache__/writer.cpython-312.pyc,, +django/db/migrations/autodetector.py,sha256=PTK23c8g2cQ5o5urT5gJpSJnrKLPKba_K2AhxHEuIXY,84048 +django/db/migrations/exceptions.py,sha256=SotQF7ZKgJpd9KN-gKDL8wCJAKSEgbZToM_vtUAnqHw,1204 +django/db/migrations/executor.py,sha256=jx9J5WdS0X48UqxHkWKd2JYBUxds46Gn03ZZNAo8pTE,19038 +django/db/migrations/graph.py,sha256=vt7Pc45LuiXR8aRCrXP5Umm6VDCCTs2LAr5NXh-rxcE,13055 +django/db/migrations/loader.py,sha256=cVeJi7PwDc2Nxzgg3K_CrhK9H2HAtaXb1tG1PyDcSEA,16877 +django/db/migrations/migration.py,sha256=itZASGGepJYCY2Uv5AmLrxOgjEH1tycGV0bv3EtRjQE,9767 +django/db/migrations/operations/__init__.py,sha256=qIOjQYpm3tOtj1jsJVSpzxDH_kYAWk8MOGj-R3WYvJc,964 +django/db/migrations/operations/__pycache__/__init__.cpython-312.pyc,, +django/db/migrations/operations/__pycache__/base.cpython-312.pyc,, +django/db/migrations/operations/__pycache__/fields.cpython-312.pyc,, +django/db/migrations/operations/__pycache__/models.cpython-312.pyc,, +django/db/migrations/operations/__pycache__/special.cpython-312.pyc,, +django/db/migrations/operations/base.py,sha256=IPBwWk-8j44IZw6FvXC9RVXqecbF0OhK-R_LMYwhNd4,5562 +django/db/migrations/operations/fields.py,sha256=OAGpT0youYLL7LcxcpO-N5fhzGlx0r_wK1ZitM7qmAE,12900 +django/db/migrations/operations/models.py,sha256=RvX62tOl3DaYktF2qJbpHLO2mKnlRd6ai3umt7qFB6Y,44385 +django/db/migrations/operations/special.py,sha256=CMLfqR4rO8AhDMNscOXjblKuvNA3vWFzg-6M_7xZnX4,7966 +django/db/migrations/optimizer.py,sha256=c0JZ5FGltD_gmh20e5SR6A21q_De6rUKfkAJKwmX4Ks,3255 +django/db/migrations/questioner.py,sha256=HVtcEBRxQwL9JrQO5r1bVIZIZUFBfs9L-siuDQERZh0,13330 +django/db/migrations/recorder.py,sha256=HviA3DydJPqpE8gowv1lAnIdLMTSRpRXuLFn53r-Q1Y,3827 +django/db/migrations/serializer.py,sha256=oPznMQhNezYzUb-R1U79iIAp4DtZocFvjK--B0Bbyv4,14133 +django/db/migrations/state.py,sha256=W46D-rTkF2bLonDKgg6ucEyGAY-TEU2W4Gp5R43aubY,40750 +django/db/migrations/utils.py,sha256=pdrzumGDhgytc5KVWdZov7cQtBt3jRASLqbmBxSRSvg,4401 +django/db/migrations/writer.py,sha256=OWRUgtTrBLndIUeNxL3-6gI5ORPdIWG_Jy9Iluizs0M,11613 +django/db/models/__init__.py,sha256=Br4FzeU4EiGShlasR9xYwaXVXfVUtnbsrp7kEkWo-QQ,2992 +django/db/models/__pycache__/__init__.cpython-312.pyc,, +django/db/models/__pycache__/aggregates.cpython-312.pyc,, +django/db/models/__pycache__/base.cpython-312.pyc,, +django/db/models/__pycache__/constants.cpython-312.pyc,, +django/db/models/__pycache__/constraints.cpython-312.pyc,, +django/db/models/__pycache__/deletion.cpython-312.pyc,, +django/db/models/__pycache__/enums.cpython-312.pyc,, +django/db/models/__pycache__/expressions.cpython-312.pyc,, +django/db/models/__pycache__/indexes.cpython-312.pyc,, +django/db/models/__pycache__/lookups.cpython-312.pyc,, +django/db/models/__pycache__/manager.cpython-312.pyc,, +django/db/models/__pycache__/options.cpython-312.pyc,, +django/db/models/__pycache__/query.cpython-312.pyc,, +django/db/models/__pycache__/query_utils.cpython-312.pyc,, +django/db/models/__pycache__/signals.cpython-312.pyc,, +django/db/models/__pycache__/utils.cpython-312.pyc,, +django/db/models/aggregates.py,sha256=IRMdrM8j5t5R2Bpi-mStifRtBuaIyicymG-cSNgslCE,7663 +django/db/models/base.py,sha256=0qm6ImuWmdX03iVxNuDWPUc-_DpVk64TJ8hn55RkyMg,97078 +django/db/models/constants.py,sha256=ndnj9TOTKW0p4YcIPLOLEbsH6mOgFi6B1-rIzr_iwwU,210 +django/db/models/constraints.py,sha256=xSb5vVkGuMg4-8T2u7goQ9I8AH6sk5HZR2NdoKGdGtM,27772 +django/db/models/deletion.py,sha256=-d11zKahydG3NuyeM-HZLp1ZE9HWvZbMK8DEE0PzV5Q,21003 +django/db/models/enums.py,sha256=mgBBX7bFzuPYgkPR9hvy4FZOtbZE5gfbhHWsvrIhONQ,3527 +django/db/models/expressions.py,sha256=pEEBlVnK8DVeM1kdMksnyGaLGTxWL8oXY6zfPmc4caY,72565 +django/db/models/fields/__init__.py,sha256=zuout4tQcpK99Pc5JfLRM9jE8Xi_G3r5vcgaN15_-zQ,98305 +django/db/models/fields/__pycache__/__init__.cpython-312.pyc,, +django/db/models/fields/__pycache__/files.cpython-312.pyc,, +django/db/models/fields/__pycache__/generated.cpython-312.pyc,, +django/db/models/fields/__pycache__/json.cpython-312.pyc,, +django/db/models/fields/__pycache__/mixins.cpython-312.pyc,, +django/db/models/fields/__pycache__/proxy.cpython-312.pyc,, +django/db/models/fields/__pycache__/related.cpython-312.pyc,, +django/db/models/fields/__pycache__/related_descriptors.cpython-312.pyc,, +django/db/models/fields/__pycache__/related_lookups.cpython-312.pyc,, +django/db/models/fields/__pycache__/reverse_related.cpython-312.pyc,, +django/db/models/fields/files.py,sha256=nLiRiY9bcVEwE8s5J6yxo2HqN3HreDHPDNHfaW3qLrs,20206 +django/db/models/fields/generated.py,sha256=hzCBUpS1fvoimEI_D7WtoLk6AryGw0TRdyk-UkYBDJE,7655 +django/db/models/fields/json.py,sha256=3ILErpyDWTplMZSvGf0N8mCQbUKZ1LVCZEoLMYBSAHg,22066 +django/db/models/fields/mixins.py,sha256=8HrdKIq0eG9vVstJwkK-2g2wdwyvcEVWBzP3S0hzeWY,2478 +django/db/models/fields/proxy.py,sha256=eFHyl4gRTqocjgd6nID9UlQuOIppBA57Vcr71UReTAs,515 +django/db/models/fields/related.py,sha256=HzwQIVSyRQp8smW_8ImQ-AKJt5vbJRvj3hkzF14poNo,76543 +django/db/models/fields/related_descriptors.py,sha256=7ztPstQcip5e-N7QT2BAXsAVXY5f6tnm3MFg7rxeCds,66832 +django/db/models/fields/related_lookups.py,sha256=qTe81CM5MVVxmn28jfaoTDPYgh_m4gHW7g_MyJVtrmo,7813 +django/db/models/fields/reverse_related.py,sha256=vfkd-rmEFGqwqhZKRur2KNbPvTF0L1-QYPuY3qn1aP4,12882 +django/db/models/functions/__init__.py,sha256=aglCm_JtzDYk2KmxubDN_78CGG3JCfRWnfJ74Oj5YJ4,2658 +django/db/models/functions/__pycache__/__init__.cpython-312.pyc,, +django/db/models/functions/__pycache__/comparison.cpython-312.pyc,, +django/db/models/functions/__pycache__/datetime.cpython-312.pyc,, +django/db/models/functions/__pycache__/math.cpython-312.pyc,, +django/db/models/functions/__pycache__/mixins.cpython-312.pyc,, +django/db/models/functions/__pycache__/text.cpython-312.pyc,, +django/db/models/functions/__pycache__/window.cpython-312.pyc,, +django/db/models/functions/comparison.py,sha256=2aZ9uj1WRWW1eaWVHzkW0IsQyTFYsl3DLfA2jIHXIoQ,8984 +django/db/models/functions/datetime.py,sha256=IxDj0X1IUkzbIFbyDmjQZ0PL7eIO2rMn1kU47JlSl1E,13614 +django/db/models/functions/math.py,sha256=NugCfaC8Y_VhpEr62HMeDX3O934NnuBPsk3mi5I_DmE,6140 +django/db/models/functions/mixins.py,sha256=UqpHYyF33JSEWYdggezTtWkrMkPKFEfW6enIkujzgaQ,2382 +django/db/models/functions/text.py,sha256=aBnl-5-l3qw8wa7hFIOcHCoUOLGtlk6SFFY4PYZGMtU,11528 +django/db/models/functions/window.py,sha256=g4fryay1tLQCpZRfmPQhrTiuib4RvPqtwFdodlLbi98,2841 +django/db/models/indexes.py,sha256=HYCD06Is7-f0aIGkXdWNeEXzfBoSY6ECNCiVbe8tlwk,11935 +django/db/models/lookups.py,sha256=0kFrvPOg9deZ2NN-vSNGsB55K1DyKH5770NiX1nN1gw,27407 +django/db/models/manager.py,sha256=n97p4q0ttwmI1XcF9dAl8Pfg5Zs8iudufhWebQ7Xau0,6866 +django/db/models/options.py,sha256=Q7uyChb_iUw-L9C8QNFsHi6jSRn4FqZulpxSXXqooNA,39039 +django/db/models/query.py,sha256=rdmIkedhXBaHqGvf00I3YpbuPHcCiLDpIjxle-ZU25Q,105536 +django/db/models/query_utils.py,sha256=w3x-mS-FFnF4GXkXr4_Otgv5Nst9skYNC1Hmj5pycwc,17266 +django/db/models/signals.py,sha256=mG6hxVWugr_m0ugTU2XAEMiqlu2FJ4CBuGa34dLJvEQ,1622 +django/db/models/sql/__init__.py,sha256=BGZ1GSn03dTOO8PYx6vF1-ImE3g1keZsQ74AHJoQwmQ,241 +django/db/models/sql/__pycache__/__init__.cpython-312.pyc,, +django/db/models/sql/__pycache__/compiler.cpython-312.pyc,, +django/db/models/sql/__pycache__/constants.cpython-312.pyc,, +django/db/models/sql/__pycache__/datastructures.cpython-312.pyc,, +django/db/models/sql/__pycache__/query.cpython-312.pyc,, +django/db/models/sql/__pycache__/subqueries.cpython-312.pyc,, +django/db/models/sql/__pycache__/where.cpython-312.pyc,, +django/db/models/sql/compiler.py,sha256=ny4zohi_eSFtYhri7eRJiSSgdyDV26_xpKPIOfubKqM,89920 +django/db/models/sql/constants.py,sha256=usb1LSh9WNGPsurWAGppDkV0wYJJg5GEegKibQdS718,533 +django/db/models/sql/datastructures.py,sha256=tDcVdWqVZgpzcMgEVBVBNyR21-UCoV2bd6o0AkgeUGs,8271 +django/db/models/sql/query.py,sha256=hA2k3gQUAdvWqD0V5DuhvupGMkTqzzbLjoptJqCArEw,116561 +django/db/models/sql/subqueries.py,sha256=0UgV3H-aG3178weqpp_hfQkwgUxm5t3LDlSKGAqmaU8,6029 +django/db/models/sql/where.py,sha256=Vi98aGtuFwccTDp9LJ5AtQiitnrZyF8VdRlGqsdIKBg,13049 +django/db/models/utils.py,sha256=vzojL0uUQHuOm2KxTJ19DHGnQ1pBXbnWaTlzR0vVimI,2182 +django/db/transaction.py,sha256=U9O5DF_Eg8SG1dvcn_oFimU-ONaXKoHdDsXl0ZYtjFM,12504 +django/db/utils.py,sha256=RKtSSyVJmM5__SAs1pY0njX6hLVRy1WIBggYo1zP4RI,9279 +django/dispatch/__init__.py,sha256=qP203zNwjaolUFnXLNZHnuBn7HNzyw9_JkODECRKZbc,286 +django/dispatch/__pycache__/__init__.cpython-312.pyc,, +django/dispatch/__pycache__/dispatcher.cpython-312.pyc,, +django/dispatch/dispatcher.py,sha256=OHaB-_kl1GeVwKh_bIMbHNFmH2yVN4qfSQz2aAVXfME,17777 +django/dispatch/license.txt,sha256=VABMS2BpZOvBY68W0EYHwW5Cj4p4oCb-y1P3DAn0qU8,1743 +django/forms/__init__.py,sha256=S6ckOMmvUX-vVST6AC-M8BzsfVQwuEUAdHWabMN-OGI,368 +django/forms/__pycache__/__init__.cpython-312.pyc,, +django/forms/__pycache__/boundfield.cpython-312.pyc,, +django/forms/__pycache__/fields.cpython-312.pyc,, +django/forms/__pycache__/forms.cpython-312.pyc,, +django/forms/__pycache__/formsets.cpython-312.pyc,, +django/forms/__pycache__/models.cpython-312.pyc,, +django/forms/__pycache__/renderers.cpython-312.pyc,, +django/forms/__pycache__/utils.cpython-312.pyc,, +django/forms/__pycache__/widgets.cpython-312.pyc,, +django/forms/boundfield.py,sha256=2skied44gaSV-e9TSB-iP1EVyQN_5KsOcVd30vHggmc,13029 +django/forms/fields.py,sha256=POauofCdgP4jxTeHNt9xtE0CES1ZAbi86wqEWSMjLqo,49511 +django/forms/forms.py,sha256=z43KFrTN97zgAXoybZeVafVWsRNZGHB6cwNLRUoDK9g,15767 +django/forms/formsets.py,sha256=ps-7Og-757fKSgPT6xoJJ8UFzYnIbJuZ0_rKEdZzRO4,21190 +django/forms/jinja2/django/forms/attrs.html,sha256=TD0lNK-ohDjb_bWg1Kosdn4kU01B_M0_C19dp9kYJqo,165 +django/forms/jinja2/django/forms/div.html,sha256=WaOqY1hQe1l6vnc3TdlBmQnQRsofIoNDvGAfg2-X1lU,514 +django/forms/jinja2/django/forms/errors/dict/default.html,sha256=1DLQf0Czjr5V4cghQOyJr3v34G2ClF0RAOc-H7GwXUE,49 +django/forms/jinja2/django/forms/errors/dict/text.txt,sha256=E7eqEWc6q2_kLyc9k926klRe2mPp4O2VqG-2_MliYaU,113 +django/forms/jinja2/django/forms/errors/dict/ul.html,sha256=65EYJOqDAn7-ca7FtjrcdbXygLE-RA_IJQTltO7qS1Q,137 +django/forms/jinja2/django/forms/errors/list/default.html,sha256=q41d4u6XcxDL06gRAVdU021kM_iFLIt5BuYa-HATOWE,49 +django/forms/jinja2/django/forms/errors/list/text.txt,sha256=VVbLrGMHcbs1hK9-2v2Y6SIoH9qRMtlKzM6qzLVAFyE,52 +django/forms/jinja2/django/forms/errors/list/ul.html,sha256=AwXfGxnos6llX44dhxMChz6Kk6VStAJiNzUpSLN8_y4,119 +django/forms/jinja2/django/forms/field.html,sha256=-3Ta35bjK6x9yOMn9it5RJJOVJlBXrKfZobcNV02PDY,573 +django/forms/jinja2/django/forms/formsets/div.html,sha256=uq10XZdQ1WSt6kJFoKxtluvnCKE4L3oYcLkPraF4ovs,86 +django/forms/jinja2/django/forms/formsets/p.html,sha256=HzEX7XdSDt9owDkYJvBdFIETeU9RDbXc1e4R2YEt6ec,84 +django/forms/jinja2/django/forms/formsets/table.html,sha256=L9B4E8lR0roTr7dBoMiUlekuMbO-3y4_b4NHm6Oy_Vg,88 +django/forms/jinja2/django/forms/formsets/ul.html,sha256=ANvMWb6EeFAtLPDTr61IeI3-YHtAYZCT_zmm-_y-5Oc,85 +django/forms/jinja2/django/forms/label.html,sha256=trXo6yF4ezDv-y-8y1yJnP7sSByw0TTppgZLcrmfR6M,147 +django/forms/jinja2/django/forms/p.html,sha256=NsTxSuqV58iOT7_3EvWRkY1zVYCdhzLBrtde1V47QTA,740 +django/forms/jinja2/django/forms/table.html,sha256=RoJweFtjCPwkFhAAlPT7i_sSCDxo1xMs3NH0uFIla20,881 +django/forms/jinja2/django/forms/ul.html,sha256=svUpAmU5EhhGVHKs8qXixJN-3SzPft8CXoG3-4gegs8,779 +django/forms/jinja2/django/forms/widgets/attrs.html,sha256=_J2P-AOpHFhIwaqCNcrJFxEY4s-KPdy0Wcq0KlarIG0,172 +django/forms/jinja2/django/forms/widgets/checkbox.html,sha256=fXpbxMzAdbv_avfWC5464gD2jFng931Eq7vzbzy1-yA,48 +django/forms/jinja2/django/forms/widgets/checkbox_option.html,sha256=U2dFtAXvOn_eK4ok0oO6BwKE-3-jozJboGah_PQFLVM,55 +django/forms/jinja2/django/forms/widgets/checkbox_select.html,sha256=-ob26uqmvrEUMZPQq6kAqK4KBk2YZHTCWWCM6BnaL0w,57 +django/forms/jinja2/django/forms/widgets/clearable_file_input.html,sha256=1dv4xtik6um_mzK1skURF_n4G1t1yluziQu2UWa6fX8,559 +django/forms/jinja2/django/forms/widgets/date.html,sha256=fXpbxMzAdbv_avfWC5464gD2jFng931Eq7vzbzy1-yA,48 +django/forms/jinja2/django/forms/widgets/datetime.html,sha256=fXpbxMzAdbv_avfWC5464gD2jFng931Eq7vzbzy1-yA,48 +django/forms/jinja2/django/forms/widgets/email.html,sha256=fXpbxMzAdbv_avfWC5464gD2jFng931Eq7vzbzy1-yA,48 +django/forms/jinja2/django/forms/widgets/file.html,sha256=fXpbxMzAdbv_avfWC5464gD2jFng931Eq7vzbzy1-yA,48 +django/forms/jinja2/django/forms/widgets/hidden.html,sha256=fXpbxMzAdbv_avfWC5464gD2jFng931Eq7vzbzy1-yA,48 +django/forms/jinja2/django/forms/widgets/input.html,sha256=u12fZde-ugkEAAkPAtAfSxwGQmYBkXkssWohOUs-xoE,172 +django/forms/jinja2/django/forms/widgets/input_option.html,sha256=PyRNn9lmE9Da0-RK37zW4yJZUSiJWgIPCU9ou5oUC28,219 +django/forms/jinja2/django/forms/widgets/multiple_hidden.html,sha256=T54-n1ZeUlTd-svM3C4tLF42umKM0R5A7fdfsdthwkA,54 +django/forms/jinja2/django/forms/widgets/multiple_input.html,sha256=voM3dqu69R0Z202TmCgMFM6toJp7FgFPVvbWY9WKEAU,395 +django/forms/jinja2/django/forms/widgets/multiwidget.html,sha256=pr-MxRyucRxn_HvBGZvbc3JbFyrAolbroxvA4zmPz2Y,86 +django/forms/jinja2/django/forms/widgets/number.html,sha256=fXpbxMzAdbv_avfWC5464gD2jFng931Eq7vzbzy1-yA,48 +django/forms/jinja2/django/forms/widgets/password.html,sha256=fXpbxMzAdbv_avfWC5464gD2jFng931Eq7vzbzy1-yA,48 +django/forms/jinja2/django/forms/widgets/radio.html,sha256=-ob26uqmvrEUMZPQq6kAqK4KBk2YZHTCWWCM6BnaL0w,57 +django/forms/jinja2/django/forms/widgets/radio_option.html,sha256=U2dFtAXvOn_eK4ok0oO6BwKE-3-jozJboGah_PQFLVM,55 +django/forms/jinja2/django/forms/widgets/select.html,sha256=ESyDzbLTtM7-OG34EuSUnvxCtyP5IrQsZh0jGFrIdEA,365 +django/forms/jinja2/django/forms/widgets/select_date.html,sha256=AzaPLlNLg91qkVQwwtAJxwOqDemrtt_btSkWLpboJDs,54 +django/forms/jinja2/django/forms/widgets/select_option.html,sha256=tNa1D3G8iy2ZcWeKyI-mijjDjRmMaqSo-jnAR_VS3Qc,110 +django/forms/jinja2/django/forms/widgets/splitdatetime.html,sha256=AzaPLlNLg91qkVQwwtAJxwOqDemrtt_btSkWLpboJDs,54 +django/forms/jinja2/django/forms/widgets/splithiddendatetime.html,sha256=AzaPLlNLg91qkVQwwtAJxwOqDemrtt_btSkWLpboJDs,54 +django/forms/jinja2/django/forms/widgets/text.html,sha256=fXpbxMzAdbv_avfWC5464gD2jFng931Eq7vzbzy1-yA,48 +django/forms/jinja2/django/forms/widgets/textarea.html,sha256=Av1Y-hpXUU2AjrhnUivgZFKNBLdwCSZSeuSmCqmCkDA,145 +django/forms/jinja2/django/forms/widgets/time.html,sha256=fXpbxMzAdbv_avfWC5464gD2jFng931Eq7vzbzy1-yA,48 +django/forms/jinja2/django/forms/widgets/url.html,sha256=fXpbxMzAdbv_avfWC5464gD2jFng931Eq7vzbzy1-yA,48 +django/forms/models.py,sha256=hzd8IFjIP8qauQQocI_Uf3jF0jnZkSOxDDZ0OfWo2mI,61209 +django/forms/renderers.py,sha256=48Xahe1sV49TVX_A3aKwZqMbGgC7jd0LkZ1FX2vgU_k,3203 +django/forms/templates/django/forms/attrs.html,sha256=UFPgCXXCAkbumxZE1NM-aJVE4VCe2RjCrHLNseibv3I,165 +django/forms/templates/django/forms/div.html,sha256=PgJSGlEXXLmh58WLH49cxvUaWI8bxE0ioTf-MY89uF8,525 +django/forms/templates/django/forms/errors/dict/default.html,sha256=tFtwfHlkOY_XaKjoUPsWshiSWT5olxm3kDElND-GQtQ,48 +django/forms/templates/django/forms/errors/dict/text.txt,sha256=E7eqEWc6q2_kLyc9k926klRe2mPp4O2VqG-2_MliYaU,113 +django/forms/templates/django/forms/errors/dict/ul.html,sha256=65EYJOqDAn7-ca7FtjrcdbXygLE-RA_IJQTltO7qS1Q,137 +django/forms/templates/django/forms/errors/list/default.html,sha256=Kmx1nwrzQ49MaP80Gd17GC5TQH4B7doWa3I3azXvoHA,48 +django/forms/templates/django/forms/errors/list/text.txt,sha256=VVbLrGMHcbs1hK9-2v2Y6SIoH9qRMtlKzM6qzLVAFyE,52 +django/forms/templates/django/forms/errors/list/ul.html,sha256=5kt2ckbr3esK0yoPzco2EB0WzS8MvGzau_rAcomB508,118 +django/forms/templates/django/forms/field.html,sha256=8XAHg-I3OKmLS4EGQT_zQHJKLL9z6KRPR8ehmcxsDvg,568 +django/forms/templates/django/forms/formsets/div.html,sha256=lmIRSTBuGczEd2lj-UfDS9zAlVv8ntpmRo-boDDRwEg,84 +django/forms/templates/django/forms/formsets/p.html,sha256=qkoHKem-gb3iqvTtROBcHNJqI-RoUwLHUvJC6EoHg-I,82 +django/forms/templates/django/forms/formsets/table.html,sha256=N0G9GETzJfV16wUesvdrNMDwc8Fhh6durrmkHUPeDZY,86 +django/forms/templates/django/forms/formsets/ul.html,sha256=bGQpjbpKwMahyiIP4-2p3zg3yJP-pN1A48yCqhHdw7o,83 +django/forms/templates/django/forms/label.html,sha256=0bJCdIj8G5e2Gaw3QUR0ZMdwVavC80YwxS5E0ShkzmE,122 +django/forms/templates/django/forms/p.html,sha256=NhXyxIJCngGT7xK2nA4_vpEWWiaIcIUKGVOmMcnjRy4,751 +django/forms/templates/django/forms/table.html,sha256=ELTypjKfqSluAJk6-no0m2_Rve3c6HJoWV3hQ_xfnto,892 +django/forms/templates/django/forms/ul.html,sha256=vPmRsKnLcofRZJq23XHxnBs8PLs6jD4_Pw1ULbtSxPg,790 +django/forms/templates/django/forms/widgets/attrs.html,sha256=9ylIPv5EZg-rx2qPLgobRkw6Zq_WJSM8kt106PpSYa0,172 +django/forms/templates/django/forms/widgets/checkbox.html,sha256=fXpbxMzAdbv_avfWC5464gD2jFng931Eq7vzbzy1-yA,48 +django/forms/templates/django/forms/widgets/checkbox_option.html,sha256=U2dFtAXvOn_eK4ok0oO6BwKE-3-jozJboGah_PQFLVM,55 +django/forms/templates/django/forms/widgets/checkbox_select.html,sha256=-ob26uqmvrEUMZPQq6kAqK4KBk2YZHTCWWCM6BnaL0w,57 +django/forms/templates/django/forms/widgets/clearable_file_input.html,sha256=1dv4xtik6um_mzK1skURF_n4G1t1yluziQu2UWa6fX8,559 +django/forms/templates/django/forms/widgets/date.html,sha256=fXpbxMzAdbv_avfWC5464gD2jFng931Eq7vzbzy1-yA,48 +django/forms/templates/django/forms/widgets/datetime.html,sha256=fXpbxMzAdbv_avfWC5464gD2jFng931Eq7vzbzy1-yA,48 +django/forms/templates/django/forms/widgets/email.html,sha256=fXpbxMzAdbv_avfWC5464gD2jFng931Eq7vzbzy1-yA,48 +django/forms/templates/django/forms/widgets/file.html,sha256=fXpbxMzAdbv_avfWC5464gD2jFng931Eq7vzbzy1-yA,48 +django/forms/templates/django/forms/widgets/hidden.html,sha256=fXpbxMzAdbv_avfWC5464gD2jFng931Eq7vzbzy1-yA,48 +django/forms/templates/django/forms/widgets/input.html,sha256=dwzzrLocGLZQIaGe-_X8k7z87jV6AFtn28LilnUnUH0,189 +django/forms/templates/django/forms/widgets/input_option.html,sha256=PyRNn9lmE9Da0-RK37zW4yJZUSiJWgIPCU9ou5oUC28,219 +django/forms/templates/django/forms/widgets/multiple_hidden.html,sha256=T54-n1ZeUlTd-svM3C4tLF42umKM0R5A7fdfsdthwkA,54 +django/forms/templates/django/forms/widgets/multiple_input.html,sha256=jxEWRqV32a73340eQ0uIn672Xz5jW9qm3V_srByLEd0,426 +django/forms/templates/django/forms/widgets/multiwidget.html,sha256=slk4AgCdXnVmFvavhjVcsza0quTOP2LG50D8wna0dw0,117 +django/forms/templates/django/forms/widgets/number.html,sha256=fXpbxMzAdbv_avfWC5464gD2jFng931Eq7vzbzy1-yA,48 +django/forms/templates/django/forms/widgets/password.html,sha256=fXpbxMzAdbv_avfWC5464gD2jFng931Eq7vzbzy1-yA,48 +django/forms/templates/django/forms/widgets/radio.html,sha256=-ob26uqmvrEUMZPQq6kAqK4KBk2YZHTCWWCM6BnaL0w,57 +django/forms/templates/django/forms/widgets/radio_option.html,sha256=U2dFtAXvOn_eK4ok0oO6BwKE-3-jozJboGah_PQFLVM,55 +django/forms/templates/django/forms/widgets/select.html,sha256=7U0RzjeESG87ENzQjPRUF71gvKvGjVVvXcpsW2-BTR4,384 +django/forms/templates/django/forms/widgets/select_date.html,sha256=AzaPLlNLg91qkVQwwtAJxwOqDemrtt_btSkWLpboJDs,54 +django/forms/templates/django/forms/widgets/select_option.html,sha256=N_psd0JYCqNhx2eh2oyvkF2KU2dv7M9mtMw_4BLYq8A,127 +django/forms/templates/django/forms/widgets/splitdatetime.html,sha256=AzaPLlNLg91qkVQwwtAJxwOqDemrtt_btSkWLpboJDs,54 +django/forms/templates/django/forms/widgets/splithiddendatetime.html,sha256=AzaPLlNLg91qkVQwwtAJxwOqDemrtt_btSkWLpboJDs,54 +django/forms/templates/django/forms/widgets/text.html,sha256=fXpbxMzAdbv_avfWC5464gD2jFng931Eq7vzbzy1-yA,48 +django/forms/templates/django/forms/widgets/textarea.html,sha256=Av1Y-hpXUU2AjrhnUivgZFKNBLdwCSZSeuSmCqmCkDA,145 +django/forms/templates/django/forms/widgets/time.html,sha256=fXpbxMzAdbv_avfWC5464gD2jFng931Eq7vzbzy1-yA,48 +django/forms/templates/django/forms/widgets/url.html,sha256=fXpbxMzAdbv_avfWC5464gD2jFng931Eq7vzbzy1-yA,48 +django/forms/utils.py,sha256=Aqd1Sz6wHl7SaueN7hzE1-XqhHvy9wOCWn_TSRlqLMY,7888 +django/forms/widgets.py,sha256=0xT2Cr0DYrf8Gs4wvGvyjSHWB2GtmvpmS5_Cz8Z7Qf0,39470 +django/http/__init__.py,sha256=uVUz0ov-emc29hbD78QKKka_R1L4mpDDPhkyfkx4jzQ,1200 +django/http/__pycache__/__init__.cpython-312.pyc,, +django/http/__pycache__/cookie.cpython-312.pyc,, +django/http/__pycache__/multipartparser.cpython-312.pyc,, +django/http/__pycache__/request.cpython-312.pyc,, +django/http/__pycache__/response.cpython-312.pyc,, +django/http/cookie.py,sha256=t7yGORGClUnCYVKQqyLBlEYsxQLLHn9crsMSWqK_Eic,679 +django/http/multipartparser.py,sha256=mrVXa2yenSbSOOlhIrgbfWS-3qlhvVtDEflSgTAKtsk,27830 +django/http/request.py,sha256=SPKLZprCQ1-tdSQauspS9DeDjS97XCposUg6JQLDk8w,25750 +django/http/response.py,sha256=62Xj0NhLfYR_V_UHuLEddNKif-O55RHgZhan5D1TSxo,25348 +django/middleware/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/middleware/__pycache__/__init__.cpython-312.pyc,, +django/middleware/__pycache__/cache.cpython-312.pyc,, +django/middleware/__pycache__/clickjacking.cpython-312.pyc,, +django/middleware/__pycache__/common.cpython-312.pyc,, +django/middleware/__pycache__/csrf.cpython-312.pyc,, +django/middleware/__pycache__/gzip.cpython-312.pyc,, +django/middleware/__pycache__/http.cpython-312.pyc,, +django/middleware/__pycache__/locale.cpython-312.pyc,, +django/middleware/__pycache__/security.cpython-312.pyc,, +django/middleware/cache.py,sha256=KOlg-Knjx_17KtXr-vx2DEpWvpzojk3yFUSsMHUIYo4,8487 +django/middleware/clickjacking.py,sha256=rIm2VlbblLWrMTRYJ1JBIui5xshAM-2mpyJf989xOgY,1724 +django/middleware/common.py,sha256=ZXRbyYb2l71FRhVYV8RK_APZw9qVVHQSzLq6Ip80mFo,7666 +django/middleware/csrf.py,sha256=3wo10zy9uLq1P8dF8740-rN6gbKmEjDBDlTjX9K3M-Q,19489 +django/middleware/gzip.py,sha256=jsJeYv0-A4iD6-1Pd3Hehl2ZtshpE4WeBTei-4PwciA,2945 +django/middleware/http.py,sha256=RqXN9Kp6GEh8j_ub7YXRi6W2_CKZTZEyAPpFUzeNPBs,1616 +django/middleware/locale.py,sha256=CV8aerSUWmO6cJQ6IrD5BzT3YlOxYNIqFraCqr8DoY4,3442 +django/middleware/security.py,sha256=yqawglqNcPrITIUvQhSpn3BD899It4fhyOyJCTImlXE,2599 +django/shortcuts.py,sha256=AqabKkXfFofMyVAbkYGBZcUMkkiySRu0-CIembfO6cA,6293 +django/template/__init__.py,sha256=-hvAhcRO8ydLdjTJJFr6LYoBVCsJq561ebRqE9kYBJs,1845 +django/template/__pycache__/__init__.cpython-312.pyc,, +django/template/__pycache__/autoreload.cpython-312.pyc,, +django/template/__pycache__/base.cpython-312.pyc,, +django/template/__pycache__/context.cpython-312.pyc,, +django/template/__pycache__/context_processors.cpython-312.pyc,, +django/template/__pycache__/defaultfilters.cpython-312.pyc,, +django/template/__pycache__/defaulttags.cpython-312.pyc,, +django/template/__pycache__/engine.cpython-312.pyc,, +django/template/__pycache__/exceptions.cpython-312.pyc,, +django/template/__pycache__/library.cpython-312.pyc,, +django/template/__pycache__/loader.cpython-312.pyc,, +django/template/__pycache__/loader_tags.cpython-312.pyc,, +django/template/__pycache__/response.cpython-312.pyc,, +django/template/__pycache__/smartif.cpython-312.pyc,, +django/template/__pycache__/utils.cpython-312.pyc,, +django/template/autoreload.py,sha256=hBanYQNDNEdgpty89I2mP_bxD-MyaeXWRmgX3K6a8Zg,2063 +django/template/backends/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/template/backends/__pycache__/__init__.cpython-312.pyc,, +django/template/backends/__pycache__/base.cpython-312.pyc,, +django/template/backends/__pycache__/django.cpython-312.pyc,, +django/template/backends/__pycache__/dummy.cpython-312.pyc,, +django/template/backends/__pycache__/jinja2.cpython-312.pyc,, +django/template/backends/__pycache__/utils.cpython-312.pyc,, +django/template/backends/base.py,sha256=IniOWzwfJHhrg0azO55fhZ3d1cghNjvsrgaMkV7o6x4,2801 +django/template/backends/django.py,sha256=wbOUhTVQyz2HvrTVG1GJUknDPJtuBFDuXbm15xf7jO4,5963 +django/template/backends/dummy.py,sha256=M62stG_knf7AdVp42ZWWddkNv6g6ck_sc1nRR6Sc_xA,1751 +django/template/backends/jinja2.py,sha256=U9WBznoElT-REbITG7DnZgR7SA_Awf1gWS9vc0yrEfs,4036 +django/template/backends/utils.py,sha256=z5X_lxKa9qL4KFDVeai-FmsewU3KLgVHO8y-gHLiVts,424 +django/template/base.py,sha256=NT8kiQUNjRuSDOJTW9ez_TEsBE2OESRM6h6yj6aqH28,40582 +django/template/context.py,sha256=Ztm5fvpHtdLVy7Dc7x5o8iZD3DtQBR7okocbKPpezYA,9353 +django/template/context_processors.py,sha256=PMIuGUE1iljf5L8oXggIdvvFOhCLJpASdwd39BMdjBE,2480 +django/template/defaultfilters.py,sha256=BxaTQcUOmE4C_-FLhCQkATQS0S0z7jGfSaouGPl3T5A,28438 +django/template/defaulttags.py,sha256=rg8MynL_3R2LzK9wGCuSdf2a_ynVOiC7bB5pcty8rh8,49678 +django/template/engine.py,sha256=gpk2HUxFfxVhw5onriW1uHVAec6JhVHqMcObNESXwO4,7773 +django/template/exceptions.py,sha256=rqG3_qZq31tUHbmtZD-MIu0StChqwaFejFFpR4u7th4,1342 +django/template/library.py,sha256=f_7-FMZRxhyhWdZMd4rGVYBnPoP8ZCPu5m-FSVoz_3s,13359 +django/template/loader.py,sha256=PVFUUtC5WgiRVVTilhQ6NFZnvjly6sP9s7anFmMoKdo,2054 +django/template/loader_tags.py,sha256=yGu7UOutGgzM_60RmNQhFL5Ctuho6_IuIM1sIzENgrc,13119 +django/template/loaders/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/template/loaders/__pycache__/__init__.cpython-312.pyc,, +django/template/loaders/__pycache__/app_directories.cpython-312.pyc,, +django/template/loaders/__pycache__/base.cpython-312.pyc,, +django/template/loaders/__pycache__/cached.cpython-312.pyc,, +django/template/loaders/__pycache__/filesystem.cpython-312.pyc,, +django/template/loaders/__pycache__/locmem.cpython-312.pyc,, +django/template/loaders/app_directories.py,sha256=sQpVXKYpnKr9Rl1YStNca-bGIQHcOkSnmm1l2qRGFVE,312 +django/template/loaders/base.py,sha256=Y5V4g0ly9GuNe7BQxaJSMENJnvxzXJm7XhSTxzfFM0s,1636 +django/template/loaders/cached.py,sha256=bDwkWYPgbvprU_u9f9w9oNYpSW_j9b7so_mlKzp9-N4,3716 +django/template/loaders/filesystem.py,sha256=f4silD7WWhv3K9QySMgW7dlGGNwwYAcHCMSTFpwiiXY,1506 +django/template/loaders/locmem.py,sha256=t9p0GYF2VHf4XG6Gggp0KBmHkdIuSKuLdiVXMVb2iHs,672 +django/template/response.py,sha256=UAU-aM7mn6cbGOIJuurn4EE5ITdcAqSFgKD5RXFms4w,5584 +django/template/smartif.py,sha256=TLbvSZa_M4B80M2X108FK2TFjHoA8RG9bfxB0PLKNck,6410 +django/template/utils.py,sha256=c9cJRfmBXs-41xa8KkZiLkeqUAbd-8elKc_7WdnI3G0,3626 +django/templatetags/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/templatetags/__pycache__/__init__.cpython-312.pyc,, +django/templatetags/__pycache__/cache.cpython-312.pyc,, +django/templatetags/__pycache__/i18n.cpython-312.pyc,, +django/templatetags/__pycache__/l10n.cpython-312.pyc,, +django/templatetags/__pycache__/static.cpython-312.pyc,, +django/templatetags/__pycache__/tz.cpython-312.pyc,, +django/templatetags/cache.py,sha256=WaYvWUn5ZTERwjouvkm-c5L5LRLc-GpSWl19wFod_bk,3551 +django/templatetags/i18n.py,sha256=UrS-aE3XCEK_oX18kmH8gSgA10MGHMeMTLOAESDtufI,19961 +django/templatetags/l10n.py,sha256=GB5_u3ymAtzxUtAY8QLb_pcZrzie9ZxEca-1NuKIXBY,1563 +django/templatetags/static.py,sha256=W4Rqt3DN_YtXe6EoqO-GLy7WR7xd7z0JsoX-VT0vvjc,4730 +django/templatetags/tz.py,sha256=0uSwEcqywsn1FrdOtyIjSsSCCEqzW0CDVebP-tzIBiY,5357 +django/test/__init__.py,sha256=X12C98lKN5JW1-wms7B6OaMTo-Li90waQpjfJE1V3AE,834 +django/test/__pycache__/__init__.cpython-312.pyc,, +django/test/__pycache__/client.cpython-312.pyc,, +django/test/__pycache__/html.cpython-312.pyc,, +django/test/__pycache__/runner.cpython-312.pyc,, +django/test/__pycache__/selenium.cpython-312.pyc,, +django/test/__pycache__/signals.cpython-312.pyc,, +django/test/__pycache__/testcases.cpython-312.pyc,, +django/test/__pycache__/utils.cpython-312.pyc,, +django/test/client.py,sha256=wcB9CqUb4Rq_kx5srAJ34DqMGwsjvb4B5jwnjJ8ZGb8,55968 +django/test/html.py,sha256=W97B8kAeeY3tqWrttffWkI0bK-j-vn69l-79WCsMu9A,8869 +django/test/runner.py,sha256=ZfFg65uYrWFiMMKB1HgbFK0_zVz5hsDwE-62145_H6M,42227 +django/test/selenium.py,sha256=DtQxR_MqglIfkR5dMQXeNiC3l_vmgxllRuHBz_LKZNY,9685 +django/test/signals.py,sha256=qiQBLO_rjVITdLDV4WiDVqfdGGGa5BLV4jLOn0XHJFw,7368 +django/test/testcases.py,sha256=VkWoXBHn_wsFJ4OUDiBuH8ajv6e9FPAb8vkB69rGfNA,67524 +django/test/utils.py,sha256=ObDoxbBL-vb-iT39bGt5s_kPAQiJsUEoB_PEZu5VhrQ,32151 +django/urls/__init__.py,sha256=BHyBIOD3E4_3Ng27SpXnRmqO3IzUqvBLCE4TTfs4wNs,1079 +django/urls/__pycache__/__init__.cpython-312.pyc,, +django/urls/__pycache__/base.cpython-312.pyc,, +django/urls/__pycache__/conf.cpython-312.pyc,, +django/urls/__pycache__/converters.cpython-312.pyc,, +django/urls/__pycache__/exceptions.cpython-312.pyc,, +django/urls/__pycache__/resolvers.cpython-312.pyc,, +django/urls/__pycache__/utils.cpython-312.pyc,, +django/urls/base.py,sha256=MDgpJtKVu7wKbWhzuo9SJUOyvIi3ndef0b_htzawIPU,5691 +django/urls/conf.py,sha256=TFZCdC1G8KftDuB_I7smC7UH1QGKkm5o1uNAIKP2B7M,3426 +django/urls/converters.py,sha256=OTsqmA3uCrmY7Xh94HUaOjGCBttNIKKOJRfPYBm5twM,1782 +django/urls/exceptions.py,sha256=alLNjkORtAxneC00g4qnRpG5wouOHvJvGbymdpKtG_I,115 +django/urls/resolvers.py,sha256=5p7SVNVhh9FmuFke5IquHKPO3jSA29N_eiXzsMpi2xE,31518 +django/urls/utils.py,sha256=d1KSc6JVR-5Z8axg_yDgYKtkqObdbJwWNkhcB8x44Rs,2179 +django/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/utils/__pycache__/__init__.cpython-312.pyc,, +django/utils/__pycache__/_os.cpython-312.pyc,, +django/utils/__pycache__/archive.cpython-312.pyc,, +django/utils/__pycache__/asyncio.cpython-312.pyc,, +django/utils/__pycache__/autoreload.cpython-312.pyc,, +django/utils/__pycache__/cache.cpython-312.pyc,, +django/utils/__pycache__/choices.cpython-312.pyc,, +django/utils/__pycache__/connection.cpython-312.pyc,, +django/utils/__pycache__/crypto.cpython-312.pyc,, +django/utils/__pycache__/datastructures.cpython-312.pyc,, +django/utils/__pycache__/dateformat.cpython-312.pyc,, +django/utils/__pycache__/dateparse.cpython-312.pyc,, +django/utils/__pycache__/dates.cpython-312.pyc,, +django/utils/__pycache__/deconstruct.cpython-312.pyc,, +django/utils/__pycache__/decorators.cpython-312.pyc,, +django/utils/__pycache__/deprecation.cpython-312.pyc,, +django/utils/__pycache__/duration.cpython-312.pyc,, +django/utils/__pycache__/encoding.cpython-312.pyc,, +django/utils/__pycache__/feedgenerator.cpython-312.pyc,, +django/utils/__pycache__/formats.cpython-312.pyc,, +django/utils/__pycache__/functional.cpython-312.pyc,, +django/utils/__pycache__/hashable.cpython-312.pyc,, +django/utils/__pycache__/html.cpython-312.pyc,, +django/utils/__pycache__/http.cpython-312.pyc,, +django/utils/__pycache__/inspect.cpython-312.pyc,, +django/utils/__pycache__/ipv6.cpython-312.pyc,, +django/utils/__pycache__/itercompat.cpython-312.pyc,, +django/utils/__pycache__/jslex.cpython-312.pyc,, +django/utils/__pycache__/log.cpython-312.pyc,, +django/utils/__pycache__/lorem_ipsum.cpython-312.pyc,, +django/utils/__pycache__/module_loading.cpython-312.pyc,, +django/utils/__pycache__/numberformat.cpython-312.pyc,, +django/utils/__pycache__/regex_helper.cpython-312.pyc,, +django/utils/__pycache__/safestring.cpython-312.pyc,, +django/utils/__pycache__/termcolors.cpython-312.pyc,, +django/utils/__pycache__/text.cpython-312.pyc,, +django/utils/__pycache__/timesince.cpython-312.pyc,, +django/utils/__pycache__/timezone.cpython-312.pyc,, +django/utils/__pycache__/tree.cpython-312.pyc,, +django/utils/__pycache__/version.cpython-312.pyc,, +django/utils/__pycache__/xmlutils.cpython-312.pyc,, +django/utils/_os.py,sha256=Q0d96RWFaQr6YqG00GulGqQ9M2Oni5WIjf_y4JnEWn8,2323 +django/utils/archive.py,sha256=HOBIOtVUzxNe_scK0gl-gu1yeQGU8X4VkYIdyCwkFuA,8087 +django/utils/asyncio.py,sha256=0glOg3eGmms-gUv04ZgDvZt19IZbdPBC64PnaKqeGDc,1138 +django/utils/autoreload.py,sha256=IABCHCytEe07k6h7ZlDDVnvT0JJ3Z7eQZbc_zjit-qg,24451 +django/utils/cache.py,sha256=xyazhD17lfCRXbWHnNWbI1WMHvwyXLUupRzG670y8gU,16583 +django/utils/choices.py,sha256=kSYtbZZit2Rdtl7PECG9f8Jrhkbn-DfBqZajUg8xPUg,4147 +django/utils/connection.py,sha256=2kqA6M_EObbZg6QKMXhX6p4YXG9RiPTUHwwN3mumhDY,2554 +django/utils/crypto.py,sha256=91KEDCMKAh3kKAMxUv2eQQKMEj-EgbMWRE2lVjmAzgY,2662 +django/utils/datastructures.py,sha256=mEt2-kg3zOQ24fW7ltxZDFaatZZyTSeJP9WAGWOg6UM,10267 +django/utils/dateformat.py,sha256=FvIRPWcVlSTQfVnPARPbV1BtQ1OX3Z3i49Iiyx9JuDI,10118 +django/utils/dateparse.py,sha256=oWTWbJax4NP1uY7tCGPSgnyAkoGxnXf1snEh-kfCkiQ,5356 +django/utils/dates.py,sha256=zHUHeOkxuo53rTvHG3dWMLRfVyfaMLBIt5xmA4E_Ids,2179 +django/utils/deconstruct.py,sha256=R3ks8L-Cif9-qyNwy-2R6KWf9UmcGDSiMGX-N6CbLOA,2126 +django/utils/decorators.py,sha256=p3NKImxC6MdbH2IVElMGu9OUdi3jRKt3d6_RXaeFm2M,8227 +django/utils/deprecation.py,sha256=PXnTY2003LnV5fUonR1N7dckwex7aUwF3IkS7NTiK3E,5133 +django/utils/duration.py,sha256=HK5E36F1GGdPchCqHsmloYhrHX_ByyITvOHyuxtElSE,1230 +django/utils/encoding.py,sha256=DLjcAjvBxrz5Jr5d8T2XnEUccseRVHTTXOm-zf-FVD4,8793 +django/utils/feedgenerator.py,sha256=nGSoWb5jlD0io-76tmjYnWlQxcFS6fksUn61Zn09KqQ,15636 +django/utils/formats.py,sha256=FmPUj3dfL2gCH2ijcWtcesYKbsi2-EbHGLGyHvGOJA0,10255 +django/utils/functional.py,sha256=URFZkoTNJmOlm_ay9872-_lEgV1ewunZS9GKSJRg-e8,14541 +django/utils/hashable.py,sha256=HzcLr4YPZGls_TLt0aQra7cCHcFp-hpTEOcOJ_DTQj0,738 +django/utils/html.py,sha256=H2hODT0Lzd5OOF7zyt77Y3QlgvYV0wjj46t6CNV_Km0,16993 +django/utils/http.py,sha256=PqAUD05dlvDU9zCnmct4DMeT21nFx0u878g90xmyh-E,12776 +django/utils/inspect.py,sha256=utTOblKvpF1VhziK14LoUDtAjMP9xVX9q5a-Q3YKd2o,2318 +django/utils/ipv6.py,sha256=RlrNSr2fKESeUxPyXtE3W4QJk9PdEVKLSCB1qsor3lk,1387 +django/utils/itercompat.py,sha256=mXmO77Sd3P_0VN6ox4kAorZ2vo2CjKRiFBuDbIqu1os,532 +django/utils/jslex.py,sha256=qHVWN1SCWcJCSJQa-GL2EVEJk4ksBvGIrIWeISS8UwQ,8049 +django/utils/log.py,sha256=5qHhornekS3LJLFEr095hu4wqL4bfPqdjKKhzx7vMFw,8186 +django/utils/lorem_ipsum.py,sha256=yUtBgKhshftIpPg04pc1IrLpOBydZIf7g0isFCIJZqk,5473 +django/utils/module_loading.py,sha256=-a7qOb5rpp-Lw_51vyIPSdb7R40B16Er1Zc1C_a6ibY,3820 +django/utils/numberformat.py,sha256=8LqSMmfxaN0PYSTTES6UT_ATerfDYQn7Ya4NI70gMaU,3781 +django/utils/regex_helper.py,sha256=FsGQkHjDNJmYnCDPT2f3b07hdp4RRNTMB_KgSRe-8hs,12772 +django/utils/safestring.py,sha256=-dKgvOyuADWC8mo0F5HH-OadkS87xF4OHzdB3_fpLUc,1876 +django/utils/termcolors.py,sha256=vvQbUH7GsFofGRSiKQwx4YvgE4yZMtAGRVz9QPDfisA,7386 +django/utils/text.py,sha256=kejMRNU_DRFvtWcTwdGwDjrFuLn29-BM7bGdJExY1sk,14745 +django/utils/timesince.py,sha256=j9B_wSnsdS3ZXn9pt9GImOJDpgO61YMr_jtnUpZDx0g,4914 +django/utils/timezone.py,sha256=Wg4eIhEHAsOMEKlzfSS_aYPf-h70DYqOqnmRDG1TbbE,7295 +django/utils/translation/__init__.py,sha256=IzuMZHXY059T4hOcsqQjDmSOT2itEQb8OBsNi88aURA,8878 +django/utils/translation/__pycache__/__init__.cpython-312.pyc,, +django/utils/translation/__pycache__/reloader.cpython-312.pyc,, +django/utils/translation/__pycache__/template.cpython-312.pyc,, +django/utils/translation/__pycache__/trans_null.cpython-312.pyc,, +django/utils/translation/__pycache__/trans_real.cpython-312.pyc,, +django/utils/translation/reloader.py,sha256=oVM0xenn3fraUomMEFucvwlbr5UGYUijWnUn6FL55Zc,1114 +django/utils/translation/template.py,sha256=TOfPNT62RnUbUG64a_6d_VQ7tsDC1_F1TCopw_HwlcA,10549 +django/utils/translation/trans_null.py,sha256=niy_g1nztS2bPsINqK7_g0HcpI_w6hL-c8_hqpC7U7s,1287 +django/utils/translation/trans_real.py,sha256=7pLwuC7oTOeeY_HMsMB277yIgTSl4575XAiMYAmu558,22357 +django/utils/tree.py,sha256=v8sNUsnsG2Loi9xBIIk0GmV5yN7VWOGTzbmk8BOEs6E,4394 +django/utils/version.py,sha256=oQDlhyhDJiwAhtjuevKXnyy-ZCMTlPBmOnZpsaRW8wg,3701 +django/utils/xmlutils.py,sha256=LsggeI4vhln3An_YXNBk2cCwKLQgMe-O_3L--j3o3GM,1172 +django/views/__init__.py,sha256=GIq6CKUBCbGpQVyK4xIoaAUDPrmRvbBPSX_KSHk0Bb4,63 +django/views/__pycache__/__init__.cpython-312.pyc,, +django/views/__pycache__/csrf.cpython-312.pyc,, +django/views/__pycache__/debug.cpython-312.pyc,, +django/views/__pycache__/defaults.cpython-312.pyc,, +django/views/__pycache__/i18n.cpython-312.pyc,, +django/views/__pycache__/static.cpython-312.pyc,, +django/views/csrf.py,sha256=PwZPfYD-zI0SL19etlwAcpD4LOMp8Flu1qPGgHlrsBg,3425 +django/views/debug.py,sha256=3yDwwZPSIv3D1FvSQ3r2bbZfNiPtfZt5rvf2S-JyN1w,25660 +django/views/decorators/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +django/views/decorators/__pycache__/__init__.cpython-312.pyc,, +django/views/decorators/__pycache__/cache.cpython-312.pyc,, +django/views/decorators/__pycache__/clickjacking.cpython-312.pyc,, +django/views/decorators/__pycache__/common.cpython-312.pyc,, +django/views/decorators/__pycache__/csrf.cpython-312.pyc,, +django/views/decorators/__pycache__/debug.cpython-312.pyc,, +django/views/decorators/__pycache__/gzip.cpython-312.pyc,, +django/views/decorators/__pycache__/http.cpython-312.pyc,, +django/views/decorators/__pycache__/vary.cpython-312.pyc,, +django/views/decorators/cache.py,sha256=4cWEWW88qPv57St9Wwmv0aK0vVxD-7aevFOQc8z4pQs,2821 +django/views/decorators/clickjacking.py,sha256=3w8djeDoQUK67uDfIzi9jdlds_ZdekwDMIV2IM8NBWk,2555 +django/views/decorators/common.py,sha256=Kcj1Q-aPTBLGMW_kkeUleRiYiEZCg7uoP_UexklyyQA,739 +django/views/decorators/csrf.py,sha256=q9lXnlNkbm7Hlg4FRx1pesf64sNpCIC52mCqY7xduZo,2324 +django/views/decorators/debug.py,sha256=jvKimgFDSVzCN3RWA1X5Ry7BSADFA21K3A2RjUsJy7E,5256 +django/views/decorators/gzip.py,sha256=PtpSGd8BePa1utGqvKMFzpLtZJxpV2_Jej8llw5bCJY,253 +django/views/decorators/http.py,sha256=vaoIxGGIn6kychggji7CmdmVl5JXvNs-7FUUVNv5w9Y,6533 +django/views/decorators/vary.py,sha256=DGR1eA8mSaXM8kgMJta4XnzCznJIrW1_KDMrd4aqCTM,1201 +django/views/defaults.py,sha256=BXT36auw8XF5ZwqdU0akzX5ITFBWhuy8idT8YGkCo_I,4718 +django/views/generic/__init__.py,sha256=VwQKUbBFJktiq5J2fo3qRNzRc0STfcMRPChlLPYAkkE,886 +django/views/generic/__pycache__/__init__.cpython-312.pyc,, +django/views/generic/__pycache__/base.cpython-312.pyc,, +django/views/generic/__pycache__/dates.cpython-312.pyc,, +django/views/generic/__pycache__/detail.cpython-312.pyc,, +django/views/generic/__pycache__/edit.cpython-312.pyc,, +django/views/generic/__pycache__/list.cpython-312.pyc,, +django/views/generic/base.py,sha256=p5HbLA01-FQSqC3hSGIg7jQk23khBMn9ssg4d9GHui4,9275 +django/views/generic/dates.py,sha256=xwSEF6zsaSl1jUTePs6NPihnOJEWT-j8SST0RG4bco0,26332 +django/views/generic/detail.py,sha256=zrAuhJxrFvNqJLnlvK-NSiRiiONsKKOYFantD7UztwU,6663 +django/views/generic/edit.py,sha256=lQ9msLa7PVw3mp4Ivup5vPjb7Vo_9G_paX34R7xhD-8,9091 +django/views/generic/list.py,sha256=KWsT5UOK5jflxn5JFoJCnyJEQXa0fM4talHswzEjzXU,7941 +django/views/i18n.py,sha256=EVTwiUOVetsRqzxs3HSwiuC7Wa_e-CYBDq26m_Nexk8,9020 +django/views/static.py,sha256=dfEj3tr0tBN6fW02T0z43fszVSj1DB6Gxe-C3V4VYPo,4055 +django/views/templates/csrf_403.html,sha256=lrD9CeNoW5UOC1cay8RJzydMMWF12BMMSpz5UDufNAk,2856 +django/views/templates/default_urlconf.html,sha256=P8dRIQu9i-K38Gsk-OP7nAMR4vGtMd2-Pw6cWjKnhN8,12521 +django/views/templates/directory_index.html,sha256=0CGI4FUy9n_Yo2e7U2vWeKCLsUgizBmoqHseNQxxe04,653 +django/views/templates/i18n_catalog.js,sha256=WTPJxawKwdORo12g9I_mUn4YSU6Xx-DCx6E06yKBKZQ,2785 +django/views/templates/technical_404.html,sha256=da7h7kPnDufG3D1KM5JzySVHEm4mTYx3UxV8KdPSz_c,2816 +django/views/templates/technical_500.html,sha256=ZJAa_HrpoqOaemlk3nikPH-wHXHlhaY1oyx6qGDAGgQ,18124 +django/views/templates/technical_500.txt,sha256=b0ihE_FS7YtfAFOXU_yk0-CTgUmZ4ZkWVfkFHdEQXQI,3712 diff --git a/.venv/Lib/site-packages/Django-5.1.2.dist-info/REQUESTED b/.venv/Lib/site-packages/Django-5.1.2.dist-info/REQUESTED new file mode 100644 index 00000000..e69de29b diff --git a/.venv/Lib/site-packages/Django-5.1.2.dist-info/WHEEL b/.venv/Lib/site-packages/Django-5.1.2.dist-info/WHEEL new file mode 100644 index 00000000..08519a66 --- /dev/null +++ b/.venv/Lib/site-packages/Django-5.1.2.dist-info/WHEEL @@ -0,0 +1,5 @@ +Wheel-Version: 1.0 +Generator: bdist_wheel (0.44.0) +Root-Is-Purelib: true +Tag: py3-none-any + diff --git a/.venv/Lib/site-packages/Django-5.1.2.dist-info/entry_points.txt b/.venv/Lib/site-packages/Django-5.1.2.dist-info/entry_points.txt new file mode 100644 index 00000000..eaeb88e2 --- /dev/null +++ b/.venv/Lib/site-packages/Django-5.1.2.dist-info/entry_points.txt @@ -0,0 +1,2 @@ +[console_scripts] +django-admin = django.core.management:execute_from_command_line diff --git a/.venv/Lib/site-packages/Django-5.1.2.dist-info/top_level.txt b/.venv/Lib/site-packages/Django-5.1.2.dist-info/top_level.txt new file mode 100644 index 00000000..d3e4ba56 --- /dev/null +++ b/.venv/Lib/site-packages/Django-5.1.2.dist-info/top_level.txt @@ -0,0 +1 @@ +django diff --git a/.venv/Lib/site-packages/_pytest/__init__.py b/.venv/Lib/site-packages/_pytest/__init__.py new file mode 100644 index 00000000..8eb8ec96 --- /dev/null +++ b/.venv/Lib/site-packages/_pytest/__init__.py @@ -0,0 +1,13 @@ +from __future__ import annotations + + +__all__ = ["__version__", "version_tuple"] + +try: + from ._version import version as __version__ + from ._version import version_tuple +except ImportError: # pragma: no cover + # broken installation, we don't even try + # unknown only works because we do poor mans version compare + __version__ = "unknown" + version_tuple = (0, 0, "unknown") diff --git a/.venv/Lib/site-packages/_pytest/_argcomplete.py b/.venv/Lib/site-packages/_pytest/_argcomplete.py new file mode 100644 index 00000000..59426ef9 --- /dev/null +++ b/.venv/Lib/site-packages/_pytest/_argcomplete.py @@ -0,0 +1,117 @@ +"""Allow bash-completion for argparse with argcomplete if installed. + +Needs argcomplete>=0.5.6 for python 3.2/3.3 (older versions fail +to find the magic string, so _ARGCOMPLETE env. var is never set, and +this does not need special code). + +Function try_argcomplete(parser) should be called directly before +the call to ArgumentParser.parse_args(). + +The filescompleter is what you normally would use on the positional +arguments specification, in order to get "dirname/" after "dirn" +instead of the default "dirname ": + + optparser.add_argument(Config._file_or_dir, nargs='*').completer=filescompleter + +Other, application specific, completers should go in the file +doing the add_argument calls as they need to be specified as .completer +attributes as well. (If argcomplete is not installed, the function the +attribute points to will not be used). + +SPEEDUP +======= + +The generic argcomplete script for bash-completion +(/etc/bash_completion.d/python-argcomplete.sh) +uses a python program to determine startup script generated by pip. +You can speed up completion somewhat by changing this script to include + # PYTHON_ARGCOMPLETE_OK +so the python-argcomplete-check-easy-install-script does not +need to be called to find the entry point of the code and see if that is +marked with PYTHON_ARGCOMPLETE_OK. + +INSTALL/DEBUGGING +================= + +To include this support in another application that has setup.py generated +scripts: + +- Add the line: + # PYTHON_ARGCOMPLETE_OK + near the top of the main python entry point. + +- Include in the file calling parse_args(): + from _argcomplete import try_argcomplete, filescompleter + Call try_argcomplete just before parse_args(), and optionally add + filescompleter to the positional arguments' add_argument(). + +If things do not work right away: + +- Switch on argcomplete debugging with (also helpful when doing custom + completers): + export _ARC_DEBUG=1 + +- Run: + python-argcomplete-check-easy-install-script $(which appname) + echo $? + will echo 0 if the magic line has been found, 1 if not. + +- Sometimes it helps to find early on errors using: + _ARGCOMPLETE=1 _ARC_DEBUG=1 appname + which should throw a KeyError: 'COMPLINE' (which is properly set by the + global argcomplete script). +""" + +from __future__ import annotations + +import argparse +from glob import glob +import os +import sys +from typing import Any + + +class FastFilesCompleter: + """Fast file completer class.""" + + def __init__(self, directories: bool = True) -> None: + self.directories = directories + + def __call__(self, prefix: str, **kwargs: Any) -> list[str]: + # Only called on non option completions. + if os.sep in prefix[1:]: + prefix_dir = len(os.path.dirname(prefix) + os.sep) + else: + prefix_dir = 0 + completion = [] + globbed = [] + if "*" not in prefix and "?" not in prefix: + # We are on unix, otherwise no bash. + if not prefix or prefix[-1] == os.sep: + globbed.extend(glob(prefix + ".*")) + prefix += "*" + globbed.extend(glob(prefix)) + for x in sorted(globbed): + if os.path.isdir(x): + x += "/" + # Append stripping the prefix (like bash, not like compgen). + completion.append(x[prefix_dir:]) + return completion + + +if os.environ.get("_ARGCOMPLETE"): + try: + import argcomplete.completers + except ImportError: + sys.exit(-1) + filescompleter: FastFilesCompleter | None = FastFilesCompleter() + + def try_argcomplete(parser: argparse.ArgumentParser) -> None: + argcomplete.autocomplete(parser, always_complete_options=False) + +else: + + def try_argcomplete(parser: argparse.ArgumentParser) -> None: + pass + + filescompleter = None diff --git a/.venv/Lib/site-packages/_pytest/_code/__init__.py b/.venv/Lib/site-packages/_pytest/_code/__init__.py new file mode 100644 index 00000000..0bfde426 --- /dev/null +++ b/.venv/Lib/site-packages/_pytest/_code/__init__.py @@ -0,0 +1,26 @@ +"""Python inspection/code generation API.""" + +from __future__ import annotations + +from .code import Code +from .code import ExceptionInfo +from .code import filter_traceback +from .code import Frame +from .code import getfslineno +from .code import Traceback +from .code import TracebackEntry +from .source import getrawcode +from .source import Source + + +__all__ = [ + "Code", + "ExceptionInfo", + "filter_traceback", + "Frame", + "getfslineno", + "getrawcode", + "Traceback", + "TracebackEntry", + "Source", +] diff --git a/.venv/Lib/site-packages/_pytest/_code/code.py b/.venv/Lib/site-packages/_pytest/_code/code.py new file mode 100644 index 00000000..8fac39ea --- /dev/null +++ b/.venv/Lib/site-packages/_pytest/_code/code.py @@ -0,0 +1,1403 @@ +# mypy: allow-untyped-defs +from __future__ import annotations + +import ast +import dataclasses +import inspect +from inspect import CO_VARARGS +from inspect import CO_VARKEYWORDS +from io import StringIO +import os +from pathlib import Path +import re +import sys +import traceback +from traceback import format_exception_only +from types import CodeType +from types import FrameType +from types import TracebackType +from typing import Any +from typing import Callable +from typing import ClassVar +from typing import Final +from typing import final +from typing import Generic +from typing import Iterable +from typing import List +from typing import Literal +from typing import Mapping +from typing import overload +from typing import Pattern +from typing import Sequence +from typing import SupportsIndex +from typing import Tuple +from typing import Type +from typing import TypeVar +from typing import Union + +import pluggy + +import _pytest +from _pytest._code.source import findsource +from _pytest._code.source import getrawcode +from _pytest._code.source import getstatementrange_ast +from _pytest._code.source import Source +from _pytest._io import TerminalWriter +from _pytest._io.saferepr import safeformat +from _pytest._io.saferepr import saferepr +from _pytest.compat import get_real_func +from _pytest.deprecated import check_ispytest +from _pytest.pathlib import absolutepath +from _pytest.pathlib import bestrelpath + + +if sys.version_info < (3, 11): + from exceptiongroup import BaseExceptionGroup + +TracebackStyle = Literal["long", "short", "line", "no", "native", "value", "auto"] + +EXCEPTION_OR_MORE = Union[Type[BaseException], Tuple[Type[BaseException], ...]] + + +class Code: + """Wrapper around Python code objects.""" + + __slots__ = ("raw",) + + def __init__(self, obj: CodeType) -> None: + self.raw = obj + + @classmethod + def from_function(cls, obj: object) -> Code: + return cls(getrawcode(obj)) + + def __eq__(self, other): + return self.raw == other.raw + + # Ignore type because of https://github.com/python/mypy/issues/4266. + __hash__ = None # type: ignore + + @property + def firstlineno(self) -> int: + return self.raw.co_firstlineno - 1 + + @property + def name(self) -> str: + return self.raw.co_name + + @property + def path(self) -> Path | str: + """Return a path object pointing to source code, or an ``str`` in + case of ``OSError`` / non-existing file.""" + if not self.raw.co_filename: + return "" + try: + p = absolutepath(self.raw.co_filename) + # maybe don't try this checking + if not p.exists(): + raise OSError("path check failed.") + return p + except OSError: + # XXX maybe try harder like the weird logic + # in the standard lib [linecache.updatecache] does? + return self.raw.co_filename + + @property + def fullsource(self) -> Source | None: + """Return a _pytest._code.Source object for the full source file of the code.""" + full, _ = findsource(self.raw) + return full + + def source(self) -> Source: + """Return a _pytest._code.Source object for the code object's source only.""" + # return source only for that part of code + return Source(self.raw) + + def getargs(self, var: bool = False) -> tuple[str, ...]: + """Return a tuple with the argument names for the code object. + + If 'var' is set True also return the names of the variable and + keyword arguments when present. + """ + # Handy shortcut for getting args. + raw = self.raw + argcount = raw.co_argcount + if var: + argcount += raw.co_flags & CO_VARARGS + argcount += raw.co_flags & CO_VARKEYWORDS + return raw.co_varnames[:argcount] + + +class Frame: + """Wrapper around a Python frame holding f_locals and f_globals + in which expressions can be evaluated.""" + + __slots__ = ("raw",) + + def __init__(self, frame: FrameType) -> None: + self.raw = frame + + @property + def lineno(self) -> int: + return self.raw.f_lineno - 1 + + @property + def f_globals(self) -> dict[str, Any]: + return self.raw.f_globals + + @property + def f_locals(self) -> dict[str, Any]: + return self.raw.f_locals + + @property + def code(self) -> Code: + return Code(self.raw.f_code) + + @property + def statement(self) -> Source: + """Statement this frame is at.""" + if self.code.fullsource is None: + return Source("") + return self.code.fullsource.getstatement(self.lineno) + + def eval(self, code, **vars): + """Evaluate 'code' in the frame. + + 'vars' are optional additional local variables. + + Returns the result of the evaluation. + """ + f_locals = self.f_locals.copy() + f_locals.update(vars) + return eval(code, self.f_globals, f_locals) + + def repr(self, object: object) -> str: + """Return a 'safe' (non-recursive, one-line) string repr for 'object'.""" + return saferepr(object) + + def getargs(self, var: bool = False): + """Return a list of tuples (name, value) for all arguments. + + If 'var' is set True, also include the variable and keyword arguments + when present. + """ + retval = [] + for arg in self.code.getargs(var): + try: + retval.append((arg, self.f_locals[arg])) + except KeyError: + pass # this can occur when using Psyco + return retval + + +class TracebackEntry: + """A single entry in a Traceback.""" + + __slots__ = ("_rawentry", "_repr_style") + + def __init__( + self, + rawentry: TracebackType, + repr_style: Literal["short", "long"] | None = None, + ) -> None: + self._rawentry: Final = rawentry + self._repr_style: Final = repr_style + + def with_repr_style( + self, repr_style: Literal["short", "long"] | None + ) -> TracebackEntry: + return TracebackEntry(self._rawentry, repr_style) + + @property + def lineno(self) -> int: + return self._rawentry.tb_lineno - 1 + + @property + def frame(self) -> Frame: + return Frame(self._rawentry.tb_frame) + + @property + def relline(self) -> int: + return self.lineno - self.frame.code.firstlineno + + def __repr__(self) -> str: + return "" % (self.frame.code.path, self.lineno + 1) + + @property + def statement(self) -> Source: + """_pytest._code.Source object for the current statement.""" + source = self.frame.code.fullsource + assert source is not None + return source.getstatement(self.lineno) + + @property + def path(self) -> Path | str: + """Path to the source code.""" + return self.frame.code.path + + @property + def locals(self) -> dict[str, Any]: + """Locals of underlying frame.""" + return self.frame.f_locals + + def getfirstlinesource(self) -> int: + return self.frame.code.firstlineno + + def getsource( + self, astcache: dict[str | Path, ast.AST] | None = None + ) -> Source | None: + """Return failing source code.""" + # we use the passed in astcache to not reparse asttrees + # within exception info printing + source = self.frame.code.fullsource + if source is None: + return None + key = astnode = None + if astcache is not None: + key = self.frame.code.path + if key is not None: + astnode = astcache.get(key, None) + start = self.getfirstlinesource() + try: + astnode, _, end = getstatementrange_ast( + self.lineno, source, astnode=astnode + ) + except SyntaxError: + end = self.lineno + 1 + else: + if key is not None and astcache is not None: + astcache[key] = astnode + return source[start:end] + + source = property(getsource) + + def ishidden(self, excinfo: ExceptionInfo[BaseException] | None) -> bool: + """Return True if the current frame has a var __tracebackhide__ + resolving to True. + + If __tracebackhide__ is a callable, it gets called with the + ExceptionInfo instance and can decide whether to hide the traceback. + + Mostly for internal use. + """ + tbh: bool | Callable[[ExceptionInfo[BaseException] | None], bool] = False + for maybe_ns_dct in (self.frame.f_locals, self.frame.f_globals): + # in normal cases, f_locals and f_globals are dictionaries + # however via `exec(...)` / `eval(...)` they can be other types + # (even incorrect types!). + # as such, we suppress all exceptions while accessing __tracebackhide__ + try: + tbh = maybe_ns_dct["__tracebackhide__"] + except Exception: + pass + else: + break + if tbh and callable(tbh): + return tbh(excinfo) + return tbh + + def __str__(self) -> str: + name = self.frame.code.name + try: + line = str(self.statement).lstrip() + except KeyboardInterrupt: + raise + except BaseException: + line = "???" + # This output does not quite match Python's repr for traceback entries, + # but changing it to do so would break certain plugins. See + # https://github.com/pytest-dev/pytest/pull/7535/ for details. + return " File %r:%d in %s\n %s\n" % ( + str(self.path), + self.lineno + 1, + name, + line, + ) + + @property + def name(self) -> str: + """co_name of underlying code.""" + return self.frame.code.raw.co_name + + +class Traceback(List[TracebackEntry]): + """Traceback objects encapsulate and offer higher level access to Traceback entries.""" + + def __init__( + self, + tb: TracebackType | Iterable[TracebackEntry], + ) -> None: + """Initialize from given python traceback object and ExceptionInfo.""" + if isinstance(tb, TracebackType): + + def f(cur: TracebackType) -> Iterable[TracebackEntry]: + cur_: TracebackType | None = cur + while cur_ is not None: + yield TracebackEntry(cur_) + cur_ = cur_.tb_next + + super().__init__(f(tb)) + else: + super().__init__(tb) + + def cut( + self, + path: os.PathLike[str] | str | None = None, + lineno: int | None = None, + firstlineno: int | None = None, + excludepath: os.PathLike[str] | None = None, + ) -> Traceback: + """Return a Traceback instance wrapping part of this Traceback. + + By providing any combination of path, lineno and firstlineno, the + first frame to start the to-be-returned traceback is determined. + + This allows cutting the first part of a Traceback instance e.g. + for formatting reasons (removing some uninteresting bits that deal + with handling of the exception/traceback). + """ + path_ = None if path is None else os.fspath(path) + excludepath_ = None if excludepath is None else os.fspath(excludepath) + for x in self: + code = x.frame.code + codepath = code.path + if path is not None and str(codepath) != path_: + continue + if ( + excludepath is not None + and isinstance(codepath, Path) + and excludepath_ in (str(p) for p in codepath.parents) # type: ignore[operator] + ): + continue + if lineno is not None and x.lineno != lineno: + continue + if firstlineno is not None and x.frame.code.firstlineno != firstlineno: + continue + return Traceback(x._rawentry) + return self + + @overload + def __getitem__(self, key: SupportsIndex) -> TracebackEntry: ... + + @overload + def __getitem__(self, key: slice) -> Traceback: ... + + def __getitem__(self, key: SupportsIndex | slice) -> TracebackEntry | Traceback: + if isinstance(key, slice): + return self.__class__(super().__getitem__(key)) + else: + return super().__getitem__(key) + + def filter( + self, + excinfo_or_fn: ExceptionInfo[BaseException] | Callable[[TracebackEntry], bool], + /, + ) -> Traceback: + """Return a Traceback instance with certain items removed. + + If the filter is an `ExceptionInfo`, removes all the ``TracebackEntry``s + which are hidden (see ishidden() above). + + Otherwise, the filter is a function that gets a single argument, a + ``TracebackEntry`` instance, and should return True when the item should + be added to the ``Traceback``, False when not. + """ + if isinstance(excinfo_or_fn, ExceptionInfo): + fn = lambda x: not x.ishidden(excinfo_or_fn) # noqa: E731 + else: + fn = excinfo_or_fn + return Traceback(filter(fn, self)) + + def recursionindex(self) -> int | None: + """Return the index of the frame/TracebackEntry where recursion originates if + appropriate, None if no recursion occurred.""" + cache: dict[tuple[Any, int, int], list[dict[str, Any]]] = {} + for i, entry in enumerate(self): + # id for the code.raw is needed to work around + # the strange metaprogramming in the decorator lib from pypi + # which generates code objects that have hash/value equality + # XXX needs a test + key = entry.frame.code.path, id(entry.frame.code.raw), entry.lineno + values = cache.setdefault(key, []) + # Since Python 3.13 f_locals is a proxy, freeze it. + loc = dict(entry.frame.f_locals) + if values: + for otherloc in values: + if otherloc == loc: + return i + values.append(loc) + return None + + +E = TypeVar("E", bound=BaseException, covariant=True) + + +@final +@dataclasses.dataclass +class ExceptionInfo(Generic[E]): + """Wraps sys.exc_info() objects and offers help for navigating the traceback.""" + + _assert_start_repr: ClassVar = "AssertionError('assert " + + _excinfo: tuple[type[E], E, TracebackType] | None + _striptext: str + _traceback: Traceback | None + + def __init__( + self, + excinfo: tuple[type[E], E, TracebackType] | None, + striptext: str = "", + traceback: Traceback | None = None, + *, + _ispytest: bool = False, + ) -> None: + check_ispytest(_ispytest) + self._excinfo = excinfo + self._striptext = striptext + self._traceback = traceback + + @classmethod + def from_exception( + cls, + # Ignoring error: "Cannot use a covariant type variable as a parameter". + # This is OK to ignore because this class is (conceptually) readonly. + # See https://github.com/python/mypy/issues/7049. + exception: E, # type: ignore[misc] + exprinfo: str | None = None, + ) -> ExceptionInfo[E]: + """Return an ExceptionInfo for an existing exception. + + The exception must have a non-``None`` ``__traceback__`` attribute, + otherwise this function fails with an assertion error. This means that + the exception must have been raised, or added a traceback with the + :py:meth:`~BaseException.with_traceback()` method. + + :param exprinfo: + A text string helping to determine if we should strip + ``AssertionError`` from the output. Defaults to the exception + message/``__str__()``. + + .. versionadded:: 7.4 + """ + assert exception.__traceback__, ( + "Exceptions passed to ExcInfo.from_exception(...)" + " must have a non-None __traceback__." + ) + exc_info = (type(exception), exception, exception.__traceback__) + return cls.from_exc_info(exc_info, exprinfo) + + @classmethod + def from_exc_info( + cls, + exc_info: tuple[type[E], E, TracebackType], + exprinfo: str | None = None, + ) -> ExceptionInfo[E]: + """Like :func:`from_exception`, but using old-style exc_info tuple.""" + _striptext = "" + if exprinfo is None and isinstance(exc_info[1], AssertionError): + exprinfo = getattr(exc_info[1], "msg", None) + if exprinfo is None: + exprinfo = saferepr(exc_info[1]) + if exprinfo and exprinfo.startswith(cls._assert_start_repr): + _striptext = "AssertionError: " + + return cls(exc_info, _striptext, _ispytest=True) + + @classmethod + def from_current(cls, exprinfo: str | None = None) -> ExceptionInfo[BaseException]: + """Return an ExceptionInfo matching the current traceback. + + .. warning:: + + Experimental API + + :param exprinfo: + A text string helping to determine if we should strip + ``AssertionError`` from the output. Defaults to the exception + message/``__str__()``. + """ + tup = sys.exc_info() + assert tup[0] is not None, "no current exception" + assert tup[1] is not None, "no current exception" + assert tup[2] is not None, "no current exception" + exc_info = (tup[0], tup[1], tup[2]) + return ExceptionInfo.from_exc_info(exc_info, exprinfo) + + @classmethod + def for_later(cls) -> ExceptionInfo[E]: + """Return an unfilled ExceptionInfo.""" + return cls(None, _ispytest=True) + + def fill_unfilled(self, exc_info: tuple[type[E], E, TracebackType]) -> None: + """Fill an unfilled ExceptionInfo created with ``for_later()``.""" + assert self._excinfo is None, "ExceptionInfo was already filled" + self._excinfo = exc_info + + @property + def type(self) -> type[E]: + """The exception class.""" + assert ( + self._excinfo is not None + ), ".type can only be used after the context manager exits" + return self._excinfo[0] + + @property + def value(self) -> E: + """The exception value.""" + assert ( + self._excinfo is not None + ), ".value can only be used after the context manager exits" + return self._excinfo[1] + + @property + def tb(self) -> TracebackType: + """The exception raw traceback.""" + assert ( + self._excinfo is not None + ), ".tb can only be used after the context manager exits" + return self._excinfo[2] + + @property + def typename(self) -> str: + """The type name of the exception.""" + assert ( + self._excinfo is not None + ), ".typename can only be used after the context manager exits" + return self.type.__name__ + + @property + def traceback(self) -> Traceback: + """The traceback.""" + if self._traceback is None: + self._traceback = Traceback(self.tb) + return self._traceback + + @traceback.setter + def traceback(self, value: Traceback) -> None: + self._traceback = value + + def __repr__(self) -> str: + if self._excinfo is None: + return "" + return f"<{self.__class__.__name__} {saferepr(self._excinfo[1])} tblen={len(self.traceback)}>" + + def exconly(self, tryshort: bool = False) -> str: + """Return the exception as a string. + + When 'tryshort' resolves to True, and the exception is an + AssertionError, only the actual exception part of the exception + representation is returned (so 'AssertionError: ' is removed from + the beginning). + """ + lines = format_exception_only(self.type, self.value) + text = "".join(lines) + text = text.rstrip() + if tryshort: + if text.startswith(self._striptext): + text = text[len(self._striptext) :] + return text + + def errisinstance(self, exc: EXCEPTION_OR_MORE) -> bool: + """Return True if the exception is an instance of exc. + + Consider using ``isinstance(excinfo.value, exc)`` instead. + """ + return isinstance(self.value, exc) + + def _getreprcrash(self) -> ReprFileLocation | None: + # Find last non-hidden traceback entry that led to the exception of the + # traceback, or None if all hidden. + for i in range(-1, -len(self.traceback) - 1, -1): + entry = self.traceback[i] + if not entry.ishidden(self): + path, lineno = entry.frame.code.raw.co_filename, entry.lineno + exconly = self.exconly(tryshort=True) + return ReprFileLocation(path, lineno + 1, exconly) + return None + + def getrepr( + self, + showlocals: bool = False, + style: TracebackStyle = "long", + abspath: bool = False, + tbfilter: bool + | Callable[[ExceptionInfo[BaseException]], _pytest._code.code.Traceback] = True, + funcargs: bool = False, + truncate_locals: bool = True, + truncate_args: bool = True, + chain: bool = True, + ) -> ReprExceptionInfo | ExceptionChainRepr: + """Return str()able representation of this exception info. + + :param bool showlocals: + Show locals per traceback entry. + Ignored if ``style=="native"``. + + :param str style: + long|short|line|no|native|value traceback style. + + :param bool abspath: + If paths should be changed to absolute or left unchanged. + + :param tbfilter: + A filter for traceback entries. + + * If false, don't hide any entries. + * If true, hide internal entries and entries that contain a local + variable ``__tracebackhide__ = True``. + * If a callable, delegates the filtering to the callable. + + Ignored if ``style`` is ``"native"``. + + :param bool funcargs: + Show fixtures ("funcargs" for legacy purposes) per traceback entry. + + :param bool truncate_locals: + With ``showlocals==True``, make sure locals can be safely represented as strings. + + :param bool truncate_args: + With ``showargs==True``, make sure args can be safely represented as strings. + + :param bool chain: + If chained exceptions in Python 3 should be shown. + + .. versionchanged:: 3.9 + + Added the ``chain`` parameter. + """ + if style == "native": + return ReprExceptionInfo( + reprtraceback=ReprTracebackNative( + traceback.format_exception( + self.type, + self.value, + self.traceback[0]._rawentry if self.traceback else None, + ) + ), + reprcrash=self._getreprcrash(), + ) + + fmt = FormattedExcinfo( + showlocals=showlocals, + style=style, + abspath=abspath, + tbfilter=tbfilter, + funcargs=funcargs, + truncate_locals=truncate_locals, + truncate_args=truncate_args, + chain=chain, + ) + return fmt.repr_excinfo(self) + + def _stringify_exception(self, exc: BaseException) -> str: + try: + notes = getattr(exc, "__notes__", []) + except KeyError: + # Workaround for https://github.com/python/cpython/issues/98778 on + # Python <= 3.9, and some 3.10 and 3.11 patch versions. + HTTPError = getattr(sys.modules.get("urllib.error", None), "HTTPError", ()) + if sys.version_info < (3, 12) and isinstance(exc, HTTPError): + notes = [] + else: + raise + + return "\n".join( + [ + str(exc), + *notes, + ] + ) + + def match(self, regexp: str | Pattern[str]) -> Literal[True]: + """Check whether the regular expression `regexp` matches the string + representation of the exception using :func:`python:re.search`. + + If it matches `True` is returned, otherwise an `AssertionError` is raised. + """ + __tracebackhide__ = True + value = self._stringify_exception(self.value) + msg = f"Regex pattern did not match.\n Regex: {regexp!r}\n Input: {value!r}" + if regexp == value: + msg += "\n Did you mean to `re.escape()` the regex?" + assert re.search(regexp, value), msg + # Return True to allow for "assert excinfo.match()". + return True + + def _group_contains( + self, + exc_group: BaseExceptionGroup[BaseException], + expected_exception: EXCEPTION_OR_MORE, + match: str | Pattern[str] | None, + target_depth: int | None = None, + current_depth: int = 1, + ) -> bool: + """Return `True` if a `BaseExceptionGroup` contains a matching exception.""" + if (target_depth is not None) and (current_depth > target_depth): + # already descended past the target depth + return False + for exc in exc_group.exceptions: + if isinstance(exc, BaseExceptionGroup): + if self._group_contains( + exc, expected_exception, match, target_depth, current_depth + 1 + ): + return True + if (target_depth is not None) and (current_depth != target_depth): + # not at the target depth, no match + continue + if not isinstance(exc, expected_exception): + continue + if match is not None: + value = self._stringify_exception(exc) + if not re.search(match, value): + continue + return True + return False + + def group_contains( + self, + expected_exception: EXCEPTION_OR_MORE, + *, + match: str | Pattern[str] | None = None, + depth: int | None = None, + ) -> bool: + """Check whether a captured exception group contains a matching exception. + + :param Type[BaseException] | Tuple[Type[BaseException]] expected_exception: + The expected exception type, or a tuple if one of multiple possible + exception types are expected. + + :param str | Pattern[str] | None match: + If specified, a string containing a regular expression, + or a regular expression object, that is tested against the string + representation of the exception and its `PEP-678 ` `__notes__` + using :func:`re.search`. + + To match a literal string that may contain :ref:`special characters + `, the pattern can first be escaped with :func:`re.escape`. + + :param Optional[int] depth: + If `None`, will search for a matching exception at any nesting depth. + If >= 1, will only match an exception if it's at the specified depth (depth = 1 being + the exceptions contained within the topmost exception group). + + .. versionadded:: 8.0 + """ + msg = "Captured exception is not an instance of `BaseExceptionGroup`" + assert isinstance(self.value, BaseExceptionGroup), msg + msg = "`depth` must be >= 1 if specified" + assert (depth is None) or (depth >= 1), msg + return self._group_contains(self.value, expected_exception, match, depth) + + +@dataclasses.dataclass +class FormattedExcinfo: + """Presenting information about failing Functions and Generators.""" + + # for traceback entries + flow_marker: ClassVar = ">" + fail_marker: ClassVar = "E" + + showlocals: bool = False + style: TracebackStyle = "long" + abspath: bool = True + tbfilter: bool | Callable[[ExceptionInfo[BaseException]], Traceback] = True + funcargs: bool = False + truncate_locals: bool = True + truncate_args: bool = True + chain: bool = True + astcache: dict[str | Path, ast.AST] = dataclasses.field( + default_factory=dict, init=False, repr=False + ) + + def _getindent(self, source: Source) -> int: + # Figure out indent for the given source. + try: + s = str(source.getstatement(len(source) - 1)) + except KeyboardInterrupt: + raise + except BaseException: + try: + s = str(source[-1]) + except KeyboardInterrupt: + raise + except BaseException: + return 0 + return 4 + (len(s) - len(s.lstrip())) + + def _getentrysource(self, entry: TracebackEntry) -> Source | None: + source = entry.getsource(self.astcache) + if source is not None: + source = source.deindent() + return source + + def repr_args(self, entry: TracebackEntry) -> ReprFuncArgs | None: + if self.funcargs: + args = [] + for argname, argvalue in entry.frame.getargs(var=True): + if self.truncate_args: + str_repr = saferepr(argvalue) + else: + str_repr = saferepr(argvalue, maxsize=None) + args.append((argname, str_repr)) + return ReprFuncArgs(args) + return None + + def get_source( + self, + source: Source | None, + line_index: int = -1, + excinfo: ExceptionInfo[BaseException] | None = None, + short: bool = False, + ) -> list[str]: + """Return formatted and marked up source lines.""" + lines = [] + if source is not None and line_index < 0: + line_index += len(source) + if source is None or line_index >= len(source.lines) or line_index < 0: + # `line_index` could still be outside `range(len(source.lines))` if + # we're processing AST with pathological position attributes. + source = Source("???") + line_index = 0 + space_prefix = " " + if short: + lines.append(space_prefix + source.lines[line_index].strip()) + else: + for line in source.lines[:line_index]: + lines.append(space_prefix + line) + lines.append(self.flow_marker + " " + source.lines[line_index]) + for line in source.lines[line_index + 1 :]: + lines.append(space_prefix + line) + if excinfo is not None: + indent = 4 if short else self._getindent(source) + lines.extend(self.get_exconly(excinfo, indent=indent, markall=True)) + return lines + + def get_exconly( + self, + excinfo: ExceptionInfo[BaseException], + indent: int = 4, + markall: bool = False, + ) -> list[str]: + lines = [] + indentstr = " " * indent + # Get the real exception information out. + exlines = excinfo.exconly(tryshort=True).split("\n") + failindent = self.fail_marker + indentstr[1:] + for line in exlines: + lines.append(failindent + line) + if not markall: + failindent = indentstr + return lines + + def repr_locals(self, locals: Mapping[str, object]) -> ReprLocals | None: + if self.showlocals: + lines = [] + keys = [loc for loc in locals if loc[0] != "@"] + keys.sort() + for name in keys: + value = locals[name] + if name == "__builtins__": + lines.append("__builtins__ = ") + else: + # This formatting could all be handled by the + # _repr() function, which is only reprlib.Repr in + # disguise, so is very configurable. + if self.truncate_locals: + str_repr = saferepr(value) + else: + str_repr = safeformat(value) + # if len(str_repr) < 70 or not isinstance(value, (list, tuple, dict)): + lines.append(f"{name:<10} = {str_repr}") + # else: + # self._line("%-10s =\\" % (name,)) + # # XXX + # pprint.pprint(value, stream=self.excinfowriter) + return ReprLocals(lines) + return None + + def repr_traceback_entry( + self, + entry: TracebackEntry | None, + excinfo: ExceptionInfo[BaseException] | None = None, + ) -> ReprEntry: + lines: list[str] = [] + style = ( + entry._repr_style + if entry is not None and entry._repr_style is not None + else self.style + ) + if style in ("short", "long") and entry is not None: + source = self._getentrysource(entry) + if source is None: + source = Source("???") + line_index = 0 + else: + line_index = entry.lineno - entry.getfirstlinesource() + short = style == "short" + reprargs = self.repr_args(entry) if not short else None + s = self.get_source(source, line_index, excinfo, short=short) + lines.extend(s) + if short: + message = f"in {entry.name}" + else: + message = excinfo and excinfo.typename or "" + entry_path = entry.path + path = self._makepath(entry_path) + reprfileloc = ReprFileLocation(path, entry.lineno + 1, message) + localsrepr = self.repr_locals(entry.locals) + return ReprEntry(lines, reprargs, localsrepr, reprfileloc, style) + elif style == "value": + if excinfo: + lines.extend(str(excinfo.value).split("\n")) + return ReprEntry(lines, None, None, None, style) + else: + if excinfo: + lines.extend(self.get_exconly(excinfo, indent=4)) + return ReprEntry(lines, None, None, None, style) + + def _makepath(self, path: Path | str) -> str: + if not self.abspath and isinstance(path, Path): + try: + np = bestrelpath(Path.cwd(), path) + except OSError: + return str(path) + if len(np) < len(str(path)): + return np + return str(path) + + def repr_traceback(self, excinfo: ExceptionInfo[BaseException]) -> ReprTraceback: + traceback = excinfo.traceback + if callable(self.tbfilter): + traceback = self.tbfilter(excinfo) + elif self.tbfilter: + traceback = traceback.filter(excinfo) + + if isinstance(excinfo.value, RecursionError): + traceback, extraline = self._truncate_recursive_traceback(traceback) + else: + extraline = None + + if not traceback: + if extraline is None: + extraline = "All traceback entries are hidden. Pass `--full-trace` to see hidden and internal frames." + entries = [self.repr_traceback_entry(None, excinfo)] + return ReprTraceback(entries, extraline, style=self.style) + + last = traceback[-1] + if self.style == "value": + entries = [self.repr_traceback_entry(last, excinfo)] + return ReprTraceback(entries, None, style=self.style) + + entries = [ + self.repr_traceback_entry(entry, excinfo if last == entry else None) + for entry in traceback + ] + return ReprTraceback(entries, extraline, style=self.style) + + def _truncate_recursive_traceback( + self, traceback: Traceback + ) -> tuple[Traceback, str | None]: + """Truncate the given recursive traceback trying to find the starting + point of the recursion. + + The detection is done by going through each traceback entry and + finding the point in which the locals of the frame are equal to the + locals of a previous frame (see ``recursionindex()``). + + Handle the situation where the recursion process might raise an + exception (for example comparing numpy arrays using equality raises a + TypeError), in which case we do our best to warn the user of the + error and show a limited traceback. + """ + try: + recursionindex = traceback.recursionindex() + except Exception as e: + max_frames = 10 + extraline: str | None = ( + "!!! Recursion error detected, but an error occurred locating the origin of recursion.\n" + " The following exception happened when comparing locals in the stack frame:\n" + f" {type(e).__name__}: {e!s}\n" + f" Displaying first and last {max_frames} stack frames out of {len(traceback)}." + ) + # Type ignored because adding two instances of a List subtype + # currently incorrectly has type List instead of the subtype. + traceback = traceback[:max_frames] + traceback[-max_frames:] # type: ignore + else: + if recursionindex is not None: + extraline = "!!! Recursion detected (same locals & position)" + traceback = traceback[: recursionindex + 1] + else: + extraline = None + + return traceback, extraline + + def repr_excinfo(self, excinfo: ExceptionInfo[BaseException]) -> ExceptionChainRepr: + repr_chain: list[tuple[ReprTraceback, ReprFileLocation | None, str | None]] = [] + e: BaseException | None = excinfo.value + excinfo_: ExceptionInfo[BaseException] | None = excinfo + descr = None + seen: set[int] = set() + while e is not None and id(e) not in seen: + seen.add(id(e)) + + if excinfo_: + # Fall back to native traceback as a temporary workaround until + # full support for exception groups added to ExceptionInfo. + # See https://github.com/pytest-dev/pytest/issues/9159 + if isinstance(e, BaseExceptionGroup): + reprtraceback: ReprTracebackNative | ReprTraceback = ( + ReprTracebackNative( + traceback.format_exception( + type(excinfo_.value), + excinfo_.value, + excinfo_.traceback[0]._rawentry, + ) + ) + ) + else: + reprtraceback = self.repr_traceback(excinfo_) + reprcrash = excinfo_._getreprcrash() + else: + # Fallback to native repr if the exception doesn't have a traceback: + # ExceptionInfo objects require a full traceback to work. + reprtraceback = ReprTracebackNative( + traceback.format_exception(type(e), e, None) + ) + reprcrash = None + repr_chain += [(reprtraceback, reprcrash, descr)] + + if e.__cause__ is not None and self.chain: + e = e.__cause__ + excinfo_ = ExceptionInfo.from_exception(e) if e.__traceback__ else None + descr = "The above exception was the direct cause of the following exception:" + elif ( + e.__context__ is not None and not e.__suppress_context__ and self.chain + ): + e = e.__context__ + excinfo_ = ExceptionInfo.from_exception(e) if e.__traceback__ else None + descr = "During handling of the above exception, another exception occurred:" + else: + e = None + repr_chain.reverse() + return ExceptionChainRepr(repr_chain) + + +@dataclasses.dataclass(eq=False) +class TerminalRepr: + def __str__(self) -> str: + # FYI this is called from pytest-xdist's serialization of exception + # information. + io = StringIO() + tw = TerminalWriter(file=io) + self.toterminal(tw) + return io.getvalue().strip() + + def __repr__(self) -> str: + return f"<{self.__class__} instance at {id(self):0x}>" + + def toterminal(self, tw: TerminalWriter) -> None: + raise NotImplementedError() + + +# This class is abstract -- only subclasses are instantiated. +@dataclasses.dataclass(eq=False) +class ExceptionRepr(TerminalRepr): + # Provided by subclasses. + reprtraceback: ReprTraceback + reprcrash: ReprFileLocation | None + sections: list[tuple[str, str, str]] = dataclasses.field( + init=False, default_factory=list + ) + + def addsection(self, name: str, content: str, sep: str = "-") -> None: + self.sections.append((name, content, sep)) + + def toterminal(self, tw: TerminalWriter) -> None: + for name, content, sep in self.sections: + tw.sep(sep, name) + tw.line(content) + + +@dataclasses.dataclass(eq=False) +class ExceptionChainRepr(ExceptionRepr): + chain: Sequence[tuple[ReprTraceback, ReprFileLocation | None, str | None]] + + def __init__( + self, + chain: Sequence[tuple[ReprTraceback, ReprFileLocation | None, str | None]], + ) -> None: + # reprcrash and reprtraceback of the outermost (the newest) exception + # in the chain. + super().__init__( + reprtraceback=chain[-1][0], + reprcrash=chain[-1][1], + ) + self.chain = chain + + def toterminal(self, tw: TerminalWriter) -> None: + for element in self.chain: + element[0].toterminal(tw) + if element[2] is not None: + tw.line("") + tw.line(element[2], yellow=True) + super().toterminal(tw) + + +@dataclasses.dataclass(eq=False) +class ReprExceptionInfo(ExceptionRepr): + reprtraceback: ReprTraceback + reprcrash: ReprFileLocation | None + + def toterminal(self, tw: TerminalWriter) -> None: + self.reprtraceback.toterminal(tw) + super().toterminal(tw) + + +@dataclasses.dataclass(eq=False) +class ReprTraceback(TerminalRepr): + reprentries: Sequence[ReprEntry | ReprEntryNative] + extraline: str | None + style: TracebackStyle + + entrysep: ClassVar = "_ " + + def toterminal(self, tw: TerminalWriter) -> None: + # The entries might have different styles. + for i, entry in enumerate(self.reprentries): + if entry.style == "long": + tw.line("") + entry.toterminal(tw) + if i < len(self.reprentries) - 1: + next_entry = self.reprentries[i + 1] + if ( + entry.style == "long" + or entry.style == "short" + and next_entry.style == "long" + ): + tw.sep(self.entrysep) + + if self.extraline: + tw.line(self.extraline) + + +class ReprTracebackNative(ReprTraceback): + def __init__(self, tblines: Sequence[str]) -> None: + self.reprentries = [ReprEntryNative(tblines)] + self.extraline = None + self.style = "native" + + +@dataclasses.dataclass(eq=False) +class ReprEntryNative(TerminalRepr): + lines: Sequence[str] + + style: ClassVar[TracebackStyle] = "native" + + def toterminal(self, tw: TerminalWriter) -> None: + tw.write("".join(self.lines)) + + +@dataclasses.dataclass(eq=False) +class ReprEntry(TerminalRepr): + lines: Sequence[str] + reprfuncargs: ReprFuncArgs | None + reprlocals: ReprLocals | None + reprfileloc: ReprFileLocation | None + style: TracebackStyle + + def _write_entry_lines(self, tw: TerminalWriter) -> None: + """Write the source code portions of a list of traceback entries with syntax highlighting. + + Usually entries are lines like these: + + " x = 1" + "> assert x == 2" + "E assert 1 == 2" + + This function takes care of rendering the "source" portions of it (the lines without + the "E" prefix) using syntax highlighting, taking care to not highlighting the ">" + character, as doing so might break line continuations. + """ + if not self.lines: + return + + # separate indents and source lines that are not failures: we want to + # highlight the code but not the indentation, which may contain markers + # such as "> assert 0" + fail_marker = f"{FormattedExcinfo.fail_marker} " + indent_size = len(fail_marker) + indents: list[str] = [] + source_lines: list[str] = [] + failure_lines: list[str] = [] + for index, line in enumerate(self.lines): + is_failure_line = line.startswith(fail_marker) + if is_failure_line: + # from this point on all lines are considered part of the failure + failure_lines.extend(self.lines[index:]) + break + else: + if self.style == "value": + source_lines.append(line) + else: + indents.append(line[:indent_size]) + source_lines.append(line[indent_size:]) + + tw._write_source(source_lines, indents) + + # failure lines are always completely red and bold + for line in failure_lines: + tw.line(line, bold=True, red=True) + + def toterminal(self, tw: TerminalWriter) -> None: + if self.style == "short": + if self.reprfileloc: + self.reprfileloc.toterminal(tw) + self._write_entry_lines(tw) + if self.reprlocals: + self.reprlocals.toterminal(tw, indent=" " * 8) + return + + if self.reprfuncargs: + self.reprfuncargs.toterminal(tw) + + self._write_entry_lines(tw) + + if self.reprlocals: + tw.line("") + self.reprlocals.toterminal(tw) + if self.reprfileloc: + if self.lines: + tw.line("") + self.reprfileloc.toterminal(tw) + + def __str__(self) -> str: + return "{}\n{}\n{}".format( + "\n".join(self.lines), self.reprlocals, self.reprfileloc + ) + + +@dataclasses.dataclass(eq=False) +class ReprFileLocation(TerminalRepr): + path: str + lineno: int + message: str + + def __post_init__(self) -> None: + self.path = str(self.path) + + def toterminal(self, tw: TerminalWriter) -> None: + # Filename and lineno output for each entry, using an output format + # that most editors understand. + msg = self.message + i = msg.find("\n") + if i != -1: + msg = msg[:i] + tw.write(self.path, bold=True, red=True) + tw.line(f":{self.lineno}: {msg}") + + +@dataclasses.dataclass(eq=False) +class ReprLocals(TerminalRepr): + lines: Sequence[str] + + def toterminal(self, tw: TerminalWriter, indent="") -> None: + for line in self.lines: + tw.line(indent + line) + + +@dataclasses.dataclass(eq=False) +class ReprFuncArgs(TerminalRepr): + args: Sequence[tuple[str, object]] + + def toterminal(self, tw: TerminalWriter) -> None: + if self.args: + linesofar = "" + for name, value in self.args: + ns = f"{name} = {value}" + if len(ns) + len(linesofar) + 2 > tw.fullwidth: + if linesofar: + tw.line(linesofar) + linesofar = ns + else: + if linesofar: + linesofar += ", " + ns + else: + linesofar = ns + if linesofar: + tw.line(linesofar) + tw.line("") + + +def getfslineno(obj: object) -> tuple[str | Path, int]: + """Return source location (path, lineno) for the given object. + + If the source cannot be determined return ("", -1). + + The line number is 0-based. + """ + # xxx let decorators etc specify a sane ordering + # NOTE: this used to be done in _pytest.compat.getfslineno, initially added + # in 6ec13a2b9. It ("place_as") appears to be something very custom. + obj = get_real_func(obj) + if hasattr(obj, "place_as"): + obj = obj.place_as + + try: + code = Code.from_function(obj) + except TypeError: + try: + fn = inspect.getsourcefile(obj) or inspect.getfile(obj) # type: ignore[arg-type] + except TypeError: + return "", -1 + + fspath = fn and absolutepath(fn) or "" + lineno = -1 + if fspath: + try: + _, lineno = findsource(obj) + except OSError: + pass + return fspath, lineno + + return code.path, code.firstlineno + + +# Relative paths that we use to filter traceback entries from appearing to the user; +# see filter_traceback. +# note: if we need to add more paths than what we have now we should probably use a list +# for better maintenance. + +_PLUGGY_DIR = Path(pluggy.__file__.rstrip("oc")) +# pluggy is either a package or a single module depending on the version +if _PLUGGY_DIR.name == "__init__.py": + _PLUGGY_DIR = _PLUGGY_DIR.parent +_PYTEST_DIR = Path(_pytest.__file__).parent + + +def filter_traceback(entry: TracebackEntry) -> bool: + """Return True if a TracebackEntry instance should be included in tracebacks. + + We hide traceback entries of: + + * dynamically generated code (no code to show up for it); + * internal traceback from pytest or its internal libraries, py and pluggy. + """ + # entry.path might sometimes return a str object when the entry + # points to dynamically generated code. + # See https://bitbucket.org/pytest-dev/py/issues/71. + raw_filename = entry.frame.code.raw.co_filename + is_generated = "<" in raw_filename and ">" in raw_filename + if is_generated: + return False + + # entry.path might point to a non-existing file, in which case it will + # also return a str object. See #1133. + p = Path(entry.path) + + parents = p.parents + if _PLUGGY_DIR in parents: + return False + if _PYTEST_DIR in parents: + return False + + return True diff --git a/.venv/Lib/site-packages/_pytest/_code/source.py b/.venv/Lib/site-packages/_pytest/_code/source.py new file mode 100644 index 00000000..604aff8b --- /dev/null +++ b/.venv/Lib/site-packages/_pytest/_code/source.py @@ -0,0 +1,215 @@ +# mypy: allow-untyped-defs +from __future__ import annotations + +import ast +from bisect import bisect_right +import inspect +import textwrap +import tokenize +import types +from typing import Iterable +from typing import Iterator +from typing import overload +import warnings + + +class Source: + """An immutable object holding a source code fragment. + + When using Source(...), the source lines are deindented. + """ + + def __init__(self, obj: object = None) -> None: + if not obj: + self.lines: list[str] = [] + elif isinstance(obj, Source): + self.lines = obj.lines + elif isinstance(obj, (tuple, list)): + self.lines = deindent(x.rstrip("\n") for x in obj) + elif isinstance(obj, str): + self.lines = deindent(obj.split("\n")) + else: + try: + rawcode = getrawcode(obj) + src = inspect.getsource(rawcode) + except TypeError: + src = inspect.getsource(obj) # type: ignore[arg-type] + self.lines = deindent(src.split("\n")) + + def __eq__(self, other: object) -> bool: + if not isinstance(other, Source): + return NotImplemented + return self.lines == other.lines + + # Ignore type because of https://github.com/python/mypy/issues/4266. + __hash__ = None # type: ignore + + @overload + def __getitem__(self, key: int) -> str: ... + + @overload + def __getitem__(self, key: slice) -> Source: ... + + def __getitem__(self, key: int | slice) -> str | Source: + if isinstance(key, int): + return self.lines[key] + else: + if key.step not in (None, 1): + raise IndexError("cannot slice a Source with a step") + newsource = Source() + newsource.lines = self.lines[key.start : key.stop] + return newsource + + def __iter__(self) -> Iterator[str]: + return iter(self.lines) + + def __len__(self) -> int: + return len(self.lines) + + def strip(self) -> Source: + """Return new Source object with trailing and leading blank lines removed.""" + start, end = 0, len(self) + while start < end and not self.lines[start].strip(): + start += 1 + while end > start and not self.lines[end - 1].strip(): + end -= 1 + source = Source() + source.lines[:] = self.lines[start:end] + return source + + def indent(self, indent: str = " " * 4) -> Source: + """Return a copy of the source object with all lines indented by the + given indent-string.""" + newsource = Source() + newsource.lines = [(indent + line) for line in self.lines] + return newsource + + def getstatement(self, lineno: int) -> Source: + """Return Source statement which contains the given linenumber + (counted from 0).""" + start, end = self.getstatementrange(lineno) + return self[start:end] + + def getstatementrange(self, lineno: int) -> tuple[int, int]: + """Return (start, end) tuple which spans the minimal statement region + which containing the given lineno.""" + if not (0 <= lineno < len(self)): + raise IndexError("lineno out of range") + ast, start, end = getstatementrange_ast(lineno, self) + return start, end + + def deindent(self) -> Source: + """Return a new Source object deindented.""" + newsource = Source() + newsource.lines[:] = deindent(self.lines) + return newsource + + def __str__(self) -> str: + return "\n".join(self.lines) + + +# +# helper functions +# + + +def findsource(obj) -> tuple[Source | None, int]: + try: + sourcelines, lineno = inspect.findsource(obj) + except Exception: + return None, -1 + source = Source() + source.lines = [line.rstrip() for line in sourcelines] + return source, lineno + + +def getrawcode(obj: object, trycall: bool = True) -> types.CodeType: + """Return code object for given function.""" + try: + return obj.__code__ # type: ignore[attr-defined,no-any-return] + except AttributeError: + pass + if trycall: + call = getattr(obj, "__call__", None) + if call and not isinstance(obj, type): + return getrawcode(call, trycall=False) + raise TypeError(f"could not get code object for {obj!r}") + + +def deindent(lines: Iterable[str]) -> list[str]: + return textwrap.dedent("\n".join(lines)).splitlines() + + +def get_statement_startend2(lineno: int, node: ast.AST) -> tuple[int, int | None]: + # Flatten all statements and except handlers into one lineno-list. + # AST's line numbers start indexing at 1. + values: list[int] = [] + for x in ast.walk(node): + if isinstance(x, (ast.stmt, ast.ExceptHandler)): + # The lineno points to the class/def, so need to include the decorators. + if isinstance(x, (ast.ClassDef, ast.FunctionDef, ast.AsyncFunctionDef)): + for d in x.decorator_list: + values.append(d.lineno - 1) + values.append(x.lineno - 1) + for name in ("finalbody", "orelse"): + val: list[ast.stmt] | None = getattr(x, name, None) + if val: + # Treat the finally/orelse part as its own statement. + values.append(val[0].lineno - 1 - 1) + values.sort() + insert_index = bisect_right(values, lineno) + start = values[insert_index - 1] + if insert_index >= len(values): + end = None + else: + end = values[insert_index] + return start, end + + +def getstatementrange_ast( + lineno: int, + source: Source, + assertion: bool = False, + astnode: ast.AST | None = None, +) -> tuple[ast.AST, int, int]: + if astnode is None: + content = str(source) + # See #4260: + # Don't produce duplicate warnings when compiling source to find AST. + with warnings.catch_warnings(): + warnings.simplefilter("ignore") + astnode = ast.parse(content, "source", "exec") + + start, end = get_statement_startend2(lineno, astnode) + # We need to correct the end: + # - ast-parsing strips comments + # - there might be empty lines + # - we might have lesser indented code blocks at the end + if end is None: + end = len(source.lines) + + if end > start + 1: + # Make sure we don't span differently indented code blocks + # by using the BlockFinder helper used which inspect.getsource() uses itself. + block_finder = inspect.BlockFinder() + # If we start with an indented line, put blockfinder to "started" mode. + block_finder.started = ( + bool(source.lines[start]) and source.lines[start][0].isspace() + ) + it = ((x + "\n") for x in source.lines[start:end]) + try: + for tok in tokenize.generate_tokens(lambda: next(it)): + block_finder.tokeneater(*tok) + except (inspect.EndOfBlock, IndentationError): + end = block_finder.last + start + except Exception: + pass + + # The end might still point to a comment or empty line, correct it. + while end: + line = source.lines[end - 1].lstrip() + if line.startswith("#") or not line: + end -= 1 + else: + break + return astnode, start, end diff --git a/.venv/Lib/site-packages/_pytest/_io/__init__.py b/.venv/Lib/site-packages/_pytest/_io/__init__.py new file mode 100644 index 00000000..b0155b18 --- /dev/null +++ b/.venv/Lib/site-packages/_pytest/_io/__init__.py @@ -0,0 +1,10 @@ +from __future__ import annotations + +from .terminalwriter import get_terminal_width +from .terminalwriter import TerminalWriter + + +__all__ = [ + "TerminalWriter", + "get_terminal_width", +] diff --git a/.venv/Lib/site-packages/_pytest/_io/pprint.py b/.venv/Lib/site-packages/_pytest/_io/pprint.py new file mode 100644 index 00000000..fc29989b --- /dev/null +++ b/.venv/Lib/site-packages/_pytest/_io/pprint.py @@ -0,0 +1,673 @@ +# mypy: allow-untyped-defs +# This module was imported from the cpython standard library +# (https://github.com/python/cpython/) at commit +# c5140945c723ae6c4b7ee81ff720ac8ea4b52cfd (python3.12). +# +# +# Original Author: Fred L. Drake, Jr. +# fdrake@acm.org +# +# This is a simple little module I wrote to make life easier. I didn't +# see anything quite like it in the library, though I may have overlooked +# something. I wrote this when I was trying to read some heavily nested +# tuples with fairly non-descriptive content. This is modeled very much +# after Lisp/Scheme - style pretty-printing of lists. If you find it +# useful, thank small children who sleep at night. +from __future__ import annotations + +import collections as _collections +import dataclasses as _dataclasses +from io import StringIO as _StringIO +import re +import types as _types +from typing import Any +from typing import Callable +from typing import IO +from typing import Iterator + + +class _safe_key: + """Helper function for key functions when sorting unorderable objects. + + The wrapped-object will fallback to a Py2.x style comparison for + unorderable types (sorting first comparing the type name and then by + the obj ids). Does not work recursively, so dict.items() must have + _safe_key applied to both the key and the value. + + """ + + __slots__ = ["obj"] + + def __init__(self, obj): + self.obj = obj + + def __lt__(self, other): + try: + return self.obj < other.obj + except TypeError: + return (str(type(self.obj)), id(self.obj)) < ( + str(type(other.obj)), + id(other.obj), + ) + + +def _safe_tuple(t): + """Helper function for comparing 2-tuples""" + return _safe_key(t[0]), _safe_key(t[1]) + + +class PrettyPrinter: + def __init__( + self, + indent: int = 4, + width: int = 80, + depth: int | None = None, + ) -> None: + """Handle pretty printing operations onto a stream using a set of + configured parameters. + + indent + Number of spaces to indent for each level of nesting. + + width + Attempted maximum number of columns in the output. + + depth + The maximum depth to print out nested structures. + + """ + if indent < 0: + raise ValueError("indent must be >= 0") + if depth is not None and depth <= 0: + raise ValueError("depth must be > 0") + if not width: + raise ValueError("width must be != 0") + self._depth = depth + self._indent_per_level = indent + self._width = width + + def pformat(self, object: Any) -> str: + sio = _StringIO() + self._format(object, sio, 0, 0, set(), 0) + return sio.getvalue() + + def _format( + self, + object: Any, + stream: IO[str], + indent: int, + allowance: int, + context: set[int], + level: int, + ) -> None: + objid = id(object) + if objid in context: + stream.write(_recursion(object)) + return + + p = self._dispatch.get(type(object).__repr__, None) + if p is not None: + context.add(objid) + p(self, object, stream, indent, allowance, context, level + 1) + context.remove(objid) + elif ( + _dataclasses.is_dataclass(object) # type:ignore[unreachable] + and not isinstance(object, type) + and object.__dataclass_params__.repr + and + # Check dataclass has generated repr method. + hasattr(object.__repr__, "__wrapped__") + and "__create_fn__" in object.__repr__.__wrapped__.__qualname__ + ): + context.add(objid) # type:ignore[unreachable] + self._pprint_dataclass( + object, stream, indent, allowance, context, level + 1 + ) + context.remove(objid) + else: + stream.write(self._repr(object, context, level)) + + def _pprint_dataclass( + self, + object: Any, + stream: IO[str], + indent: int, + allowance: int, + context: set[int], + level: int, + ) -> None: + cls_name = object.__class__.__name__ + items = [ + (f.name, getattr(object, f.name)) + for f in _dataclasses.fields(object) + if f.repr + ] + stream.write(cls_name + "(") + self._format_namespace_items(items, stream, indent, allowance, context, level) + stream.write(")") + + _dispatch: dict[ + Callable[..., str], + Callable[[PrettyPrinter, Any, IO[str], int, int, set[int], int], None], + ] = {} + + def _pprint_dict( + self, + object: Any, + stream: IO[str], + indent: int, + allowance: int, + context: set[int], + level: int, + ) -> None: + write = stream.write + write("{") + items = sorted(object.items(), key=_safe_tuple) + self._format_dict_items(items, stream, indent, allowance, context, level) + write("}") + + _dispatch[dict.__repr__] = _pprint_dict + + def _pprint_ordered_dict( + self, + object: Any, + stream: IO[str], + indent: int, + allowance: int, + context: set[int], + level: int, + ) -> None: + if not len(object): + stream.write(repr(object)) + return + cls = object.__class__ + stream.write(cls.__name__ + "(") + self._pprint_dict(object, stream, indent, allowance, context, level) + stream.write(")") + + _dispatch[_collections.OrderedDict.__repr__] = _pprint_ordered_dict + + def _pprint_list( + self, + object: Any, + stream: IO[str], + indent: int, + allowance: int, + context: set[int], + level: int, + ) -> None: + stream.write("[") + self._format_items(object, stream, indent, allowance, context, level) + stream.write("]") + + _dispatch[list.__repr__] = _pprint_list + + def _pprint_tuple( + self, + object: Any, + stream: IO[str], + indent: int, + allowance: int, + context: set[int], + level: int, + ) -> None: + stream.write("(") + self._format_items(object, stream, indent, allowance, context, level) + stream.write(")") + + _dispatch[tuple.__repr__] = _pprint_tuple + + def _pprint_set( + self, + object: Any, + stream: IO[str], + indent: int, + allowance: int, + context: set[int], + level: int, + ) -> None: + if not len(object): + stream.write(repr(object)) + return + typ = object.__class__ + if typ is set: + stream.write("{") + endchar = "}" + else: + stream.write(typ.__name__ + "({") + endchar = "})" + object = sorted(object, key=_safe_key) + self._format_items(object, stream, indent, allowance, context, level) + stream.write(endchar) + + _dispatch[set.__repr__] = _pprint_set + _dispatch[frozenset.__repr__] = _pprint_set + + def _pprint_str( + self, + object: Any, + stream: IO[str], + indent: int, + allowance: int, + context: set[int], + level: int, + ) -> None: + write = stream.write + if not len(object): + write(repr(object)) + return + chunks = [] + lines = object.splitlines(True) + if level == 1: + indent += 1 + allowance += 1 + max_width1 = max_width = self._width - indent + for i, line in enumerate(lines): + rep = repr(line) + if i == len(lines) - 1: + max_width1 -= allowance + if len(rep) <= max_width1: + chunks.append(rep) + else: + # A list of alternating (non-space, space) strings + parts = re.findall(r"\S*\s*", line) + assert parts + assert not parts[-1] + parts.pop() # drop empty last part + max_width2 = max_width + current = "" + for j, part in enumerate(parts): + candidate = current + part + if j == len(parts) - 1 and i == len(lines) - 1: + max_width2 -= allowance + if len(repr(candidate)) > max_width2: + if current: + chunks.append(repr(current)) + current = part + else: + current = candidate + if current: + chunks.append(repr(current)) + if len(chunks) == 1: + write(rep) + return + if level == 1: + write("(") + for i, rep in enumerate(chunks): + if i > 0: + write("\n" + " " * indent) + write(rep) + if level == 1: + write(")") + + _dispatch[str.__repr__] = _pprint_str + + def _pprint_bytes( + self, + object: Any, + stream: IO[str], + indent: int, + allowance: int, + context: set[int], + level: int, + ) -> None: + write = stream.write + if len(object) <= 4: + write(repr(object)) + return + parens = level == 1 + if parens: + indent += 1 + allowance += 1 + write("(") + delim = "" + for rep in _wrap_bytes_repr(object, self._width - indent, allowance): + write(delim) + write(rep) + if not delim: + delim = "\n" + " " * indent + if parens: + write(")") + + _dispatch[bytes.__repr__] = _pprint_bytes + + def _pprint_bytearray( + self, + object: Any, + stream: IO[str], + indent: int, + allowance: int, + context: set[int], + level: int, + ) -> None: + write = stream.write + write("bytearray(") + self._pprint_bytes( + bytes(object), stream, indent + 10, allowance + 1, context, level + 1 + ) + write(")") + + _dispatch[bytearray.__repr__] = _pprint_bytearray + + def _pprint_mappingproxy( + self, + object: Any, + stream: IO[str], + indent: int, + allowance: int, + context: set[int], + level: int, + ) -> None: + stream.write("mappingproxy(") + self._format(object.copy(), stream, indent, allowance, context, level) + stream.write(")") + + _dispatch[_types.MappingProxyType.__repr__] = _pprint_mappingproxy + + def _pprint_simplenamespace( + self, + object: Any, + stream: IO[str], + indent: int, + allowance: int, + context: set[int], + level: int, + ) -> None: + if type(object) is _types.SimpleNamespace: + # The SimpleNamespace repr is "namespace" instead of the class + # name, so we do the same here. For subclasses; use the class name. + cls_name = "namespace" + else: + cls_name = object.__class__.__name__ + items = object.__dict__.items() + stream.write(cls_name + "(") + self._format_namespace_items(items, stream, indent, allowance, context, level) + stream.write(")") + + _dispatch[_types.SimpleNamespace.__repr__] = _pprint_simplenamespace + + def _format_dict_items( + self, + items: list[tuple[Any, Any]], + stream: IO[str], + indent: int, + allowance: int, + context: set[int], + level: int, + ) -> None: + if not items: + return + + write = stream.write + item_indent = indent + self._indent_per_level + delimnl = "\n" + " " * item_indent + for key, ent in items: + write(delimnl) + write(self._repr(key, context, level)) + write(": ") + self._format(ent, stream, item_indent, 1, context, level) + write(",") + + write("\n" + " " * indent) + + def _format_namespace_items( + self, + items: list[tuple[Any, Any]], + stream: IO[str], + indent: int, + allowance: int, + context: set[int], + level: int, + ) -> None: + if not items: + return + + write = stream.write + item_indent = indent + self._indent_per_level + delimnl = "\n" + " " * item_indent + for key, ent in items: + write(delimnl) + write(key) + write("=") + if id(ent) in context: + # Special-case representation of recursion to match standard + # recursive dataclass repr. + write("...") + else: + self._format( + ent, + stream, + item_indent + len(key) + 1, + 1, + context, + level, + ) + + write(",") + + write("\n" + " " * indent) + + def _format_items( + self, + items: list[Any], + stream: IO[str], + indent: int, + allowance: int, + context: set[int], + level: int, + ) -> None: + if not items: + return + + write = stream.write + item_indent = indent + self._indent_per_level + delimnl = "\n" + " " * item_indent + + for item in items: + write(delimnl) + self._format(item, stream, item_indent, 1, context, level) + write(",") + + write("\n" + " " * indent) + + def _repr(self, object: Any, context: set[int], level: int) -> str: + return self._safe_repr(object, context.copy(), self._depth, level) + + def _pprint_default_dict( + self, + object: Any, + stream: IO[str], + indent: int, + allowance: int, + context: set[int], + level: int, + ) -> None: + rdf = self._repr(object.default_factory, context, level) + stream.write(f"{object.__class__.__name__}({rdf}, ") + self._pprint_dict(object, stream, indent, allowance, context, level) + stream.write(")") + + _dispatch[_collections.defaultdict.__repr__] = _pprint_default_dict + + def _pprint_counter( + self, + object: Any, + stream: IO[str], + indent: int, + allowance: int, + context: set[int], + level: int, + ) -> None: + stream.write(object.__class__.__name__ + "(") + + if object: + stream.write("{") + items = object.most_common() + self._format_dict_items(items, stream, indent, allowance, context, level) + stream.write("}") + + stream.write(")") + + _dispatch[_collections.Counter.__repr__] = _pprint_counter + + def _pprint_chain_map( + self, + object: Any, + stream: IO[str], + indent: int, + allowance: int, + context: set[int], + level: int, + ) -> None: + if not len(object.maps) or (len(object.maps) == 1 and not len(object.maps[0])): + stream.write(repr(object)) + return + + stream.write(object.__class__.__name__ + "(") + self._format_items(object.maps, stream, indent, allowance, context, level) + stream.write(")") + + _dispatch[_collections.ChainMap.__repr__] = _pprint_chain_map + + def _pprint_deque( + self, + object: Any, + stream: IO[str], + indent: int, + allowance: int, + context: set[int], + level: int, + ) -> None: + stream.write(object.__class__.__name__ + "(") + if object.maxlen is not None: + stream.write("maxlen=%d, " % object.maxlen) + stream.write("[") + + self._format_items(object, stream, indent, allowance + 1, context, level) + stream.write("])") + + _dispatch[_collections.deque.__repr__] = _pprint_deque + + def _pprint_user_dict( + self, + object: Any, + stream: IO[str], + indent: int, + allowance: int, + context: set[int], + level: int, + ) -> None: + self._format(object.data, stream, indent, allowance, context, level - 1) + + _dispatch[_collections.UserDict.__repr__] = _pprint_user_dict + + def _pprint_user_list( + self, + object: Any, + stream: IO[str], + indent: int, + allowance: int, + context: set[int], + level: int, + ) -> None: + self._format(object.data, stream, indent, allowance, context, level - 1) + + _dispatch[_collections.UserList.__repr__] = _pprint_user_list + + def _pprint_user_string( + self, + object: Any, + stream: IO[str], + indent: int, + allowance: int, + context: set[int], + level: int, + ) -> None: + self._format(object.data, stream, indent, allowance, context, level - 1) + + _dispatch[_collections.UserString.__repr__] = _pprint_user_string + + def _safe_repr( + self, object: Any, context: set[int], maxlevels: int | None, level: int + ) -> str: + typ = type(object) + if typ in _builtin_scalars: + return repr(object) + + r = getattr(typ, "__repr__", None) + + if issubclass(typ, dict) and r is dict.__repr__: + if not object: + return "{}" + objid = id(object) + if maxlevels and level >= maxlevels: + return "{...}" + if objid in context: + return _recursion(object) + context.add(objid) + components: list[str] = [] + append = components.append + level += 1 + for k, v in sorted(object.items(), key=_safe_tuple): + krepr = self._safe_repr(k, context, maxlevels, level) + vrepr = self._safe_repr(v, context, maxlevels, level) + append(f"{krepr}: {vrepr}") + context.remove(objid) + return "{{{}}}".format(", ".join(components)) + + if (issubclass(typ, list) and r is list.__repr__) or ( + issubclass(typ, tuple) and r is tuple.__repr__ + ): + if issubclass(typ, list): + if not object: + return "[]" + format = "[%s]" + elif len(object) == 1: + format = "(%s,)" + else: + if not object: + return "()" + format = "(%s)" + objid = id(object) + if maxlevels and level >= maxlevels: + return format % "..." + if objid in context: + return _recursion(object) + context.add(objid) + components = [] + append = components.append + level += 1 + for o in object: + orepr = self._safe_repr(o, context, maxlevels, level) + append(orepr) + context.remove(objid) + return format % ", ".join(components) + + return repr(object) + + +_builtin_scalars = frozenset( + {str, bytes, bytearray, float, complex, bool, type(None), int} +) + + +def _recursion(object: Any) -> str: + return f"" + + +def _wrap_bytes_repr(object: Any, width: int, allowance: int) -> Iterator[str]: + current = b"" + last = len(object) // 4 * 4 + for i in range(0, len(object), 4): + part = object[i : i + 4] + candidate = current + part + if i == last: + width -= allowance + if len(repr(candidate)) > width: + if current: + yield repr(current) + current = part + else: + current = candidate + if current: + yield repr(current) diff --git a/.venv/Lib/site-packages/_pytest/_io/saferepr.py b/.venv/Lib/site-packages/_pytest/_io/saferepr.py new file mode 100644 index 00000000..cee70e33 --- /dev/null +++ b/.venv/Lib/site-packages/_pytest/_io/saferepr.py @@ -0,0 +1,130 @@ +from __future__ import annotations + +import pprint +import reprlib + + +def _try_repr_or_str(obj: object) -> str: + try: + return repr(obj) + except (KeyboardInterrupt, SystemExit): + raise + except BaseException: + return f'{type(obj).__name__}("{obj}")' + + +def _format_repr_exception(exc: BaseException, obj: object) -> str: + try: + exc_info = _try_repr_or_str(exc) + except (KeyboardInterrupt, SystemExit): + raise + except BaseException as inner_exc: + exc_info = f"unpresentable exception ({_try_repr_or_str(inner_exc)})" + return ( + f"<[{exc_info} raised in repr()] {type(obj).__name__} object at 0x{id(obj):x}>" + ) + + +def _ellipsize(s: str, maxsize: int) -> str: + if len(s) > maxsize: + i = max(0, (maxsize - 3) // 2) + j = max(0, maxsize - 3 - i) + return s[:i] + "..." + s[len(s) - j :] + return s + + +class SafeRepr(reprlib.Repr): + """ + repr.Repr that limits the resulting size of repr() and includes + information on exceptions raised during the call. + """ + + def __init__(self, maxsize: int | None, use_ascii: bool = False) -> None: + """ + :param maxsize: + If not None, will truncate the resulting repr to that specific size, using ellipsis + somewhere in the middle to hide the extra text. + If None, will not impose any size limits on the returning repr. + """ + super().__init__() + # ``maxstring`` is used by the superclass, and needs to be an int; using a + # very large number in case maxsize is None, meaning we want to disable + # truncation. + self.maxstring = maxsize if maxsize is not None else 1_000_000_000 + self.maxsize = maxsize + self.use_ascii = use_ascii + + def repr(self, x: object) -> str: + try: + if self.use_ascii: + s = ascii(x) + else: + s = super().repr(x) + except (KeyboardInterrupt, SystemExit): + raise + except BaseException as exc: + s = _format_repr_exception(exc, x) + if self.maxsize is not None: + s = _ellipsize(s, self.maxsize) + return s + + def repr_instance(self, x: object, level: int) -> str: + try: + s = repr(x) + except (KeyboardInterrupt, SystemExit): + raise + except BaseException as exc: + s = _format_repr_exception(exc, x) + if self.maxsize is not None: + s = _ellipsize(s, self.maxsize) + return s + + +def safeformat(obj: object) -> str: + """Return a pretty printed string for the given object. + + Failing __repr__ functions of user instances will be represented + with a short exception info. + """ + try: + return pprint.pformat(obj) + except Exception as exc: + return _format_repr_exception(exc, obj) + + +# Maximum size of overall repr of objects to display during assertion errors. +DEFAULT_REPR_MAX_SIZE = 240 + + +def saferepr( + obj: object, maxsize: int | None = DEFAULT_REPR_MAX_SIZE, use_ascii: bool = False +) -> str: + """Return a size-limited safe repr-string for the given object. + + Failing __repr__ functions of user instances will be represented + with a short exception info and 'saferepr' generally takes + care to never raise exceptions itself. + + This function is a wrapper around the Repr/reprlib functionality of the + stdlib. + """ + return SafeRepr(maxsize, use_ascii).repr(obj) + + +def saferepr_unlimited(obj: object, use_ascii: bool = True) -> str: + """Return an unlimited-size safe repr-string for the given object. + + As with saferepr, failing __repr__ functions of user instances + will be represented with a short exception info. + + This function is a wrapper around simple repr. + + Note: a cleaner solution would be to alter ``saferepr``this way + when maxsize=None, but that might affect some other code. + """ + try: + if use_ascii: + return ascii(obj) + return repr(obj) + except Exception as exc: + return _format_repr_exception(exc, obj) diff --git a/.venv/Lib/site-packages/_pytest/_io/terminalwriter.py b/.venv/Lib/site-packages/_pytest/_io/terminalwriter.py new file mode 100644 index 00000000..70ebd3d0 --- /dev/null +++ b/.venv/Lib/site-packages/_pytest/_io/terminalwriter.py @@ -0,0 +1,274 @@ +"""Helper functions for writing to terminals and files.""" + +from __future__ import annotations + +import os +import shutil +import sys +from typing import final +from typing import Literal +from typing import Sequence +from typing import TextIO +from typing import TYPE_CHECKING + +from ..compat import assert_never +from .wcwidth import wcswidth + + +if TYPE_CHECKING: + from pygments.formatter import Formatter + from pygments.lexer import Lexer + + +# This code was initially copied from py 1.8.1, file _io/terminalwriter.py. + + +def get_terminal_width() -> int: + width, _ = shutil.get_terminal_size(fallback=(80, 24)) + + # The Windows get_terminal_size may be bogus, let's sanify a bit. + if width < 40: + width = 80 + + return width + + +def should_do_markup(file: TextIO) -> bool: + if os.environ.get("PY_COLORS") == "1": + return True + if os.environ.get("PY_COLORS") == "0": + return False + if os.environ.get("NO_COLOR"): + return False + if os.environ.get("FORCE_COLOR"): + return True + return ( + hasattr(file, "isatty") and file.isatty() and os.environ.get("TERM") != "dumb" + ) + + +@final +class TerminalWriter: + _esctable = dict( + black=30, + red=31, + green=32, + yellow=33, + blue=34, + purple=35, + cyan=36, + white=37, + Black=40, + Red=41, + Green=42, + Yellow=43, + Blue=44, + Purple=45, + Cyan=46, + White=47, + bold=1, + light=2, + blink=5, + invert=7, + ) + + def __init__(self, file: TextIO | None = None) -> None: + if file is None: + file = sys.stdout + if hasattr(file, "isatty") and file.isatty() and sys.platform == "win32": + try: + import colorama + except ImportError: + pass + else: + file = colorama.AnsiToWin32(file).stream + assert file is not None + self._file = file + self.hasmarkup = should_do_markup(file) + self._current_line = "" + self._terminal_width: int | None = None + self.code_highlight = True + + @property + def fullwidth(self) -> int: + if self._terminal_width is not None: + return self._terminal_width + return get_terminal_width() + + @fullwidth.setter + def fullwidth(self, value: int) -> None: + self._terminal_width = value + + @property + def width_of_current_line(self) -> int: + """Return an estimate of the width so far in the current line.""" + return wcswidth(self._current_line) + + def markup(self, text: str, **markup: bool) -> str: + for name in markup: + if name not in self._esctable: + raise ValueError(f"unknown markup: {name!r}") + if self.hasmarkup: + esc = [self._esctable[name] for name, on in markup.items() if on] + if esc: + text = "".join(f"\x1b[{cod}m" for cod in esc) + text + "\x1b[0m" + return text + + def sep( + self, + sepchar: str, + title: str | None = None, + fullwidth: int | None = None, + **markup: bool, + ) -> None: + if fullwidth is None: + fullwidth = self.fullwidth + # The goal is to have the line be as long as possible + # under the condition that len(line) <= fullwidth. + if sys.platform == "win32": + # If we print in the last column on windows we are on a + # new line but there is no way to verify/neutralize this + # (we may not know the exact line width). + # So let's be defensive to avoid empty lines in the output. + fullwidth -= 1 + if title is not None: + # we want 2 + 2*len(fill) + len(title) <= fullwidth + # i.e. 2 + 2*len(sepchar)*N + len(title) <= fullwidth + # 2*len(sepchar)*N <= fullwidth - len(title) - 2 + # N <= (fullwidth - len(title) - 2) // (2*len(sepchar)) + N = max((fullwidth - len(title) - 2) // (2 * len(sepchar)), 1) + fill = sepchar * N + line = f"{fill} {title} {fill}" + else: + # we want len(sepchar)*N <= fullwidth + # i.e. N <= fullwidth // len(sepchar) + line = sepchar * (fullwidth // len(sepchar)) + # In some situations there is room for an extra sepchar at the right, + # in particular if we consider that with a sepchar like "_ " the + # trailing space is not important at the end of the line. + if len(line) + len(sepchar.rstrip()) <= fullwidth: + line += sepchar.rstrip() + + self.line(line, **markup) + + def write(self, msg: str, *, flush: bool = False, **markup: bool) -> None: + if msg: + current_line = msg.rsplit("\n", 1)[-1] + if "\n" in msg: + self._current_line = current_line + else: + self._current_line += current_line + + msg = self.markup(msg, **markup) + + try: + self._file.write(msg) + except UnicodeEncodeError: + # Some environments don't support printing general Unicode + # strings, due to misconfiguration or otherwise; in that case, + # print the string escaped to ASCII. + # When the Unicode situation improves we should consider + # letting the error propagate instead of masking it (see #7475 + # for one brief attempt). + msg = msg.encode("unicode-escape").decode("ascii") + self._file.write(msg) + + if flush: + self.flush() + + def line(self, s: str = "", **markup: bool) -> None: + self.write(s, **markup) + self.write("\n") + + def flush(self) -> None: + self._file.flush() + + def _write_source(self, lines: Sequence[str], indents: Sequence[str] = ()) -> None: + """Write lines of source code possibly highlighted. + + Keeping this private for now because the API is clunky. We should discuss how + to evolve the terminal writer so we can have more precise color support, for example + being able to write part of a line in one color and the rest in another, and so on. + """ + if indents and len(indents) != len(lines): + raise ValueError( + f"indents size ({len(indents)}) should have same size as lines ({len(lines)})" + ) + if not indents: + indents = [""] * len(lines) + source = "\n".join(lines) + new_lines = self._highlight(source).splitlines() + for indent, new_line in zip(indents, new_lines): + self.line(indent + new_line) + + def _get_pygments_lexer(self, lexer: Literal["python", "diff"]) -> Lexer | None: + try: + if lexer == "python": + from pygments.lexers.python import PythonLexer + + return PythonLexer() + elif lexer == "diff": + from pygments.lexers.diff import DiffLexer + + return DiffLexer() + else: + assert_never(lexer) + except ModuleNotFoundError: + return None + + def _get_pygments_formatter(self) -> Formatter | None: + try: + import pygments.util + except ModuleNotFoundError: + return None + + from _pytest.config.exceptions import UsageError + + theme = os.getenv("PYTEST_THEME") + theme_mode = os.getenv("PYTEST_THEME_MODE", "dark") + + try: + from pygments.formatters.terminal import TerminalFormatter + + return TerminalFormatter(bg=theme_mode, style=theme) + + except pygments.util.ClassNotFound as e: + raise UsageError( + f"PYTEST_THEME environment variable has an invalid value: '{theme}'. " + "Hint: See available pygments styles with `pygmentize -L styles`." + ) from e + except pygments.util.OptionError as e: + raise UsageError( + f"PYTEST_THEME_MODE environment variable has an invalid value: '{theme_mode}'. " + "The allowed values are 'dark' (default) and 'light'." + ) from e + + def _highlight( + self, source: str, lexer: Literal["diff", "python"] = "python" + ) -> str: + """Highlight the given source if we have markup support.""" + if not source or not self.hasmarkup or not self.code_highlight: + return source + + pygments_lexer = self._get_pygments_lexer(lexer) + if pygments_lexer is None: + return source + + pygments_formatter = self._get_pygments_formatter() + if pygments_formatter is None: + return source + + from pygments import highlight + + highlighted: str = highlight(source, pygments_lexer, pygments_formatter) + # pygments terminal formatter may add a newline when there wasn't one. + # We don't want this, remove. + if highlighted[-1] == "\n" and source[-1] != "\n": + highlighted = highlighted[:-1] + + # Some lexers will not set the initial color explicitly + # which may lead to the previous color being propagated to the + # start of the expression, so reset first. + highlighted = "\x1b[0m" + highlighted + + return highlighted diff --git a/.venv/Lib/site-packages/_pytest/_io/wcwidth.py b/.venv/Lib/site-packages/_pytest/_io/wcwidth.py new file mode 100644 index 00000000..23886ff1 --- /dev/null +++ b/.venv/Lib/site-packages/_pytest/_io/wcwidth.py @@ -0,0 +1,57 @@ +from __future__ import annotations + +from functools import lru_cache +import unicodedata + + +@lru_cache(100) +def wcwidth(c: str) -> int: + """Determine how many columns are needed to display a character in a terminal. + + Returns -1 if the character is not printable. + Returns 0, 1 or 2 for other characters. + """ + o = ord(c) + + # ASCII fast path. + if 0x20 <= o < 0x07F: + return 1 + + # Some Cf/Zp/Zl characters which should be zero-width. + if ( + o == 0x0000 + or 0x200B <= o <= 0x200F + or 0x2028 <= o <= 0x202E + or 0x2060 <= o <= 0x2063 + ): + return 0 + + category = unicodedata.category(c) + + # Control characters. + if category == "Cc": + return -1 + + # Combining characters with zero width. + if category in ("Me", "Mn"): + return 0 + + # Full/Wide east asian characters. + if unicodedata.east_asian_width(c) in ("F", "W"): + return 2 + + return 1 + + +def wcswidth(s: str) -> int: + """Determine how many columns are needed to display a string in a terminal. + + Returns -1 if the string contains non-printable characters. + """ + width = 0 + for c in unicodedata.normalize("NFC", s): + wc = wcwidth(c) + if wc < 0: + return -1 + width += wc + return width diff --git a/.venv/Lib/site-packages/_pytest/_py/__init__.py b/.venv/Lib/site-packages/_pytest/_py/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/.venv/Lib/site-packages/_pytest/_py/error.py b/.venv/Lib/site-packages/_pytest/_py/error.py new file mode 100644 index 00000000..ab3a4ed3 --- /dev/null +++ b/.venv/Lib/site-packages/_pytest/_py/error.py @@ -0,0 +1,111 @@ +"""create errno-specific classes for IO or os calls.""" + +from __future__ import annotations + +import errno +import os +import sys +from typing import Callable +from typing import TYPE_CHECKING +from typing import TypeVar + + +if TYPE_CHECKING: + from typing_extensions import ParamSpec + + P = ParamSpec("P") + +R = TypeVar("R") + + +class Error(EnvironmentError): + def __repr__(self) -> str: + return "{}.{} {!r}: {} ".format( + self.__class__.__module__, + self.__class__.__name__, + self.__class__.__doc__, + " ".join(map(str, self.args)), + # repr(self.args) + ) + + def __str__(self) -> str: + s = "[{}]: {}".format( + self.__class__.__doc__, + " ".join(map(str, self.args)), + ) + return s + + +_winerrnomap = { + 2: errno.ENOENT, + 3: errno.ENOENT, + 17: errno.EEXIST, + 18: errno.EXDEV, + 13: errno.EBUSY, # empty cd drive, but ENOMEDIUM seems unavailable + 22: errno.ENOTDIR, + 20: errno.ENOTDIR, + 267: errno.ENOTDIR, + 5: errno.EACCES, # anything better? +} + + +class ErrorMaker: + """lazily provides Exception classes for each possible POSIX errno + (as defined per the 'errno' module). All such instances + subclass EnvironmentError. + """ + + _errno2class: dict[int, type[Error]] = {} + + def __getattr__(self, name: str) -> type[Error]: + if name[0] == "_": + raise AttributeError(name) + eno = getattr(errno, name) + cls = self._geterrnoclass(eno) + setattr(self, name, cls) + return cls + + def _geterrnoclass(self, eno: int) -> type[Error]: + try: + return self._errno2class[eno] + except KeyError: + clsname = errno.errorcode.get(eno, "UnknownErrno%d" % (eno,)) + errorcls = type( + clsname, + (Error,), + {"__module__": "py.error", "__doc__": os.strerror(eno)}, + ) + self._errno2class[eno] = errorcls + return errorcls + + def checked_call( + self, func: Callable[P, R], *args: P.args, **kwargs: P.kwargs + ) -> R: + """Call a function and raise an errno-exception if applicable.""" + __tracebackhide__ = True + try: + return func(*args, **kwargs) + except Error: + raise + except OSError as value: + if not hasattr(value, "errno"): + raise + errno = value.errno + if sys.platform == "win32": + try: + cls = self._geterrnoclass(_winerrnomap[errno]) + except KeyError: + raise value + else: + # we are not on Windows, or we got a proper OSError + cls = self._geterrnoclass(errno) + + raise cls(f"{func.__name__}{args!r}") + + +_error_maker = ErrorMaker() +checked_call = _error_maker.checked_call + + +def __getattr__(attr: str) -> type[Error]: + return getattr(_error_maker, attr) # type: ignore[no-any-return] diff --git a/.venv/Lib/site-packages/_pytest/_py/path.py b/.venv/Lib/site-packages/_pytest/_py/path.py new file mode 100644 index 00000000..c7ab1182 --- /dev/null +++ b/.venv/Lib/site-packages/_pytest/_py/path.py @@ -0,0 +1,1475 @@ +# mypy: allow-untyped-defs +"""local path implementation.""" + +from __future__ import annotations + +import atexit +from contextlib import contextmanager +import fnmatch +import importlib.util +import io +import os +from os.path import abspath +from os.path import dirname +from os.path import exists +from os.path import isabs +from os.path import isdir +from os.path import isfile +from os.path import islink +from os.path import normpath +import posixpath +from stat import S_ISDIR +from stat import S_ISLNK +from stat import S_ISREG +import sys +from typing import Any +from typing import Callable +from typing import cast +from typing import Literal +from typing import overload +from typing import TYPE_CHECKING +import uuid +import warnings + +from . import error + + +# Moved from local.py. +iswin32 = sys.platform == "win32" or (getattr(os, "_name", False) == "nt") + + +class Checkers: + _depend_on_existence = "exists", "link", "dir", "file" + + def __init__(self, path): + self.path = path + + def dotfile(self): + return self.path.basename.startswith(".") + + def ext(self, arg): + if not arg.startswith("."): + arg = "." + arg + return self.path.ext == arg + + def basename(self, arg): + return self.path.basename == arg + + def basestarts(self, arg): + return self.path.basename.startswith(arg) + + def relto(self, arg): + return self.path.relto(arg) + + def fnmatch(self, arg): + return self.path.fnmatch(arg) + + def endswith(self, arg): + return str(self.path).endswith(arg) + + def _evaluate(self, kw): + from .._code.source import getrawcode + + for name, value in kw.items(): + invert = False + meth = None + try: + meth = getattr(self, name) + except AttributeError: + if name[:3] == "not": + invert = True + try: + meth = getattr(self, name[3:]) + except AttributeError: + pass + if meth is None: + raise TypeError(f"no {name!r} checker available for {self.path!r}") + try: + if getrawcode(meth).co_argcount > 1: + if (not meth(value)) ^ invert: + return False + else: + if bool(value) ^ bool(meth()) ^ invert: + return False + except (error.ENOENT, error.ENOTDIR, error.EBUSY): + # EBUSY feels not entirely correct, + # but its kind of necessary since ENOMEDIUM + # is not accessible in python + for name in self._depend_on_existence: + if name in kw: + if kw.get(name): + return False + name = "not" + name + if name in kw: + if not kw.get(name): + return False + return True + + _statcache: Stat + + def _stat(self) -> Stat: + try: + return self._statcache + except AttributeError: + try: + self._statcache = self.path.stat() + except error.ELOOP: + self._statcache = self.path.lstat() + return self._statcache + + def dir(self): + return S_ISDIR(self._stat().mode) + + def file(self): + return S_ISREG(self._stat().mode) + + def exists(self): + return self._stat() + + def link(self): + st = self.path.lstat() + return S_ISLNK(st.mode) + + +class NeverRaised(Exception): + pass + + +class Visitor: + def __init__(self, fil, rec, ignore, bf, sort): + if isinstance(fil, str): + fil = FNMatcher(fil) + if isinstance(rec, str): + self.rec: Callable[[LocalPath], bool] = FNMatcher(rec) + elif not hasattr(rec, "__call__") and rec: + self.rec = lambda path: True + else: + self.rec = rec + self.fil = fil + self.ignore = ignore + self.breadthfirst = bf + self.optsort = cast(Callable[[Any], Any], sorted) if sort else (lambda x: x) + + def gen(self, path): + try: + entries = path.listdir() + except self.ignore: + return + rec = self.rec + dirs = self.optsort( + [p for p in entries if p.check(dir=1) and (rec is None or rec(p))] + ) + if not self.breadthfirst: + for subdir in dirs: + yield from self.gen(subdir) + for p in self.optsort(entries): + if self.fil is None or self.fil(p): + yield p + if self.breadthfirst: + for subdir in dirs: + yield from self.gen(subdir) + + +class FNMatcher: + def __init__(self, pattern): + self.pattern = pattern + + def __call__(self, path): + pattern = self.pattern + + if ( + pattern.find(path.sep) == -1 + and iswin32 + and pattern.find(posixpath.sep) != -1 + ): + # Running on Windows, the pattern has no Windows path separators, + # and the pattern has one or more Posix path separators. Replace + # the Posix path separators with the Windows path separator. + pattern = pattern.replace(posixpath.sep, path.sep) + + if pattern.find(path.sep) == -1: + name = path.basename + else: + name = str(path) # path.strpath # XXX svn? + if not os.path.isabs(pattern): + pattern = "*" + path.sep + pattern + return fnmatch.fnmatch(name, pattern) + + +def map_as_list(func, iter): + return list(map(func, iter)) + + +class Stat: + if TYPE_CHECKING: + + @property + def size(self) -> int: ... + + @property + def mtime(self) -> float: ... + + def __getattr__(self, name: str) -> Any: + return getattr(self._osstatresult, "st_" + name) + + def __init__(self, path, osstatresult): + self.path = path + self._osstatresult = osstatresult + + @property + def owner(self): + if iswin32: + raise NotImplementedError("XXX win32") + import pwd + + entry = error.checked_call(pwd.getpwuid, self.uid) # type:ignore[attr-defined,unused-ignore] + return entry[0] + + @property + def group(self): + """Return group name of file.""" + if iswin32: + raise NotImplementedError("XXX win32") + import grp + + entry = error.checked_call(grp.getgrgid, self.gid) # type:ignore[attr-defined,unused-ignore] + return entry[0] + + def isdir(self): + return S_ISDIR(self._osstatresult.st_mode) + + def isfile(self): + return S_ISREG(self._osstatresult.st_mode) + + def islink(self): + self.path.lstat() + return S_ISLNK(self._osstatresult.st_mode) + + +def getuserid(user): + import pwd + + if not isinstance(user, int): + user = pwd.getpwnam(user)[2] # type:ignore[attr-defined,unused-ignore] + return user + + +def getgroupid(group): + import grp + + if not isinstance(group, int): + group = grp.getgrnam(group)[2] # type:ignore[attr-defined,unused-ignore] + return group + + +class LocalPath: + """Object oriented interface to os.path and other local filesystem + related information. + """ + + class ImportMismatchError(ImportError): + """raised on pyimport() if there is a mismatch of __file__'s""" + + sep = os.sep + + def __init__(self, path=None, expanduser=False): + """Initialize and return a local Path instance. + + Path can be relative to the current directory. + If path is None it defaults to the current working directory. + If expanduser is True, tilde-expansion is performed. + Note that Path instances always carry an absolute path. + Note also that passing in a local path object will simply return + the exact same path object. Use new() to get a new copy. + """ + if path is None: + self.strpath = error.checked_call(os.getcwd) + else: + try: + path = os.fspath(path) + except TypeError: + raise ValueError( + "can only pass None, Path instances " + "or non-empty strings to LocalPath" + ) + if expanduser: + path = os.path.expanduser(path) + self.strpath = abspath(path) + + if sys.platform != "win32": + + def chown(self, user, group, rec=0): + """Change ownership to the given user and group. + user and group may be specified by a number or + by a name. if rec is True change ownership + recursively. + """ + uid = getuserid(user) + gid = getgroupid(group) + if rec: + for x in self.visit(rec=lambda x: x.check(link=0)): + if x.check(link=0): + error.checked_call(os.chown, str(x), uid, gid) + error.checked_call(os.chown, str(self), uid, gid) + + def readlink(self) -> str: + """Return value of a symbolic link.""" + # https://github.com/python/mypy/issues/12278 + return error.checked_call(os.readlink, self.strpath) # type: ignore[arg-type,return-value,unused-ignore] + + def mklinkto(self, oldname): + """Posix style hard link to another name.""" + error.checked_call(os.link, str(oldname), str(self)) + + def mksymlinkto(self, value, absolute=1): + """Create a symbolic link with the given value (pointing to another name).""" + if absolute: + error.checked_call(os.symlink, str(value), self.strpath) + else: + base = self.common(value) + # with posix local paths '/' is always a common base + relsource = self.__class__(value).relto(base) + reldest = self.relto(base) + n = reldest.count(self.sep) + target = self.sep.join(("..",) * n + (relsource,)) + error.checked_call(os.symlink, target, self.strpath) + + def __div__(self, other): + return self.join(os.fspath(other)) + + __truediv__ = __div__ # py3k + + @property + def basename(self): + """Basename part of path.""" + return self._getbyspec("basename")[0] + + @property + def dirname(self): + """Dirname part of path.""" + return self._getbyspec("dirname")[0] + + @property + def purebasename(self): + """Pure base name of the path.""" + return self._getbyspec("purebasename")[0] + + @property + def ext(self): + """Extension of the path (including the '.').""" + return self._getbyspec("ext")[0] + + def read_binary(self): + """Read and return a bytestring from reading the path.""" + with self.open("rb") as f: + return f.read() + + def read_text(self, encoding): + """Read and return a Unicode string from reading the path.""" + with self.open("r", encoding=encoding) as f: + return f.read() + + def read(self, mode="r"): + """Read and return a bytestring from reading the path.""" + with self.open(mode) as f: + return f.read() + + def readlines(self, cr=1): + """Read and return a list of lines from the path. if cr is False, the + newline will be removed from the end of each line.""" + mode = "r" + + if not cr: + content = self.read(mode) + return content.split("\n") + else: + f = self.open(mode) + try: + return f.readlines() + finally: + f.close() + + def load(self): + """(deprecated) return object unpickled from self.read()""" + f = self.open("rb") + try: + import pickle + + return error.checked_call(pickle.load, f) + finally: + f.close() + + def move(self, target): + """Move this path to target.""" + if target.relto(self): + raise error.EINVAL(target, "cannot move path into a subdirectory of itself") + try: + self.rename(target) + except error.EXDEV: # invalid cross-device link + self.copy(target) + self.remove() + + def fnmatch(self, pattern): + """Return true if the basename/fullname matches the glob-'pattern'. + + valid pattern characters:: + + * matches everything + ? matches any single character + [seq] matches any character in seq + [!seq] matches any char not in seq + + If the pattern contains a path-separator then the full path + is used for pattern matching and a '*' is prepended to the + pattern. + + if the pattern doesn't contain a path-separator the pattern + is only matched against the basename. + """ + return FNMatcher(pattern)(self) + + def relto(self, relpath): + """Return a string which is the relative part of the path + to the given 'relpath'. + """ + if not isinstance(relpath, (str, LocalPath)): + raise TypeError(f"{relpath!r}: not a string or path object") + strrelpath = str(relpath) + if strrelpath and strrelpath[-1] != self.sep: + strrelpath += self.sep + # assert strrelpath[-1] == self.sep + # assert strrelpath[-2] != self.sep + strself = self.strpath + if sys.platform == "win32" or getattr(os, "_name", None) == "nt": + if os.path.normcase(strself).startswith(os.path.normcase(strrelpath)): + return strself[len(strrelpath) :] + elif strself.startswith(strrelpath): + return strself[len(strrelpath) :] + return "" + + def ensure_dir(self, *args): + """Ensure the path joined with args is a directory.""" + return self.ensure(*args, dir=True) + + def bestrelpath(self, dest): + """Return a string which is a relative path from self + (assumed to be a directory) to dest such that + self.join(bestrelpath) == dest and if not such + path can be determined return dest. + """ + try: + if self == dest: + return os.curdir + base = self.common(dest) + if not base: # can be the case on windows + return str(dest) + self2base = self.relto(base) + reldest = dest.relto(base) + if self2base: + n = self2base.count(self.sep) + 1 + else: + n = 0 + lst = [os.pardir] * n + if reldest: + lst.append(reldest) + target = dest.sep.join(lst) + return target + except AttributeError: + return str(dest) + + def exists(self): + return self.check() + + def isdir(self): + return self.check(dir=1) + + def isfile(self): + return self.check(file=1) + + def parts(self, reverse=False): + """Return a root-first list of all ancestor directories + plus the path itself. + """ + current = self + lst = [self] + while 1: + last = current + current = current.dirpath() + if last == current: + break + lst.append(current) + if not reverse: + lst.reverse() + return lst + + def common(self, other): + """Return the common part shared with the other path + or None if there is no common part. + """ + last = None + for x, y in zip(self.parts(), other.parts()): + if x != y: + return last + last = x + return last + + def __add__(self, other): + """Return new path object with 'other' added to the basename""" + return self.new(basename=self.basename + str(other)) + + def visit(self, fil=None, rec=None, ignore=NeverRaised, bf=False, sort=False): + """Yields all paths below the current one + + fil is a filter (glob pattern or callable), if not matching the + path will not be yielded, defaulting to None (everything is + returned) + + rec is a filter (glob pattern or callable) that controls whether + a node is descended, defaulting to None + + ignore is an Exception class that is ignoredwhen calling dirlist() + on any of the paths (by default, all exceptions are reported) + + bf if True will cause a breadthfirst search instead of the + default depthfirst. Default: False + + sort if True will sort entries within each directory level. + """ + yield from Visitor(fil, rec, ignore, bf, sort).gen(self) + + def _sortlist(self, res, sort): + if sort: + if hasattr(sort, "__call__"): + warnings.warn( + DeprecationWarning( + "listdir(sort=callable) is deprecated and breaks on python3" + ), + stacklevel=3, + ) + res.sort(sort) + else: + res.sort() + + def __fspath__(self): + return self.strpath + + def __hash__(self): + s = self.strpath + if iswin32: + s = s.lower() + return hash(s) + + def __eq__(self, other): + s1 = os.fspath(self) + try: + s2 = os.fspath(other) + except TypeError: + return False + if iswin32: + s1 = s1.lower() + try: + s2 = s2.lower() + except AttributeError: + return False + return s1 == s2 + + def __ne__(self, other): + return not (self == other) + + def __lt__(self, other): + return os.fspath(self) < os.fspath(other) + + def __gt__(self, other): + return os.fspath(self) > os.fspath(other) + + def samefile(self, other): + """Return True if 'other' references the same file as 'self'.""" + other = os.fspath(other) + if not isabs(other): + other = abspath(other) + if self == other: + return True + if not hasattr(os.path, "samefile"): + return False + return error.checked_call(os.path.samefile, self.strpath, other) + + def remove(self, rec=1, ignore_errors=False): + """Remove a file or directory (or a directory tree if rec=1). + if ignore_errors is True, errors while removing directories will + be ignored. + """ + if self.check(dir=1, link=0): + if rec: + # force remove of readonly files on windows + if iswin32: + self.chmod(0o700, rec=1) + import shutil + + error.checked_call( + shutil.rmtree, self.strpath, ignore_errors=ignore_errors + ) + else: + error.checked_call(os.rmdir, self.strpath) + else: + if iswin32: + self.chmod(0o700) + error.checked_call(os.remove, self.strpath) + + def computehash(self, hashtype="md5", chunksize=524288): + """Return hexdigest of hashvalue for this file.""" + try: + try: + import hashlib as mod + except ImportError: + if hashtype == "sha1": + hashtype = "sha" + mod = __import__(hashtype) + hash = getattr(mod, hashtype)() + except (AttributeError, ImportError): + raise ValueError(f"Don't know how to compute {hashtype!r} hash") + f = self.open("rb") + try: + while 1: + buf = f.read(chunksize) + if not buf: + return hash.hexdigest() + hash.update(buf) + finally: + f.close() + + def new(self, **kw): + """Create a modified version of this path. + the following keyword arguments modify various path parts:: + + a:/some/path/to/a/file.ext + xx drive + xxxxxxxxxxxxxxxxx dirname + xxxxxxxx basename + xxxx purebasename + xxx ext + """ + obj = object.__new__(self.__class__) + if not kw: + obj.strpath = self.strpath + return obj + drive, dirname, basename, purebasename, ext = self._getbyspec( + "drive,dirname,basename,purebasename,ext" + ) + if "basename" in kw: + if "purebasename" in kw or "ext" in kw: + raise ValueError(f"invalid specification {kw!r}") + else: + pb = kw.setdefault("purebasename", purebasename) + try: + ext = kw["ext"] + except KeyError: + pass + else: + if ext and not ext.startswith("."): + ext = "." + ext + kw["basename"] = pb + ext + + if "dirname" in kw and not kw["dirname"]: + kw["dirname"] = drive + else: + kw.setdefault("dirname", dirname) + kw.setdefault("sep", self.sep) + obj.strpath = normpath("{dirname}{sep}{basename}".format(**kw)) + return obj + + def _getbyspec(self, spec: str) -> list[str]: + """See new for what 'spec' can be.""" + res = [] + parts = self.strpath.split(self.sep) + + args = filter(None, spec.split(",")) + for name in args: + if name == "drive": + res.append(parts[0]) + elif name == "dirname": + res.append(self.sep.join(parts[:-1])) + else: + basename = parts[-1] + if name == "basename": + res.append(basename) + else: + i = basename.rfind(".") + if i == -1: + purebasename, ext = basename, "" + else: + purebasename, ext = basename[:i], basename[i:] + if name == "purebasename": + res.append(purebasename) + elif name == "ext": + res.append(ext) + else: + raise ValueError(f"invalid part specification {name!r}") + return res + + def dirpath(self, *args, **kwargs): + """Return the directory path joined with any given path arguments.""" + if not kwargs: + path = object.__new__(self.__class__) + path.strpath = dirname(self.strpath) + if args: + path = path.join(*args) + return path + return self.new(basename="").join(*args, **kwargs) + + def join(self, *args: os.PathLike[str], abs: bool = False) -> LocalPath: + """Return a new path by appending all 'args' as path + components. if abs=1 is used restart from root if any + of the args is an absolute path. + """ + sep = self.sep + strargs = [os.fspath(arg) for arg in args] + strpath = self.strpath + if abs: + newargs: list[str] = [] + for arg in reversed(strargs): + if isabs(arg): + strpath = arg + strargs = newargs + break + newargs.insert(0, arg) + # special case for when we have e.g. strpath == "/" + actual_sep = "" if strpath.endswith(sep) else sep + for arg in strargs: + arg = arg.strip(sep) + if iswin32: + # allow unix style paths even on windows. + arg = arg.strip("/") + arg = arg.replace("/", sep) + strpath = strpath + actual_sep + arg + actual_sep = sep + obj = object.__new__(self.__class__) + obj.strpath = normpath(strpath) + return obj + + def open(self, mode="r", ensure=False, encoding=None): + """Return an opened file with the given mode. + + If ensure is True, create parent directories if needed. + """ + if ensure: + self.dirpath().ensure(dir=1) + if encoding: + return error.checked_call( + io.open, + self.strpath, + mode, + encoding=encoding, + ) + return error.checked_call(open, self.strpath, mode) + + def _fastjoin(self, name): + child = object.__new__(self.__class__) + child.strpath = self.strpath + self.sep + name + return child + + def islink(self): + return islink(self.strpath) + + def check(self, **kw): + """Check a path for existence and properties. + + Without arguments, return True if the path exists, otherwise False. + + valid checkers:: + + file = 1 # is a file + file = 0 # is not a file (may not even exist) + dir = 1 # is a dir + link = 1 # is a link + exists = 1 # exists + + You can specify multiple checker definitions, for example:: + + path.check(file=1, link=1) # a link pointing to a file + """ + if not kw: + return exists(self.strpath) + if len(kw) == 1: + if "dir" in kw: + return not kw["dir"] ^ isdir(self.strpath) + if "file" in kw: + return not kw["file"] ^ isfile(self.strpath) + if not kw: + kw = {"exists": 1} + return Checkers(self)._evaluate(kw) + + _patternchars = set("*?[" + os.sep) + + def listdir(self, fil=None, sort=None): + """List directory contents, possibly filter by the given fil func + and possibly sorted. + """ + if fil is None and sort is None: + names = error.checked_call(os.listdir, self.strpath) + return map_as_list(self._fastjoin, names) + if isinstance(fil, str): + if not self._patternchars.intersection(fil): + child = self._fastjoin(fil) + if exists(child.strpath): + return [child] + return [] + fil = FNMatcher(fil) + names = error.checked_call(os.listdir, self.strpath) + res = [] + for name in names: + child = self._fastjoin(name) + if fil is None or fil(child): + res.append(child) + self._sortlist(res, sort) + return res + + def size(self) -> int: + """Return size of the underlying file object""" + return self.stat().size + + def mtime(self) -> float: + """Return last modification time of the path.""" + return self.stat().mtime + + def copy(self, target, mode=False, stat=False): + """Copy path to target. + + If mode is True, will copy permission from path to target. + If stat is True, copy permission, last modification + time, last access time, and flags from path to target. + """ + if self.check(file=1): + if target.check(dir=1): + target = target.join(self.basename) + assert self != target + copychunked(self, target) + if mode: + copymode(self.strpath, target.strpath) + if stat: + copystat(self, target) + else: + + def rec(p): + return p.check(link=0) + + for x in self.visit(rec=rec): + relpath = x.relto(self) + newx = target.join(relpath) + newx.dirpath().ensure(dir=1) + if x.check(link=1): + newx.mksymlinkto(x.readlink()) + continue + elif x.check(file=1): + copychunked(x, newx) + elif x.check(dir=1): + newx.ensure(dir=1) + if mode: + copymode(x.strpath, newx.strpath) + if stat: + copystat(x, newx) + + def rename(self, target): + """Rename this path to target.""" + target = os.fspath(target) + return error.checked_call(os.rename, self.strpath, target) + + def dump(self, obj, bin=1): + """Pickle object into path location""" + f = self.open("wb") + import pickle + + try: + error.checked_call(pickle.dump, obj, f, bin) + finally: + f.close() + + def mkdir(self, *args): + """Create & return the directory joined with args.""" + p = self.join(*args) + error.checked_call(os.mkdir, os.fspath(p)) + return p + + def write_binary(self, data, ensure=False): + """Write binary data into path. If ensure is True create + missing parent directories. + """ + if ensure: + self.dirpath().ensure(dir=1) + with self.open("wb") as f: + f.write(data) + + def write_text(self, data, encoding, ensure=False): + """Write text data into path using the specified encoding. + If ensure is True create missing parent directories. + """ + if ensure: + self.dirpath().ensure(dir=1) + with self.open("w", encoding=encoding) as f: + f.write(data) + + def write(self, data, mode="w", ensure=False): + """Write data into path. If ensure is True create + missing parent directories. + """ + if ensure: + self.dirpath().ensure(dir=1) + if "b" in mode: + if not isinstance(data, bytes): + raise ValueError("can only process bytes") + else: + if not isinstance(data, str): + if not isinstance(data, bytes): + data = str(data) + else: + data = data.decode(sys.getdefaultencoding()) + f = self.open(mode) + try: + f.write(data) + finally: + f.close() + + def _ensuredirs(self): + parent = self.dirpath() + if parent == self: + return self + if parent.check(dir=0): + parent._ensuredirs() + if self.check(dir=0): + try: + self.mkdir() + except error.EEXIST: + # race condition: file/dir created by another thread/process. + # complain if it is not a dir + if self.check(dir=0): + raise + return self + + def ensure(self, *args, **kwargs): + """Ensure that an args-joined path exists (by default as + a file). if you specify a keyword argument 'dir=True' + then the path is forced to be a directory path. + """ + p = self.join(*args) + if kwargs.get("dir", 0): + return p._ensuredirs() + else: + p.dirpath()._ensuredirs() + if not p.check(file=1): + p.open("wb").close() + return p + + @overload + def stat(self, raising: Literal[True] = ...) -> Stat: ... + + @overload + def stat(self, raising: Literal[False]) -> Stat | None: ... + + def stat(self, raising: bool = True) -> Stat | None: + """Return an os.stat() tuple.""" + if raising: + return Stat(self, error.checked_call(os.stat, self.strpath)) + try: + return Stat(self, os.stat(self.strpath)) + except KeyboardInterrupt: + raise + except Exception: + return None + + def lstat(self) -> Stat: + """Return an os.lstat() tuple.""" + return Stat(self, error.checked_call(os.lstat, self.strpath)) + + def setmtime(self, mtime=None): + """Set modification time for the given path. if 'mtime' is None + (the default) then the file's mtime is set to current time. + + Note that the resolution for 'mtime' is platform dependent. + """ + if mtime is None: + return error.checked_call(os.utime, self.strpath, mtime) + try: + return error.checked_call(os.utime, self.strpath, (-1, mtime)) + except error.EINVAL: + return error.checked_call(os.utime, self.strpath, (self.atime(), mtime)) + + def chdir(self): + """Change directory to self and return old current directory""" + try: + old = self.__class__() + except error.ENOENT: + old = None + error.checked_call(os.chdir, self.strpath) + return old + + @contextmanager + def as_cwd(self): + """ + Return a context manager, which changes to the path's dir during the + managed "with" context. + On __enter__ it returns the old dir, which might be ``None``. + """ + old = self.chdir() + try: + yield old + finally: + if old is not None: + old.chdir() + + def realpath(self): + """Return a new path which contains no symbolic links.""" + return self.__class__(os.path.realpath(self.strpath)) + + def atime(self): + """Return last access time of the path.""" + return self.stat().atime + + def __repr__(self): + return f"local({self.strpath!r})" + + def __str__(self): + """Return string representation of the Path.""" + return self.strpath + + def chmod(self, mode, rec=0): + """Change permissions to the given mode. If mode is an + integer it directly encodes the os-specific modes. + if rec is True perform recursively. + """ + if not isinstance(mode, int): + raise TypeError(f"mode {mode!r} must be an integer") + if rec: + for x in self.visit(rec=rec): + error.checked_call(os.chmod, str(x), mode) + error.checked_call(os.chmod, self.strpath, mode) + + def pypkgpath(self): + """Return the Python package path by looking for the last + directory upwards which still contains an __init__.py. + Return None if a pkgpath cannot be determined. + """ + pkgpath = None + for parent in self.parts(reverse=True): + if parent.isdir(): + if not parent.join("__init__.py").exists(): + break + if not isimportable(parent.basename): + break + pkgpath = parent + return pkgpath + + def _ensuresyspath(self, ensuremode, path): + if ensuremode: + s = str(path) + if ensuremode == "append": + if s not in sys.path: + sys.path.append(s) + else: + if s != sys.path[0]: + sys.path.insert(0, s) + + def pyimport(self, modname=None, ensuresyspath=True): + """Return path as an imported python module. + + If modname is None, look for the containing package + and construct an according module name. + The module will be put/looked up in sys.modules. + if ensuresyspath is True then the root dir for importing + the file (taking __init__.py files into account) will + be prepended to sys.path if it isn't there already. + If ensuresyspath=="append" the root dir will be appended + if it isn't already contained in sys.path. + if ensuresyspath is False no modification of syspath happens. + + Special value of ensuresyspath=="importlib" is intended + purely for using in pytest, it is capable only of importing + separate .py files outside packages, e.g. for test suite + without any __init__.py file. It effectively allows having + same-named test modules in different places and offers + mild opt-in via this option. Note that it works only in + recent versions of python. + """ + if not self.check(): + raise error.ENOENT(self) + + if ensuresyspath == "importlib": + if modname is None: + modname = self.purebasename + spec = importlib.util.spec_from_file_location(modname, str(self)) + if spec is None or spec.loader is None: + raise ImportError(f"Can't find module {modname} at location {self!s}") + mod = importlib.util.module_from_spec(spec) + spec.loader.exec_module(mod) + return mod + + pkgpath = None + if modname is None: + pkgpath = self.pypkgpath() + if pkgpath is not None: + pkgroot = pkgpath.dirpath() + names = self.new(ext="").relto(pkgroot).split(self.sep) + if names[-1] == "__init__": + names.pop() + modname = ".".join(names) + else: + pkgroot = self.dirpath() + modname = self.purebasename + + self._ensuresyspath(ensuresyspath, pkgroot) + __import__(modname) + mod = sys.modules[modname] + if self.basename == "__init__.py": + return mod # we don't check anything as we might + # be in a namespace package ... too icky to check + modfile = mod.__file__ + assert modfile is not None + if modfile[-4:] in (".pyc", ".pyo"): + modfile = modfile[:-1] + elif modfile.endswith("$py.class"): + modfile = modfile[:-9] + ".py" + if modfile.endswith(os.sep + "__init__.py"): + if self.basename != "__init__.py": + modfile = modfile[:-12] + try: + issame = self.samefile(modfile) + except error.ENOENT: + issame = False + if not issame: + ignore = os.getenv("PY_IGNORE_IMPORTMISMATCH") + if ignore != "1": + raise self.ImportMismatchError(modname, modfile, self) + return mod + else: + try: + return sys.modules[modname] + except KeyError: + # we have a custom modname, do a pseudo-import + import types + + mod = types.ModuleType(modname) + mod.__file__ = str(self) + sys.modules[modname] = mod + try: + with open(str(self), "rb") as f: + exec(f.read(), mod.__dict__) + except BaseException: + del sys.modules[modname] + raise + return mod + + def sysexec(self, *argv: os.PathLike[str], **popen_opts: Any) -> str: + """Return stdout text from executing a system child process, + where the 'self' path points to executable. + The process is directly invoked and not through a system shell. + """ + from subprocess import PIPE + from subprocess import Popen + + popen_opts.pop("stdout", None) + popen_opts.pop("stderr", None) + proc = Popen( + [str(self)] + [str(arg) for arg in argv], + **popen_opts, + stdout=PIPE, + stderr=PIPE, + ) + stdout: str | bytes + stdout, stderr = proc.communicate() + ret = proc.wait() + if isinstance(stdout, bytes): + stdout = stdout.decode(sys.getdefaultencoding()) + if ret != 0: + if isinstance(stderr, bytes): + stderr = stderr.decode(sys.getdefaultencoding()) + raise RuntimeError( + ret, + ret, + str(self), + stdout, + stderr, + ) + return stdout + + @classmethod + def sysfind(cls, name, checker=None, paths=None): + """Return a path object found by looking at the systems + underlying PATH specification. If the checker is not None + it will be invoked to filter matching paths. If a binary + cannot be found, None is returned + Note: This is probably not working on plain win32 systems + but may work on cygwin. + """ + if isabs(name): + p = local(name) + if p.check(file=1): + return p + else: + if paths is None: + if iswin32: + paths = os.environ["Path"].split(";") + if "" not in paths and "." not in paths: + paths.append(".") + try: + systemroot = os.environ["SYSTEMROOT"] + except KeyError: + pass + else: + paths = [ + path.replace("%SystemRoot%", systemroot) for path in paths + ] + else: + paths = os.environ["PATH"].split(":") + tryadd = [] + if iswin32: + tryadd += os.environ["PATHEXT"].split(os.pathsep) + tryadd.append("") + + for x in paths: + for addext in tryadd: + p = local(x).join(name, abs=True) + addext + try: + if p.check(file=1): + if checker: + if not checker(p): + continue + return p + except error.EACCES: + pass + return None + + @classmethod + def _gethomedir(cls): + try: + x = os.environ["HOME"] + except KeyError: + try: + x = os.environ["HOMEDRIVE"] + os.environ["HOMEPATH"] + except KeyError: + return None + return cls(x) + + # """ + # special class constructors for local filesystem paths + # """ + @classmethod + def get_temproot(cls): + """Return the system's temporary directory + (where tempfiles are usually created in) + """ + import tempfile + + return local(tempfile.gettempdir()) + + @classmethod + def mkdtemp(cls, rootdir=None): + """Return a Path object pointing to a fresh new temporary directory + (which we created ourselves). + """ + import tempfile + + if rootdir is None: + rootdir = cls.get_temproot() + path = error.checked_call(tempfile.mkdtemp, dir=str(rootdir)) + return cls(path) + + @classmethod + def make_numbered_dir( + cls, prefix="session-", rootdir=None, keep=3, lock_timeout=172800 + ): # two days + """Return unique directory with a number greater than the current + maximum one. The number is assumed to start directly after prefix. + if keep is true directories with a number less than (maxnum-keep) + will be removed. If .lock files are used (lock_timeout non-zero), + algorithm is multi-process safe. + """ + if rootdir is None: + rootdir = cls.get_temproot() + + nprefix = prefix.lower() + + def parse_num(path): + """Parse the number out of a path (if it matches the prefix)""" + nbasename = path.basename.lower() + if nbasename.startswith(nprefix): + try: + return int(nbasename[len(nprefix) :]) + except ValueError: + pass + + def create_lockfile(path): + """Exclusively create lockfile. Throws when failed""" + mypid = os.getpid() + lockfile = path.join(".lock") + if hasattr(lockfile, "mksymlinkto"): + lockfile.mksymlinkto(str(mypid)) + else: + fd = error.checked_call( + os.open, str(lockfile), os.O_WRONLY | os.O_CREAT | os.O_EXCL, 0o644 + ) + with os.fdopen(fd, "w") as f: + f.write(str(mypid)) + return lockfile + + def atexit_remove_lockfile(lockfile): + """Ensure lockfile is removed at process exit""" + mypid = os.getpid() + + def try_remove_lockfile(): + # in a fork() situation, only the last process should + # remove the .lock, otherwise the other processes run the + # risk of seeing their temporary dir disappear. For now + # we remove the .lock in the parent only (i.e. we assume + # that the children finish before the parent). + if os.getpid() != mypid: + return + try: + lockfile.remove() + except error.Error: + pass + + atexit.register(try_remove_lockfile) + + # compute the maximum number currently in use with the prefix + lastmax = None + while True: + maxnum = -1 + for path in rootdir.listdir(): + num = parse_num(path) + if num is not None: + maxnum = max(maxnum, num) + + # make the new directory + try: + udir = rootdir.mkdir(prefix + str(maxnum + 1)) + if lock_timeout: + lockfile = create_lockfile(udir) + atexit_remove_lockfile(lockfile) + except (error.EEXIST, error.ENOENT, error.EBUSY): + # race condition (1): another thread/process created the dir + # in the meantime - try again + # race condition (2): another thread/process spuriously acquired + # lock treating empty directory as candidate + # for removal - try again + # race condition (3): another thread/process tried to create the lock at + # the same time (happened in Python 3.3 on Windows) + # https://ci.appveyor.com/project/pytestbot/py/build/1.0.21/job/ffi85j4c0lqwsfwa + if lastmax == maxnum: + raise + lastmax = maxnum + continue + break + + def get_mtime(path): + """Read file modification time""" + try: + return path.lstat().mtime + except error.Error: + pass + + garbage_prefix = prefix + "garbage-" + + def is_garbage(path): + """Check if path denotes directory scheduled for removal""" + bn = path.basename + return bn.startswith(garbage_prefix) + + # prune old directories + udir_time = get_mtime(udir) + if keep and udir_time: + for path in rootdir.listdir(): + num = parse_num(path) + if num is not None and num <= (maxnum - keep): + try: + # try acquiring lock to remove directory as exclusive user + if lock_timeout: + create_lockfile(path) + except (error.EEXIST, error.ENOENT, error.EBUSY): + path_time = get_mtime(path) + if not path_time: + # assume directory doesn't exist now + continue + if abs(udir_time - path_time) < lock_timeout: + # assume directory with lockfile exists + # and lock timeout hasn't expired yet + continue + + # path dir locked for exclusive use + # and scheduled for removal to avoid another thread/process + # treating it as a new directory or removal candidate + garbage_path = rootdir.join(garbage_prefix + str(uuid.uuid4())) + try: + path.rename(garbage_path) + garbage_path.remove(rec=1) + except KeyboardInterrupt: + raise + except Exception: # this might be error.Error, WindowsError ... + pass + if is_garbage(path): + try: + path.remove(rec=1) + except KeyboardInterrupt: + raise + except Exception: # this might be error.Error, WindowsError ... + pass + + # make link... + try: + username = os.environ["USER"] # linux, et al + except KeyError: + try: + username = os.environ["USERNAME"] # windows + except KeyError: + username = "current" + + src = str(udir) + dest = src[: src.rfind("-")] + "-" + username + try: + os.unlink(dest) + except OSError: + pass + try: + os.symlink(src, dest) + except (OSError, AttributeError, NotImplementedError): + pass + + return udir + + +def copymode(src, dest): + """Copy permission from src to dst.""" + import shutil + + shutil.copymode(src, dest) + + +def copystat(src, dest): + """Copy permission, last modification time, + last access time, and flags from src to dst.""" + import shutil + + shutil.copystat(str(src), str(dest)) + + +def copychunked(src, dest): + chunksize = 524288 # half a meg of bytes + fsrc = src.open("rb") + try: + fdest = dest.open("wb") + try: + while 1: + buf = fsrc.read(chunksize) + if not buf: + break + fdest.write(buf) + finally: + fdest.close() + finally: + fsrc.close() + + +def isimportable(name): + if name and (name[0].isalpha() or name[0] == "_"): + name = name.replace("_", "") + return not name or name.isalnum() + + +local = LocalPath diff --git a/.venv/Lib/site-packages/_pytest/_version.py b/.venv/Lib/site-packages/_pytest/_version.py new file mode 100644 index 00000000..cf258c17 --- /dev/null +++ b/.venv/Lib/site-packages/_pytest/_version.py @@ -0,0 +1,16 @@ +# file generated by setuptools_scm +# don't change, don't track in version control +TYPE_CHECKING = False +if TYPE_CHECKING: + from typing import Tuple, Union + VERSION_TUPLE = Tuple[Union[int, str], ...] +else: + VERSION_TUPLE = object + +version: str +__version__: str +__version_tuple__: VERSION_TUPLE +version_tuple: VERSION_TUPLE + +__version__ = version = '8.3.3' +__version_tuple__ = version_tuple = (8, 3, 3) diff --git a/.venv/Lib/site-packages/_pytest/assertion/__init__.py b/.venv/Lib/site-packages/_pytest/assertion/__init__.py new file mode 100644 index 00000000..f2f1d029 --- /dev/null +++ b/.venv/Lib/site-packages/_pytest/assertion/__init__.py @@ -0,0 +1,192 @@ +# mypy: allow-untyped-defs +"""Support for presenting detailed information in failing assertions.""" + +from __future__ import annotations + +import sys +from typing import Any +from typing import Generator +from typing import TYPE_CHECKING + +from _pytest.assertion import rewrite +from _pytest.assertion import truncate +from _pytest.assertion import util +from _pytest.assertion.rewrite import assertstate_key +from _pytest.config import Config +from _pytest.config import hookimpl +from _pytest.config.argparsing import Parser +from _pytest.nodes import Item + + +if TYPE_CHECKING: + from _pytest.main import Session + + +def pytest_addoption(parser: Parser) -> None: + group = parser.getgroup("debugconfig") + group.addoption( + "--assert", + action="store", + dest="assertmode", + choices=("rewrite", "plain"), + default="rewrite", + metavar="MODE", + help=( + "Control assertion debugging tools.\n" + "'plain' performs no assertion debugging.\n" + "'rewrite' (the default) rewrites assert statements in test modules" + " on import to provide assert expression information." + ), + ) + parser.addini( + "enable_assertion_pass_hook", + type="bool", + default=False, + help="Enables the pytest_assertion_pass hook. " + "Make sure to delete any previously generated pyc cache files.", + ) + Config._add_verbosity_ini( + parser, + Config.VERBOSITY_ASSERTIONS, + help=( + "Specify a verbosity level for assertions, overriding the main level. " + "Higher levels will provide more detailed explanation when an assertion fails." + ), + ) + + +def register_assert_rewrite(*names: str) -> None: + """Register one or more module names to be rewritten on import. + + This function will make sure that this module or all modules inside + the package will get their assert statements rewritten. + Thus you should make sure to call this before the module is + actually imported, usually in your __init__.py if you are a plugin + using a package. + + :param names: The module names to register. + """ + for name in names: + if not isinstance(name, str): + msg = "expected module names as *args, got {0} instead" # type: ignore[unreachable] + raise TypeError(msg.format(repr(names))) + for hook in sys.meta_path: + if isinstance(hook, rewrite.AssertionRewritingHook): + importhook = hook + break + else: + # TODO(typing): Add a protocol for mark_rewrite() and use it + # for importhook and for PytestPluginManager.rewrite_hook. + importhook = DummyRewriteHook() # type: ignore + importhook.mark_rewrite(*names) + + +class DummyRewriteHook: + """A no-op import hook for when rewriting is disabled.""" + + def mark_rewrite(self, *names: str) -> None: + pass + + +class AssertionState: + """State for the assertion plugin.""" + + def __init__(self, config: Config, mode) -> None: + self.mode = mode + self.trace = config.trace.root.get("assertion") + self.hook: rewrite.AssertionRewritingHook | None = None + + +def install_importhook(config: Config) -> rewrite.AssertionRewritingHook: + """Try to install the rewrite hook, raise SystemError if it fails.""" + config.stash[assertstate_key] = AssertionState(config, "rewrite") + config.stash[assertstate_key].hook = hook = rewrite.AssertionRewritingHook(config) + sys.meta_path.insert(0, hook) + config.stash[assertstate_key].trace("installed rewrite import hook") + + def undo() -> None: + hook = config.stash[assertstate_key].hook + if hook is not None and hook in sys.meta_path: + sys.meta_path.remove(hook) + + config.add_cleanup(undo) + return hook + + +def pytest_collection(session: Session) -> None: + # This hook is only called when test modules are collected + # so for example not in the managing process of pytest-xdist + # (which does not collect test modules). + assertstate = session.config.stash.get(assertstate_key, None) + if assertstate: + if assertstate.hook is not None: + assertstate.hook.set_session(session) + + +@hookimpl(wrapper=True, tryfirst=True) +def pytest_runtest_protocol(item: Item) -> Generator[None, object, object]: + """Setup the pytest_assertrepr_compare and pytest_assertion_pass hooks. + + The rewrite module will use util._reprcompare if it exists to use custom + reporting via the pytest_assertrepr_compare hook. This sets up this custom + comparison for the test. + """ + ihook = item.ihook + + def callbinrepr(op, left: object, right: object) -> str | None: + """Call the pytest_assertrepr_compare hook and prepare the result. + + This uses the first result from the hook and then ensures the + following: + * Overly verbose explanations are truncated unless configured otherwise + (eg. if running in verbose mode). + * Embedded newlines are escaped to help util.format_explanation() + later. + * If the rewrite mode is used embedded %-characters are replaced + to protect later % formatting. + + The result can be formatted by util.format_explanation() for + pretty printing. + """ + hook_result = ihook.pytest_assertrepr_compare( + config=item.config, op=op, left=left, right=right + ) + for new_expl in hook_result: + if new_expl: + new_expl = truncate.truncate_if_required(new_expl, item) + new_expl = [line.replace("\n", "\\n") for line in new_expl] + res = "\n~".join(new_expl) + if item.config.getvalue("assertmode") == "rewrite": + res = res.replace("%", "%%") + return res + return None + + saved_assert_hooks = util._reprcompare, util._assertion_pass + util._reprcompare = callbinrepr + util._config = item.config + + if ihook.pytest_assertion_pass.get_hookimpls(): + + def call_assertion_pass_hook(lineno: int, orig: str, expl: str) -> None: + ihook.pytest_assertion_pass(item=item, lineno=lineno, orig=orig, expl=expl) + + util._assertion_pass = call_assertion_pass_hook + + try: + return (yield) + finally: + util._reprcompare, util._assertion_pass = saved_assert_hooks + util._config = None + + +def pytest_sessionfinish(session: Session) -> None: + assertstate = session.config.stash.get(assertstate_key, None) + if assertstate: + if assertstate.hook is not None: + assertstate.hook.set_session(None) + + +def pytest_assertrepr_compare( + config: Config, op: str, left: Any, right: Any +) -> list[str] | None: + return util.assertrepr_compare(config=config, op=op, left=left, right=right) diff --git a/.venv/Lib/site-packages/_pytest/assertion/rewrite.py b/.venv/Lib/site-packages/_pytest/assertion/rewrite.py new file mode 100644 index 00000000..a7a92c0f --- /dev/null +++ b/.venv/Lib/site-packages/_pytest/assertion/rewrite.py @@ -0,0 +1,1204 @@ +"""Rewrite assertion AST to produce nice error messages.""" + +from __future__ import annotations + +import ast +from collections import defaultdict +import errno +import functools +import importlib.abc +import importlib.machinery +import importlib.util +import io +import itertools +import marshal +import os +from pathlib import Path +from pathlib import PurePath +import struct +import sys +import tokenize +import types +from typing import Callable +from typing import IO +from typing import Iterable +from typing import Iterator +from typing import Sequence +from typing import TYPE_CHECKING + +from _pytest._io.saferepr import DEFAULT_REPR_MAX_SIZE +from _pytest._io.saferepr import saferepr +from _pytest._version import version +from _pytest.assertion import util +from _pytest.config import Config +from _pytest.main import Session +from _pytest.pathlib import absolutepath +from _pytest.pathlib import fnmatch_ex +from _pytest.stash import StashKey + + +# fmt: off +from _pytest.assertion.util import format_explanation as _format_explanation # noqa:F401, isort:skip +# fmt:on + +if TYPE_CHECKING: + from _pytest.assertion import AssertionState + + +class Sentinel: + pass + + +assertstate_key = StashKey["AssertionState"]() + +# pytest caches rewritten pycs in pycache dirs +PYTEST_TAG = f"{sys.implementation.cache_tag}-pytest-{version}" +PYC_EXT = ".py" + (__debug__ and "c" or "o") +PYC_TAIL = "." + PYTEST_TAG + PYC_EXT + +# Special marker that denotes we have just left a scope definition +_SCOPE_END_MARKER = Sentinel() + + +class AssertionRewritingHook(importlib.abc.MetaPathFinder, importlib.abc.Loader): + """PEP302/PEP451 import hook which rewrites asserts.""" + + def __init__(self, config: Config) -> None: + self.config = config + try: + self.fnpats = config.getini("python_files") + except ValueError: + self.fnpats = ["test_*.py", "*_test.py"] + self.session: Session | None = None + self._rewritten_names: dict[str, Path] = {} + self._must_rewrite: set[str] = set() + # flag to guard against trying to rewrite a pyc file while we are already writing another pyc file, + # which might result in infinite recursion (#3506) + self._writing_pyc = False + self._basenames_to_check_rewrite = {"conftest"} + self._marked_for_rewrite_cache: dict[str, bool] = {} + self._session_paths_checked = False + + def set_session(self, session: Session | None) -> None: + self.session = session + self._session_paths_checked = False + + # Indirection so we can mock calls to find_spec originated from the hook during testing + _find_spec = importlib.machinery.PathFinder.find_spec + + def find_spec( + self, + name: str, + path: Sequence[str | bytes] | None = None, + target: types.ModuleType | None = None, + ) -> importlib.machinery.ModuleSpec | None: + if self._writing_pyc: + return None + state = self.config.stash[assertstate_key] + if self._early_rewrite_bailout(name, state): + return None + state.trace(f"find_module called for: {name}") + + # Type ignored because mypy is confused about the `self` binding here. + spec = self._find_spec(name, path) # type: ignore + + if spec is None and path is not None: + # With --import-mode=importlib, PathFinder cannot find spec without modifying `sys.path`, + # causing inability to assert rewriting (#12659). + # At this point, try using the file path to find the module spec. + for _path_str in path: + spec = importlib.util.spec_from_file_location(name, _path_str) + if spec is not None: + break + + if ( + # the import machinery could not find a file to import + spec is None + # this is a namespace package (without `__init__.py`) + # there's nothing to rewrite there + or spec.origin is None + # we can only rewrite source files + or not isinstance(spec.loader, importlib.machinery.SourceFileLoader) + # if the file doesn't exist, we can't rewrite it + or not os.path.exists(spec.origin) + ): + return None + else: + fn = spec.origin + + if not self._should_rewrite(name, fn, state): + return None + + return importlib.util.spec_from_file_location( + name, + fn, + loader=self, + submodule_search_locations=spec.submodule_search_locations, + ) + + def create_module( + self, spec: importlib.machinery.ModuleSpec + ) -> types.ModuleType | None: + return None # default behaviour is fine + + def exec_module(self, module: types.ModuleType) -> None: + assert module.__spec__ is not None + assert module.__spec__.origin is not None + fn = Path(module.__spec__.origin) + state = self.config.stash[assertstate_key] + + self._rewritten_names[module.__name__] = fn + + # The requested module looks like a test file, so rewrite it. This is + # the most magical part of the process: load the source, rewrite the + # asserts, and load the rewritten source. We also cache the rewritten + # module code in a special pyc. We must be aware of the possibility of + # concurrent pytest processes rewriting and loading pycs. To avoid + # tricky race conditions, we maintain the following invariant: The + # cached pyc is always a complete, valid pyc. Operations on it must be + # atomic. POSIX's atomic rename comes in handy. + write = not sys.dont_write_bytecode + cache_dir = get_cache_dir(fn) + if write: + ok = try_makedirs(cache_dir) + if not ok: + write = False + state.trace(f"read only directory: {cache_dir}") + + cache_name = fn.name[:-3] + PYC_TAIL + pyc = cache_dir / cache_name + # Notice that even if we're in a read-only directory, I'm going + # to check for a cached pyc. This may not be optimal... + co = _read_pyc(fn, pyc, state.trace) + if co is None: + state.trace(f"rewriting {fn!r}") + source_stat, co = _rewrite_test(fn, self.config) + if write: + self._writing_pyc = True + try: + _write_pyc(state, co, source_stat, pyc) + finally: + self._writing_pyc = False + else: + state.trace(f"found cached rewritten pyc for {fn}") + exec(co, module.__dict__) + + def _early_rewrite_bailout(self, name: str, state: AssertionState) -> bool: + """A fast way to get out of rewriting modules. + + Profiling has shown that the call to PathFinder.find_spec (inside of + the find_spec from this class) is a major slowdown, so, this method + tries to filter what we're sure won't be rewritten before getting to + it. + """ + if self.session is not None and not self._session_paths_checked: + self._session_paths_checked = True + for initial_path in self.session._initialpaths: + # Make something as c:/projects/my_project/path.py -> + # ['c:', 'projects', 'my_project', 'path.py'] + parts = str(initial_path).split(os.sep) + # add 'path' to basenames to be checked. + self._basenames_to_check_rewrite.add(os.path.splitext(parts[-1])[0]) + + # Note: conftest already by default in _basenames_to_check_rewrite. + parts = name.split(".") + if parts[-1] in self._basenames_to_check_rewrite: + return False + + # For matching the name it must be as if it was a filename. + path = PurePath(*parts).with_suffix(".py") + + for pat in self.fnpats: + # if the pattern contains subdirectories ("tests/**.py" for example) we can't bail out based + # on the name alone because we need to match against the full path + if os.path.dirname(pat): + return False + if fnmatch_ex(pat, path): + return False + + if self._is_marked_for_rewrite(name, state): + return False + + state.trace(f"early skip of rewriting module: {name}") + return True + + def _should_rewrite(self, name: str, fn: str, state: AssertionState) -> bool: + # always rewrite conftest files + if os.path.basename(fn) == "conftest.py": + state.trace(f"rewriting conftest file: {fn!r}") + return True + + if self.session is not None: + if self.session.isinitpath(absolutepath(fn)): + state.trace(f"matched test file (was specified on cmdline): {fn!r}") + return True + + # modules not passed explicitly on the command line are only + # rewritten if they match the naming convention for test files + fn_path = PurePath(fn) + for pat in self.fnpats: + if fnmatch_ex(pat, fn_path): + state.trace(f"matched test file {fn!r}") + return True + + return self._is_marked_for_rewrite(name, state) + + def _is_marked_for_rewrite(self, name: str, state: AssertionState) -> bool: + try: + return self._marked_for_rewrite_cache[name] + except KeyError: + for marked in self._must_rewrite: + if name == marked or name.startswith(marked + "."): + state.trace(f"matched marked file {name!r} (from {marked!r})") + self._marked_for_rewrite_cache[name] = True + return True + + self._marked_for_rewrite_cache[name] = False + return False + + def mark_rewrite(self, *names: str) -> None: + """Mark import names as needing to be rewritten. + + The named module or package as well as any nested modules will + be rewritten on import. + """ + already_imported = ( + set(names).intersection(sys.modules).difference(self._rewritten_names) + ) + for name in already_imported: + mod = sys.modules[name] + if not AssertionRewriter.is_rewrite_disabled( + mod.__doc__ or "" + ) and not isinstance(mod.__loader__, type(self)): + self._warn_already_imported(name) + self._must_rewrite.update(names) + self._marked_for_rewrite_cache.clear() + + def _warn_already_imported(self, name: str) -> None: + from _pytest.warning_types import PytestAssertRewriteWarning + + self.config.issue_config_time_warning( + PytestAssertRewriteWarning( + f"Module already imported so cannot be rewritten: {name}" + ), + stacklevel=5, + ) + + def get_data(self, pathname: str | bytes) -> bytes: + """Optional PEP302 get_data API.""" + with open(pathname, "rb") as f: + return f.read() + + if sys.version_info >= (3, 10): + if sys.version_info >= (3, 12): + from importlib.resources.abc import TraversableResources + else: + from importlib.abc import TraversableResources + + def get_resource_reader(self, name: str) -> TraversableResources: + if sys.version_info < (3, 11): + from importlib.readers import FileReader + else: + from importlib.resources.readers import FileReader + + return FileReader(types.SimpleNamespace(path=self._rewritten_names[name])) + + +def _write_pyc_fp( + fp: IO[bytes], source_stat: os.stat_result, co: types.CodeType +) -> None: + # Technically, we don't have to have the same pyc format as + # (C)Python, since these "pycs" should never be seen by builtin + # import. However, there's little reason to deviate. + fp.write(importlib.util.MAGIC_NUMBER) + # https://www.python.org/dev/peps/pep-0552/ + flags = b"\x00\x00\x00\x00" + fp.write(flags) + # as of now, bytecode header expects 32-bit numbers for size and mtime (#4903) + mtime = int(source_stat.st_mtime) & 0xFFFFFFFF + size = source_stat.st_size & 0xFFFFFFFF + # " bool: + proc_pyc = f"{pyc}.{os.getpid()}" + try: + with open(proc_pyc, "wb") as fp: + _write_pyc_fp(fp, source_stat, co) + except OSError as e: + state.trace(f"error writing pyc file at {proc_pyc}: errno={e.errno}") + return False + + try: + os.replace(proc_pyc, pyc) + except OSError as e: + state.trace(f"error writing pyc file at {pyc}: {e}") + # we ignore any failure to write the cache file + # there are many reasons, permission-denied, pycache dir being a + # file etc. + return False + return True + + +def _rewrite_test(fn: Path, config: Config) -> tuple[os.stat_result, types.CodeType]: + """Read and rewrite *fn* and return the code object.""" + stat = os.stat(fn) + source = fn.read_bytes() + strfn = str(fn) + tree = ast.parse(source, filename=strfn) + rewrite_asserts(tree, source, strfn, config) + co = compile(tree, strfn, "exec", dont_inherit=True) + return stat, co + + +def _read_pyc( + source: Path, pyc: Path, trace: Callable[[str], None] = lambda x: None +) -> types.CodeType | None: + """Possibly read a pytest pyc containing rewritten code. + + Return rewritten code if successful or None if not. + """ + try: + fp = open(pyc, "rb") + except OSError: + return None + with fp: + try: + stat_result = os.stat(source) + mtime = int(stat_result.st_mtime) + size = stat_result.st_size + data = fp.read(16) + except OSError as e: + trace(f"_read_pyc({source}): OSError {e}") + return None + # Check for invalid or out of date pyc file. + if len(data) != (16): + trace(f"_read_pyc({source}): invalid pyc (too short)") + return None + if data[:4] != importlib.util.MAGIC_NUMBER: + trace(f"_read_pyc({source}): invalid pyc (bad magic number)") + return None + if data[4:8] != b"\x00\x00\x00\x00": + trace(f"_read_pyc({source}): invalid pyc (unsupported flags)") + return None + mtime_data = data[8:12] + if int.from_bytes(mtime_data, "little") != mtime & 0xFFFFFFFF: + trace(f"_read_pyc({source}): out of date") + return None + size_data = data[12:16] + if int.from_bytes(size_data, "little") != size & 0xFFFFFFFF: + trace(f"_read_pyc({source}): invalid pyc (incorrect size)") + return None + try: + co = marshal.load(fp) + except Exception as e: + trace(f"_read_pyc({source}): marshal.load error {e}") + return None + if not isinstance(co, types.CodeType): + trace(f"_read_pyc({source}): not a code object") + return None + return co + + +def rewrite_asserts( + mod: ast.Module, + source: bytes, + module_path: str | None = None, + config: Config | None = None, +) -> None: + """Rewrite the assert statements in mod.""" + AssertionRewriter(module_path, config, source).run(mod) + + +def _saferepr(obj: object) -> str: + r"""Get a safe repr of an object for assertion error messages. + + The assertion formatting (util.format_explanation()) requires + newlines to be escaped since they are a special character for it. + Normally assertion.util.format_explanation() does this but for a + custom repr it is possible to contain one of the special escape + sequences, especially '\n{' and '\n}' are likely to be present in + JSON reprs. + """ + if isinstance(obj, types.MethodType): + # for bound methods, skip redundant information + return obj.__name__ + + maxsize = _get_maxsize_for_saferepr(util._config) + return saferepr(obj, maxsize=maxsize).replace("\n", "\\n") + + +def _get_maxsize_for_saferepr(config: Config | None) -> int | None: + """Get `maxsize` configuration for saferepr based on the given config object.""" + if config is None: + verbosity = 0 + else: + verbosity = config.get_verbosity(Config.VERBOSITY_ASSERTIONS) + if verbosity >= 2: + return None + if verbosity >= 1: + return DEFAULT_REPR_MAX_SIZE * 10 + return DEFAULT_REPR_MAX_SIZE + + +def _format_assertmsg(obj: object) -> str: + r"""Format the custom assertion message given. + + For strings this simply replaces newlines with '\n~' so that + util.format_explanation() will preserve them instead of escaping + newlines. For other objects saferepr() is used first. + """ + # reprlib appears to have a bug which means that if a string + # contains a newline it gets escaped, however if an object has a + # .__repr__() which contains newlines it does not get escaped. + # However in either case we want to preserve the newline. + replaces = [("\n", "\n~"), ("%", "%%")] + if not isinstance(obj, str): + obj = saferepr(obj, _get_maxsize_for_saferepr(util._config)) + replaces.append(("\\n", "\n~")) + + for r1, r2 in replaces: + obj = obj.replace(r1, r2) + + return obj + + +def _should_repr_global_name(obj: object) -> bool: + if callable(obj): + return False + + try: + return not hasattr(obj, "__name__") + except Exception: + return True + + +def _format_boolop(explanations: Iterable[str], is_or: bool) -> str: + explanation = "(" + (is_or and " or " or " and ").join(explanations) + ")" + return explanation.replace("%", "%%") + + +def _call_reprcompare( + ops: Sequence[str], + results: Sequence[bool], + expls: Sequence[str], + each_obj: Sequence[object], +) -> str: + for i, res, expl in zip(range(len(ops)), results, expls): + try: + done = not res + except Exception: + done = True + if done: + break + if util._reprcompare is not None: + custom = util._reprcompare(ops[i], each_obj[i], each_obj[i + 1]) + if custom is not None: + return custom + return expl + + +def _call_assertion_pass(lineno: int, orig: str, expl: str) -> None: + if util._assertion_pass is not None: + util._assertion_pass(lineno, orig, expl) + + +def _check_if_assertion_pass_impl() -> bool: + """Check if any plugins implement the pytest_assertion_pass hook + in order not to generate explanation unnecessarily (might be expensive).""" + return True if util._assertion_pass else False + + +UNARY_MAP = {ast.Not: "not %s", ast.Invert: "~%s", ast.USub: "-%s", ast.UAdd: "+%s"} + +BINOP_MAP = { + ast.BitOr: "|", + ast.BitXor: "^", + ast.BitAnd: "&", + ast.LShift: "<<", + ast.RShift: ">>", + ast.Add: "+", + ast.Sub: "-", + ast.Mult: "*", + ast.Div: "/", + ast.FloorDiv: "//", + ast.Mod: "%%", # escaped for string formatting + ast.Eq: "==", + ast.NotEq: "!=", + ast.Lt: "<", + ast.LtE: "<=", + ast.Gt: ">", + ast.GtE: ">=", + ast.Pow: "**", + ast.Is: "is", + ast.IsNot: "is not", + ast.In: "in", + ast.NotIn: "not in", + ast.MatMult: "@", +} + + +def traverse_node(node: ast.AST) -> Iterator[ast.AST]: + """Recursively yield node and all its children in depth-first order.""" + yield node + for child in ast.iter_child_nodes(node): + yield from traverse_node(child) + + +@functools.lru_cache(maxsize=1) +def _get_assertion_exprs(src: bytes) -> dict[int, str]: + """Return a mapping from {lineno: "assertion test expression"}.""" + ret: dict[int, str] = {} + + depth = 0 + lines: list[str] = [] + assert_lineno: int | None = None + seen_lines: set[int] = set() + + def _write_and_reset() -> None: + nonlocal depth, lines, assert_lineno, seen_lines + assert assert_lineno is not None + ret[assert_lineno] = "".join(lines).rstrip().rstrip("\\") + depth = 0 + lines = [] + assert_lineno = None + seen_lines = set() + + tokens = tokenize.tokenize(io.BytesIO(src).readline) + for tp, source, (lineno, offset), _, line in tokens: + if tp == tokenize.NAME and source == "assert": + assert_lineno = lineno + elif assert_lineno is not None: + # keep track of depth for the assert-message `,` lookup + if tp == tokenize.OP and source in "([{": + depth += 1 + elif tp == tokenize.OP and source in ")]}": + depth -= 1 + + if not lines: + lines.append(line[offset:]) + seen_lines.add(lineno) + # a non-nested comma separates the expression from the message + elif depth == 0 and tp == tokenize.OP and source == ",": + # one line assert with message + if lineno in seen_lines and len(lines) == 1: + offset_in_trimmed = offset + len(lines[-1]) - len(line) + lines[-1] = lines[-1][:offset_in_trimmed] + # multi-line assert with message + elif lineno in seen_lines: + lines[-1] = lines[-1][:offset] + # multi line assert with escaped newline before message + else: + lines.append(line[:offset]) + _write_and_reset() + elif tp in {tokenize.NEWLINE, tokenize.ENDMARKER}: + _write_and_reset() + elif lines and lineno not in seen_lines: + lines.append(line) + seen_lines.add(lineno) + + return ret + + +class AssertionRewriter(ast.NodeVisitor): + """Assertion rewriting implementation. + + The main entrypoint is to call .run() with an ast.Module instance, + this will then find all the assert statements and rewrite them to + provide intermediate values and a detailed assertion error. See + http://pybites.blogspot.be/2011/07/behind-scenes-of-pytests-new-assertion.html + for an overview of how this works. + + The entry point here is .run() which will iterate over all the + statements in an ast.Module and for each ast.Assert statement it + finds call .visit() with it. Then .visit_Assert() takes over and + is responsible for creating new ast statements to replace the + original assert statement: it rewrites the test of an assertion + to provide intermediate values and replace it with an if statement + which raises an assertion error with a detailed explanation in + case the expression is false and calls pytest_assertion_pass hook + if expression is true. + + For this .visit_Assert() uses the visitor pattern to visit all the + AST nodes of the ast.Assert.test field, each visit call returning + an AST node and the corresponding explanation string. During this + state is kept in several instance attributes: + + :statements: All the AST statements which will replace the assert + statement. + + :variables: This is populated by .variable() with each variable + used by the statements so that they can all be set to None at + the end of the statements. + + :variable_counter: Counter to create new unique variables needed + by statements. Variables are created using .variable() and + have the form of "@py_assert0". + + :expl_stmts: The AST statements which will be executed to get + data from the assertion. This is the code which will construct + the detailed assertion message that is used in the AssertionError + or for the pytest_assertion_pass hook. + + :explanation_specifiers: A dict filled by .explanation_param() + with %-formatting placeholders and their corresponding + expressions to use in the building of an assertion message. + This is used by .pop_format_context() to build a message. + + :stack: A stack of the explanation_specifiers dicts maintained by + .push_format_context() and .pop_format_context() which allows + to build another %-formatted string while already building one. + + :scope: A tuple containing the current scope used for variables_overwrite. + + :variables_overwrite: A dict filled with references to variables + that change value within an assert. This happens when a variable is + reassigned with the walrus operator + + This state, except the variables_overwrite, is reset on every new assert + statement visited and used by the other visitors. + """ + + def __init__( + self, module_path: str | None, config: Config | None, source: bytes + ) -> None: + super().__init__() + self.module_path = module_path + self.config = config + if config is not None: + self.enable_assertion_pass_hook = config.getini( + "enable_assertion_pass_hook" + ) + else: + self.enable_assertion_pass_hook = False + self.source = source + self.scope: tuple[ast.AST, ...] = () + self.variables_overwrite: defaultdict[tuple[ast.AST, ...], dict[str, str]] = ( + defaultdict(dict) + ) + + def run(self, mod: ast.Module) -> None: + """Find all assert statements in *mod* and rewrite them.""" + if not mod.body: + # Nothing to do. + return + + # We'll insert some special imports at the top of the module, but after any + # docstrings and __future__ imports, so first figure out where that is. + doc = getattr(mod, "docstring", None) + expect_docstring = doc is None + if doc is not None and self.is_rewrite_disabled(doc): + return + pos = 0 + item = None + for item in mod.body: + if ( + expect_docstring + and isinstance(item, ast.Expr) + and isinstance(item.value, ast.Constant) + and isinstance(item.value.value, str) + ): + doc = item.value.value + if self.is_rewrite_disabled(doc): + return + expect_docstring = False + elif ( + isinstance(item, ast.ImportFrom) + and item.level == 0 + and item.module == "__future__" + ): + pass + else: + break + pos += 1 + # Special case: for a decorated function, set the lineno to that of the + # first decorator, not the `def`. Issue #4984. + if isinstance(item, ast.FunctionDef) and item.decorator_list: + lineno = item.decorator_list[0].lineno + else: + lineno = item.lineno + # Now actually insert the special imports. + if sys.version_info >= (3, 10): + aliases = [ + ast.alias("builtins", "@py_builtins", lineno=lineno, col_offset=0), + ast.alias( + "_pytest.assertion.rewrite", + "@pytest_ar", + lineno=lineno, + col_offset=0, + ), + ] + else: + aliases = [ + ast.alias("builtins", "@py_builtins"), + ast.alias("_pytest.assertion.rewrite", "@pytest_ar"), + ] + imports = [ + ast.Import([alias], lineno=lineno, col_offset=0) for alias in aliases + ] + mod.body[pos:pos] = imports + + # Collect asserts. + self.scope = (mod,) + nodes: list[ast.AST | Sentinel] = [mod] + while nodes: + node = nodes.pop() + if isinstance(node, (ast.FunctionDef, ast.AsyncFunctionDef, ast.ClassDef)): + self.scope = tuple((*self.scope, node)) + nodes.append(_SCOPE_END_MARKER) + if node == _SCOPE_END_MARKER: + self.scope = self.scope[:-1] + continue + assert isinstance(node, ast.AST) + for name, field in ast.iter_fields(node): + if isinstance(field, list): + new: list[ast.AST] = [] + for i, child in enumerate(field): + if isinstance(child, ast.Assert): + # Transform assert. + new.extend(self.visit(child)) + else: + new.append(child) + if isinstance(child, ast.AST): + nodes.append(child) + setattr(node, name, new) + elif ( + isinstance(field, ast.AST) + # Don't recurse into expressions as they can't contain + # asserts. + and not isinstance(field, ast.expr) + ): + nodes.append(field) + + @staticmethod + def is_rewrite_disabled(docstring: str) -> bool: + return "PYTEST_DONT_REWRITE" in docstring + + def variable(self) -> str: + """Get a new variable.""" + # Use a character invalid in python identifiers to avoid clashing. + name = "@py_assert" + str(next(self.variable_counter)) + self.variables.append(name) + return name + + def assign(self, expr: ast.expr) -> ast.Name: + """Give *expr* a name.""" + name = self.variable() + self.statements.append(ast.Assign([ast.Name(name, ast.Store())], expr)) + return ast.Name(name, ast.Load()) + + def display(self, expr: ast.expr) -> ast.expr: + """Call saferepr on the expression.""" + return self.helper("_saferepr", expr) + + def helper(self, name: str, *args: ast.expr) -> ast.expr: + """Call a helper in this module.""" + py_name = ast.Name("@pytest_ar", ast.Load()) + attr = ast.Attribute(py_name, name, ast.Load()) + return ast.Call(attr, list(args), []) + + def builtin(self, name: str) -> ast.Attribute: + """Return the builtin called *name*.""" + builtin_name = ast.Name("@py_builtins", ast.Load()) + return ast.Attribute(builtin_name, name, ast.Load()) + + def explanation_param(self, expr: ast.expr) -> str: + """Return a new named %-formatting placeholder for expr. + + This creates a %-formatting placeholder for expr in the + current formatting context, e.g. ``%(py0)s``. The placeholder + and expr are placed in the current format context so that it + can be used on the next call to .pop_format_context(). + """ + specifier = "py" + str(next(self.variable_counter)) + self.explanation_specifiers[specifier] = expr + return "%(" + specifier + ")s" + + def push_format_context(self) -> None: + """Create a new formatting context. + + The format context is used for when an explanation wants to + have a variable value formatted in the assertion message. In + this case the value required can be added using + .explanation_param(). Finally .pop_format_context() is used + to format a string of %-formatted values as added by + .explanation_param(). + """ + self.explanation_specifiers: dict[str, ast.expr] = {} + self.stack.append(self.explanation_specifiers) + + def pop_format_context(self, expl_expr: ast.expr) -> ast.Name: + """Format the %-formatted string with current format context. + + The expl_expr should be an str ast.expr instance constructed from + the %-placeholders created by .explanation_param(). This will + add the required code to format said string to .expl_stmts and + return the ast.Name instance of the formatted string. + """ + current = self.stack.pop() + if self.stack: + self.explanation_specifiers = self.stack[-1] + keys: list[ast.expr | None] = [ast.Constant(key) for key in current.keys()] + format_dict = ast.Dict(keys, list(current.values())) + form = ast.BinOp(expl_expr, ast.Mod(), format_dict) + name = "@py_format" + str(next(self.variable_counter)) + if self.enable_assertion_pass_hook: + self.format_variables.append(name) + self.expl_stmts.append(ast.Assign([ast.Name(name, ast.Store())], form)) + return ast.Name(name, ast.Load()) + + def generic_visit(self, node: ast.AST) -> tuple[ast.Name, str]: + """Handle expressions we don't have custom code for.""" + assert isinstance(node, ast.expr) + res = self.assign(node) + return res, self.explanation_param(self.display(res)) + + def visit_Assert(self, assert_: ast.Assert) -> list[ast.stmt]: + """Return the AST statements to replace the ast.Assert instance. + + This rewrites the test of an assertion to provide + intermediate values and replace it with an if statement which + raises an assertion error with a detailed explanation in case + the expression is false. + """ + if isinstance(assert_.test, ast.Tuple) and len(assert_.test.elts) >= 1: + import warnings + + from _pytest.warning_types import PytestAssertRewriteWarning + + # TODO: This assert should not be needed. + assert self.module_path is not None + warnings.warn_explicit( + PytestAssertRewriteWarning( + "assertion is always true, perhaps remove parentheses?" + ), + category=None, + filename=self.module_path, + lineno=assert_.lineno, + ) + + self.statements: list[ast.stmt] = [] + self.variables: list[str] = [] + self.variable_counter = itertools.count() + + if self.enable_assertion_pass_hook: + self.format_variables: list[str] = [] + + self.stack: list[dict[str, ast.expr]] = [] + self.expl_stmts: list[ast.stmt] = [] + self.push_format_context() + # Rewrite assert into a bunch of statements. + top_condition, explanation = self.visit(assert_.test) + + negation = ast.UnaryOp(ast.Not(), top_condition) + + if self.enable_assertion_pass_hook: # Experimental pytest_assertion_pass hook + msg = self.pop_format_context(ast.Constant(explanation)) + + # Failed + if assert_.msg: + assertmsg = self.helper("_format_assertmsg", assert_.msg) + gluestr = "\n>assert " + else: + assertmsg = ast.Constant("") + gluestr = "assert " + err_explanation = ast.BinOp(ast.Constant(gluestr), ast.Add(), msg) + err_msg = ast.BinOp(assertmsg, ast.Add(), err_explanation) + err_name = ast.Name("AssertionError", ast.Load()) + fmt = self.helper("_format_explanation", err_msg) + exc = ast.Call(err_name, [fmt], []) + raise_ = ast.Raise(exc, None) + statements_fail = [] + statements_fail.extend(self.expl_stmts) + statements_fail.append(raise_) + + # Passed + fmt_pass = self.helper("_format_explanation", msg) + orig = _get_assertion_exprs(self.source)[assert_.lineno] + hook_call_pass = ast.Expr( + self.helper( + "_call_assertion_pass", + ast.Constant(assert_.lineno), + ast.Constant(orig), + fmt_pass, + ) + ) + # If any hooks implement assert_pass hook + hook_impl_test = ast.If( + self.helper("_check_if_assertion_pass_impl"), + [*self.expl_stmts, hook_call_pass], + [], + ) + statements_pass: list[ast.stmt] = [hook_impl_test] + + # Test for assertion condition + main_test = ast.If(negation, statements_fail, statements_pass) + self.statements.append(main_test) + if self.format_variables: + variables: list[ast.expr] = [ + ast.Name(name, ast.Store()) for name in self.format_variables + ] + clear_format = ast.Assign(variables, ast.Constant(None)) + self.statements.append(clear_format) + + else: # Original assertion rewriting + # Create failure message. + body = self.expl_stmts + self.statements.append(ast.If(negation, body, [])) + if assert_.msg: + assertmsg = self.helper("_format_assertmsg", assert_.msg) + explanation = "\n>assert " + explanation + else: + assertmsg = ast.Constant("") + explanation = "assert " + explanation + template = ast.BinOp(assertmsg, ast.Add(), ast.Constant(explanation)) + msg = self.pop_format_context(template) + fmt = self.helper("_format_explanation", msg) + err_name = ast.Name("AssertionError", ast.Load()) + exc = ast.Call(err_name, [fmt], []) + raise_ = ast.Raise(exc, None) + + body.append(raise_) + + # Clear temporary variables by setting them to None. + if self.variables: + variables = [ast.Name(name, ast.Store()) for name in self.variables] + clear = ast.Assign(variables, ast.Constant(None)) + self.statements.append(clear) + # Fix locations (line numbers/column offsets). + for stmt in self.statements: + for node in traverse_node(stmt): + ast.copy_location(node, assert_) + return self.statements + + def visit_NamedExpr(self, name: ast.NamedExpr) -> tuple[ast.NamedExpr, str]: + # This method handles the 'walrus operator' repr of the target + # name if it's a local variable or _should_repr_global_name() + # thinks it's acceptable. + locs = ast.Call(self.builtin("locals"), [], []) + target_id = name.target.id + inlocs = ast.Compare(ast.Constant(target_id), [ast.In()], [locs]) + dorepr = self.helper("_should_repr_global_name", name) + test = ast.BoolOp(ast.Or(), [inlocs, dorepr]) + expr = ast.IfExp(test, self.display(name), ast.Constant(target_id)) + return name, self.explanation_param(expr) + + def visit_Name(self, name: ast.Name) -> tuple[ast.Name, str]: + # Display the repr of the name if it's a local variable or + # _should_repr_global_name() thinks it's acceptable. + locs = ast.Call(self.builtin("locals"), [], []) + inlocs = ast.Compare(ast.Constant(name.id), [ast.In()], [locs]) + dorepr = self.helper("_should_repr_global_name", name) + test = ast.BoolOp(ast.Or(), [inlocs, dorepr]) + expr = ast.IfExp(test, self.display(name), ast.Constant(name.id)) + return name, self.explanation_param(expr) + + def visit_BoolOp(self, boolop: ast.BoolOp) -> tuple[ast.Name, str]: + res_var = self.variable() + expl_list = self.assign(ast.List([], ast.Load())) + app = ast.Attribute(expl_list, "append", ast.Load()) + is_or = int(isinstance(boolop.op, ast.Or)) + body = save = self.statements + fail_save = self.expl_stmts + levels = len(boolop.values) - 1 + self.push_format_context() + # Process each operand, short-circuiting if needed. + for i, v in enumerate(boolop.values): + if i: + fail_inner: list[ast.stmt] = [] + # cond is set in a prior loop iteration below + self.expl_stmts.append(ast.If(cond, fail_inner, [])) # noqa: F821 + self.expl_stmts = fail_inner + # Check if the left operand is a ast.NamedExpr and the value has already been visited + if ( + isinstance(v, ast.Compare) + and isinstance(v.left, ast.NamedExpr) + and v.left.target.id + in [ + ast_expr.id + for ast_expr in boolop.values[:i] + if hasattr(ast_expr, "id") + ] + ): + pytest_temp = self.variable() + self.variables_overwrite[self.scope][v.left.target.id] = v.left # type:ignore[assignment] + v.left.target.id = pytest_temp + self.push_format_context() + res, expl = self.visit(v) + body.append(ast.Assign([ast.Name(res_var, ast.Store())], res)) + expl_format = self.pop_format_context(ast.Constant(expl)) + call = ast.Call(app, [expl_format], []) + self.expl_stmts.append(ast.Expr(call)) + if i < levels: + cond: ast.expr = res + if is_or: + cond = ast.UnaryOp(ast.Not(), cond) + inner: list[ast.stmt] = [] + self.statements.append(ast.If(cond, inner, [])) + self.statements = body = inner + self.statements = save + self.expl_stmts = fail_save + expl_template = self.helper("_format_boolop", expl_list, ast.Constant(is_or)) + expl = self.pop_format_context(expl_template) + return ast.Name(res_var, ast.Load()), self.explanation_param(expl) + + def visit_UnaryOp(self, unary: ast.UnaryOp) -> tuple[ast.Name, str]: + pattern = UNARY_MAP[unary.op.__class__] + operand_res, operand_expl = self.visit(unary.operand) + res = self.assign(ast.UnaryOp(unary.op, operand_res)) + return res, pattern % (operand_expl,) + + def visit_BinOp(self, binop: ast.BinOp) -> tuple[ast.Name, str]: + symbol = BINOP_MAP[binop.op.__class__] + left_expr, left_expl = self.visit(binop.left) + right_expr, right_expl = self.visit(binop.right) + explanation = f"({left_expl} {symbol} {right_expl})" + res = self.assign(ast.BinOp(left_expr, binop.op, right_expr)) + return res, explanation + + def visit_Call(self, call: ast.Call) -> tuple[ast.Name, str]: + new_func, func_expl = self.visit(call.func) + arg_expls = [] + new_args = [] + new_kwargs = [] + for arg in call.args: + if isinstance(arg, ast.Name) and arg.id in self.variables_overwrite.get( + self.scope, {} + ): + arg = self.variables_overwrite[self.scope][arg.id] # type:ignore[assignment] + res, expl = self.visit(arg) + arg_expls.append(expl) + new_args.append(res) + for keyword in call.keywords: + if isinstance( + keyword.value, ast.Name + ) and keyword.value.id in self.variables_overwrite.get(self.scope, {}): + keyword.value = self.variables_overwrite[self.scope][keyword.value.id] # type:ignore[assignment] + res, expl = self.visit(keyword.value) + new_kwargs.append(ast.keyword(keyword.arg, res)) + if keyword.arg: + arg_expls.append(keyword.arg + "=" + expl) + else: # **args have `arg` keywords with an .arg of None + arg_expls.append("**" + expl) + + expl = "{}({})".format(func_expl, ", ".join(arg_expls)) + new_call = ast.Call(new_func, new_args, new_kwargs) + res = self.assign(new_call) + res_expl = self.explanation_param(self.display(res)) + outer_expl = f"{res_expl}\n{{{res_expl} = {expl}\n}}" + return res, outer_expl + + def visit_Starred(self, starred: ast.Starred) -> tuple[ast.Starred, str]: + # A Starred node can appear in a function call. + res, expl = self.visit(starred.value) + new_starred = ast.Starred(res, starred.ctx) + return new_starred, "*" + expl + + def visit_Attribute(self, attr: ast.Attribute) -> tuple[ast.Name, str]: + if not isinstance(attr.ctx, ast.Load): + return self.generic_visit(attr) + value, value_expl = self.visit(attr.value) + res = self.assign(ast.Attribute(value, attr.attr, ast.Load())) + res_expl = self.explanation_param(self.display(res)) + pat = "%s\n{%s = %s.%s\n}" + expl = pat % (res_expl, res_expl, value_expl, attr.attr) + return res, expl + + def visit_Compare(self, comp: ast.Compare) -> tuple[ast.expr, str]: + self.push_format_context() + # We first check if we have overwritten a variable in the previous assert + if isinstance( + comp.left, ast.Name + ) and comp.left.id in self.variables_overwrite.get(self.scope, {}): + comp.left = self.variables_overwrite[self.scope][comp.left.id] # type:ignore[assignment] + if isinstance(comp.left, ast.NamedExpr): + self.variables_overwrite[self.scope][comp.left.target.id] = comp.left # type:ignore[assignment] + left_res, left_expl = self.visit(comp.left) + if isinstance(comp.left, (ast.Compare, ast.BoolOp)): + left_expl = f"({left_expl})" + res_variables = [self.variable() for i in range(len(comp.ops))] + load_names: list[ast.expr] = [ast.Name(v, ast.Load()) for v in res_variables] + store_names = [ast.Name(v, ast.Store()) for v in res_variables] + it = zip(range(len(comp.ops)), comp.ops, comp.comparators) + expls: list[ast.expr] = [] + syms: list[ast.expr] = [] + results = [left_res] + for i, op, next_operand in it: + if ( + isinstance(next_operand, ast.NamedExpr) + and isinstance(left_res, ast.Name) + and next_operand.target.id == left_res.id + ): + next_operand.target.id = self.variable() + self.variables_overwrite[self.scope][left_res.id] = next_operand # type:ignore[assignment] + next_res, next_expl = self.visit(next_operand) + if isinstance(next_operand, (ast.Compare, ast.BoolOp)): + next_expl = f"({next_expl})" + results.append(next_res) + sym = BINOP_MAP[op.__class__] + syms.append(ast.Constant(sym)) + expl = f"{left_expl} {sym} {next_expl}" + expls.append(ast.Constant(expl)) + res_expr = ast.Compare(left_res, [op], [next_res]) + self.statements.append(ast.Assign([store_names[i]], res_expr)) + left_res, left_expl = next_res, next_expl + # Use pytest.assertion.util._reprcompare if that's available. + expl_call = self.helper( + "_call_reprcompare", + ast.Tuple(syms, ast.Load()), + ast.Tuple(load_names, ast.Load()), + ast.Tuple(expls, ast.Load()), + ast.Tuple(results, ast.Load()), + ) + if len(comp.ops) > 1: + res: ast.expr = ast.BoolOp(ast.And(), load_names) + else: + res = load_names[0] + + return res, self.explanation_param(self.pop_format_context(expl_call)) + + +def try_makedirs(cache_dir: Path) -> bool: + """Attempt to create the given directory and sub-directories exist. + + Returns True if successful or if it already exists. + """ + try: + os.makedirs(cache_dir, exist_ok=True) + except (FileNotFoundError, NotADirectoryError, FileExistsError): + # One of the path components was not a directory: + # - we're in a zip file + # - it is a file + return False + except PermissionError: + return False + except OSError as e: + # as of now, EROFS doesn't have an equivalent OSError-subclass + # + # squashfuse_ll returns ENOSYS "OSError: [Errno 38] Function not + # implemented" for a read-only error + if e.errno in {errno.EROFS, errno.ENOSYS}: + return False + raise + return True + + +def get_cache_dir(file_path: Path) -> Path: + """Return the cache directory to write .pyc files for the given .py file path.""" + if sys.pycache_prefix: + # given: + # prefix = '/tmp/pycs' + # path = '/home/user/proj/test_app.py' + # we want: + # '/tmp/pycs/home/user/proj' + return Path(sys.pycache_prefix) / Path(*file_path.parts[1:-1]) + else: + # classic pycache directory + return file_path.parent / "__pycache__" diff --git a/.venv/Lib/site-packages/_pytest/assertion/truncate.py b/.venv/Lib/site-packages/_pytest/assertion/truncate.py new file mode 100644 index 00000000..b67f02cc --- /dev/null +++ b/.venv/Lib/site-packages/_pytest/assertion/truncate.py @@ -0,0 +1,117 @@ +"""Utilities for truncating assertion output. + +Current default behaviour is to truncate assertion explanations at +terminal lines, unless running with an assertions verbosity level of at least 2 or running on CI. +""" + +from __future__ import annotations + +from _pytest.assertion import util +from _pytest.config import Config +from _pytest.nodes import Item + + +DEFAULT_MAX_LINES = 8 +DEFAULT_MAX_CHARS = 8 * 80 +USAGE_MSG = "use '-vv' to show" + + +def truncate_if_required( + explanation: list[str], item: Item, max_length: int | None = None +) -> list[str]: + """Truncate this assertion explanation if the given test item is eligible.""" + if _should_truncate_item(item): + return _truncate_explanation(explanation) + return explanation + + +def _should_truncate_item(item: Item) -> bool: + """Whether or not this test item is eligible for truncation.""" + verbose = item.config.get_verbosity(Config.VERBOSITY_ASSERTIONS) + return verbose < 2 and not util.running_on_ci() + + +def _truncate_explanation( + input_lines: list[str], + max_lines: int | None = None, + max_chars: int | None = None, +) -> list[str]: + """Truncate given list of strings that makes up the assertion explanation. + + Truncates to either 8 lines, or 640 characters - whichever the input reaches + first, taking the truncation explanation into account. The remaining lines + will be replaced by a usage message. + """ + if max_lines is None: + max_lines = DEFAULT_MAX_LINES + if max_chars is None: + max_chars = DEFAULT_MAX_CHARS + + # Check if truncation required + input_char_count = len("".join(input_lines)) + # The length of the truncation explanation depends on the number of lines + # removed but is at least 68 characters: + # The real value is + # 64 (for the base message: + # '...\n...Full output truncated (1 line hidden), use '-vv' to show")' + # ) + # + 1 (for plural) + # + int(math.log10(len(input_lines) - max_lines)) (number of hidden line, at least 1) + # + 3 for the '...' added to the truncated line + # But if there's more than 100 lines it's very likely that we're going to + # truncate, so we don't need the exact value using log10. + tolerable_max_chars = ( + max_chars + 70 # 64 + 1 (for plural) + 2 (for '99') + 3 for '...' + ) + # The truncation explanation add two lines to the output + tolerable_max_lines = max_lines + 2 + if ( + len(input_lines) <= tolerable_max_lines + and input_char_count <= tolerable_max_chars + ): + return input_lines + # Truncate first to max_lines, and then truncate to max_chars if necessary + truncated_explanation = input_lines[:max_lines] + truncated_char = True + # We reevaluate the need to truncate chars following removal of some lines + if len("".join(truncated_explanation)) > tolerable_max_chars: + truncated_explanation = _truncate_by_char_count( + truncated_explanation, max_chars + ) + else: + truncated_char = False + + truncated_line_count = len(input_lines) - len(truncated_explanation) + if truncated_explanation[-1]: + # Add ellipsis and take into account part-truncated final line + truncated_explanation[-1] = truncated_explanation[-1] + "..." + if truncated_char: + # It's possible that we did not remove any char from this line + truncated_line_count += 1 + else: + # Add proper ellipsis when we were able to fit a full line exactly + truncated_explanation[-1] = "..." + return [ + *truncated_explanation, + "", + f"...Full output truncated ({truncated_line_count} line" + f"{'' if truncated_line_count == 1 else 's'} hidden), {USAGE_MSG}", + ] + + +def _truncate_by_char_count(input_lines: list[str], max_chars: int) -> list[str]: + # Find point at which input length exceeds total allowed length + iterated_char_count = 0 + for iterated_index, input_line in enumerate(input_lines): + if iterated_char_count + len(input_line) > max_chars: + break + iterated_char_count += len(input_line) + + # Create truncated explanation with modified final line + truncated_result = input_lines[:iterated_index] + final_line = input_lines[iterated_index] + if final_line: + final_line_truncate_point = max_chars - iterated_char_count + final_line = final_line[:final_line_truncate_point] + truncated_result.append(final_line) + return truncated_result diff --git a/.venv/Lib/site-packages/_pytest/assertion/util.py b/.venv/Lib/site-packages/_pytest/assertion/util.py new file mode 100644 index 00000000..4dc1af4a --- /dev/null +++ b/.venv/Lib/site-packages/_pytest/assertion/util.py @@ -0,0 +1,609 @@ +# mypy: allow-untyped-defs +"""Utilities for assertion debugging.""" + +from __future__ import annotations + +import collections.abc +import os +import pprint +from typing import AbstractSet +from typing import Any +from typing import Callable +from typing import Iterable +from typing import Literal +from typing import Mapping +from typing import Protocol +from typing import Sequence +from unicodedata import normalize + +from _pytest import outcomes +import _pytest._code +from _pytest._io.pprint import PrettyPrinter +from _pytest._io.saferepr import saferepr +from _pytest._io.saferepr import saferepr_unlimited +from _pytest.config import Config + + +# The _reprcompare attribute on the util module is used by the new assertion +# interpretation code and assertion rewriter to detect this plugin was +# loaded and in turn call the hooks defined here as part of the +# DebugInterpreter. +_reprcompare: Callable[[str, object, object], str | None] | None = None + +# Works similarly as _reprcompare attribute. Is populated with the hook call +# when pytest_runtest_setup is called. +_assertion_pass: Callable[[int, str, str], None] | None = None + +# Config object which is assigned during pytest_runtest_protocol. +_config: Config | None = None + + +class _HighlightFunc(Protocol): + def __call__(self, source: str, lexer: Literal["diff", "python"] = "python") -> str: + """Apply highlighting to the given source.""" + + +def format_explanation(explanation: str) -> str: + r"""Format an explanation. + + Normally all embedded newlines are escaped, however there are + three exceptions: \n{, \n} and \n~. The first two are intended + cover nested explanations, see function and attribute explanations + for examples (.visit_Call(), visit_Attribute()). The last one is + for when one explanation needs to span multiple lines, e.g. when + displaying diffs. + """ + lines = _split_explanation(explanation) + result = _format_lines(lines) + return "\n".join(result) + + +def _split_explanation(explanation: str) -> list[str]: + r"""Return a list of individual lines in the explanation. + + This will return a list of lines split on '\n{', '\n}' and '\n~'. + Any other newlines will be escaped and appear in the line as the + literal '\n' characters. + """ + raw_lines = (explanation or "").split("\n") + lines = [raw_lines[0]] + for values in raw_lines[1:]: + if values and values[0] in ["{", "}", "~", ">"]: + lines.append(values) + else: + lines[-1] += "\\n" + values + return lines + + +def _format_lines(lines: Sequence[str]) -> list[str]: + """Format the individual lines. + + This will replace the '{', '}' and '~' characters of our mini formatting + language with the proper 'where ...', 'and ...' and ' + ...' text, taking + care of indentation along the way. + + Return a list of formatted lines. + """ + result = list(lines[:1]) + stack = [0] + stackcnt = [0] + for line in lines[1:]: + if line.startswith("{"): + if stackcnt[-1]: + s = "and " + else: + s = "where " + stack.append(len(result)) + stackcnt[-1] += 1 + stackcnt.append(0) + result.append(" +" + " " * (len(stack) - 1) + s + line[1:]) + elif line.startswith("}"): + stack.pop() + stackcnt.pop() + result[stack[-1]] += line[1:] + else: + assert line[0] in ["~", ">"] + stack[-1] += 1 + indent = len(stack) if line.startswith("~") else len(stack) - 1 + result.append(" " * indent + line[1:]) + assert len(stack) == 1 + return result + + +def issequence(x: Any) -> bool: + return isinstance(x, collections.abc.Sequence) and not isinstance(x, str) + + +def istext(x: Any) -> bool: + return isinstance(x, str) + + +def isdict(x: Any) -> bool: + return isinstance(x, dict) + + +def isset(x: Any) -> bool: + return isinstance(x, (set, frozenset)) + + +def isnamedtuple(obj: Any) -> bool: + return isinstance(obj, tuple) and getattr(obj, "_fields", None) is not None + + +def isdatacls(obj: Any) -> bool: + return getattr(obj, "__dataclass_fields__", None) is not None + + +def isattrs(obj: Any) -> bool: + return getattr(obj, "__attrs_attrs__", None) is not None + + +def isiterable(obj: Any) -> bool: + try: + iter(obj) + return not istext(obj) + except Exception: + return False + + +def has_default_eq( + obj: object, +) -> bool: + """Check if an instance of an object contains the default eq + + First, we check if the object's __eq__ attribute has __code__, + if so, we check the equally of the method code filename (__code__.co_filename) + to the default one generated by the dataclass and attr module + for dataclasses the default co_filename is , for attrs class, the __eq__ should contain "attrs eq generated" + """ + # inspired from https://github.com/willmcgugan/rich/blob/07d51ffc1aee6f16bd2e5a25b4e82850fb9ed778/rich/pretty.py#L68 + if hasattr(obj.__eq__, "__code__") and hasattr(obj.__eq__.__code__, "co_filename"): + code_filename = obj.__eq__.__code__.co_filename + + if isattrs(obj): + return "attrs generated eq" in code_filename + + return code_filename == "" # data class + return True + + +def assertrepr_compare( + config, op: str, left: Any, right: Any, use_ascii: bool = False +) -> list[str] | None: + """Return specialised explanations for some operators/operands.""" + verbose = config.get_verbosity(Config.VERBOSITY_ASSERTIONS) + + # Strings which normalize equal are often hard to distinguish when printed; use ascii() to make this easier. + # See issue #3246. + use_ascii = ( + isinstance(left, str) + and isinstance(right, str) + and normalize("NFD", left) == normalize("NFD", right) + ) + + if verbose > 1: + left_repr = saferepr_unlimited(left, use_ascii=use_ascii) + right_repr = saferepr_unlimited(right, use_ascii=use_ascii) + else: + # XXX: "15 chars indentation" is wrong + # ("E AssertionError: assert "); should use term width. + maxsize = ( + 80 - 15 - len(op) - 2 + ) // 2 # 15 chars indentation, 1 space around op + + left_repr = saferepr(left, maxsize=maxsize, use_ascii=use_ascii) + right_repr = saferepr(right, maxsize=maxsize, use_ascii=use_ascii) + + summary = f"{left_repr} {op} {right_repr}" + highlighter = config.get_terminal_writer()._highlight + + explanation = None + try: + if op == "==": + explanation = _compare_eq_any(left, right, highlighter, verbose) + elif op == "not in": + if istext(left) and istext(right): + explanation = _notin_text(left, right, verbose) + elif op == "!=": + if isset(left) and isset(right): + explanation = ["Both sets are equal"] + elif op == ">=": + if isset(left) and isset(right): + explanation = _compare_gte_set(left, right, highlighter, verbose) + elif op == "<=": + if isset(left) and isset(right): + explanation = _compare_lte_set(left, right, highlighter, verbose) + elif op == ">": + if isset(left) and isset(right): + explanation = _compare_gt_set(left, right, highlighter, verbose) + elif op == "<": + if isset(left) and isset(right): + explanation = _compare_lt_set(left, right, highlighter, verbose) + + except outcomes.Exit: + raise + except Exception: + repr_crash = _pytest._code.ExceptionInfo.from_current()._getreprcrash() + explanation = [ + f"(pytest_assertion plugin: representation of details failed: {repr_crash}.", + " Probably an object has a faulty __repr__.)", + ] + + if not explanation: + return None + + if explanation[0] != "": + explanation = ["", *explanation] + return [summary, *explanation] + + +def _compare_eq_any( + left: Any, right: Any, highlighter: _HighlightFunc, verbose: int = 0 +) -> list[str]: + explanation = [] + if istext(left) and istext(right): + explanation = _diff_text(left, right, verbose) + else: + from _pytest.python_api import ApproxBase + + if isinstance(left, ApproxBase) or isinstance(right, ApproxBase): + # Although the common order should be obtained == expected, this ensures both ways + approx_side = left if isinstance(left, ApproxBase) else right + other_side = right if isinstance(left, ApproxBase) else left + + explanation = approx_side._repr_compare(other_side) + elif type(left) is type(right) and ( + isdatacls(left) or isattrs(left) or isnamedtuple(left) + ): + # Note: unlike dataclasses/attrs, namedtuples compare only the + # field values, not the type or field names. But this branch + # intentionally only handles the same-type case, which was often + # used in older code bases before dataclasses/attrs were available. + explanation = _compare_eq_cls(left, right, highlighter, verbose) + elif issequence(left) and issequence(right): + explanation = _compare_eq_sequence(left, right, highlighter, verbose) + elif isset(left) and isset(right): + explanation = _compare_eq_set(left, right, highlighter, verbose) + elif isdict(left) and isdict(right): + explanation = _compare_eq_dict(left, right, highlighter, verbose) + + if isiterable(left) and isiterable(right): + expl = _compare_eq_iterable(left, right, highlighter, verbose) + explanation.extend(expl) + + return explanation + + +def _diff_text(left: str, right: str, verbose: int = 0) -> list[str]: + """Return the explanation for the diff between text. + + Unless --verbose is used this will skip leading and trailing + characters which are identical to keep the diff minimal. + """ + from difflib import ndiff + + explanation: list[str] = [] + + if verbose < 1: + i = 0 # just in case left or right has zero length + for i in range(min(len(left), len(right))): + if left[i] != right[i]: + break + if i > 42: + i -= 10 # Provide some context + explanation = [ + f"Skipping {i} identical leading characters in diff, use -v to show" + ] + left = left[i:] + right = right[i:] + if len(left) == len(right): + for i in range(len(left)): + if left[-i] != right[-i]: + break + if i > 42: + i -= 10 # Provide some context + explanation += [ + f"Skipping {i} identical trailing " + "characters in diff, use -v to show" + ] + left = left[:-i] + right = right[:-i] + keepends = True + if left.isspace() or right.isspace(): + left = repr(str(left)) + right = repr(str(right)) + explanation += ["Strings contain only whitespace, escaping them using repr()"] + # "right" is the expected base against which we compare "left", + # see https://github.com/pytest-dev/pytest/issues/3333 + explanation += [ + line.strip("\n") + for line in ndiff(right.splitlines(keepends), left.splitlines(keepends)) + ] + return explanation + + +def _compare_eq_iterable( + left: Iterable[Any], + right: Iterable[Any], + highlighter: _HighlightFunc, + verbose: int = 0, +) -> list[str]: + if verbose <= 0 and not running_on_ci(): + return ["Use -v to get more diff"] + # dynamic import to speedup pytest + import difflib + + left_formatting = PrettyPrinter().pformat(left).splitlines() + right_formatting = PrettyPrinter().pformat(right).splitlines() + + explanation = ["", "Full diff:"] + # "right" is the expected base against which we compare "left", + # see https://github.com/pytest-dev/pytest/issues/3333 + explanation.extend( + highlighter( + "\n".join( + line.rstrip() + for line in difflib.ndiff(right_formatting, left_formatting) + ), + lexer="diff", + ).splitlines() + ) + return explanation + + +def _compare_eq_sequence( + left: Sequence[Any], + right: Sequence[Any], + highlighter: _HighlightFunc, + verbose: int = 0, +) -> list[str]: + comparing_bytes = isinstance(left, bytes) and isinstance(right, bytes) + explanation: list[str] = [] + len_left = len(left) + len_right = len(right) + for i in range(min(len_left, len_right)): + if left[i] != right[i]: + if comparing_bytes: + # when comparing bytes, we want to see their ascii representation + # instead of their numeric values (#5260) + # using a slice gives us the ascii representation: + # >>> s = b'foo' + # >>> s[0] + # 102 + # >>> s[0:1] + # b'f' + left_value = left[i : i + 1] + right_value = right[i : i + 1] + else: + left_value = left[i] + right_value = right[i] + + explanation.append( + f"At index {i} diff:" + f" {highlighter(repr(left_value))} != {highlighter(repr(right_value))}" + ) + break + + if comparing_bytes: + # when comparing bytes, it doesn't help to show the "sides contain one or more + # items" longer explanation, so skip it + + return explanation + + len_diff = len_left - len_right + if len_diff: + if len_diff > 0: + dir_with_more = "Left" + extra = saferepr(left[len_right]) + else: + len_diff = 0 - len_diff + dir_with_more = "Right" + extra = saferepr(right[len_left]) + + if len_diff == 1: + explanation += [ + f"{dir_with_more} contains one more item: {highlighter(extra)}" + ] + else: + explanation += [ + "%s contains %d more items, first extra item: %s" + % (dir_with_more, len_diff, highlighter(extra)) + ] + return explanation + + +def _compare_eq_set( + left: AbstractSet[Any], + right: AbstractSet[Any], + highlighter: _HighlightFunc, + verbose: int = 0, +) -> list[str]: + explanation = [] + explanation.extend(_set_one_sided_diff("left", left, right, highlighter)) + explanation.extend(_set_one_sided_diff("right", right, left, highlighter)) + return explanation + + +def _compare_gt_set( + left: AbstractSet[Any], + right: AbstractSet[Any], + highlighter: _HighlightFunc, + verbose: int = 0, +) -> list[str]: + explanation = _compare_gte_set(left, right, highlighter) + if not explanation: + return ["Both sets are equal"] + return explanation + + +def _compare_lt_set( + left: AbstractSet[Any], + right: AbstractSet[Any], + highlighter: _HighlightFunc, + verbose: int = 0, +) -> list[str]: + explanation = _compare_lte_set(left, right, highlighter) + if not explanation: + return ["Both sets are equal"] + return explanation + + +def _compare_gte_set( + left: AbstractSet[Any], + right: AbstractSet[Any], + highlighter: _HighlightFunc, + verbose: int = 0, +) -> list[str]: + return _set_one_sided_diff("right", right, left, highlighter) + + +def _compare_lte_set( + left: AbstractSet[Any], + right: AbstractSet[Any], + highlighter: _HighlightFunc, + verbose: int = 0, +) -> list[str]: + return _set_one_sided_diff("left", left, right, highlighter) + + +def _set_one_sided_diff( + posn: str, + set1: AbstractSet[Any], + set2: AbstractSet[Any], + highlighter: _HighlightFunc, +) -> list[str]: + explanation = [] + diff = set1 - set2 + if diff: + explanation.append(f"Extra items in the {posn} set:") + for item in diff: + explanation.append(highlighter(saferepr(item))) + return explanation + + +def _compare_eq_dict( + left: Mapping[Any, Any], + right: Mapping[Any, Any], + highlighter: _HighlightFunc, + verbose: int = 0, +) -> list[str]: + explanation: list[str] = [] + set_left = set(left) + set_right = set(right) + common = set_left.intersection(set_right) + same = {k: left[k] for k in common if left[k] == right[k]} + if same and verbose < 2: + explanation += [f"Omitting {len(same)} identical items, use -vv to show"] + elif same: + explanation += ["Common items:"] + explanation += highlighter(pprint.pformat(same)).splitlines() + diff = {k for k in common if left[k] != right[k]} + if diff: + explanation += ["Differing items:"] + for k in diff: + explanation += [ + highlighter(saferepr({k: left[k]})) + + " != " + + highlighter(saferepr({k: right[k]})) + ] + extra_left = set_left - set_right + len_extra_left = len(extra_left) + if len_extra_left: + explanation.append( + "Left contains %d more item%s:" + % (len_extra_left, "" if len_extra_left == 1 else "s") + ) + explanation.extend( + highlighter(pprint.pformat({k: left[k] for k in extra_left})).splitlines() + ) + extra_right = set_right - set_left + len_extra_right = len(extra_right) + if len_extra_right: + explanation.append( + "Right contains %d more item%s:" + % (len_extra_right, "" if len_extra_right == 1 else "s") + ) + explanation.extend( + highlighter(pprint.pformat({k: right[k] for k in extra_right})).splitlines() + ) + return explanation + + +def _compare_eq_cls( + left: Any, right: Any, highlighter: _HighlightFunc, verbose: int +) -> list[str]: + if not has_default_eq(left): + return [] + if isdatacls(left): + import dataclasses + + all_fields = dataclasses.fields(left) + fields_to_check = [info.name for info in all_fields if info.compare] + elif isattrs(left): + all_fields = left.__attrs_attrs__ + fields_to_check = [field.name for field in all_fields if getattr(field, "eq")] + elif isnamedtuple(left): + fields_to_check = left._fields + else: + assert False + + indent = " " + same = [] + diff = [] + for field in fields_to_check: + if getattr(left, field) == getattr(right, field): + same.append(field) + else: + diff.append(field) + + explanation = [] + if same or diff: + explanation += [""] + if same and verbose < 2: + explanation.append(f"Omitting {len(same)} identical items, use -vv to show") + elif same: + explanation += ["Matching attributes:"] + explanation += highlighter(pprint.pformat(same)).splitlines() + if diff: + explanation += ["Differing attributes:"] + explanation += highlighter(pprint.pformat(diff)).splitlines() + for field in diff: + field_left = getattr(left, field) + field_right = getattr(right, field) + explanation += [ + "", + f"Drill down into differing attribute {field}:", + f"{indent}{field}: {highlighter(repr(field_left))} != {highlighter(repr(field_right))}", + ] + explanation += [ + indent + line + for line in _compare_eq_any( + field_left, field_right, highlighter, verbose + ) + ] + return explanation + + +def _notin_text(term: str, text: str, verbose: int = 0) -> list[str]: + index = text.find(term) + head = text[:index] + tail = text[index + len(term) :] + correct_text = head + tail + diff = _diff_text(text, correct_text, verbose) + newdiff = [f"{saferepr(term, maxsize=42)} is contained here:"] + for line in diff: + if line.startswith("Skipping"): + continue + if line.startswith("- "): + continue + if line.startswith("+ "): + newdiff.append(" " + line[2:]) + else: + newdiff.append(line) + return newdiff + + +def running_on_ci() -> bool: + """Check if we're currently running on a CI system.""" + env_vars = ["CI", "BUILD_NUMBER"] + return any(var in os.environ for var in env_vars) diff --git a/.venv/Lib/site-packages/_pytest/cacheprovider.py b/.venv/Lib/site-packages/_pytest/cacheprovider.py new file mode 100644 index 00000000..1b236efd --- /dev/null +++ b/.venv/Lib/site-packages/_pytest/cacheprovider.py @@ -0,0 +1,626 @@ +# mypy: allow-untyped-defs +"""Implementation of the cache provider.""" + +# This plugin was not named "cache" to avoid conflicts with the external +# pytest-cache version. +from __future__ import annotations + +import dataclasses +import errno +import json +import os +from pathlib import Path +import tempfile +from typing import final +from typing import Generator +from typing import Iterable + +from .pathlib import resolve_from_str +from .pathlib import rm_rf +from .reports import CollectReport +from _pytest import nodes +from _pytest._io import TerminalWriter +from _pytest.config import Config +from _pytest.config import ExitCode +from _pytest.config import hookimpl +from _pytest.config.argparsing import Parser +from _pytest.deprecated import check_ispytest +from _pytest.fixtures import fixture +from _pytest.fixtures import FixtureRequest +from _pytest.main import Session +from _pytest.nodes import Directory +from _pytest.nodes import File +from _pytest.reports import TestReport + + +README_CONTENT = """\ +# pytest cache directory # + +This directory contains data from the pytest's cache plugin, +which provides the `--lf` and `--ff` options, as well as the `cache` fixture. + +**Do not** commit this to version control. + +See [the docs](https://docs.pytest.org/en/stable/how-to/cache.html) for more information. +""" + +CACHEDIR_TAG_CONTENT = b"""\ +Signature: 8a477f597d28d172789f06886806bc55 +# This file is a cache directory tag created by pytest. +# For information about cache directory tags, see: +# https://bford.info/cachedir/spec.html +""" + + +@final +@dataclasses.dataclass +class Cache: + """Instance of the `cache` fixture.""" + + _cachedir: Path = dataclasses.field(repr=False) + _config: Config = dataclasses.field(repr=False) + + # Sub-directory under cache-dir for directories created by `mkdir()`. + _CACHE_PREFIX_DIRS = "d" + + # Sub-directory under cache-dir for values created by `set()`. + _CACHE_PREFIX_VALUES = "v" + + def __init__( + self, cachedir: Path, config: Config, *, _ispytest: bool = False + ) -> None: + check_ispytest(_ispytest) + self._cachedir = cachedir + self._config = config + + @classmethod + def for_config(cls, config: Config, *, _ispytest: bool = False) -> Cache: + """Create the Cache instance for a Config. + + :meta private: + """ + check_ispytest(_ispytest) + cachedir = cls.cache_dir_from_config(config, _ispytest=True) + if config.getoption("cacheclear") and cachedir.is_dir(): + cls.clear_cache(cachedir, _ispytest=True) + return cls(cachedir, config, _ispytest=True) + + @classmethod + def clear_cache(cls, cachedir: Path, _ispytest: bool = False) -> None: + """Clear the sub-directories used to hold cached directories and values. + + :meta private: + """ + check_ispytest(_ispytest) + for prefix in (cls._CACHE_PREFIX_DIRS, cls._CACHE_PREFIX_VALUES): + d = cachedir / prefix + if d.is_dir(): + rm_rf(d) + + @staticmethod + def cache_dir_from_config(config: Config, *, _ispytest: bool = False) -> Path: + """Get the path to the cache directory for a Config. + + :meta private: + """ + check_ispytest(_ispytest) + return resolve_from_str(config.getini("cache_dir"), config.rootpath) + + def warn(self, fmt: str, *, _ispytest: bool = False, **args: object) -> None: + """Issue a cache warning. + + :meta private: + """ + check_ispytest(_ispytest) + import warnings + + from _pytest.warning_types import PytestCacheWarning + + warnings.warn( + PytestCacheWarning(fmt.format(**args) if args else fmt), + self._config.hook, + stacklevel=3, + ) + + def _mkdir(self, path: Path) -> None: + self._ensure_cache_dir_and_supporting_files() + path.mkdir(exist_ok=True, parents=True) + + def mkdir(self, name: str) -> Path: + """Return a directory path object with the given name. + + If the directory does not yet exist, it will be created. You can use + it to manage files to e.g. store/retrieve database dumps across test + sessions. + + .. versionadded:: 7.0 + + :param name: + Must be a string not containing a ``/`` separator. + Make sure the name contains your plugin or application + identifiers to prevent clashes with other cache users. + """ + path = Path(name) + if len(path.parts) > 1: + raise ValueError("name is not allowed to contain path separators") + res = self._cachedir.joinpath(self._CACHE_PREFIX_DIRS, path) + self._mkdir(res) + return res + + def _getvaluepath(self, key: str) -> Path: + return self._cachedir.joinpath(self._CACHE_PREFIX_VALUES, Path(key)) + + def get(self, key: str, default): + """Return the cached value for the given key. + + If no value was yet cached or the value cannot be read, the specified + default is returned. + + :param key: + Must be a ``/`` separated value. Usually the first + name is the name of your plugin or your application. + :param default: + The value to return in case of a cache-miss or invalid cache value. + """ + path = self._getvaluepath(key) + try: + with path.open("r", encoding="UTF-8") as f: + return json.load(f) + except (ValueError, OSError): + return default + + def set(self, key: str, value: object) -> None: + """Save value for the given key. + + :param key: + Must be a ``/`` separated value. Usually the first + name is the name of your plugin or your application. + :param value: + Must be of any combination of basic python types, + including nested types like lists of dictionaries. + """ + path = self._getvaluepath(key) + try: + self._mkdir(path.parent) + except OSError as exc: + self.warn( + f"could not create cache path {path}: {exc}", + _ispytest=True, + ) + return + data = json.dumps(value, ensure_ascii=False, indent=2) + try: + f = path.open("w", encoding="UTF-8") + except OSError as exc: + self.warn( + f"cache could not write path {path}: {exc}", + _ispytest=True, + ) + else: + with f: + f.write(data) + + def _ensure_cache_dir_and_supporting_files(self) -> None: + """Create the cache dir and its supporting files.""" + if self._cachedir.is_dir(): + return + + self._cachedir.parent.mkdir(parents=True, exist_ok=True) + with tempfile.TemporaryDirectory( + prefix="pytest-cache-files-", + dir=self._cachedir.parent, + ) as newpath: + path = Path(newpath) + + # Reset permissions to the default, see #12308. + # Note: there's no way to get the current umask atomically, eek. + umask = os.umask(0o022) + os.umask(umask) + path.chmod(0o777 - umask) + + with open(path.joinpath("README.md"), "x", encoding="UTF-8") as f: + f.write(README_CONTENT) + with open(path.joinpath(".gitignore"), "x", encoding="UTF-8") as f: + f.write("# Created by pytest automatically.\n*\n") + with open(path.joinpath("CACHEDIR.TAG"), "xb") as f: + f.write(CACHEDIR_TAG_CONTENT) + + try: + path.rename(self._cachedir) + except OSError as e: + # If 2 concurrent pytests both race to the rename, the loser + # gets "Directory not empty" from the rename. In this case, + # everything is handled so just continue (while letting the + # temporary directory be cleaned up). + # On Windows, the error is a FileExistsError which translates to EEXIST. + if e.errno not in (errno.ENOTEMPTY, errno.EEXIST): + raise + else: + # Create a directory in place of the one we just moved so that + # `TemporaryDirectory`'s cleanup doesn't complain. + # + # TODO: pass ignore_cleanup_errors=True when we no longer support python < 3.10. + # See https://github.com/python/cpython/issues/74168. Note that passing + # delete=False would do the wrong thing in case of errors and isn't supported + # until python 3.12. + path.mkdir() + + +class LFPluginCollWrapper: + def __init__(self, lfplugin: LFPlugin) -> None: + self.lfplugin = lfplugin + self._collected_at_least_one_failure = False + + @hookimpl(wrapper=True) + def pytest_make_collect_report( + self, collector: nodes.Collector + ) -> Generator[None, CollectReport, CollectReport]: + res = yield + if isinstance(collector, (Session, Directory)): + # Sort any lf-paths to the beginning. + lf_paths = self.lfplugin._last_failed_paths + + # Use stable sort to prioritize last failed. + def sort_key(node: nodes.Item | nodes.Collector) -> bool: + return node.path in lf_paths + + res.result = sorted( + res.result, + key=sort_key, + reverse=True, + ) + + elif isinstance(collector, File): + if collector.path in self.lfplugin._last_failed_paths: + result = res.result + lastfailed = self.lfplugin.lastfailed + + # Only filter with known failures. + if not self._collected_at_least_one_failure: + if not any(x.nodeid in lastfailed for x in result): + return res + self.lfplugin.config.pluginmanager.register( + LFPluginCollSkipfiles(self.lfplugin), "lfplugin-collskip" + ) + self._collected_at_least_one_failure = True + + session = collector.session + result[:] = [ + x + for x in result + if x.nodeid in lastfailed + # Include any passed arguments (not trivial to filter). + or session.isinitpath(x.path) + # Keep all sub-collectors. + or isinstance(x, nodes.Collector) + ] + + return res + + +class LFPluginCollSkipfiles: + def __init__(self, lfplugin: LFPlugin) -> None: + self.lfplugin = lfplugin + + @hookimpl + def pytest_make_collect_report( + self, collector: nodes.Collector + ) -> CollectReport | None: + if isinstance(collector, File): + if collector.path not in self.lfplugin._last_failed_paths: + self.lfplugin._skipped_files += 1 + + return CollectReport( + collector.nodeid, "passed", longrepr=None, result=[] + ) + return None + + +class LFPlugin: + """Plugin which implements the --lf (run last-failing) option.""" + + def __init__(self, config: Config) -> None: + self.config = config + active_keys = "lf", "failedfirst" + self.active = any(config.getoption(key) for key in active_keys) + assert config.cache + self.lastfailed: dict[str, bool] = config.cache.get("cache/lastfailed", {}) + self._previously_failed_count: int | None = None + self._report_status: str | None = None + self._skipped_files = 0 # count skipped files during collection due to --lf + + if config.getoption("lf"): + self._last_failed_paths = self.get_last_failed_paths() + config.pluginmanager.register( + LFPluginCollWrapper(self), "lfplugin-collwrapper" + ) + + def get_last_failed_paths(self) -> set[Path]: + """Return a set with all Paths of the previously failed nodeids and + their parents.""" + rootpath = self.config.rootpath + result = set() + for nodeid in self.lastfailed: + path = rootpath / nodeid.split("::")[0] + result.add(path) + result.update(path.parents) + return {x for x in result if x.exists()} + + def pytest_report_collectionfinish(self) -> str | None: + if self.active and self.config.get_verbosity() >= 0: + return f"run-last-failure: {self._report_status}" + return None + + def pytest_runtest_logreport(self, report: TestReport) -> None: + if (report.when == "call" and report.passed) or report.skipped: + self.lastfailed.pop(report.nodeid, None) + elif report.failed: + self.lastfailed[report.nodeid] = True + + def pytest_collectreport(self, report: CollectReport) -> None: + passed = report.outcome in ("passed", "skipped") + if passed: + if report.nodeid in self.lastfailed: + self.lastfailed.pop(report.nodeid) + self.lastfailed.update((item.nodeid, True) for item in report.result) + else: + self.lastfailed[report.nodeid] = True + + @hookimpl(wrapper=True, tryfirst=True) + def pytest_collection_modifyitems( + self, config: Config, items: list[nodes.Item] + ) -> Generator[None]: + res = yield + + if not self.active: + return res + + if self.lastfailed: + previously_failed = [] + previously_passed = [] + for item in items: + if item.nodeid in self.lastfailed: + previously_failed.append(item) + else: + previously_passed.append(item) + self._previously_failed_count = len(previously_failed) + + if not previously_failed: + # Running a subset of all tests with recorded failures + # only outside of it. + self._report_status = "%d known failures not in selected tests" % ( + len(self.lastfailed), + ) + else: + if self.config.getoption("lf"): + items[:] = previously_failed + config.hook.pytest_deselected(items=previously_passed) + else: # --failedfirst + items[:] = previously_failed + previously_passed + + noun = "failure" if self._previously_failed_count == 1 else "failures" + suffix = " first" if self.config.getoption("failedfirst") else "" + self._report_status = ( + f"rerun previous {self._previously_failed_count} {noun}{suffix}" + ) + + if self._skipped_files > 0: + files_noun = "file" if self._skipped_files == 1 else "files" + self._report_status += f" (skipped {self._skipped_files} {files_noun})" + else: + self._report_status = "no previously failed tests, " + if self.config.getoption("last_failed_no_failures") == "none": + self._report_status += "deselecting all items." + config.hook.pytest_deselected(items=items[:]) + items[:] = [] + else: + self._report_status += "not deselecting items." + + return res + + def pytest_sessionfinish(self, session: Session) -> None: + config = self.config + if config.getoption("cacheshow") or hasattr(config, "workerinput"): + return + + assert config.cache is not None + saved_lastfailed = config.cache.get("cache/lastfailed", {}) + if saved_lastfailed != self.lastfailed: + config.cache.set("cache/lastfailed", self.lastfailed) + + +class NFPlugin: + """Plugin which implements the --nf (run new-first) option.""" + + def __init__(self, config: Config) -> None: + self.config = config + self.active = config.option.newfirst + assert config.cache is not None + self.cached_nodeids = set(config.cache.get("cache/nodeids", [])) + + @hookimpl(wrapper=True, tryfirst=True) + def pytest_collection_modifyitems(self, items: list[nodes.Item]) -> Generator[None]: + res = yield + + if self.active: + new_items: dict[str, nodes.Item] = {} + other_items: dict[str, nodes.Item] = {} + for item in items: + if item.nodeid not in self.cached_nodeids: + new_items[item.nodeid] = item + else: + other_items[item.nodeid] = item + + items[:] = self._get_increasing_order( + new_items.values() + ) + self._get_increasing_order(other_items.values()) + self.cached_nodeids.update(new_items) + else: + self.cached_nodeids.update(item.nodeid for item in items) + + return res + + def _get_increasing_order(self, items: Iterable[nodes.Item]) -> list[nodes.Item]: + return sorted(items, key=lambda item: item.path.stat().st_mtime, reverse=True) + + def pytest_sessionfinish(self) -> None: + config = self.config + if config.getoption("cacheshow") or hasattr(config, "workerinput"): + return + + if config.getoption("collectonly"): + return + + assert config.cache is not None + config.cache.set("cache/nodeids", sorted(self.cached_nodeids)) + + +def pytest_addoption(parser: Parser) -> None: + group = parser.getgroup("general") + group.addoption( + "--lf", + "--last-failed", + action="store_true", + dest="lf", + help="Rerun only the tests that failed " + "at the last run (or all if none failed)", + ) + group.addoption( + "--ff", + "--failed-first", + action="store_true", + dest="failedfirst", + help="Run all tests, but run the last failures first. " + "This may re-order tests and thus lead to " + "repeated fixture setup/teardown.", + ) + group.addoption( + "--nf", + "--new-first", + action="store_true", + dest="newfirst", + help="Run tests from new files first, then the rest of the tests " + "sorted by file mtime", + ) + group.addoption( + "--cache-show", + action="append", + nargs="?", + dest="cacheshow", + help=( + "Show cache contents, don't perform collection or tests. " + "Optional argument: glob (default: '*')." + ), + ) + group.addoption( + "--cache-clear", + action="store_true", + dest="cacheclear", + help="Remove all cache contents at start of test run", + ) + cache_dir_default = ".pytest_cache" + if "TOX_ENV_DIR" in os.environ: + cache_dir_default = os.path.join(os.environ["TOX_ENV_DIR"], cache_dir_default) + parser.addini("cache_dir", default=cache_dir_default, help="Cache directory path") + group.addoption( + "--lfnf", + "--last-failed-no-failures", + action="store", + dest="last_failed_no_failures", + choices=("all", "none"), + default="all", + help="With ``--lf``, determines whether to execute tests when there " + "are no previously (known) failures or when no " + "cached ``lastfailed`` data was found. " + "``all`` (the default) runs the full test suite again. " + "``none`` just emits a message about no known failures and exits successfully.", + ) + + +def pytest_cmdline_main(config: Config) -> int | ExitCode | None: + if config.option.cacheshow and not config.option.help: + from _pytest.main import wrap_session + + return wrap_session(config, cacheshow) + return None + + +@hookimpl(tryfirst=True) +def pytest_configure(config: Config) -> None: + config.cache = Cache.for_config(config, _ispytest=True) + config.pluginmanager.register(LFPlugin(config), "lfplugin") + config.pluginmanager.register(NFPlugin(config), "nfplugin") + + +@fixture +def cache(request: FixtureRequest) -> Cache: + """Return a cache object that can persist state between testing sessions. + + cache.get(key, default) + cache.set(key, value) + + Keys must be ``/`` separated strings, where the first part is usually the + name of your plugin or application to avoid clashes with other cache users. + + Values can be any object handled by the json stdlib module. + """ + assert request.config.cache is not None + return request.config.cache + + +def pytest_report_header(config: Config) -> str | None: + """Display cachedir with --cache-show and if non-default.""" + if config.option.verbose > 0 or config.getini("cache_dir") != ".pytest_cache": + assert config.cache is not None + cachedir = config.cache._cachedir + # TODO: evaluate generating upward relative paths + # starting with .., ../.. if sensible + + try: + displaypath = cachedir.relative_to(config.rootpath) + except ValueError: + displaypath = cachedir + return f"cachedir: {displaypath}" + return None + + +def cacheshow(config: Config, session: Session) -> int: + from pprint import pformat + + assert config.cache is not None + + tw = TerminalWriter() + tw.line("cachedir: " + str(config.cache._cachedir)) + if not config.cache._cachedir.is_dir(): + tw.line("cache is empty") + return 0 + + glob = config.option.cacheshow[0] + if glob is None: + glob = "*" + + dummy = object() + basedir = config.cache._cachedir + vdir = basedir / Cache._CACHE_PREFIX_VALUES + tw.sep("-", f"cache values for {glob!r}") + for valpath in sorted(x for x in vdir.rglob(glob) if x.is_file()): + key = str(valpath.relative_to(vdir)) + val = config.cache.get(key, dummy) + if val is dummy: + tw.line(f"{key} contains unreadable content, will be ignored") + else: + tw.line(f"{key} contains:") + for line in pformat(val).splitlines(): + tw.line(" " + line) + + ddir = basedir / Cache._CACHE_PREFIX_DIRS + if ddir.is_dir(): + contents = sorted(ddir.rglob(glob)) + tw.sep("-", f"cache directories for {glob!r}") + for p in contents: + # if p.is_dir(): + # print("%s/" % p.relative_to(basedir)) + if p.is_file(): + key = str(p.relative_to(basedir)) + tw.line(f"{key} is a file of length {p.stat().st_size:d}") + return 0 diff --git a/.venv/Lib/site-packages/_pytest/capture.py b/.venv/Lib/site-packages/_pytest/capture.py new file mode 100644 index 00000000..506c0b3d --- /dev/null +++ b/.venv/Lib/site-packages/_pytest/capture.py @@ -0,0 +1,1087 @@ +# mypy: allow-untyped-defs +"""Per-test stdout/stderr capturing mechanism.""" + +from __future__ import annotations + +import abc +import collections +import contextlib +import io +from io import UnsupportedOperation +import os +import sys +from tempfile import TemporaryFile +from types import TracebackType +from typing import Any +from typing import AnyStr +from typing import BinaryIO +from typing import Final +from typing import final +from typing import Generator +from typing import Generic +from typing import Iterable +from typing import Iterator +from typing import Literal +from typing import NamedTuple +from typing import TextIO +from typing import TYPE_CHECKING + + +if TYPE_CHECKING: + from typing_extensions import Self + +from _pytest.config import Config +from _pytest.config import hookimpl +from _pytest.config.argparsing import Parser +from _pytest.deprecated import check_ispytest +from _pytest.fixtures import fixture +from _pytest.fixtures import SubRequest +from _pytest.nodes import Collector +from _pytest.nodes import File +from _pytest.nodes import Item +from _pytest.reports import CollectReport + + +_CaptureMethod = Literal["fd", "sys", "no", "tee-sys"] + + +def pytest_addoption(parser: Parser) -> None: + group = parser.getgroup("general") + group._addoption( + "--capture", + action="store", + default="fd", + metavar="method", + choices=["fd", "sys", "no", "tee-sys"], + help="Per-test capturing method: one of fd|sys|no|tee-sys", + ) + group._addoption( + "-s", + action="store_const", + const="no", + dest="capture", + help="Shortcut for --capture=no", + ) + + +def _colorama_workaround() -> None: + """Ensure colorama is imported so that it attaches to the correct stdio + handles on Windows. + + colorama uses the terminal on import time. So if something does the + first import of colorama while I/O capture is active, colorama will + fail in various ways. + """ + if sys.platform.startswith("win32"): + try: + import colorama # noqa: F401 + except ImportError: + pass + + +def _windowsconsoleio_workaround(stream: TextIO) -> None: + """Workaround for Windows Unicode console handling. + + Python 3.6 implemented Unicode console handling for Windows. This works + by reading/writing to the raw console handle using + ``{Read,Write}ConsoleW``. + + The problem is that we are going to ``dup2`` over the stdio file + descriptors when doing ``FDCapture`` and this will ``CloseHandle`` the + handles used by Python to write to the console. Though there is still some + weirdness and the console handle seems to only be closed randomly and not + on the first call to ``CloseHandle``, or maybe it gets reopened with the + same handle value when we suspend capturing. + + The workaround in this case will reopen stdio with a different fd which + also means a different handle by replicating the logic in + "Py_lifecycle.c:initstdio/create_stdio". + + :param stream: + In practice ``sys.stdout`` or ``sys.stderr``, but given + here as parameter for unittesting purposes. + + See https://github.com/pytest-dev/py/issues/103. + """ + if not sys.platform.startswith("win32") or hasattr(sys, "pypy_version_info"): + return + + # Bail out if ``stream`` doesn't seem like a proper ``io`` stream (#2666). + if not hasattr(stream, "buffer"): # type: ignore[unreachable,unused-ignore] + return + + raw_stdout = stream.buffer.raw if hasattr(stream.buffer, "raw") else stream.buffer + + if not isinstance(raw_stdout, io._WindowsConsoleIO): # type: ignore[attr-defined,unused-ignore] + return + + def _reopen_stdio(f, mode): + if not hasattr(stream.buffer, "raw") and mode[0] == "w": + buffering = 0 + else: + buffering = -1 + + return io.TextIOWrapper( + open(os.dup(f.fileno()), mode, buffering), + f.encoding, + f.errors, + f.newlines, + f.line_buffering, + ) + + sys.stdin = _reopen_stdio(sys.stdin, "rb") + sys.stdout = _reopen_stdio(sys.stdout, "wb") + sys.stderr = _reopen_stdio(sys.stderr, "wb") + + +@hookimpl(wrapper=True) +def pytest_load_initial_conftests(early_config: Config) -> Generator[None]: + ns = early_config.known_args_namespace + if ns.capture == "fd": + _windowsconsoleio_workaround(sys.stdout) + _colorama_workaround() + pluginmanager = early_config.pluginmanager + capman = CaptureManager(ns.capture) + pluginmanager.register(capman, "capturemanager") + + # Make sure that capturemanager is properly reset at final shutdown. + early_config.add_cleanup(capman.stop_global_capturing) + + # Finally trigger conftest loading but while capturing (issue #93). + capman.start_global_capturing() + try: + try: + yield + finally: + capman.suspend_global_capture() + except BaseException: + out, err = capman.read_global_capture() + sys.stdout.write(out) + sys.stderr.write(err) + raise + + +# IO Helpers. + + +class EncodedFile(io.TextIOWrapper): + __slots__ = () + + @property + def name(self) -> str: + # Ensure that file.name is a string. Workaround for a Python bug + # fixed in >=3.7.4: https://bugs.python.org/issue36015 + return repr(self.buffer) + + @property + def mode(self) -> str: + # TextIOWrapper doesn't expose a mode, but at least some of our + # tests check it. + return self.buffer.mode.replace("b", "") + + +class CaptureIO(io.TextIOWrapper): + def __init__(self) -> None: + super().__init__(io.BytesIO(), encoding="UTF-8", newline="", write_through=True) + + def getvalue(self) -> str: + assert isinstance(self.buffer, io.BytesIO) + return self.buffer.getvalue().decode("UTF-8") + + +class TeeCaptureIO(CaptureIO): + def __init__(self, other: TextIO) -> None: + self._other = other + super().__init__() + + def write(self, s: str) -> int: + super().write(s) + return self._other.write(s) + + +class DontReadFromInput(TextIO): + @property + def encoding(self) -> str: + assert sys.__stdin__ is not None + return sys.__stdin__.encoding + + def read(self, size: int = -1) -> str: + raise OSError( + "pytest: reading from stdin while output is captured! Consider using `-s`." + ) + + readline = read + + def __next__(self) -> str: + return self.readline() + + def readlines(self, hint: int | None = -1) -> list[str]: + raise OSError( + "pytest: reading from stdin while output is captured! Consider using `-s`." + ) + + def __iter__(self) -> Iterator[str]: + return self + + def fileno(self) -> int: + raise UnsupportedOperation("redirected stdin is pseudofile, has no fileno()") + + def flush(self) -> None: + raise UnsupportedOperation("redirected stdin is pseudofile, has no flush()") + + def isatty(self) -> bool: + return False + + def close(self) -> None: + pass + + def readable(self) -> bool: + return False + + def seek(self, offset: int, whence: int = 0) -> int: + raise UnsupportedOperation("redirected stdin is pseudofile, has no seek(int)") + + def seekable(self) -> bool: + return False + + def tell(self) -> int: + raise UnsupportedOperation("redirected stdin is pseudofile, has no tell()") + + def truncate(self, size: int | None = None) -> int: + raise UnsupportedOperation("cannot truncate stdin") + + def write(self, data: str) -> int: + raise UnsupportedOperation("cannot write to stdin") + + def writelines(self, lines: Iterable[str]) -> None: + raise UnsupportedOperation("Cannot write to stdin") + + def writable(self) -> bool: + return False + + def __enter__(self) -> Self: + return self + + def __exit__( + self, + type: type[BaseException] | None, + value: BaseException | None, + traceback: TracebackType | None, + ) -> None: + pass + + @property + def buffer(self) -> BinaryIO: + # The str/bytes doesn't actually matter in this type, so OK to fake. + return self # type: ignore[return-value] + + +# Capture classes. + + +class CaptureBase(abc.ABC, Generic[AnyStr]): + EMPTY_BUFFER: AnyStr + + @abc.abstractmethod + def __init__(self, fd: int) -> None: + raise NotImplementedError() + + @abc.abstractmethod + def start(self) -> None: + raise NotImplementedError() + + @abc.abstractmethod + def done(self) -> None: + raise NotImplementedError() + + @abc.abstractmethod + def suspend(self) -> None: + raise NotImplementedError() + + @abc.abstractmethod + def resume(self) -> None: + raise NotImplementedError() + + @abc.abstractmethod + def writeorg(self, data: AnyStr) -> None: + raise NotImplementedError() + + @abc.abstractmethod + def snap(self) -> AnyStr: + raise NotImplementedError() + + +patchsysdict = {0: "stdin", 1: "stdout", 2: "stderr"} + + +class NoCapture(CaptureBase[str]): + EMPTY_BUFFER = "" + + def __init__(self, fd: int) -> None: + pass + + def start(self) -> None: + pass + + def done(self) -> None: + pass + + def suspend(self) -> None: + pass + + def resume(self) -> None: + pass + + def snap(self) -> str: + return "" + + def writeorg(self, data: str) -> None: + pass + + +class SysCaptureBase(CaptureBase[AnyStr]): + def __init__( + self, fd: int, tmpfile: TextIO | None = None, *, tee: bool = False + ) -> None: + name = patchsysdict[fd] + self._old: TextIO = getattr(sys, name) + self.name = name + if tmpfile is None: + if name == "stdin": + tmpfile = DontReadFromInput() + else: + tmpfile = CaptureIO() if not tee else TeeCaptureIO(self._old) + self.tmpfile = tmpfile + self._state = "initialized" + + def repr(self, class_name: str) -> str: + return "<{} {} _old={} _state={!r} tmpfile={!r}>".format( + class_name, + self.name, + hasattr(self, "_old") and repr(self._old) or "", + self._state, + self.tmpfile, + ) + + def __repr__(self) -> str: + return "<{} {} _old={} _state={!r} tmpfile={!r}>".format( + self.__class__.__name__, + self.name, + hasattr(self, "_old") and repr(self._old) or "", + self._state, + self.tmpfile, + ) + + def _assert_state(self, op: str, states: tuple[str, ...]) -> None: + assert ( + self._state in states + ), "cannot {} in state {!r}: expected one of {}".format( + op, self._state, ", ".join(states) + ) + + def start(self) -> None: + self._assert_state("start", ("initialized",)) + setattr(sys, self.name, self.tmpfile) + self._state = "started" + + def done(self) -> None: + self._assert_state("done", ("initialized", "started", "suspended", "done")) + if self._state == "done": + return + setattr(sys, self.name, self._old) + del self._old + self.tmpfile.close() + self._state = "done" + + def suspend(self) -> None: + self._assert_state("suspend", ("started", "suspended")) + setattr(sys, self.name, self._old) + self._state = "suspended" + + def resume(self) -> None: + self._assert_state("resume", ("started", "suspended")) + if self._state == "started": + return + setattr(sys, self.name, self.tmpfile) + self._state = "started" + + +class SysCaptureBinary(SysCaptureBase[bytes]): + EMPTY_BUFFER = b"" + + def snap(self) -> bytes: + self._assert_state("snap", ("started", "suspended")) + self.tmpfile.seek(0) + res = self.tmpfile.buffer.read() + self.tmpfile.seek(0) + self.tmpfile.truncate() + return res + + def writeorg(self, data: bytes) -> None: + self._assert_state("writeorg", ("started", "suspended")) + self._old.flush() + self._old.buffer.write(data) + self._old.buffer.flush() + + +class SysCapture(SysCaptureBase[str]): + EMPTY_BUFFER = "" + + def snap(self) -> str: + self._assert_state("snap", ("started", "suspended")) + assert isinstance(self.tmpfile, CaptureIO) + res = self.tmpfile.getvalue() + self.tmpfile.seek(0) + self.tmpfile.truncate() + return res + + def writeorg(self, data: str) -> None: + self._assert_state("writeorg", ("started", "suspended")) + self._old.write(data) + self._old.flush() + + +class FDCaptureBase(CaptureBase[AnyStr]): + def __init__(self, targetfd: int) -> None: + self.targetfd = targetfd + + try: + os.fstat(targetfd) + except OSError: + # FD capturing is conceptually simple -- create a temporary file, + # redirect the FD to it, redirect back when done. But when the + # target FD is invalid it throws a wrench into this lovely scheme. + # + # Tests themselves shouldn't care if the FD is valid, FD capturing + # should work regardless of external circumstances. So falling back + # to just sys capturing is not a good option. + # + # Further complications are the need to support suspend() and the + # possibility of FD reuse (e.g. the tmpfile getting the very same + # target FD). The following approach is robust, I believe. + self.targetfd_invalid: int | None = os.open(os.devnull, os.O_RDWR) + os.dup2(self.targetfd_invalid, targetfd) + else: + self.targetfd_invalid = None + self.targetfd_save = os.dup(targetfd) + + if targetfd == 0: + self.tmpfile = open(os.devnull, encoding="utf-8") + self.syscapture: CaptureBase[str] = SysCapture(targetfd) + else: + self.tmpfile = EncodedFile( + TemporaryFile(buffering=0), + encoding="utf-8", + errors="replace", + newline="", + write_through=True, + ) + if targetfd in patchsysdict: + self.syscapture = SysCapture(targetfd, self.tmpfile) + else: + self.syscapture = NoCapture(targetfd) + + self._state = "initialized" + + def __repr__(self) -> str: + return ( + f"<{self.__class__.__name__} {self.targetfd} oldfd={self.targetfd_save} " + f"_state={self._state!r} tmpfile={self.tmpfile!r}>" + ) + + def _assert_state(self, op: str, states: tuple[str, ...]) -> None: + assert ( + self._state in states + ), "cannot {} in state {!r}: expected one of {}".format( + op, self._state, ", ".join(states) + ) + + def start(self) -> None: + """Start capturing on targetfd using memorized tmpfile.""" + self._assert_state("start", ("initialized",)) + os.dup2(self.tmpfile.fileno(), self.targetfd) + self.syscapture.start() + self._state = "started" + + def done(self) -> None: + """Stop capturing, restore streams, return original capture file, + seeked to position zero.""" + self._assert_state("done", ("initialized", "started", "suspended", "done")) + if self._state == "done": + return + os.dup2(self.targetfd_save, self.targetfd) + os.close(self.targetfd_save) + if self.targetfd_invalid is not None: + if self.targetfd_invalid != self.targetfd: + os.close(self.targetfd) + os.close(self.targetfd_invalid) + self.syscapture.done() + self.tmpfile.close() + self._state = "done" + + def suspend(self) -> None: + self._assert_state("suspend", ("started", "suspended")) + if self._state == "suspended": + return + self.syscapture.suspend() + os.dup2(self.targetfd_save, self.targetfd) + self._state = "suspended" + + def resume(self) -> None: + self._assert_state("resume", ("started", "suspended")) + if self._state == "started": + return + self.syscapture.resume() + os.dup2(self.tmpfile.fileno(), self.targetfd) + self._state = "started" + + +class FDCaptureBinary(FDCaptureBase[bytes]): + """Capture IO to/from a given OS-level file descriptor. + + snap() produces `bytes`. + """ + + EMPTY_BUFFER = b"" + + def snap(self) -> bytes: + self._assert_state("snap", ("started", "suspended")) + self.tmpfile.seek(0) + res = self.tmpfile.buffer.read() + self.tmpfile.seek(0) + self.tmpfile.truncate() + return res + + def writeorg(self, data: bytes) -> None: + """Write to original file descriptor.""" + self._assert_state("writeorg", ("started", "suspended")) + os.write(self.targetfd_save, data) + + +class FDCapture(FDCaptureBase[str]): + """Capture IO to/from a given OS-level file descriptor. + + snap() produces text. + """ + + EMPTY_BUFFER = "" + + def snap(self) -> str: + self._assert_state("snap", ("started", "suspended")) + self.tmpfile.seek(0) + res = self.tmpfile.read() + self.tmpfile.seek(0) + self.tmpfile.truncate() + return res + + def writeorg(self, data: str) -> None: + """Write to original file descriptor.""" + self._assert_state("writeorg", ("started", "suspended")) + # XXX use encoding of original stream + os.write(self.targetfd_save, data.encode("utf-8")) + + +# MultiCapture + + +# Generic NamedTuple only supported since Python 3.11. +if sys.version_info >= (3, 11) or TYPE_CHECKING: + + @final + class CaptureResult(NamedTuple, Generic[AnyStr]): + """The result of :method:`caplog.readouterr() `.""" + + out: AnyStr + err: AnyStr + +else: + + class CaptureResult( + collections.namedtuple("CaptureResult", ["out", "err"]), # noqa: PYI024 + Generic[AnyStr], + ): + """The result of :method:`caplog.readouterr() `.""" + + __slots__ = () + + +class MultiCapture(Generic[AnyStr]): + _state = None + _in_suspended = False + + def __init__( + self, + in_: CaptureBase[AnyStr] | None, + out: CaptureBase[AnyStr] | None, + err: CaptureBase[AnyStr] | None, + ) -> None: + self.in_: CaptureBase[AnyStr] | None = in_ + self.out: CaptureBase[AnyStr] | None = out + self.err: CaptureBase[AnyStr] | None = err + + def __repr__(self) -> str: + return ( + f"" + ) + + def start_capturing(self) -> None: + self._state = "started" + if self.in_: + self.in_.start() + if self.out: + self.out.start() + if self.err: + self.err.start() + + def pop_outerr_to_orig(self) -> tuple[AnyStr, AnyStr]: + """Pop current snapshot out/err capture and flush to orig streams.""" + out, err = self.readouterr() + if out: + assert self.out is not None + self.out.writeorg(out) + if err: + assert self.err is not None + self.err.writeorg(err) + return out, err + + def suspend_capturing(self, in_: bool = False) -> None: + self._state = "suspended" + if self.out: + self.out.suspend() + if self.err: + self.err.suspend() + if in_ and self.in_: + self.in_.suspend() + self._in_suspended = True + + def resume_capturing(self) -> None: + self._state = "started" + if self.out: + self.out.resume() + if self.err: + self.err.resume() + if self._in_suspended: + assert self.in_ is not None + self.in_.resume() + self._in_suspended = False + + def stop_capturing(self) -> None: + """Stop capturing and reset capturing streams.""" + if self._state == "stopped": + raise ValueError("was already stopped") + self._state = "stopped" + if self.out: + self.out.done() + if self.err: + self.err.done() + if self.in_: + self.in_.done() + + def is_started(self) -> bool: + """Whether actively capturing -- not suspended or stopped.""" + return self._state == "started" + + def readouterr(self) -> CaptureResult[AnyStr]: + out = self.out.snap() if self.out else "" + err = self.err.snap() if self.err else "" + # TODO: This type error is real, need to fix. + return CaptureResult(out, err) # type: ignore[arg-type] + + +def _get_multicapture(method: _CaptureMethod) -> MultiCapture[str]: + if method == "fd": + return MultiCapture(in_=FDCapture(0), out=FDCapture(1), err=FDCapture(2)) + elif method == "sys": + return MultiCapture(in_=SysCapture(0), out=SysCapture(1), err=SysCapture(2)) + elif method == "no": + return MultiCapture(in_=None, out=None, err=None) + elif method == "tee-sys": + return MultiCapture( + in_=None, out=SysCapture(1, tee=True), err=SysCapture(2, tee=True) + ) + raise ValueError(f"unknown capturing method: {method!r}") + + +# CaptureManager and CaptureFixture + + +class CaptureManager: + """The capture plugin. + + Manages that the appropriate capture method is enabled/disabled during + collection and each test phase (setup, call, teardown). After each of + those points, the captured output is obtained and attached to the + collection/runtest report. + + There are two levels of capture: + + * global: enabled by default and can be suppressed by the ``-s`` + option. This is always enabled/disabled during collection and each test + phase. + + * fixture: when a test function or one of its fixture depend on the + ``capsys`` or ``capfd`` fixtures. In this case special handling is + needed to ensure the fixtures take precedence over the global capture. + """ + + def __init__(self, method: _CaptureMethod) -> None: + self._method: Final = method + self._global_capturing: MultiCapture[str] | None = None + self._capture_fixture: CaptureFixture[Any] | None = None + + def __repr__(self) -> str: + return ( + f"" + ) + + def is_capturing(self) -> str | bool: + if self.is_globally_capturing(): + return "global" + if self._capture_fixture: + return f"fixture {self._capture_fixture.request.fixturename}" + return False + + # Global capturing control + + def is_globally_capturing(self) -> bool: + return self._method != "no" + + def start_global_capturing(self) -> None: + assert self._global_capturing is None + self._global_capturing = _get_multicapture(self._method) + self._global_capturing.start_capturing() + + def stop_global_capturing(self) -> None: + if self._global_capturing is not None: + self._global_capturing.pop_outerr_to_orig() + self._global_capturing.stop_capturing() + self._global_capturing = None + + def resume_global_capture(self) -> None: + # During teardown of the python process, and on rare occasions, capture + # attributes can be `None` while trying to resume global capture. + if self._global_capturing is not None: + self._global_capturing.resume_capturing() + + def suspend_global_capture(self, in_: bool = False) -> None: + if self._global_capturing is not None: + self._global_capturing.suspend_capturing(in_=in_) + + def suspend(self, in_: bool = False) -> None: + # Need to undo local capsys-et-al if it exists before disabling global capture. + self.suspend_fixture() + self.suspend_global_capture(in_) + + def resume(self) -> None: + self.resume_global_capture() + self.resume_fixture() + + def read_global_capture(self) -> CaptureResult[str]: + assert self._global_capturing is not None + return self._global_capturing.readouterr() + + # Fixture Control + + def set_fixture(self, capture_fixture: CaptureFixture[Any]) -> None: + if self._capture_fixture: + current_fixture = self._capture_fixture.request.fixturename + requested_fixture = capture_fixture.request.fixturename + capture_fixture.request.raiseerror( + f"cannot use {requested_fixture} and {current_fixture} at the same time" + ) + self._capture_fixture = capture_fixture + + def unset_fixture(self) -> None: + self._capture_fixture = None + + def activate_fixture(self) -> None: + """If the current item is using ``capsys`` or ``capfd``, activate + them so they take precedence over the global capture.""" + if self._capture_fixture: + self._capture_fixture._start() + + def deactivate_fixture(self) -> None: + """Deactivate the ``capsys`` or ``capfd`` fixture of this item, if any.""" + if self._capture_fixture: + self._capture_fixture.close() + + def suspend_fixture(self) -> None: + if self._capture_fixture: + self._capture_fixture._suspend() + + def resume_fixture(self) -> None: + if self._capture_fixture: + self._capture_fixture._resume() + + # Helper context managers + + @contextlib.contextmanager + def global_and_fixture_disabled(self) -> Generator[None]: + """Context manager to temporarily disable global and current fixture capturing.""" + do_fixture = self._capture_fixture and self._capture_fixture._is_started() + if do_fixture: + self.suspend_fixture() + do_global = self._global_capturing and self._global_capturing.is_started() + if do_global: + self.suspend_global_capture() + try: + yield + finally: + if do_global: + self.resume_global_capture() + if do_fixture: + self.resume_fixture() + + @contextlib.contextmanager + def item_capture(self, when: str, item: Item) -> Generator[None]: + self.resume_global_capture() + self.activate_fixture() + try: + yield + finally: + self.deactivate_fixture() + self.suspend_global_capture(in_=False) + + out, err = self.read_global_capture() + item.add_report_section(when, "stdout", out) + item.add_report_section(when, "stderr", err) + + # Hooks + + @hookimpl(wrapper=True) + def pytest_make_collect_report( + self, collector: Collector + ) -> Generator[None, CollectReport, CollectReport]: + if isinstance(collector, File): + self.resume_global_capture() + try: + rep = yield + finally: + self.suspend_global_capture() + out, err = self.read_global_capture() + if out: + rep.sections.append(("Captured stdout", out)) + if err: + rep.sections.append(("Captured stderr", err)) + else: + rep = yield + return rep + + @hookimpl(wrapper=True) + def pytest_runtest_setup(self, item: Item) -> Generator[None]: + with self.item_capture("setup", item): + return (yield) + + @hookimpl(wrapper=True) + def pytest_runtest_call(self, item: Item) -> Generator[None]: + with self.item_capture("call", item): + return (yield) + + @hookimpl(wrapper=True) + def pytest_runtest_teardown(self, item: Item) -> Generator[None]: + with self.item_capture("teardown", item): + return (yield) + + @hookimpl(tryfirst=True) + def pytest_keyboard_interrupt(self) -> None: + self.stop_global_capturing() + + @hookimpl(tryfirst=True) + def pytest_internalerror(self) -> None: + self.stop_global_capturing() + + +class CaptureFixture(Generic[AnyStr]): + """Object returned by the :fixture:`capsys`, :fixture:`capsysbinary`, + :fixture:`capfd` and :fixture:`capfdbinary` fixtures.""" + + def __init__( + self, + captureclass: type[CaptureBase[AnyStr]], + request: SubRequest, + *, + _ispytest: bool = False, + ) -> None: + check_ispytest(_ispytest) + self.captureclass: type[CaptureBase[AnyStr]] = captureclass + self.request = request + self._capture: MultiCapture[AnyStr] | None = None + self._captured_out: AnyStr = self.captureclass.EMPTY_BUFFER + self._captured_err: AnyStr = self.captureclass.EMPTY_BUFFER + + def _start(self) -> None: + if self._capture is None: + self._capture = MultiCapture( + in_=None, + out=self.captureclass(1), + err=self.captureclass(2), + ) + self._capture.start_capturing() + + def close(self) -> None: + if self._capture is not None: + out, err = self._capture.pop_outerr_to_orig() + self._captured_out += out + self._captured_err += err + self._capture.stop_capturing() + self._capture = None + + def readouterr(self) -> CaptureResult[AnyStr]: + """Read and return the captured output so far, resetting the internal + buffer. + + :returns: + The captured content as a namedtuple with ``out`` and ``err`` + string attributes. + """ + captured_out, captured_err = self._captured_out, self._captured_err + if self._capture is not None: + out, err = self._capture.readouterr() + captured_out += out + captured_err += err + self._captured_out = self.captureclass.EMPTY_BUFFER + self._captured_err = self.captureclass.EMPTY_BUFFER + return CaptureResult(captured_out, captured_err) + + def _suspend(self) -> None: + """Suspend this fixture's own capturing temporarily.""" + if self._capture is not None: + self._capture.suspend_capturing() + + def _resume(self) -> None: + """Resume this fixture's own capturing temporarily.""" + if self._capture is not None: + self._capture.resume_capturing() + + def _is_started(self) -> bool: + """Whether actively capturing -- not disabled or closed.""" + if self._capture is not None: + return self._capture.is_started() + return False + + @contextlib.contextmanager + def disabled(self) -> Generator[None]: + """Temporarily disable capturing while inside the ``with`` block.""" + capmanager: CaptureManager = self.request.config.pluginmanager.getplugin( + "capturemanager" + ) + with capmanager.global_and_fixture_disabled(): + yield + + +# The fixtures. + + +@fixture +def capsys(request: SubRequest) -> Generator[CaptureFixture[str]]: + r"""Enable text capturing of writes to ``sys.stdout`` and ``sys.stderr``. + + The captured output is made available via ``capsys.readouterr()`` method + calls, which return a ``(out, err)`` namedtuple. + ``out`` and ``err`` will be ``text`` objects. + + Returns an instance of :class:`CaptureFixture[str] `. + + Example: + + .. code-block:: python + + def test_output(capsys): + print("hello") + captured = capsys.readouterr() + assert captured.out == "hello\n" + """ + capman: CaptureManager = request.config.pluginmanager.getplugin("capturemanager") + capture_fixture = CaptureFixture(SysCapture, request, _ispytest=True) + capman.set_fixture(capture_fixture) + capture_fixture._start() + yield capture_fixture + capture_fixture.close() + capman.unset_fixture() + + +@fixture +def capsysbinary(request: SubRequest) -> Generator[CaptureFixture[bytes]]: + r"""Enable bytes capturing of writes to ``sys.stdout`` and ``sys.stderr``. + + The captured output is made available via ``capsysbinary.readouterr()`` + method calls, which return a ``(out, err)`` namedtuple. + ``out`` and ``err`` will be ``bytes`` objects. + + Returns an instance of :class:`CaptureFixture[bytes] `. + + Example: + + .. code-block:: python + + def test_output(capsysbinary): + print("hello") + captured = capsysbinary.readouterr() + assert captured.out == b"hello\n" + """ + capman: CaptureManager = request.config.pluginmanager.getplugin("capturemanager") + capture_fixture = CaptureFixture(SysCaptureBinary, request, _ispytest=True) + capman.set_fixture(capture_fixture) + capture_fixture._start() + yield capture_fixture + capture_fixture.close() + capman.unset_fixture() + + +@fixture +def capfd(request: SubRequest) -> Generator[CaptureFixture[str]]: + r"""Enable text capturing of writes to file descriptors ``1`` and ``2``. + + The captured output is made available via ``capfd.readouterr()`` method + calls, which return a ``(out, err)`` namedtuple. + ``out`` and ``err`` will be ``text`` objects. + + Returns an instance of :class:`CaptureFixture[str] `. + + Example: + + .. code-block:: python + + def test_system_echo(capfd): + os.system('echo "hello"') + captured = capfd.readouterr() + assert captured.out == "hello\n" + """ + capman: CaptureManager = request.config.pluginmanager.getplugin("capturemanager") + capture_fixture = CaptureFixture(FDCapture, request, _ispytest=True) + capman.set_fixture(capture_fixture) + capture_fixture._start() + yield capture_fixture + capture_fixture.close() + capman.unset_fixture() + + +@fixture +def capfdbinary(request: SubRequest) -> Generator[CaptureFixture[bytes]]: + r"""Enable bytes capturing of writes to file descriptors ``1`` and ``2``. + + The captured output is made available via ``capfd.readouterr()`` method + calls, which return a ``(out, err)`` namedtuple. + ``out`` and ``err`` will be ``byte`` objects. + + Returns an instance of :class:`CaptureFixture[bytes] `. + + Example: + + .. code-block:: python + + def test_system_echo(capfdbinary): + os.system('echo "hello"') + captured = capfdbinary.readouterr() + assert captured.out == b"hello\n" + + """ + capman: CaptureManager = request.config.pluginmanager.getplugin("capturemanager") + capture_fixture = CaptureFixture(FDCaptureBinary, request, _ispytest=True) + capman.set_fixture(capture_fixture) + capture_fixture._start() + yield capture_fixture + capture_fixture.close() + capman.unset_fixture() diff --git a/.venv/Lib/site-packages/_pytest/compat.py b/.venv/Lib/site-packages/_pytest/compat.py new file mode 100644 index 00000000..614848e0 --- /dev/null +++ b/.venv/Lib/site-packages/_pytest/compat.py @@ -0,0 +1,351 @@ +# mypy: allow-untyped-defs +"""Python version compatibility code.""" + +from __future__ import annotations + +import dataclasses +import enum +import functools +import inspect +from inspect import Parameter +from inspect import signature +import os +from pathlib import Path +import sys +from typing import Any +from typing import Callable +from typing import Final +from typing import NoReturn + +import py + + +#: constant to prepare valuing pylib path replacements/lazy proxies later on +# intended for removal in pytest 8.0 or 9.0 + +# fmt: off +# intentional space to create a fake difference for the verification +LEGACY_PATH = py.path. local +# fmt: on + + +def legacy_path(path: str | os.PathLike[str]) -> LEGACY_PATH: + """Internal wrapper to prepare lazy proxies for legacy_path instances""" + return LEGACY_PATH(path) + + +# fmt: off +# Singleton type for NOTSET, as described in: +# https://www.python.org/dev/peps/pep-0484/#support-for-singleton-types-in-unions +class NotSetType(enum.Enum): + token = 0 +NOTSET: Final = NotSetType.token +# fmt: on + + +def is_generator(func: object) -> bool: + genfunc = inspect.isgeneratorfunction(func) + return genfunc and not iscoroutinefunction(func) + + +def iscoroutinefunction(func: object) -> bool: + """Return True if func is a coroutine function (a function defined with async + def syntax, and doesn't contain yield), or a function decorated with + @asyncio.coroutine. + + Note: copied and modified from Python 3.5's builtin coroutines.py to avoid + importing asyncio directly, which in turns also initializes the "logging" + module as a side-effect (see issue #8). + """ + return inspect.iscoroutinefunction(func) or getattr(func, "_is_coroutine", False) + + +def is_async_function(func: object) -> bool: + """Return True if the given function seems to be an async function or + an async generator.""" + return iscoroutinefunction(func) or inspect.isasyncgenfunction(func) + + +def getlocation(function, curdir: str | os.PathLike[str] | None = None) -> str: + function = get_real_func(function) + fn = Path(inspect.getfile(function)) + lineno = function.__code__.co_firstlineno + if curdir is not None: + try: + relfn = fn.relative_to(curdir) + except ValueError: + pass + else: + return "%s:%d" % (relfn, lineno + 1) + return "%s:%d" % (fn, lineno + 1) + + +def num_mock_patch_args(function) -> int: + """Return number of arguments used up by mock arguments (if any).""" + patchings = getattr(function, "patchings", None) + if not patchings: + return 0 + + mock_sentinel = getattr(sys.modules.get("mock"), "DEFAULT", object()) + ut_mock_sentinel = getattr(sys.modules.get("unittest.mock"), "DEFAULT", object()) + + return len( + [ + p + for p in patchings + if not p.attribute_name + and (p.new is mock_sentinel or p.new is ut_mock_sentinel) + ] + ) + + +def getfuncargnames( + function: Callable[..., object], + *, + name: str = "", + cls: type | None = None, +) -> tuple[str, ...]: + """Return the names of a function's mandatory arguments. + + Should return the names of all function arguments that: + * Aren't bound to an instance or type as in instance or class methods. + * Don't have default values. + * Aren't bound with functools.partial. + * Aren't replaced with mocks. + + The cls arguments indicate that the function should be treated as a bound + method even though it's not unless the function is a static method. + + The name parameter should be the original name in which the function was collected. + """ + # TODO(RonnyPfannschmidt): This function should be refactored when we + # revisit fixtures. The fixture mechanism should ask the node for + # the fixture names, and not try to obtain directly from the + # function object well after collection has occurred. + + # The parameters attribute of a Signature object contains an + # ordered mapping of parameter names to Parameter instances. This + # creates a tuple of the names of the parameters that don't have + # defaults. + try: + parameters = signature(function).parameters + except (ValueError, TypeError) as e: + from _pytest.outcomes import fail + + fail( + f"Could not determine arguments of {function!r}: {e}", + pytrace=False, + ) + + arg_names = tuple( + p.name + for p in parameters.values() + if ( + p.kind is Parameter.POSITIONAL_OR_KEYWORD + or p.kind is Parameter.KEYWORD_ONLY + ) + and p.default is Parameter.empty + ) + if not name: + name = function.__name__ + + # If this function should be treated as a bound method even though + # it's passed as an unbound method or function, remove the first + # parameter name. + if ( + # Not using `getattr` because we don't want to resolve the staticmethod. + # Not using `cls.__dict__` because we want to check the entire MRO. + cls + and not isinstance( + inspect.getattr_static(cls, name, default=None), staticmethod + ) + ): + arg_names = arg_names[1:] + # Remove any names that will be replaced with mocks. + if hasattr(function, "__wrapped__"): + arg_names = arg_names[num_mock_patch_args(function) :] + return arg_names + + +def get_default_arg_names(function: Callable[..., Any]) -> tuple[str, ...]: + # Note: this code intentionally mirrors the code at the beginning of + # getfuncargnames, to get the arguments which were excluded from its result + # because they had default values. + return tuple( + p.name + for p in signature(function).parameters.values() + if p.kind in (Parameter.POSITIONAL_OR_KEYWORD, Parameter.KEYWORD_ONLY) + and p.default is not Parameter.empty + ) + + +_non_printable_ascii_translate_table = { + i: f"\\x{i:02x}" for i in range(128) if i not in range(32, 127) +} +_non_printable_ascii_translate_table.update( + {ord("\t"): "\\t", ord("\r"): "\\r", ord("\n"): "\\n"} +) + + +def ascii_escaped(val: bytes | str) -> str: + r"""If val is pure ASCII, return it as an str, otherwise, escape + bytes objects into a sequence of escaped bytes: + + b'\xc3\xb4\xc5\xd6' -> r'\xc3\xb4\xc5\xd6' + + and escapes strings into a sequence of escaped unicode ids, e.g.: + + r'4\nV\U00043efa\x0eMXWB\x1e\u3028\u15fd\xcd\U0007d944' + + Note: + The obvious "v.decode('unicode-escape')" will return + valid UTF-8 unicode if it finds them in bytes, but we + want to return escaped bytes for any byte, even if they match + a UTF-8 string. + """ + if isinstance(val, bytes): + ret = val.decode("ascii", "backslashreplace") + else: + ret = val.encode("unicode_escape").decode("ascii") + return ret.translate(_non_printable_ascii_translate_table) + + +@dataclasses.dataclass +class _PytestWrapper: + """Dummy wrapper around a function object for internal use only. + + Used to correctly unwrap the underlying function object when we are + creating fixtures, because we wrap the function object ourselves with a + decorator to issue warnings when the fixture function is called directly. + """ + + obj: Any + + +def get_real_func(obj): + """Get the real function object of the (possibly) wrapped object by + functools.wraps or functools.partial.""" + start_obj = obj + for i in range(100): + # __pytest_wrapped__ is set by @pytest.fixture when wrapping the fixture function + # to trigger a warning if it gets called directly instead of by pytest: we don't + # want to unwrap further than this otherwise we lose useful wrappings like @mock.patch (#3774) + new_obj = getattr(obj, "__pytest_wrapped__", None) + if isinstance(new_obj, _PytestWrapper): + obj = new_obj.obj + break + new_obj = getattr(obj, "__wrapped__", None) + if new_obj is None: + break + obj = new_obj + else: + from _pytest._io.saferepr import saferepr + + raise ValueError( + f"could not find real function of {saferepr(start_obj)}\nstopped at {saferepr(obj)}" + ) + if isinstance(obj, functools.partial): + obj = obj.func + return obj + + +def get_real_method(obj, holder): + """Attempt to obtain the real function object that might be wrapping + ``obj``, while at the same time returning a bound method to ``holder`` if + the original object was a bound method.""" + try: + is_method = hasattr(obj, "__func__") + obj = get_real_func(obj) + except Exception: # pragma: no cover + return obj + if is_method and hasattr(obj, "__get__") and callable(obj.__get__): + obj = obj.__get__(holder) + return obj + + +def getimfunc(func): + try: + return func.__func__ + except AttributeError: + return func + + +def safe_getattr(object: Any, name: str, default: Any) -> Any: + """Like getattr but return default upon any Exception or any OutcomeException. + + Attribute access can potentially fail for 'evil' Python objects. + See issue #214. + It catches OutcomeException because of #2490 (issue #580), new outcomes + are derived from BaseException instead of Exception (for more details + check #2707). + """ + from _pytest.outcomes import TEST_OUTCOME + + try: + return getattr(object, name, default) + except TEST_OUTCOME: + return default + + +def safe_isclass(obj: object) -> bool: + """Ignore any exception via isinstance on Python 3.""" + try: + return inspect.isclass(obj) + except Exception: + return False + + +def get_user_id() -> int | None: + """Return the current process's real user id or None if it could not be + determined. + + :return: The user id or None if it could not be determined. + """ + # mypy follows the version and platform checking expectation of PEP 484: + # https://mypy.readthedocs.io/en/stable/common_issues.html?highlight=platform#python-version-and-system-platform-checks + # Containment checks are too complex for mypy v1.5.0 and cause failure. + if sys.platform == "win32" or sys.platform == "emscripten": + # win32 does not have a getuid() function. + # Emscripten has a return 0 stub. + return None + else: + # On other platforms, a return value of -1 is assumed to indicate that + # the current process's real user id could not be determined. + ERROR = -1 + uid = os.getuid() + return uid if uid != ERROR else None + + +# Perform exhaustiveness checking. +# +# Consider this example: +# +# MyUnion = Union[int, str] +# +# def handle(x: MyUnion) -> int { +# if isinstance(x, int): +# return 1 +# elif isinstance(x, str): +# return 2 +# else: +# raise Exception('unreachable') +# +# Now suppose we add a new variant: +# +# MyUnion = Union[int, str, bytes] +# +# After doing this, we must remember ourselves to go and update the handle +# function to handle the new variant. +# +# With `assert_never` we can do better: +# +# // raise Exception('unreachable') +# return assert_never(x) +# +# Now, if we forget to handle the new variant, the type-checker will emit a +# compile-time error, instead of the runtime error we would have gotten +# previously. +# +# This also work for Enums (if you use `is` to compare) and Literals. +def assert_never(value: NoReturn) -> NoReturn: + assert False, f"Unhandled value: {value} ({type(value).__name__})" diff --git a/.venv/Lib/site-packages/_pytest/config/__init__.py b/.venv/Lib/site-packages/_pytest/config/__init__.py new file mode 100644 index 00000000..3cca1479 --- /dev/null +++ b/.venv/Lib/site-packages/_pytest/config/__init__.py @@ -0,0 +1,1972 @@ +# mypy: allow-untyped-defs +"""Command line options, ini-file and conftest.py processing.""" + +from __future__ import annotations + +import argparse +import collections.abc +import copy +import dataclasses +import enum +from functools import lru_cache +import glob +import importlib.metadata +import inspect +import os +import pathlib +import re +import shlex +import sys +from textwrap import dedent +import types +from types import FunctionType +from typing import Any +from typing import Callable +from typing import cast +from typing import Final +from typing import final +from typing import Generator +from typing import IO +from typing import Iterable +from typing import Iterator +from typing import Sequence +from typing import TextIO +from typing import Type +from typing import TYPE_CHECKING +import warnings + +import pluggy +from pluggy import HookimplMarker +from pluggy import HookimplOpts +from pluggy import HookspecMarker +from pluggy import HookspecOpts +from pluggy import PluginManager + +from .compat import PathAwareHookProxy +from .exceptions import PrintHelp as PrintHelp +from .exceptions import UsageError as UsageError +from .findpaths import determine_setup +from _pytest import __version__ +import _pytest._code +from _pytest._code import ExceptionInfo +from _pytest._code import filter_traceback +from _pytest._code.code import TracebackStyle +from _pytest._io import TerminalWriter +from _pytest.config.argparsing import Argument +from _pytest.config.argparsing import Parser +import _pytest.deprecated +import _pytest.hookspec +from _pytest.outcomes import fail +from _pytest.outcomes import Skipped +from _pytest.pathlib import absolutepath +from _pytest.pathlib import bestrelpath +from _pytest.pathlib import import_path +from _pytest.pathlib import ImportMode +from _pytest.pathlib import resolve_package_path +from _pytest.pathlib import safe_exists +from _pytest.stash import Stash +from _pytest.warning_types import PytestConfigWarning +from _pytest.warning_types import warn_explicit_for + + +if TYPE_CHECKING: + from _pytest.cacheprovider import Cache + from _pytest.terminal import TerminalReporter + + +_PluggyPlugin = object +"""A type to represent plugin objects. + +Plugins can be any namespace, so we can't narrow it down much, but we use an +alias to make the intent clear. + +Ideally this type would be provided by pluggy itself. +""" + + +hookimpl = HookimplMarker("pytest") +hookspec = HookspecMarker("pytest") + + +@final +class ExitCode(enum.IntEnum): + """Encodes the valid exit codes by pytest. + + Currently users and plugins may supply other exit codes as well. + + .. versionadded:: 5.0 + """ + + #: Tests passed. + OK = 0 + #: Tests failed. + TESTS_FAILED = 1 + #: pytest was interrupted. + INTERRUPTED = 2 + #: An internal error got in the way. + INTERNAL_ERROR = 3 + #: pytest was misused. + USAGE_ERROR = 4 + #: pytest couldn't find tests. + NO_TESTS_COLLECTED = 5 + + +class ConftestImportFailure(Exception): + def __init__( + self, + path: pathlib.Path, + *, + cause: Exception, + ) -> None: + self.path = path + self.cause = cause + + def __str__(self) -> str: + return f"{type(self.cause).__name__}: {self.cause} (from {self.path})" + + +def filter_traceback_for_conftest_import_failure( + entry: _pytest._code.TracebackEntry, +) -> bool: + """Filter tracebacks entries which point to pytest internals or importlib. + + Make a special case for importlib because we use it to import test modules and conftest files + in _pytest.pathlib.import_path. + """ + return filter_traceback(entry) and "importlib" not in str(entry.path).split(os.sep) + + +def main( + args: list[str] | os.PathLike[str] | None = None, + plugins: Sequence[str | _PluggyPlugin] | None = None, +) -> int | ExitCode: + """Perform an in-process test run. + + :param args: + List of command line arguments. If `None` or not given, defaults to reading + arguments directly from the process command line (:data:`sys.argv`). + :param plugins: List of plugin objects to be auto-registered during initialization. + + :returns: An exit code. + """ + old_pytest_version = os.environ.get("PYTEST_VERSION") + try: + os.environ["PYTEST_VERSION"] = __version__ + try: + config = _prepareconfig(args, plugins) + except ConftestImportFailure as e: + exc_info = ExceptionInfo.from_exception(e.cause) + tw = TerminalWriter(sys.stderr) + tw.line(f"ImportError while loading conftest '{e.path}'.", red=True) + exc_info.traceback = exc_info.traceback.filter( + filter_traceback_for_conftest_import_failure + ) + exc_repr = ( + exc_info.getrepr(style="short", chain=False) + if exc_info.traceback + else exc_info.exconly() + ) + formatted_tb = str(exc_repr) + for line in formatted_tb.splitlines(): + tw.line(line.rstrip(), red=True) + return ExitCode.USAGE_ERROR + else: + try: + ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config) + try: + return ExitCode(ret) + except ValueError: + return ret + finally: + config._ensure_unconfigure() + except UsageError as e: + tw = TerminalWriter(sys.stderr) + for msg in e.args: + tw.line(f"ERROR: {msg}\n", red=True) + return ExitCode.USAGE_ERROR + finally: + if old_pytest_version is None: + os.environ.pop("PYTEST_VERSION", None) + else: + os.environ["PYTEST_VERSION"] = old_pytest_version + + +def console_main() -> int: + """The CLI entry point of pytest. + + This function is not meant for programmable use; use `main()` instead. + """ + # https://docs.python.org/3/library/signal.html#note-on-sigpipe + try: + code = main() + sys.stdout.flush() + return code + except BrokenPipeError: + # Python flushes standard streams on exit; redirect remaining output + # to devnull to avoid another BrokenPipeError at shutdown + devnull = os.open(os.devnull, os.O_WRONLY) + os.dup2(devnull, sys.stdout.fileno()) + return 1 # Python exits with error code 1 on EPIPE + + +class cmdline: # compatibility namespace + main = staticmethod(main) + + +def filename_arg(path: str, optname: str) -> str: + """Argparse type validator for filename arguments. + + :path: Path of filename. + :optname: Name of the option. + """ + if os.path.isdir(path): + raise UsageError(f"{optname} must be a filename, given: {path}") + return path + + +def directory_arg(path: str, optname: str) -> str: + """Argparse type validator for directory arguments. + + :path: Path of directory. + :optname: Name of the option. + """ + if not os.path.isdir(path): + raise UsageError(f"{optname} must be a directory, given: {path}") + return path + + +# Plugins that cannot be disabled via "-p no:X" currently. +essential_plugins = ( + "mark", + "main", + "runner", + "fixtures", + "helpconfig", # Provides -p. +) + +default_plugins = ( + *essential_plugins, + "python", + "terminal", + "debugging", + "unittest", + "capture", + "skipping", + "legacypath", + "tmpdir", + "monkeypatch", + "recwarn", + "pastebin", + "assertion", + "junitxml", + "doctest", + "cacheprovider", + "freeze_support", + "setuponly", + "setupplan", + "stepwise", + "warnings", + "logging", + "reports", + "python_path", + "unraisableexception", + "threadexception", + "faulthandler", +) + +builtin_plugins = set(default_plugins) +builtin_plugins.add("pytester") +builtin_plugins.add("pytester_assertions") + + +def get_config( + args: list[str] | None = None, + plugins: Sequence[str | _PluggyPlugin] | None = None, +) -> Config: + # subsequent calls to main will create a fresh instance + pluginmanager = PytestPluginManager() + config = Config( + pluginmanager, + invocation_params=Config.InvocationParams( + args=args or (), + plugins=plugins, + dir=pathlib.Path.cwd(), + ), + ) + + if args is not None: + # Handle any "-p no:plugin" args. + pluginmanager.consider_preparse(args, exclude_only=True) + + for spec in default_plugins: + pluginmanager.import_plugin(spec) + + return config + + +def get_plugin_manager() -> PytestPluginManager: + """Obtain a new instance of the + :py:class:`pytest.PytestPluginManager`, with default plugins + already loaded. + + This function can be used by integration with other tools, like hooking + into pytest to run tests into an IDE. + """ + return get_config().pluginmanager + + +def _prepareconfig( + args: list[str] | os.PathLike[str] | None = None, + plugins: Sequence[str | _PluggyPlugin] | None = None, +) -> Config: + if args is None: + args = sys.argv[1:] + elif isinstance(args, os.PathLike): + args = [os.fspath(args)] + elif not isinstance(args, list): + msg = ( # type:ignore[unreachable] + "`args` parameter expected to be a list of strings, got: {!r} (type: {})" + ) + raise TypeError(msg.format(args, type(args))) + + config = get_config(args, plugins) + pluginmanager = config.pluginmanager + try: + if plugins: + for plugin in plugins: + if isinstance(plugin, str): + pluginmanager.consider_pluginarg(plugin) + else: + pluginmanager.register(plugin) + config = pluginmanager.hook.pytest_cmdline_parse( + pluginmanager=pluginmanager, args=args + ) + return config + except BaseException: + config._ensure_unconfigure() + raise + + +def _get_directory(path: pathlib.Path) -> pathlib.Path: + """Get the directory of a path - itself if already a directory.""" + if path.is_file(): + return path.parent + else: + return path + + +def _get_legacy_hook_marks( + method: Any, + hook_type: str, + opt_names: tuple[str, ...], +) -> dict[str, bool]: + if TYPE_CHECKING: + # abuse typeguard from importlib to avoid massive method type union that's lacking an alias + assert inspect.isroutine(method) + known_marks: set[str] = {m.name for m in getattr(method, "pytestmark", [])} + must_warn: list[str] = [] + opts: dict[str, bool] = {} + for opt_name in opt_names: + opt_attr = getattr(method, opt_name, AttributeError) + if opt_attr is not AttributeError: + must_warn.append(f"{opt_name}={opt_attr}") + opts[opt_name] = True + elif opt_name in known_marks: + must_warn.append(f"{opt_name}=True") + opts[opt_name] = True + else: + opts[opt_name] = False + if must_warn: + hook_opts = ", ".join(must_warn) + message = _pytest.deprecated.HOOK_LEGACY_MARKING.format( + type=hook_type, + fullname=method.__qualname__, + hook_opts=hook_opts, + ) + warn_explicit_for(cast(FunctionType, method), message) + return opts + + +@final +class PytestPluginManager(PluginManager): + """A :py:class:`pluggy.PluginManager ` with + additional pytest-specific functionality: + + * Loading plugins from the command line, ``PYTEST_PLUGINS`` env variable and + ``pytest_plugins`` global variables found in plugins being loaded. + * ``conftest.py`` loading during start-up. + """ + + def __init__(self) -> None: + import _pytest.assertion + + super().__init__("pytest") + + # -- State related to local conftest plugins. + # All loaded conftest modules. + self._conftest_plugins: set[types.ModuleType] = set() + # All conftest modules applicable for a directory. + # This includes the directory's own conftest modules as well + # as those of its parent directories. + self._dirpath2confmods: dict[pathlib.Path, list[types.ModuleType]] = {} + # Cutoff directory above which conftests are no longer discovered. + self._confcutdir: pathlib.Path | None = None + # If set, conftest loading is skipped. + self._noconftest = False + + # _getconftestmodules()'s call to _get_directory() causes a stat + # storm when it's called potentially thousands of times in a test + # session (#9478), often with the same path, so cache it. + self._get_directory = lru_cache(256)(_get_directory) + + # plugins that were explicitly skipped with pytest.skip + # list of (module name, skip reason) + # previously we would issue a warning when a plugin was skipped, but + # since we refactored warnings as first citizens of Config, they are + # just stored here to be used later. + self.skipped_plugins: list[tuple[str, str]] = [] + + self.add_hookspecs(_pytest.hookspec) + self.register(self) + if os.environ.get("PYTEST_DEBUG"): + err: IO[str] = sys.stderr + encoding: str = getattr(err, "encoding", "utf8") + try: + err = open( + os.dup(err.fileno()), + mode=err.mode, + buffering=1, + encoding=encoding, + ) + except Exception: + pass + self.trace.root.setwriter(err.write) + self.enable_tracing() + + # Config._consider_importhook will set a real object if required. + self.rewrite_hook = _pytest.assertion.DummyRewriteHook() + # Used to know when we are importing conftests after the pytest_configure stage. + self._configured = False + + def parse_hookimpl_opts( + self, plugin: _PluggyPlugin, name: str + ) -> HookimplOpts | None: + """:meta private:""" + # pytest hooks are always prefixed with "pytest_", + # so we avoid accessing possibly non-readable attributes + # (see issue #1073). + if not name.startswith("pytest_"): + return None + # Ignore names which cannot be hooks. + if name == "pytest_plugins": + return None + + opts = super().parse_hookimpl_opts(plugin, name) + if opts is not None: + return opts + + method = getattr(plugin, name) + # Consider only actual functions for hooks (#3775). + if not inspect.isroutine(method): + return None + # Collect unmarked hooks as long as they have the `pytest_' prefix. + return _get_legacy_hook_marks( # type: ignore[return-value] + method, "impl", ("tryfirst", "trylast", "optionalhook", "hookwrapper") + ) + + def parse_hookspec_opts(self, module_or_class, name: str) -> HookspecOpts | None: + """:meta private:""" + opts = super().parse_hookspec_opts(module_or_class, name) + if opts is None: + method = getattr(module_or_class, name) + if name.startswith("pytest_"): + opts = _get_legacy_hook_marks( # type: ignore[assignment] + method, + "spec", + ("firstresult", "historic"), + ) + return opts + + def register(self, plugin: _PluggyPlugin, name: str | None = None) -> str | None: + if name in _pytest.deprecated.DEPRECATED_EXTERNAL_PLUGINS: + warnings.warn( + PytestConfigWarning( + "{} plugin has been merged into the core, " + "please remove it from your requirements.".format( + name.replace("_", "-") + ) + ) + ) + return None + plugin_name = super().register(plugin, name) + if plugin_name is not None: + self.hook.pytest_plugin_registered.call_historic( + kwargs=dict( + plugin=plugin, + plugin_name=plugin_name, + manager=self, + ) + ) + + if isinstance(plugin, types.ModuleType): + self.consider_module(plugin) + return plugin_name + + def getplugin(self, name: str): + # Support deprecated naming because plugins (xdist e.g.) use it. + plugin: _PluggyPlugin | None = self.get_plugin(name) + return plugin + + def hasplugin(self, name: str) -> bool: + """Return whether a plugin with the given name is registered.""" + return bool(self.get_plugin(name)) + + def pytest_configure(self, config: Config) -> None: + """:meta private:""" + # XXX now that the pluginmanager exposes hookimpl(tryfirst...) + # we should remove tryfirst/trylast as markers. + config.addinivalue_line( + "markers", + "tryfirst: mark a hook implementation function such that the " + "plugin machinery will try to call it first/as early as possible. " + "DEPRECATED, use @pytest.hookimpl(tryfirst=True) instead.", + ) + config.addinivalue_line( + "markers", + "trylast: mark a hook implementation function such that the " + "plugin machinery will try to call it last/as late as possible. " + "DEPRECATED, use @pytest.hookimpl(trylast=True) instead.", + ) + self._configured = True + + # + # Internal API for local conftest plugin handling. + # + def _set_initial_conftests( + self, + args: Sequence[str | pathlib.Path], + pyargs: bool, + noconftest: bool, + rootpath: pathlib.Path, + confcutdir: pathlib.Path | None, + invocation_dir: pathlib.Path, + importmode: ImportMode | str, + *, + consider_namespace_packages: bool, + ) -> None: + """Load initial conftest files given a preparsed "namespace". + + As conftest files may add their own command line options which have + arguments ('--my-opt somepath') we might get some false positives. + All builtin and 3rd party plugins will have been loaded, however, so + common options will not confuse our logic here. + """ + self._confcutdir = ( + absolutepath(invocation_dir / confcutdir) if confcutdir else None + ) + self._noconftest = noconftest + self._using_pyargs = pyargs + foundanchor = False + for initial_path in args: + path = str(initial_path) + # remove node-id syntax + i = path.find("::") + if i != -1: + path = path[:i] + anchor = absolutepath(invocation_dir / path) + + # Ensure we do not break if what appears to be an anchor + # is in fact a very long option (#10169, #11394). + if safe_exists(anchor): + self._try_load_conftest( + anchor, + importmode, + rootpath, + consider_namespace_packages=consider_namespace_packages, + ) + foundanchor = True + if not foundanchor: + self._try_load_conftest( + invocation_dir, + importmode, + rootpath, + consider_namespace_packages=consider_namespace_packages, + ) + + def _is_in_confcutdir(self, path: pathlib.Path) -> bool: + """Whether to consider the given path to load conftests from.""" + if self._confcutdir is None: + return True + # The semantics here are literally: + # Do not load a conftest if it is found upwards from confcut dir. + # But this is *not* the same as: + # Load only conftests from confcutdir or below. + # At first glance they might seem the same thing, however we do support use cases where + # we want to load conftests that are not found in confcutdir or below, but are found + # in completely different directory hierarchies like packages installed + # in out-of-source trees. + # (see #9767 for a regression where the logic was inverted). + return path not in self._confcutdir.parents + + def _try_load_conftest( + self, + anchor: pathlib.Path, + importmode: str | ImportMode, + rootpath: pathlib.Path, + *, + consider_namespace_packages: bool, + ) -> None: + self._loadconftestmodules( + anchor, + importmode, + rootpath, + consider_namespace_packages=consider_namespace_packages, + ) + # let's also consider test* subdirs + if anchor.is_dir(): + for x in anchor.glob("test*"): + if x.is_dir(): + self._loadconftestmodules( + x, + importmode, + rootpath, + consider_namespace_packages=consider_namespace_packages, + ) + + def _loadconftestmodules( + self, + path: pathlib.Path, + importmode: str | ImportMode, + rootpath: pathlib.Path, + *, + consider_namespace_packages: bool, + ) -> None: + if self._noconftest: + return + + directory = self._get_directory(path) + + # Optimization: avoid repeated searches in the same directory. + # Assumes always called with same importmode and rootpath. + if directory in self._dirpath2confmods: + return + + clist = [] + for parent in reversed((directory, *directory.parents)): + if self._is_in_confcutdir(parent): + conftestpath = parent / "conftest.py" + if conftestpath.is_file(): + mod = self._importconftest( + conftestpath, + importmode, + rootpath, + consider_namespace_packages=consider_namespace_packages, + ) + clist.append(mod) + self._dirpath2confmods[directory] = clist + + def _getconftestmodules(self, path: pathlib.Path) -> Sequence[types.ModuleType]: + directory = self._get_directory(path) + return self._dirpath2confmods.get(directory, ()) + + def _rget_with_confmod( + self, + name: str, + path: pathlib.Path, + ) -> tuple[types.ModuleType, Any]: + modules = self._getconftestmodules(path) + for mod in reversed(modules): + try: + return mod, getattr(mod, name) + except AttributeError: + continue + raise KeyError(name) + + def _importconftest( + self, + conftestpath: pathlib.Path, + importmode: str | ImportMode, + rootpath: pathlib.Path, + *, + consider_namespace_packages: bool, + ) -> types.ModuleType: + conftestpath_plugin_name = str(conftestpath) + existing = self.get_plugin(conftestpath_plugin_name) + if existing is not None: + return cast(types.ModuleType, existing) + + # conftest.py files there are not in a Python package all have module + # name "conftest", and thus conflict with each other. Clear the existing + # before loading the new one, otherwise the existing one will be + # returned from the module cache. + pkgpath = resolve_package_path(conftestpath) + if pkgpath is None: + try: + del sys.modules[conftestpath.stem] + except KeyError: + pass + + try: + mod = import_path( + conftestpath, + mode=importmode, + root=rootpath, + consider_namespace_packages=consider_namespace_packages, + ) + except Exception as e: + assert e.__traceback__ is not None + raise ConftestImportFailure(conftestpath, cause=e) from e + + self._check_non_top_pytest_plugins(mod, conftestpath) + + self._conftest_plugins.add(mod) + dirpath = conftestpath.parent + if dirpath in self._dirpath2confmods: + for path, mods in self._dirpath2confmods.items(): + if dirpath in path.parents or path == dirpath: + if mod in mods: + raise AssertionError( + f"While trying to load conftest path {conftestpath!s}, " + f"found that the module {mod} is already loaded with path {mod.__file__}. " + "This is not supposed to happen. Please report this issue to pytest." + ) + mods.append(mod) + self.trace(f"loading conftestmodule {mod!r}") + self.consider_conftest(mod, registration_name=conftestpath_plugin_name) + return mod + + def _check_non_top_pytest_plugins( + self, + mod: types.ModuleType, + conftestpath: pathlib.Path, + ) -> None: + if ( + hasattr(mod, "pytest_plugins") + and self._configured + and not self._using_pyargs + ): + msg = ( + "Defining 'pytest_plugins' in a non-top-level conftest is no longer supported:\n" + "It affects the entire test suite instead of just below the conftest as expected.\n" + " {}\n" + "Please move it to a top level conftest file at the rootdir:\n" + " {}\n" + "For more information, visit:\n" + " https://docs.pytest.org/en/stable/deprecations.html#pytest-plugins-in-non-top-level-conftest-files" + ) + fail(msg.format(conftestpath, self._confcutdir), pytrace=False) + + # + # API for bootstrapping plugin loading + # + # + + def consider_preparse( + self, args: Sequence[str], *, exclude_only: bool = False + ) -> None: + """:meta private:""" + i = 0 + n = len(args) + while i < n: + opt = args[i] + i += 1 + if isinstance(opt, str): + if opt == "-p": + try: + parg = args[i] + except IndexError: + return + i += 1 + elif opt.startswith("-p"): + parg = opt[2:] + else: + continue + parg = parg.strip() + if exclude_only and not parg.startswith("no:"): + continue + self.consider_pluginarg(parg) + + def consider_pluginarg(self, arg: str) -> None: + """:meta private:""" + if arg.startswith("no:"): + name = arg[3:] + if name in essential_plugins: + raise UsageError(f"plugin {name} cannot be disabled") + + # PR #4304: remove stepwise if cacheprovider is blocked. + if name == "cacheprovider": + self.set_blocked("stepwise") + self.set_blocked("pytest_stepwise") + + self.set_blocked(name) + if not name.startswith("pytest_"): + self.set_blocked("pytest_" + name) + else: + name = arg + # Unblock the plugin. + self.unblock(name) + if not name.startswith("pytest_"): + self.unblock("pytest_" + name) + self.import_plugin(arg, consider_entry_points=True) + + def consider_conftest( + self, conftestmodule: types.ModuleType, registration_name: str + ) -> None: + """:meta private:""" + self.register(conftestmodule, name=registration_name) + + def consider_env(self) -> None: + """:meta private:""" + self._import_plugin_specs(os.environ.get("PYTEST_PLUGINS")) + + def consider_module(self, mod: types.ModuleType) -> None: + """:meta private:""" + self._import_plugin_specs(getattr(mod, "pytest_plugins", [])) + + def _import_plugin_specs( + self, spec: None | types.ModuleType | str | Sequence[str] + ) -> None: + plugins = _get_plugin_specs_as_list(spec) + for import_spec in plugins: + self.import_plugin(import_spec) + + def import_plugin(self, modname: str, consider_entry_points: bool = False) -> None: + """Import a plugin with ``modname``. + + If ``consider_entry_points`` is True, entry point names are also + considered to find a plugin. + """ + # Most often modname refers to builtin modules, e.g. "pytester", + # "terminal" or "capture". Those plugins are registered under their + # basename for historic purposes but must be imported with the + # _pytest prefix. + assert isinstance( + modname, str + ), f"module name as text required, got {modname!r}" + if self.is_blocked(modname) or self.get_plugin(modname) is not None: + return + + importspec = "_pytest." + modname if modname in builtin_plugins else modname + self.rewrite_hook.mark_rewrite(importspec) + + if consider_entry_points: + loaded = self.load_setuptools_entrypoints("pytest11", name=modname) + if loaded: + return + + try: + __import__(importspec) + except ImportError as e: + raise ImportError( + f'Error importing plugin "{modname}": {e.args[0]}' + ).with_traceback(e.__traceback__) from e + + except Skipped as e: + self.skipped_plugins.append((modname, e.msg or "")) + else: + mod = sys.modules[importspec] + self.register(mod, modname) + + +def _get_plugin_specs_as_list( + specs: None | types.ModuleType | str | Sequence[str], +) -> list[str]: + """Parse a plugins specification into a list of plugin names.""" + # None means empty. + if specs is None: + return [] + # Workaround for #3899 - a submodule which happens to be called "pytest_plugins". + if isinstance(specs, types.ModuleType): + return [] + # Comma-separated list. + if isinstance(specs, str): + return specs.split(",") if specs else [] + # Direct specification. + if isinstance(specs, collections.abc.Sequence): + return list(specs) + raise UsageError( + f"Plugins may be specified as a sequence or a ','-separated string of plugin names. Got: {specs!r}" + ) + + +class Notset: + def __repr__(self): + return "" + + +notset = Notset() + + +def _iter_rewritable_modules(package_files: Iterable[str]) -> Iterator[str]: + """Given an iterable of file names in a source distribution, return the "names" that should + be marked for assertion rewrite. + + For example the package "pytest_mock/__init__.py" should be added as "pytest_mock" in + the assertion rewrite mechanism. + + This function has to deal with dist-info based distributions and egg based distributions + (which are still very much in use for "editable" installs). + + Here are the file names as seen in a dist-info based distribution: + + pytest_mock/__init__.py + pytest_mock/_version.py + pytest_mock/plugin.py + pytest_mock.egg-info/PKG-INFO + + Here are the file names as seen in an egg based distribution: + + src/pytest_mock/__init__.py + src/pytest_mock/_version.py + src/pytest_mock/plugin.py + src/pytest_mock.egg-info/PKG-INFO + LICENSE + setup.py + + We have to take in account those two distribution flavors in order to determine which + names should be considered for assertion rewriting. + + More information: + https://github.com/pytest-dev/pytest-mock/issues/167 + """ + package_files = list(package_files) + seen_some = False + for fn in package_files: + is_simple_module = "/" not in fn and fn.endswith(".py") + is_package = fn.count("/") == 1 and fn.endswith("__init__.py") + if is_simple_module: + module_name, _ = os.path.splitext(fn) + # we ignore "setup.py" at the root of the distribution + # as well as editable installation finder modules made by setuptools + if module_name != "setup" and not module_name.startswith("__editable__"): + seen_some = True + yield module_name + elif is_package: + package_name = os.path.dirname(fn) + seen_some = True + yield package_name + + if not seen_some: + # At this point we did not find any packages or modules suitable for assertion + # rewriting, so we try again by stripping the first path component (to account for + # "src" based source trees for example). + # This approach lets us have the common case continue to be fast, as egg-distributions + # are rarer. + new_package_files = [] + for fn in package_files: + parts = fn.split("/") + new_fn = "/".join(parts[1:]) + if new_fn: + new_package_files.append(new_fn) + if new_package_files: + yield from _iter_rewritable_modules(new_package_files) + + +@final +class Config: + """Access to configuration values, pluginmanager and plugin hooks. + + :param PytestPluginManager pluginmanager: + A pytest PluginManager. + + :param InvocationParams invocation_params: + Object containing parameters regarding the :func:`pytest.main` + invocation. + """ + + @final + @dataclasses.dataclass(frozen=True) + class InvocationParams: + """Holds parameters passed during :func:`pytest.main`. + + The object attributes are read-only. + + .. versionadded:: 5.1 + + .. note:: + + Note that the environment variable ``PYTEST_ADDOPTS`` and the ``addopts`` + ini option are handled by pytest, not being included in the ``args`` attribute. + + Plugins accessing ``InvocationParams`` must be aware of that. + """ + + args: tuple[str, ...] + """The command-line arguments as passed to :func:`pytest.main`.""" + plugins: Sequence[str | _PluggyPlugin] | None + """Extra plugins, might be `None`.""" + dir: pathlib.Path + """The directory from which :func:`pytest.main` was invoked. :type: pathlib.Path""" + + def __init__( + self, + *, + args: Iterable[str], + plugins: Sequence[str | _PluggyPlugin] | None, + dir: pathlib.Path, + ) -> None: + object.__setattr__(self, "args", tuple(args)) + object.__setattr__(self, "plugins", plugins) + object.__setattr__(self, "dir", dir) + + class ArgsSource(enum.Enum): + """Indicates the source of the test arguments. + + .. versionadded:: 7.2 + """ + + #: Command line arguments. + ARGS = enum.auto() + #: Invocation directory. + INVOCATION_DIR = enum.auto() + INCOVATION_DIR = INVOCATION_DIR # backwards compatibility alias + #: 'testpaths' configuration value. + TESTPATHS = enum.auto() + + # Set by cacheprovider plugin. + cache: Cache + + def __init__( + self, + pluginmanager: PytestPluginManager, + *, + invocation_params: InvocationParams | None = None, + ) -> None: + from .argparsing import FILE_OR_DIR + from .argparsing import Parser + + if invocation_params is None: + invocation_params = self.InvocationParams( + args=(), plugins=None, dir=pathlib.Path.cwd() + ) + + self.option = argparse.Namespace() + """Access to command line option as attributes. + + :type: argparse.Namespace + """ + + self.invocation_params = invocation_params + """The parameters with which pytest was invoked. + + :type: InvocationParams + """ + + _a = FILE_OR_DIR + self._parser = Parser( + usage=f"%(prog)s [options] [{_a}] [{_a}] [...]", + processopt=self._processopt, + _ispytest=True, + ) + self.pluginmanager = pluginmanager + """The plugin manager handles plugin registration and hook invocation. + + :type: PytestPluginManager + """ + + self.stash = Stash() + """A place where plugins can store information on the config for their + own use. + + :type: Stash + """ + # Deprecated alias. Was never public. Can be removed in a few releases. + self._store = self.stash + + self.trace = self.pluginmanager.trace.root.get("config") + self.hook: pluggy.HookRelay = PathAwareHookProxy(self.pluginmanager.hook) # type: ignore[assignment] + self._inicache: dict[str, Any] = {} + self._override_ini: Sequence[str] = () + self._opt2dest: dict[str, str] = {} + self._cleanup: list[Callable[[], None]] = [] + self.pluginmanager.register(self, "pytestconfig") + self._configured = False + self.hook.pytest_addoption.call_historic( + kwargs=dict(parser=self._parser, pluginmanager=self.pluginmanager) + ) + self.args_source = Config.ArgsSource.ARGS + self.args: list[str] = [] + + @property + def rootpath(self) -> pathlib.Path: + """The path to the :ref:`rootdir `. + + :type: pathlib.Path + + .. versionadded:: 6.1 + """ + return self._rootpath + + @property + def inipath(self) -> pathlib.Path | None: + """The path to the :ref:`configfile `. + + .. versionadded:: 6.1 + """ + return self._inipath + + def add_cleanup(self, func: Callable[[], None]) -> None: + """Add a function to be called when the config object gets out of + use (usually coinciding with pytest_unconfigure).""" + self._cleanup.append(func) + + def _do_configure(self) -> None: + assert not self._configured + self._configured = True + with warnings.catch_warnings(): + warnings.simplefilter("default") + self.hook.pytest_configure.call_historic(kwargs=dict(config=self)) + + def _ensure_unconfigure(self) -> None: + if self._configured: + self._configured = False + self.hook.pytest_unconfigure(config=self) + self.hook.pytest_configure._call_history = [] + while self._cleanup: + fin = self._cleanup.pop() + fin() + + def get_terminal_writer(self) -> TerminalWriter: + terminalreporter: TerminalReporter | None = self.pluginmanager.get_plugin( + "terminalreporter" + ) + assert terminalreporter is not None + return terminalreporter._tw + + def pytest_cmdline_parse( + self, pluginmanager: PytestPluginManager, args: list[str] + ) -> Config: + try: + self.parse(args) + except UsageError: + # Handle --version and --help here in a minimal fashion. + # This gets done via helpconfig normally, but its + # pytest_cmdline_main is not called in case of errors. + if getattr(self.option, "version", False) or "--version" in args: + from _pytest.helpconfig import showversion + + showversion(self) + elif ( + getattr(self.option, "help", False) or "--help" in args or "-h" in args + ): + self._parser._getparser().print_help() + sys.stdout.write( + "\nNOTE: displaying only minimal help due to UsageError.\n\n" + ) + + raise + + return self + + def notify_exception( + self, + excinfo: ExceptionInfo[BaseException], + option: argparse.Namespace | None = None, + ) -> None: + if option and getattr(option, "fulltrace", False): + style: TracebackStyle = "long" + else: + style = "native" + excrepr = excinfo.getrepr( + funcargs=True, showlocals=getattr(option, "showlocals", False), style=style + ) + res = self.hook.pytest_internalerror(excrepr=excrepr, excinfo=excinfo) + if not any(res): + for line in str(excrepr).split("\n"): + sys.stderr.write(f"INTERNALERROR> {line}\n") + sys.stderr.flush() + + def cwd_relative_nodeid(self, nodeid: str) -> str: + # nodeid's are relative to the rootpath, compute relative to cwd. + if self.invocation_params.dir != self.rootpath: + base_path_part, *nodeid_part = nodeid.split("::") + # Only process path part + fullpath = self.rootpath / base_path_part + relative_path = bestrelpath(self.invocation_params.dir, fullpath) + + nodeid = "::".join([relative_path, *nodeid_part]) + return nodeid + + @classmethod + def fromdictargs(cls, option_dict, args) -> Config: + """Constructor usable for subprocesses.""" + config = get_config(args) + config.option.__dict__.update(option_dict) + config.parse(args, addopts=False) + for x in config.option.plugins: + config.pluginmanager.consider_pluginarg(x) + return config + + def _processopt(self, opt: Argument) -> None: + for name in opt._short_opts + opt._long_opts: + self._opt2dest[name] = opt.dest + + if hasattr(opt, "default"): + if not hasattr(self.option, opt.dest): + setattr(self.option, opt.dest, opt.default) + + @hookimpl(trylast=True) + def pytest_load_initial_conftests(self, early_config: Config) -> None: + # We haven't fully parsed the command line arguments yet, so + # early_config.args it not set yet. But we need it for + # discovering the initial conftests. So "pre-run" the logic here. + # It will be done for real in `parse()`. + args, args_source = early_config._decide_args( + args=early_config.known_args_namespace.file_or_dir, + pyargs=early_config.known_args_namespace.pyargs, + testpaths=early_config.getini("testpaths"), + invocation_dir=early_config.invocation_params.dir, + rootpath=early_config.rootpath, + warn=False, + ) + self.pluginmanager._set_initial_conftests( + args=args, + pyargs=early_config.known_args_namespace.pyargs, + noconftest=early_config.known_args_namespace.noconftest, + rootpath=early_config.rootpath, + confcutdir=early_config.known_args_namespace.confcutdir, + invocation_dir=early_config.invocation_params.dir, + importmode=early_config.known_args_namespace.importmode, + consider_namespace_packages=early_config.getini( + "consider_namespace_packages" + ), + ) + + def _initini(self, args: Sequence[str]) -> None: + ns, unknown_args = self._parser.parse_known_and_unknown_args( + args, namespace=copy.copy(self.option) + ) + rootpath, inipath, inicfg = determine_setup( + inifile=ns.inifilename, + args=ns.file_or_dir + unknown_args, + rootdir_cmd_arg=ns.rootdir or None, + invocation_dir=self.invocation_params.dir, + ) + self._rootpath = rootpath + self._inipath = inipath + self.inicfg = inicfg + self._parser.extra_info["rootdir"] = str(self.rootpath) + self._parser.extra_info["inifile"] = str(self.inipath) + self._parser.addini("addopts", "Extra command line options", "args") + self._parser.addini("minversion", "Minimally required pytest version") + self._parser.addini( + "required_plugins", + "Plugins that must be present for pytest to run", + type="args", + default=[], + ) + self._override_ini = ns.override_ini or () + + def _consider_importhook(self, args: Sequence[str]) -> None: + """Install the PEP 302 import hook if using assertion rewriting. + + Needs to parse the --assert= option from the commandline + and find all the installed plugins to mark them for rewriting + by the importhook. + """ + ns, unknown_args = self._parser.parse_known_and_unknown_args(args) + mode = getattr(ns, "assertmode", "plain") + if mode == "rewrite": + import _pytest.assertion + + try: + hook = _pytest.assertion.install_importhook(self) + except SystemError: + mode = "plain" + else: + self._mark_plugins_for_rewrite(hook) + self._warn_about_missing_assertion(mode) + + def _mark_plugins_for_rewrite(self, hook) -> None: + """Given an importhook, mark for rewrite any top-level + modules or packages in the distribution package for + all pytest plugins.""" + self.pluginmanager.rewrite_hook = hook + + if os.environ.get("PYTEST_DISABLE_PLUGIN_AUTOLOAD"): + # We don't autoload from distribution package entry points, + # no need to continue. + return + + package_files = ( + str(file) + for dist in importlib.metadata.distributions() + if any(ep.group == "pytest11" for ep in dist.entry_points) + for file in dist.files or [] + ) + + for name in _iter_rewritable_modules(package_files): + hook.mark_rewrite(name) + + def _validate_args(self, args: list[str], via: str) -> list[str]: + """Validate known args.""" + self._parser._config_source_hint = via # type: ignore + try: + self._parser.parse_known_and_unknown_args( + args, namespace=copy.copy(self.option) + ) + finally: + del self._parser._config_source_hint # type: ignore + + return args + + def _decide_args( + self, + *, + args: list[str], + pyargs: bool, + testpaths: list[str], + invocation_dir: pathlib.Path, + rootpath: pathlib.Path, + warn: bool, + ) -> tuple[list[str], ArgsSource]: + """Decide the args (initial paths/nodeids) to use given the relevant inputs. + + :param warn: Whether can issue warnings. + + :returns: The args and the args source. Guaranteed to be non-empty. + """ + if args: + source = Config.ArgsSource.ARGS + result = args + else: + if invocation_dir == rootpath: + source = Config.ArgsSource.TESTPATHS + if pyargs: + result = testpaths + else: + result = [] + for path in testpaths: + result.extend(sorted(glob.iglob(path, recursive=True))) + if testpaths and not result: + if warn: + warning_text = ( + "No files were found in testpaths; " + "consider removing or adjusting your testpaths configuration. " + "Searching recursively from the current directory instead." + ) + self.issue_config_time_warning( + PytestConfigWarning(warning_text), stacklevel=3 + ) + else: + result = [] + if not result: + source = Config.ArgsSource.INVOCATION_DIR + result = [str(invocation_dir)] + return result, source + + def _preparse(self, args: list[str], addopts: bool = True) -> None: + if addopts: + env_addopts = os.environ.get("PYTEST_ADDOPTS", "") + if len(env_addopts): + args[:] = ( + self._validate_args(shlex.split(env_addopts), "via PYTEST_ADDOPTS") + + args + ) + self._initini(args) + if addopts: + args[:] = ( + self._validate_args(self.getini("addopts"), "via addopts config") + args + ) + + self.known_args_namespace = self._parser.parse_known_args( + args, namespace=copy.copy(self.option) + ) + self._checkversion() + self._consider_importhook(args) + self.pluginmanager.consider_preparse(args, exclude_only=False) + if not os.environ.get("PYTEST_DISABLE_PLUGIN_AUTOLOAD"): + # Don't autoload from distribution package entry point. Only + # explicitly specified plugins are going to be loaded. + self.pluginmanager.load_setuptools_entrypoints("pytest11") + self.pluginmanager.consider_env() + + self.known_args_namespace = self._parser.parse_known_args( + args, namespace=copy.copy(self.known_args_namespace) + ) + + self._validate_plugins() + self._warn_about_skipped_plugins() + + if self.known_args_namespace.confcutdir is None: + if self.inipath is not None: + confcutdir = str(self.inipath.parent) + else: + confcutdir = str(self.rootpath) + self.known_args_namespace.confcutdir = confcutdir + try: + self.hook.pytest_load_initial_conftests( + early_config=self, args=args, parser=self._parser + ) + except ConftestImportFailure as e: + if self.known_args_namespace.help or self.known_args_namespace.version: + # we don't want to prevent --help/--version to work + # so just let is pass and print a warning at the end + self.issue_config_time_warning( + PytestConfigWarning(f"could not load initial conftests: {e.path}"), + stacklevel=2, + ) + else: + raise + + @hookimpl(wrapper=True) + def pytest_collection(self) -> Generator[None, object, object]: + # Validate invalid ini keys after collection is done so we take in account + # options added by late-loading conftest files. + try: + return (yield) + finally: + self._validate_config_options() + + def _checkversion(self) -> None: + import pytest + + minver = self.inicfg.get("minversion", None) + if minver: + # Imported lazily to improve start-up time. + from packaging.version import Version + + if not isinstance(minver, str): + raise pytest.UsageError( + f"{self.inipath}: 'minversion' must be a single value" + ) + + if Version(minver) > Version(pytest.__version__): + raise pytest.UsageError( + f"{self.inipath}: 'minversion' requires pytest-{minver}, actual pytest-{pytest.__version__}'" + ) + + def _validate_config_options(self) -> None: + for key in sorted(self._get_unknown_ini_keys()): + self._warn_or_fail_if_strict(f"Unknown config option: {key}\n") + + def _validate_plugins(self) -> None: + required_plugins = sorted(self.getini("required_plugins")) + if not required_plugins: + return + + # Imported lazily to improve start-up time. + from packaging.requirements import InvalidRequirement + from packaging.requirements import Requirement + from packaging.version import Version + + plugin_info = self.pluginmanager.list_plugin_distinfo() + plugin_dist_info = {dist.project_name: dist.version for _, dist in plugin_info} + + missing_plugins = [] + for required_plugin in required_plugins: + try: + req = Requirement(required_plugin) + except InvalidRequirement: + missing_plugins.append(required_plugin) + continue + + if req.name not in plugin_dist_info: + missing_plugins.append(required_plugin) + elif not req.specifier.contains( + Version(plugin_dist_info[req.name]), prereleases=True + ): + missing_plugins.append(required_plugin) + + if missing_plugins: + raise UsageError( + "Missing required plugins: {}".format(", ".join(missing_plugins)), + ) + + def _warn_or_fail_if_strict(self, message: str) -> None: + if self.known_args_namespace.strict_config: + raise UsageError(message) + + self.issue_config_time_warning(PytestConfigWarning(message), stacklevel=3) + + def _get_unknown_ini_keys(self) -> list[str]: + parser_inicfg = self._parser._inidict + return [name for name in self.inicfg if name not in parser_inicfg] + + def parse(self, args: list[str], addopts: bool = True) -> None: + # Parse given cmdline arguments into this config object. + assert ( + self.args == [] + ), "can only parse cmdline args at most once per Config object" + self.hook.pytest_addhooks.call_historic( + kwargs=dict(pluginmanager=self.pluginmanager) + ) + self._preparse(args, addopts=addopts) + self._parser.after_preparse = True # type: ignore + try: + args = self._parser.parse_setoption( + args, self.option, namespace=self.option + ) + self.args, self.args_source = self._decide_args( + args=args, + pyargs=self.known_args_namespace.pyargs, + testpaths=self.getini("testpaths"), + invocation_dir=self.invocation_params.dir, + rootpath=self.rootpath, + warn=True, + ) + except PrintHelp: + pass + + def issue_config_time_warning(self, warning: Warning, stacklevel: int) -> None: + """Issue and handle a warning during the "configure" stage. + + During ``pytest_configure`` we can't capture warnings using the ``catch_warnings_for_item`` + function because it is not possible to have hook wrappers around ``pytest_configure``. + + This function is mainly intended for plugins that need to issue warnings during + ``pytest_configure`` (or similar stages). + + :param warning: The warning instance. + :param stacklevel: stacklevel forwarded to warnings.warn. + """ + if self.pluginmanager.is_blocked("warnings"): + return + + cmdline_filters = self.known_args_namespace.pythonwarnings or [] + config_filters = self.getini("filterwarnings") + + with warnings.catch_warnings(record=True) as records: + warnings.simplefilter("always", type(warning)) + apply_warning_filters(config_filters, cmdline_filters) + warnings.warn(warning, stacklevel=stacklevel) + + if records: + frame = sys._getframe(stacklevel - 1) + location = frame.f_code.co_filename, frame.f_lineno, frame.f_code.co_name + self.hook.pytest_warning_recorded.call_historic( + kwargs=dict( + warning_message=records[0], + when="config", + nodeid="", + location=location, + ) + ) + + def addinivalue_line(self, name: str, line: str) -> None: + """Add a line to an ini-file option. The option must have been + declared but might not yet be set in which case the line becomes + the first line in its value.""" + x = self.getini(name) + assert isinstance(x, list) + x.append(line) # modifies the cached list inline + + def getini(self, name: str): + """Return configuration value from an :ref:`ini file `. + + If a configuration value is not defined in an + :ref:`ini file `, then the ``default`` value provided while + registering the configuration through + :func:`parser.addini ` will be returned. + Please note that you can even provide ``None`` as a valid + default value. + + If ``default`` is not provided while registering using + :func:`parser.addini `, then a default value + based on the ``type`` parameter passed to + :func:`parser.addini ` will be returned. + The default values based on ``type`` are: + ``paths``, ``pathlist``, ``args`` and ``linelist`` : empty list ``[]`` + ``bool`` : ``False`` + ``string`` : empty string ``""`` + + If neither the ``default`` nor the ``type`` parameter is passed + while registering the configuration through + :func:`parser.addini `, then the configuration + is treated as a string and a default empty string '' is returned. + + If the specified name hasn't been registered through a prior + :func:`parser.addini ` call (usually from a + plugin), a ValueError is raised. + """ + try: + return self._inicache[name] + except KeyError: + self._inicache[name] = val = self._getini(name) + return val + + # Meant for easy monkeypatching by legacypath plugin. + # Can be inlined back (with no cover removed) once legacypath is gone. + def _getini_unknown_type(self, name: str, type: str, value: str | list[str]): + msg = f"unknown configuration type: {type}" + raise ValueError(msg, value) # pragma: no cover + + def _getini(self, name: str): + try: + description, type, default = self._parser._inidict[name] + except KeyError as e: + raise ValueError(f"unknown configuration value: {name!r}") from e + override_value = self._get_override_ini_value(name) + if override_value is None: + try: + value = self.inicfg[name] + except KeyError: + return default + else: + value = override_value + # Coerce the values based on types. + # + # Note: some coercions are only required if we are reading from .ini files, because + # the file format doesn't contain type information, but when reading from toml we will + # get either str or list of str values (see _parse_ini_config_from_pyproject_toml). + # For example: + # + # ini: + # a_line_list = "tests acceptance" + # in this case, we need to split the string to obtain a list of strings. + # + # toml: + # a_line_list = ["tests", "acceptance"] + # in this case, we already have a list ready to use. + # + if type == "paths": + dp = ( + self.inipath.parent + if self.inipath is not None + else self.invocation_params.dir + ) + input_values = shlex.split(value) if isinstance(value, str) else value + return [dp / x for x in input_values] + elif type == "args": + return shlex.split(value) if isinstance(value, str) else value + elif type == "linelist": + if isinstance(value, str): + return [t for t in map(lambda x: x.strip(), value.split("\n")) if t] + else: + return value + elif type == "bool": + return _strtobool(str(value).strip()) + elif type == "string": + return value + elif type is None: + return value + else: + return self._getini_unknown_type(name, type, value) + + def _getconftest_pathlist( + self, name: str, path: pathlib.Path + ) -> list[pathlib.Path] | None: + try: + mod, relroots = self.pluginmanager._rget_with_confmod(name, path) + except KeyError: + return None + assert mod.__file__ is not None + modpath = pathlib.Path(mod.__file__).parent + values: list[pathlib.Path] = [] + for relroot in relroots: + if isinstance(relroot, os.PathLike): + relroot = pathlib.Path(relroot) + else: + relroot = relroot.replace("/", os.sep) + relroot = absolutepath(modpath / relroot) + values.append(relroot) + return values + + def _get_override_ini_value(self, name: str) -> str | None: + value = None + # override_ini is a list of "ini=value" options. + # Always use the last item if multiple values are set for same ini-name, + # e.g. -o foo=bar1 -o foo=bar2 will set foo to bar2. + for ini_config in self._override_ini: + try: + key, user_ini_value = ini_config.split("=", 1) + except ValueError as e: + raise UsageError( + f"-o/--override-ini expects option=value style (got: {ini_config!r})." + ) from e + else: + if key == name: + value = user_ini_value + return value + + def getoption(self, name: str, default=notset, skip: bool = False): + """Return command line option value. + + :param name: Name of the option. You may also specify + the literal ``--OPT`` option instead of the "dest" option name. + :param default: Default value if no option of that name exists. + :param skip: If True, raise pytest.skip if option does not exists + or has a None value. + """ + name = self._opt2dest.get(name, name) + try: + val = getattr(self.option, name) + if val is None and skip: + raise AttributeError(name) + return val + except AttributeError as e: + if default is not notset: + return default + if skip: + import pytest + + pytest.skip(f"no {name!r} option found") + raise ValueError(f"no option named {name!r}") from e + + def getvalue(self, name: str, path=None): + """Deprecated, use getoption() instead.""" + return self.getoption(name) + + def getvalueorskip(self, name: str, path=None): + """Deprecated, use getoption(skip=True) instead.""" + return self.getoption(name, skip=True) + + #: Verbosity type for failed assertions (see :confval:`verbosity_assertions`). + VERBOSITY_ASSERTIONS: Final = "assertions" + #: Verbosity type for test case execution (see :confval:`verbosity_test_cases`). + VERBOSITY_TEST_CASES: Final = "test_cases" + _VERBOSITY_INI_DEFAULT: Final = "auto" + + def get_verbosity(self, verbosity_type: str | None = None) -> int: + r"""Retrieve the verbosity level for a fine-grained verbosity type. + + :param verbosity_type: Verbosity type to get level for. If a level is + configured for the given type, that value will be returned. If the + given type is not a known verbosity type, the global verbosity + level will be returned. If the given type is None (default), the + global verbosity level will be returned. + + To configure a level for a fine-grained verbosity type, the + configuration file should have a setting for the configuration name + and a numeric value for the verbosity level. A special value of "auto" + can be used to explicitly use the global verbosity level. + + Example: + + .. code-block:: ini + + # content of pytest.ini + [pytest] + verbosity_assertions = 2 + + .. code-block:: console + + pytest -v + + .. code-block:: python + + print(config.get_verbosity()) # 1 + print(config.get_verbosity(Config.VERBOSITY_ASSERTIONS)) # 2 + """ + global_level = self.getoption("verbose", default=0) + assert isinstance(global_level, int) + if verbosity_type is None: + return global_level + + ini_name = Config._verbosity_ini_name(verbosity_type) + if ini_name not in self._parser._inidict: + return global_level + + level = self.getini(ini_name) + if level == Config._VERBOSITY_INI_DEFAULT: + return global_level + + return int(level) + + @staticmethod + def _verbosity_ini_name(verbosity_type: str) -> str: + return f"verbosity_{verbosity_type}" + + @staticmethod + def _add_verbosity_ini(parser: Parser, verbosity_type: str, help: str) -> None: + """Add a output verbosity configuration option for the given output type. + + :param parser: Parser for command line arguments and ini-file values. + :param verbosity_type: Fine-grained verbosity category. + :param help: Description of the output this type controls. + + The value should be retrieved via a call to + :py:func:`config.get_verbosity(type) `. + """ + parser.addini( + Config._verbosity_ini_name(verbosity_type), + help=help, + type="string", + default=Config._VERBOSITY_INI_DEFAULT, + ) + + def _warn_about_missing_assertion(self, mode: str) -> None: + if not _assertion_supported(): + if mode == "plain": + warning_text = ( + "ASSERTIONS ARE NOT EXECUTED" + " and FAILING TESTS WILL PASS. Are you" + " using python -O?" + ) + else: + warning_text = ( + "assertions not in test modules or" + " plugins will be ignored" + " because assert statements are not executed " + "by the underlying Python interpreter " + "(are you using python -O?)\n" + ) + self.issue_config_time_warning( + PytestConfigWarning(warning_text), + stacklevel=3, + ) + + def _warn_about_skipped_plugins(self) -> None: + for module_name, msg in self.pluginmanager.skipped_plugins: + self.issue_config_time_warning( + PytestConfigWarning(f"skipped plugin {module_name!r}: {msg}"), + stacklevel=2, + ) + + +def _assertion_supported() -> bool: + try: + assert False + except AssertionError: + return True + else: + return False # type: ignore[unreachable] + + +def create_terminal_writer( + config: Config, file: TextIO | None = None +) -> TerminalWriter: + """Create a TerminalWriter instance configured according to the options + in the config object. + + Every code which requires a TerminalWriter object and has access to a + config object should use this function. + """ + tw = TerminalWriter(file=file) + + if config.option.color == "yes": + tw.hasmarkup = True + elif config.option.color == "no": + tw.hasmarkup = False + + if config.option.code_highlight == "yes": + tw.code_highlight = True + elif config.option.code_highlight == "no": + tw.code_highlight = False + + return tw + + +def _strtobool(val: str) -> bool: + """Convert a string representation of truth to True or False. + + True values are 'y', 'yes', 't', 'true', 'on', and '1'; false values + are 'n', 'no', 'f', 'false', 'off', and '0'. Raises ValueError if + 'val' is anything else. + + .. note:: Copied from distutils.util. + """ + val = val.lower() + if val in ("y", "yes", "t", "true", "on", "1"): + return True + elif val in ("n", "no", "f", "false", "off", "0"): + return False + else: + raise ValueError(f"invalid truth value {val!r}") + + +@lru_cache(maxsize=50) +def parse_warning_filter( + arg: str, *, escape: bool +) -> tuple[warnings._ActionKind, str, type[Warning], str, int]: + """Parse a warnings filter string. + + This is copied from warnings._setoption with the following changes: + + * Does not apply the filter. + * Escaping is optional. + * Raises UsageError so we get nice error messages on failure. + """ + __tracebackhide__ = True + error_template = dedent( + f"""\ + while parsing the following warning configuration: + + {arg} + + This error occurred: + + {{error}} + """ + ) + + parts = arg.split(":") + if len(parts) > 5: + doc_url = ( + "https://docs.python.org/3/library/warnings.html#describing-warning-filters" + ) + error = dedent( + f"""\ + Too many fields ({len(parts)}), expected at most 5 separated by colons: + + action:message:category:module:line + + For more information please consult: {doc_url} + """ + ) + raise UsageError(error_template.format(error=error)) + + while len(parts) < 5: + parts.append("") + action_, message, category_, module, lineno_ = (s.strip() for s in parts) + try: + action: warnings._ActionKind = warnings._getaction(action_) # type: ignore[attr-defined] + except warnings._OptionError as e: + raise UsageError(error_template.format(error=str(e))) from None + try: + category: type[Warning] = _resolve_warning_category(category_) + except Exception: + exc_info = ExceptionInfo.from_current() + exception_text = exc_info.getrepr(style="native") + raise UsageError(error_template.format(error=exception_text)) from None + if message and escape: + message = re.escape(message) + if module and escape: + module = re.escape(module) + r"\Z" + if lineno_: + try: + lineno = int(lineno_) + if lineno < 0: + raise ValueError("number is negative") + except ValueError as e: + raise UsageError( + error_template.format(error=f"invalid lineno {lineno_!r}: {e}") + ) from None + else: + lineno = 0 + return action, message, category, module, lineno + + +def _resolve_warning_category(category: str) -> type[Warning]: + """ + Copied from warnings._getcategory, but changed so it lets exceptions (specially ImportErrors) + propagate so we can get access to their tracebacks (#9218). + """ + __tracebackhide__ = True + if not category: + return Warning + + if "." not in category: + import builtins as m + + klass = category + else: + module, _, klass = category.rpartition(".") + m = __import__(module, None, None, [klass]) + cat = getattr(m, klass) + if not issubclass(cat, Warning): + raise UsageError(f"{cat} is not a Warning subclass") + return cast(Type[Warning], cat) + + +def apply_warning_filters( + config_filters: Iterable[str], cmdline_filters: Iterable[str] +) -> None: + """Applies pytest-configured filters to the warnings module""" + # Filters should have this precedence: cmdline options, config. + # Filters should be applied in the inverse order of precedence. + for arg in config_filters: + warnings.filterwarnings(*parse_warning_filter(arg, escape=False)) + + for arg in cmdline_filters: + warnings.filterwarnings(*parse_warning_filter(arg, escape=True)) diff --git a/.venv/Lib/site-packages/_pytest/config/argparsing.py b/.venv/Lib/site-packages/_pytest/config/argparsing.py new file mode 100644 index 00000000..85aa4632 --- /dev/null +++ b/.venv/Lib/site-packages/_pytest/config/argparsing.py @@ -0,0 +1,551 @@ +# mypy: allow-untyped-defs +from __future__ import annotations + +import argparse +from gettext import gettext +import os +import sys +from typing import Any +from typing import Callable +from typing import cast +from typing import final +from typing import List +from typing import Literal +from typing import Mapping +from typing import NoReturn +from typing import Sequence + +import _pytest._io +from _pytest.config.exceptions import UsageError +from _pytest.deprecated import check_ispytest + + +FILE_OR_DIR = "file_or_dir" + + +class NotSet: + def __repr__(self) -> str: + return "" + + +NOT_SET = NotSet() + + +@final +class Parser: + """Parser for command line arguments and ini-file values. + + :ivar extra_info: Dict of generic param -> value to display in case + there's an error processing the command line arguments. + """ + + prog: str | None = None + + def __init__( + self, + usage: str | None = None, + processopt: Callable[[Argument], None] | None = None, + *, + _ispytest: bool = False, + ) -> None: + check_ispytest(_ispytest) + self._anonymous = OptionGroup("Custom options", parser=self, _ispytest=True) + self._groups: list[OptionGroup] = [] + self._processopt = processopt + self._usage = usage + self._inidict: dict[str, tuple[str, str | None, Any]] = {} + self._ininames: list[str] = [] + self.extra_info: dict[str, Any] = {} + + def processoption(self, option: Argument) -> None: + if self._processopt: + if option.dest: + self._processopt(option) + + def getgroup( + self, name: str, description: str = "", after: str | None = None + ) -> OptionGroup: + """Get (or create) a named option Group. + + :param name: Name of the option group. + :param description: Long description for --help output. + :param after: Name of another group, used for ordering --help output. + :returns: The option group. + + The returned group object has an ``addoption`` method with the same + signature as :func:`parser.addoption ` but + will be shown in the respective group in the output of + ``pytest --help``. + """ + for group in self._groups: + if group.name == name: + return group + group = OptionGroup(name, description, parser=self, _ispytest=True) + i = 0 + for i, grp in enumerate(self._groups): + if grp.name == after: + break + self._groups.insert(i + 1, group) + return group + + def addoption(self, *opts: str, **attrs: Any) -> None: + """Register a command line option. + + :param opts: + Option names, can be short or long options. + :param attrs: + Same attributes as the argparse library's :meth:`add_argument() + ` function accepts. + + After command line parsing, options are available on the pytest config + object via ``config.option.NAME`` where ``NAME`` is usually set + by passing a ``dest`` attribute, for example + ``addoption("--long", dest="NAME", ...)``. + """ + self._anonymous.addoption(*opts, **attrs) + + def parse( + self, + args: Sequence[str | os.PathLike[str]], + namespace: argparse.Namespace | None = None, + ) -> argparse.Namespace: + from _pytest._argcomplete import try_argcomplete + + self.optparser = self._getparser() + try_argcomplete(self.optparser) + strargs = [os.fspath(x) for x in args] + return self.optparser.parse_args(strargs, namespace=namespace) + + def _getparser(self) -> MyOptionParser: + from _pytest._argcomplete import filescompleter + + optparser = MyOptionParser(self, self.extra_info, prog=self.prog) + groups = [*self._groups, self._anonymous] + for group in groups: + if group.options: + desc = group.description or group.name + arggroup = optparser.add_argument_group(desc) + for option in group.options: + n = option.names() + a = option.attrs() + arggroup.add_argument(*n, **a) + file_or_dir_arg = optparser.add_argument(FILE_OR_DIR, nargs="*") + # bash like autocompletion for dirs (appending '/') + # Type ignored because typeshed doesn't know about argcomplete. + file_or_dir_arg.completer = filescompleter # type: ignore + return optparser + + def parse_setoption( + self, + args: Sequence[str | os.PathLike[str]], + option: argparse.Namespace, + namespace: argparse.Namespace | None = None, + ) -> list[str]: + parsedoption = self.parse(args, namespace=namespace) + for name, value in parsedoption.__dict__.items(): + setattr(option, name, value) + return cast(List[str], getattr(parsedoption, FILE_OR_DIR)) + + def parse_known_args( + self, + args: Sequence[str | os.PathLike[str]], + namespace: argparse.Namespace | None = None, + ) -> argparse.Namespace: + """Parse the known arguments at this point. + + :returns: An argparse namespace object. + """ + return self.parse_known_and_unknown_args(args, namespace=namespace)[0] + + def parse_known_and_unknown_args( + self, + args: Sequence[str | os.PathLike[str]], + namespace: argparse.Namespace | None = None, + ) -> tuple[argparse.Namespace, list[str]]: + """Parse the known arguments at this point, and also return the + remaining unknown arguments. + + :returns: + A tuple containing an argparse namespace object for the known + arguments, and a list of the unknown arguments. + """ + optparser = self._getparser() + strargs = [os.fspath(x) for x in args] + return optparser.parse_known_args(strargs, namespace=namespace) + + def addini( + self, + name: str, + help: str, + type: Literal["string", "paths", "pathlist", "args", "linelist", "bool"] + | None = None, + default: Any = NOT_SET, + ) -> None: + """Register an ini-file option. + + :param name: + Name of the ini-variable. + :param type: + Type of the variable. Can be: + + * ``string``: a string + * ``bool``: a boolean + * ``args``: a list of strings, separated as in a shell + * ``linelist``: a list of strings, separated by line breaks + * ``paths``: a list of :class:`pathlib.Path`, separated as in a shell + * ``pathlist``: a list of ``py.path``, separated as in a shell + + For ``paths`` and ``pathlist`` types, they are considered relative to the ini-file. + In case the execution is happening without an ini-file defined, + they will be considered relative to the current working directory (for example with ``--override-ini``). + + .. versionadded:: 7.0 + The ``paths`` variable type. + + .. versionadded:: 8.1 + Use the current working directory to resolve ``paths`` and ``pathlist`` in the absence of an ini-file. + + Defaults to ``string`` if ``None`` or not passed. + :param default: + Default value if no ini-file option exists but is queried. + + The value of ini-variables can be retrieved via a call to + :py:func:`config.getini(name) `. + """ + assert type in (None, "string", "paths", "pathlist", "args", "linelist", "bool") + if default is NOT_SET: + default = get_ini_default_for_type(type) + + self._inidict[name] = (help, type, default) + self._ininames.append(name) + + +def get_ini_default_for_type( + type: Literal["string", "paths", "pathlist", "args", "linelist", "bool"] | None, +) -> Any: + """ + Used by addini to get the default value for a given ini-option type, when + default is not supplied. + """ + if type is None: + return "" + elif type in ("paths", "pathlist", "args", "linelist"): + return [] + elif type == "bool": + return False + else: + return "" + + +class ArgumentError(Exception): + """Raised if an Argument instance is created with invalid or + inconsistent arguments.""" + + def __init__(self, msg: str, option: Argument | str) -> None: + self.msg = msg + self.option_id = str(option) + + def __str__(self) -> str: + if self.option_id: + return f"option {self.option_id}: {self.msg}" + else: + return self.msg + + +class Argument: + """Class that mimics the necessary behaviour of optparse.Option. + + It's currently a least effort implementation and ignoring choices + and integer prefixes. + + https://docs.python.org/3/library/optparse.html#optparse-standard-option-types + """ + + def __init__(self, *names: str, **attrs: Any) -> None: + """Store params in private vars for use in add_argument.""" + self._attrs = attrs + self._short_opts: list[str] = [] + self._long_opts: list[str] = [] + try: + self.type = attrs["type"] + except KeyError: + pass + try: + # Attribute existence is tested in Config._processopt. + self.default = attrs["default"] + except KeyError: + pass + self._set_opt_strings(names) + dest: str | None = attrs.get("dest") + if dest: + self.dest = dest + elif self._long_opts: + self.dest = self._long_opts[0][2:].replace("-", "_") + else: + try: + self.dest = self._short_opts[0][1:] + except IndexError as e: + self.dest = "???" # Needed for the error repr. + raise ArgumentError("need a long or short option", self) from e + + def names(self) -> list[str]: + return self._short_opts + self._long_opts + + def attrs(self) -> Mapping[str, Any]: + # Update any attributes set by processopt. + attrs = "default dest help".split() + attrs.append(self.dest) + for attr in attrs: + try: + self._attrs[attr] = getattr(self, attr) + except AttributeError: + pass + return self._attrs + + def _set_opt_strings(self, opts: Sequence[str]) -> None: + """Directly from optparse. + + Might not be necessary as this is passed to argparse later on. + """ + for opt in opts: + if len(opt) < 2: + raise ArgumentError( + f"invalid option string {opt!r}: " + "must be at least two characters long", + self, + ) + elif len(opt) == 2: + if not (opt[0] == "-" and opt[1] != "-"): + raise ArgumentError( + f"invalid short option string {opt!r}: " + "must be of the form -x, (x any non-dash char)", + self, + ) + self._short_opts.append(opt) + else: + if not (opt[0:2] == "--" and opt[2] != "-"): + raise ArgumentError( + f"invalid long option string {opt!r}: " + "must start with --, followed by non-dash", + self, + ) + self._long_opts.append(opt) + + def __repr__(self) -> str: + args: list[str] = [] + if self._short_opts: + args += ["_short_opts: " + repr(self._short_opts)] + if self._long_opts: + args += ["_long_opts: " + repr(self._long_opts)] + args += ["dest: " + repr(self.dest)] + if hasattr(self, "type"): + args += ["type: " + repr(self.type)] + if hasattr(self, "default"): + args += ["default: " + repr(self.default)] + return "Argument({})".format(", ".join(args)) + + +class OptionGroup: + """A group of options shown in its own section.""" + + def __init__( + self, + name: str, + description: str = "", + parser: Parser | None = None, + *, + _ispytest: bool = False, + ) -> None: + check_ispytest(_ispytest) + self.name = name + self.description = description + self.options: list[Argument] = [] + self.parser = parser + + def addoption(self, *opts: str, **attrs: Any) -> None: + """Add an option to this group. + + If a shortened version of a long option is specified, it will + be suppressed in the help. ``addoption('--twowords', '--two-words')`` + results in help showing ``--two-words`` only, but ``--twowords`` gets + accepted **and** the automatic destination is in ``args.twowords``. + + :param opts: + Option names, can be short or long options. + :param attrs: + Same attributes as the argparse library's :meth:`add_argument() + ` function accepts. + """ + conflict = set(opts).intersection( + name for opt in self.options for name in opt.names() + ) + if conflict: + raise ValueError(f"option names {conflict} already added") + option = Argument(*opts, **attrs) + self._addoption_instance(option, shortupper=False) + + def _addoption(self, *opts: str, **attrs: Any) -> None: + option = Argument(*opts, **attrs) + self._addoption_instance(option, shortupper=True) + + def _addoption_instance(self, option: Argument, shortupper: bool = False) -> None: + if not shortupper: + for opt in option._short_opts: + if opt[0] == "-" and opt[1].islower(): + raise ValueError("lowercase shortoptions reserved") + if self.parser: + self.parser.processoption(option) + self.options.append(option) + + +class MyOptionParser(argparse.ArgumentParser): + def __init__( + self, + parser: Parser, + extra_info: dict[str, Any] | None = None, + prog: str | None = None, + ) -> None: + self._parser = parser + super().__init__( + prog=prog, + usage=parser._usage, + add_help=False, + formatter_class=DropShorterLongHelpFormatter, + allow_abbrev=False, + fromfile_prefix_chars="@", + ) + # extra_info is a dict of (param -> value) to display if there's + # an usage error to provide more contextual information to the user. + self.extra_info = extra_info if extra_info else {} + + def error(self, message: str) -> NoReturn: + """Transform argparse error message into UsageError.""" + msg = f"{self.prog}: error: {message}" + + if hasattr(self._parser, "_config_source_hint"): + msg = f"{msg} ({self._parser._config_source_hint})" + + raise UsageError(self.format_usage() + msg) + + # Type ignored because typeshed has a very complex type in the superclass. + def parse_args( # type: ignore + self, + args: Sequence[str] | None = None, + namespace: argparse.Namespace | None = None, + ) -> argparse.Namespace: + """Allow splitting of positional arguments.""" + parsed, unrecognized = self.parse_known_args(args, namespace) + if unrecognized: + for arg in unrecognized: + if arg and arg[0] == "-": + lines = [ + "unrecognized arguments: {}".format(" ".join(unrecognized)) + ] + for k, v in sorted(self.extra_info.items()): + lines.append(f" {k}: {v}") + self.error("\n".join(lines)) + getattr(parsed, FILE_OR_DIR).extend(unrecognized) + return parsed + + if sys.version_info < (3, 9): # pragma: no cover + # Backport of https://github.com/python/cpython/pull/14316 so we can + # disable long --argument abbreviations without breaking short flags. + def _parse_optional( + self, arg_string: str + ) -> tuple[argparse.Action | None, str, str | None] | None: + if not arg_string: + return None + if arg_string[0] not in self.prefix_chars: + return None + if arg_string in self._option_string_actions: + action = self._option_string_actions[arg_string] + return action, arg_string, None + if len(arg_string) == 1: + return None + if "=" in arg_string: + option_string, explicit_arg = arg_string.split("=", 1) + if option_string in self._option_string_actions: + action = self._option_string_actions[option_string] + return action, option_string, explicit_arg + if self.allow_abbrev or not arg_string.startswith("--"): + option_tuples = self._get_option_tuples(arg_string) + if len(option_tuples) > 1: + msg = gettext( + "ambiguous option: %(option)s could match %(matches)s" + ) + options = ", ".join(option for _, option, _ in option_tuples) + self.error(msg % {"option": arg_string, "matches": options}) + elif len(option_tuples) == 1: + (option_tuple,) = option_tuples + return option_tuple + if self._negative_number_matcher.match(arg_string): + if not self._has_negative_number_optionals: + return None + if " " in arg_string: + return None + return None, arg_string, None + + +class DropShorterLongHelpFormatter(argparse.HelpFormatter): + """Shorten help for long options that differ only in extra hyphens. + + - Collapse **long** options that are the same except for extra hyphens. + - Shortcut if there are only two options and one of them is a short one. + - Cache result on the action object as this is called at least 2 times. + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + # Use more accurate terminal width. + if "width" not in kwargs: + kwargs["width"] = _pytest._io.get_terminal_width() + super().__init__(*args, **kwargs) + + def _format_action_invocation(self, action: argparse.Action) -> str: + orgstr = super()._format_action_invocation(action) + if orgstr and orgstr[0] != "-": # only optional arguments + return orgstr + res: str | None = getattr(action, "_formatted_action_invocation", None) + if res: + return res + options = orgstr.split(", ") + if len(options) == 2 and (len(options[0]) == 2 or len(options[1]) == 2): + # a shortcut for '-h, --help' or '--abc', '-a' + action._formatted_action_invocation = orgstr # type: ignore + return orgstr + return_list = [] + short_long: dict[str, str] = {} + for option in options: + if len(option) == 2 or option[2] == " ": + continue + if not option.startswith("--"): + raise ArgumentError( + f'long optional argument without "--": [{option}]', option + ) + xxoption = option[2:] + shortened = xxoption.replace("-", "") + if shortened not in short_long or len(short_long[shortened]) < len( + xxoption + ): + short_long[shortened] = xxoption + # now short_long has been filled out to the longest with dashes + # **and** we keep the right option ordering from add_argument + for option in options: + if len(option) == 2 or option[2] == " ": + return_list.append(option) + if option[2:] == short_long.get(option.replace("-", "")): + return_list.append(option.replace(" ", "=", 1)) + formatted_action_invocation = ", ".join(return_list) + action._formatted_action_invocation = formatted_action_invocation # type: ignore + return formatted_action_invocation + + def _split_lines(self, text, width): + """Wrap lines after splitting on original newlines. + + This allows to have explicit line breaks in the help text. + """ + import textwrap + + lines = [] + for line in text.splitlines(): + lines.extend(textwrap.wrap(line.strip(), width)) + return lines diff --git a/.venv/Lib/site-packages/_pytest/config/compat.py b/.venv/Lib/site-packages/_pytest/config/compat.py new file mode 100644 index 00000000..2856d85d --- /dev/null +++ b/.venv/Lib/site-packages/_pytest/config/compat.py @@ -0,0 +1,85 @@ +from __future__ import annotations + +import functools +from pathlib import Path +from typing import Any +from typing import Mapping +import warnings + +import pluggy + +from ..compat import LEGACY_PATH +from ..compat import legacy_path +from ..deprecated import HOOK_LEGACY_PATH_ARG + + +# hookname: (Path, LEGACY_PATH) +imply_paths_hooks: Mapping[str, tuple[str, str]] = { + "pytest_ignore_collect": ("collection_path", "path"), + "pytest_collect_file": ("file_path", "path"), + "pytest_pycollect_makemodule": ("module_path", "path"), + "pytest_report_header": ("start_path", "startdir"), + "pytest_report_collectionfinish": ("start_path", "startdir"), +} + + +def _check_path(path: Path, fspath: LEGACY_PATH) -> None: + if Path(fspath) != path: + raise ValueError( + f"Path({fspath!r}) != {path!r}\n" + "if both path and fspath are given they need to be equal" + ) + + +class PathAwareHookProxy: + """ + this helper wraps around hook callers + until pluggy supports fixingcalls, this one will do + + it currently doesn't return full hook caller proxies for fixed hooks, + this may have to be changed later depending on bugs + """ + + def __init__(self, hook_relay: pluggy.HookRelay) -> None: + self._hook_relay = hook_relay + + def __dir__(self) -> list[str]: + return dir(self._hook_relay) + + def __getattr__(self, key: str) -> pluggy.HookCaller: + hook: pluggy.HookCaller = getattr(self._hook_relay, key) + if key not in imply_paths_hooks: + self.__dict__[key] = hook + return hook + else: + path_var, fspath_var = imply_paths_hooks[key] + + @functools.wraps(hook) + def fixed_hook(**kw: Any) -> Any: + path_value: Path | None = kw.pop(path_var, None) + fspath_value: LEGACY_PATH | None = kw.pop(fspath_var, None) + if fspath_value is not None: + warnings.warn( + HOOK_LEGACY_PATH_ARG.format( + pylib_path_arg=fspath_var, pathlib_path_arg=path_var + ), + stacklevel=2, + ) + if path_value is not None: + if fspath_value is not None: + _check_path(path_value, fspath_value) + else: + fspath_value = legacy_path(path_value) + else: + assert fspath_value is not None + path_value = Path(fspath_value) + + kw[path_var] = path_value + kw[fspath_var] = fspath_value + return hook(**kw) + + fixed_hook.name = hook.name # type: ignore[attr-defined] + fixed_hook.spec = hook.spec # type: ignore[attr-defined] + fixed_hook.__name__ = key + self.__dict__[key] = fixed_hook + return fixed_hook # type: ignore[return-value] diff --git a/.venv/Lib/site-packages/_pytest/config/exceptions.py b/.venv/Lib/site-packages/_pytest/config/exceptions.py new file mode 100644 index 00000000..90108eca --- /dev/null +++ b/.venv/Lib/site-packages/_pytest/config/exceptions.py @@ -0,0 +1,13 @@ +from __future__ import annotations + +from typing import final + + +@final +class UsageError(Exception): + """Error in pytest usage or invocation.""" + + +class PrintHelp(Exception): + """Raised when pytest should print its help to skip the rest of the + argument parsing and validation.""" diff --git a/.venv/Lib/site-packages/_pytest/config/findpaths.py b/.venv/Lib/site-packages/_pytest/config/findpaths.py new file mode 100644 index 00000000..ce4c990b --- /dev/null +++ b/.venv/Lib/site-packages/_pytest/config/findpaths.py @@ -0,0 +1,228 @@ +from __future__ import annotations + +import os +from pathlib import Path +import sys +from typing import Iterable +from typing import Sequence + +import iniconfig + +from .exceptions import UsageError +from _pytest.outcomes import fail +from _pytest.pathlib import absolutepath +from _pytest.pathlib import commonpath +from _pytest.pathlib import safe_exists + + +def _parse_ini_config(path: Path) -> iniconfig.IniConfig: + """Parse the given generic '.ini' file using legacy IniConfig parser, returning + the parsed object. + + Raise UsageError if the file cannot be parsed. + """ + try: + return iniconfig.IniConfig(str(path)) + except iniconfig.ParseError as exc: + raise UsageError(str(exc)) from exc + + +def load_config_dict_from_file( + filepath: Path, +) -> dict[str, str | list[str]] | None: + """Load pytest configuration from the given file path, if supported. + + Return None if the file does not contain valid pytest configuration. + """ + # Configuration from ini files are obtained from the [pytest] section, if present. + if filepath.suffix == ".ini": + iniconfig = _parse_ini_config(filepath) + + if "pytest" in iniconfig: + return dict(iniconfig["pytest"].items()) + else: + # "pytest.ini" files are always the source of configuration, even if empty. + if filepath.name == "pytest.ini": + return {} + + # '.cfg' files are considered if they contain a "[tool:pytest]" section. + elif filepath.suffix == ".cfg": + iniconfig = _parse_ini_config(filepath) + + if "tool:pytest" in iniconfig.sections: + return dict(iniconfig["tool:pytest"].items()) + elif "pytest" in iniconfig.sections: + # If a setup.cfg contains a "[pytest]" section, we raise a failure to indicate users that + # plain "[pytest]" sections in setup.cfg files is no longer supported (#3086). + fail(CFG_PYTEST_SECTION.format(filename="setup.cfg"), pytrace=False) + + # '.toml' files are considered if they contain a [tool.pytest.ini_options] table. + elif filepath.suffix == ".toml": + if sys.version_info >= (3, 11): + import tomllib + else: + import tomli as tomllib + + toml_text = filepath.read_text(encoding="utf-8") + try: + config = tomllib.loads(toml_text) + except tomllib.TOMLDecodeError as exc: + raise UsageError(f"{filepath}: {exc}") from exc + + result = config.get("tool", {}).get("pytest", {}).get("ini_options", None) + if result is not None: + # TOML supports richer data types than ini files (strings, arrays, floats, ints, etc), + # however we need to convert all scalar values to str for compatibility with the rest + # of the configuration system, which expects strings only. + def make_scalar(v: object) -> str | list[str]: + return v if isinstance(v, list) else str(v) + + return {k: make_scalar(v) for k, v in result.items()} + + return None + + +def locate_config( + invocation_dir: Path, + args: Iterable[Path], +) -> tuple[Path | None, Path | None, dict[str, str | list[str]]]: + """Search in the list of arguments for a valid ini-file for pytest, + and return a tuple of (rootdir, inifile, cfg-dict).""" + config_names = [ + "pytest.ini", + ".pytest.ini", + "pyproject.toml", + "tox.ini", + "setup.cfg", + ] + args = [x for x in args if not str(x).startswith("-")] + if not args: + args = [invocation_dir] + found_pyproject_toml: Path | None = None + for arg in args: + argpath = absolutepath(arg) + for base in (argpath, *argpath.parents): + for config_name in config_names: + p = base / config_name + if p.is_file(): + if p.name == "pyproject.toml" and found_pyproject_toml is None: + found_pyproject_toml = p + ini_config = load_config_dict_from_file(p) + if ini_config is not None: + return base, p, ini_config + if found_pyproject_toml is not None: + return found_pyproject_toml.parent, found_pyproject_toml, {} + return None, None, {} + + +def get_common_ancestor( + invocation_dir: Path, + paths: Iterable[Path], +) -> Path: + common_ancestor: Path | None = None + for path in paths: + if not path.exists(): + continue + if common_ancestor is None: + common_ancestor = path + else: + if common_ancestor in path.parents or path == common_ancestor: + continue + elif path in common_ancestor.parents: + common_ancestor = path + else: + shared = commonpath(path, common_ancestor) + if shared is not None: + common_ancestor = shared + if common_ancestor is None: + common_ancestor = invocation_dir + elif common_ancestor.is_file(): + common_ancestor = common_ancestor.parent + return common_ancestor + + +def get_dirs_from_args(args: Iterable[str]) -> list[Path]: + def is_option(x: str) -> bool: + return x.startswith("-") + + def get_file_part_from_node_id(x: str) -> str: + return x.split("::")[0] + + def get_dir_from_path(path: Path) -> Path: + if path.is_dir(): + return path + return path.parent + + # These look like paths but may not exist + possible_paths = ( + absolutepath(get_file_part_from_node_id(arg)) + for arg in args + if not is_option(arg) + ) + + return [get_dir_from_path(path) for path in possible_paths if safe_exists(path)] + + +CFG_PYTEST_SECTION = "[pytest] section in {filename} files is no longer supported, change to [tool:pytest] instead." + + +def determine_setup( + *, + inifile: str | None, + args: Sequence[str], + rootdir_cmd_arg: str | None, + invocation_dir: Path, +) -> tuple[Path, Path | None, dict[str, str | list[str]]]: + """Determine the rootdir, inifile and ini configuration values from the + command line arguments. + + :param inifile: + The `--inifile` command line argument, if given. + :param args: + The free command line arguments. + :param rootdir_cmd_arg: + The `--rootdir` command line argument, if given. + :param invocation_dir: + The working directory when pytest was invoked. + """ + rootdir = None + dirs = get_dirs_from_args(args) + if inifile: + inipath_ = absolutepath(inifile) + inipath: Path | None = inipath_ + inicfg = load_config_dict_from_file(inipath_) or {} + if rootdir_cmd_arg is None: + rootdir = inipath_.parent + else: + ancestor = get_common_ancestor(invocation_dir, dirs) + rootdir, inipath, inicfg = locate_config(invocation_dir, [ancestor]) + if rootdir is None and rootdir_cmd_arg is None: + for possible_rootdir in (ancestor, *ancestor.parents): + if (possible_rootdir / "setup.py").is_file(): + rootdir = possible_rootdir + break + else: + if dirs != [ancestor]: + rootdir, inipath, inicfg = locate_config(invocation_dir, dirs) + if rootdir is None: + rootdir = get_common_ancestor( + invocation_dir, [invocation_dir, ancestor] + ) + if is_fs_root(rootdir): + rootdir = ancestor + if rootdir_cmd_arg: + rootdir = absolutepath(os.path.expandvars(rootdir_cmd_arg)) + if not rootdir.is_dir(): + raise UsageError( + f"Directory '{rootdir}' not found. Check your '--rootdir' option." + ) + assert rootdir is not None + return rootdir, inipath, inicfg or {} + + +def is_fs_root(p: Path) -> bool: + r""" + Return True if the given path is pointing to the root of the + file system ("/" on Unix and "C:\\" on Windows for example). + """ + return os.path.splitdrive(str(p))[1] == os.sep diff --git a/.venv/Lib/site-packages/_pytest/debugging.py b/.venv/Lib/site-packages/_pytest/debugging.py new file mode 100644 index 00000000..2dfe321e --- /dev/null +++ b/.venv/Lib/site-packages/_pytest/debugging.py @@ -0,0 +1,385 @@ +# mypy: allow-untyped-defs +# ruff: noqa: T100 +"""Interactive debugging with PDB, the Python Debugger.""" + +from __future__ import annotations + +import argparse +import functools +import sys +import types +from typing import Any +from typing import Callable +from typing import Generator +import unittest + +from _pytest import outcomes +from _pytest._code import ExceptionInfo +from _pytest.capture import CaptureManager +from _pytest.config import Config +from _pytest.config import ConftestImportFailure +from _pytest.config import hookimpl +from _pytest.config import PytestPluginManager +from _pytest.config.argparsing import Parser +from _pytest.config.exceptions import UsageError +from _pytest.nodes import Node +from _pytest.reports import BaseReport +from _pytest.runner import CallInfo + + +def _validate_usepdb_cls(value: str) -> tuple[str, str]: + """Validate syntax of --pdbcls option.""" + try: + modname, classname = value.split(":") + except ValueError as e: + raise argparse.ArgumentTypeError( + f"{value!r} is not in the format 'modname:classname'" + ) from e + return (modname, classname) + + +def pytest_addoption(parser: Parser) -> None: + group = parser.getgroup("general") + group._addoption( + "--pdb", + dest="usepdb", + action="store_true", + help="Start the interactive Python debugger on errors or KeyboardInterrupt", + ) + group._addoption( + "--pdbcls", + dest="usepdb_cls", + metavar="modulename:classname", + type=_validate_usepdb_cls, + help="Specify a custom interactive Python debugger for use with --pdb." + "For example: --pdbcls=IPython.terminal.debugger:TerminalPdb", + ) + group._addoption( + "--trace", + dest="trace", + action="store_true", + help="Immediately break when running each test", + ) + + +def pytest_configure(config: Config) -> None: + import pdb + + if config.getvalue("trace"): + config.pluginmanager.register(PdbTrace(), "pdbtrace") + if config.getvalue("usepdb"): + config.pluginmanager.register(PdbInvoke(), "pdbinvoke") + + pytestPDB._saved.append( + (pdb.set_trace, pytestPDB._pluginmanager, pytestPDB._config) + ) + pdb.set_trace = pytestPDB.set_trace + pytestPDB._pluginmanager = config.pluginmanager + pytestPDB._config = config + + # NOTE: not using pytest_unconfigure, since it might get called although + # pytest_configure was not (if another plugin raises UsageError). + def fin() -> None: + ( + pdb.set_trace, + pytestPDB._pluginmanager, + pytestPDB._config, + ) = pytestPDB._saved.pop() + + config.add_cleanup(fin) + + +class pytestPDB: + """Pseudo PDB that defers to the real pdb.""" + + _pluginmanager: PytestPluginManager | None = None + _config: Config | None = None + _saved: list[ + tuple[Callable[..., None], PytestPluginManager | None, Config | None] + ] = [] + _recursive_debug = 0 + _wrapped_pdb_cls: tuple[type[Any], type[Any]] | None = None + + @classmethod + def _is_capturing(cls, capman: CaptureManager | None) -> str | bool: + if capman: + return capman.is_capturing() + return False + + @classmethod + def _import_pdb_cls(cls, capman: CaptureManager | None): + if not cls._config: + import pdb + + # Happens when using pytest.set_trace outside of a test. + return pdb.Pdb + + usepdb_cls = cls._config.getvalue("usepdb_cls") + + if cls._wrapped_pdb_cls and cls._wrapped_pdb_cls[0] == usepdb_cls: + return cls._wrapped_pdb_cls[1] + + if usepdb_cls: + modname, classname = usepdb_cls + + try: + __import__(modname) + mod = sys.modules[modname] + + # Handle --pdbcls=pdb:pdb.Pdb (useful e.g. with pdbpp). + parts = classname.split(".") + pdb_cls = getattr(mod, parts[0]) + for part in parts[1:]: + pdb_cls = getattr(pdb_cls, part) + except Exception as exc: + value = ":".join((modname, classname)) + raise UsageError( + f"--pdbcls: could not import {value!r}: {exc}" + ) from exc + else: + import pdb + + pdb_cls = pdb.Pdb + + wrapped_cls = cls._get_pdb_wrapper_class(pdb_cls, capman) + cls._wrapped_pdb_cls = (usepdb_cls, wrapped_cls) + return wrapped_cls + + @classmethod + def _get_pdb_wrapper_class(cls, pdb_cls, capman: CaptureManager | None): + import _pytest.config + + class PytestPdbWrapper(pdb_cls): + _pytest_capman = capman + _continued = False + + def do_debug(self, arg): + cls._recursive_debug += 1 + ret = super().do_debug(arg) + cls._recursive_debug -= 1 + return ret + + def do_continue(self, arg): + ret = super().do_continue(arg) + if cls._recursive_debug == 0: + assert cls._config is not None + tw = _pytest.config.create_terminal_writer(cls._config) + tw.line() + + capman = self._pytest_capman + capturing = pytestPDB._is_capturing(capman) + if capturing: + if capturing == "global": + tw.sep(">", "PDB continue (IO-capturing resumed)") + else: + tw.sep( + ">", + f"PDB continue (IO-capturing resumed for {capturing})", + ) + assert capman is not None + capman.resume() + else: + tw.sep(">", "PDB continue") + assert cls._pluginmanager is not None + cls._pluginmanager.hook.pytest_leave_pdb(config=cls._config, pdb=self) + self._continued = True + return ret + + do_c = do_cont = do_continue + + def do_quit(self, arg): + """Raise Exit outcome when quit command is used in pdb. + + This is a bit of a hack - it would be better if BdbQuit + could be handled, but this would require to wrap the + whole pytest run, and adjust the report etc. + """ + ret = super().do_quit(arg) + + if cls._recursive_debug == 0: + outcomes.exit("Quitting debugger") + + return ret + + do_q = do_quit + do_exit = do_quit + + def setup(self, f, tb): + """Suspend on setup(). + + Needed after do_continue resumed, and entering another + breakpoint again. + """ + ret = super().setup(f, tb) + if not ret and self._continued: + # pdb.setup() returns True if the command wants to exit + # from the interaction: do not suspend capturing then. + if self._pytest_capman: + self._pytest_capman.suspend_global_capture(in_=True) + return ret + + def get_stack(self, f, t): + stack, i = super().get_stack(f, t) + if f is None: + # Find last non-hidden frame. + i = max(0, len(stack) - 1) + while i and stack[i][0].f_locals.get("__tracebackhide__", False): + i -= 1 + return stack, i + + return PytestPdbWrapper + + @classmethod + def _init_pdb(cls, method, *args, **kwargs): + """Initialize PDB debugging, dropping any IO capturing.""" + import _pytest.config + + if cls._pluginmanager is None: + capman: CaptureManager | None = None + else: + capman = cls._pluginmanager.getplugin("capturemanager") + if capman: + capman.suspend(in_=True) + + if cls._config: + tw = _pytest.config.create_terminal_writer(cls._config) + tw.line() + + if cls._recursive_debug == 0: + # Handle header similar to pdb.set_trace in py37+. + header = kwargs.pop("header", None) + if header is not None: + tw.sep(">", header) + else: + capturing = cls._is_capturing(capman) + if capturing == "global": + tw.sep(">", f"PDB {method} (IO-capturing turned off)") + elif capturing: + tw.sep( + ">", + f"PDB {method} (IO-capturing turned off for {capturing})", + ) + else: + tw.sep(">", f"PDB {method}") + + _pdb = cls._import_pdb_cls(capman)(**kwargs) + + if cls._pluginmanager: + cls._pluginmanager.hook.pytest_enter_pdb(config=cls._config, pdb=_pdb) + return _pdb + + @classmethod + def set_trace(cls, *args, **kwargs) -> None: + """Invoke debugging via ``Pdb.set_trace``, dropping any IO capturing.""" + frame = sys._getframe().f_back + _pdb = cls._init_pdb("set_trace", *args, **kwargs) + _pdb.set_trace(frame) + + +class PdbInvoke: + def pytest_exception_interact( + self, node: Node, call: CallInfo[Any], report: BaseReport + ) -> None: + capman = node.config.pluginmanager.getplugin("capturemanager") + if capman: + capman.suspend_global_capture(in_=True) + out, err = capman.read_global_capture() + sys.stdout.write(out) + sys.stdout.write(err) + assert call.excinfo is not None + + if not isinstance(call.excinfo.value, unittest.SkipTest): + _enter_pdb(node, call.excinfo, report) + + def pytest_internalerror(self, excinfo: ExceptionInfo[BaseException]) -> None: + tb = _postmortem_traceback(excinfo) + post_mortem(tb) + + +class PdbTrace: + @hookimpl(wrapper=True) + def pytest_pyfunc_call(self, pyfuncitem) -> Generator[None, object, object]: + wrap_pytest_function_for_tracing(pyfuncitem) + return (yield) + + +def wrap_pytest_function_for_tracing(pyfuncitem) -> None: + """Change the Python function object of the given Function item by a + wrapper which actually enters pdb before calling the python function + itself, effectively leaving the user in the pdb prompt in the first + statement of the function.""" + _pdb = pytestPDB._init_pdb("runcall") + testfunction = pyfuncitem.obj + + # we can't just return `partial(pdb.runcall, testfunction)` because (on + # python < 3.7.4) runcall's first param is `func`, which means we'd get + # an exception if one of the kwargs to testfunction was called `func`. + @functools.wraps(testfunction) + def wrapper(*args, **kwargs) -> None: + func = functools.partial(testfunction, *args, **kwargs) + _pdb.runcall(func) + + pyfuncitem.obj = wrapper + + +def maybe_wrap_pytest_function_for_tracing(pyfuncitem) -> None: + """Wrap the given pytestfunct item for tracing support if --trace was given in + the command line.""" + if pyfuncitem.config.getvalue("trace"): + wrap_pytest_function_for_tracing(pyfuncitem) + + +def _enter_pdb( + node: Node, excinfo: ExceptionInfo[BaseException], rep: BaseReport +) -> BaseReport: + # XXX we reuse the TerminalReporter's terminalwriter + # because this seems to avoid some encoding related troubles + # for not completely clear reasons. + tw = node.config.pluginmanager.getplugin("terminalreporter")._tw + tw.line() + + showcapture = node.config.option.showcapture + + for sectionname, content in ( + ("stdout", rep.capstdout), + ("stderr", rep.capstderr), + ("log", rep.caplog), + ): + if showcapture in (sectionname, "all") and content: + tw.sep(">", "captured " + sectionname) + if content[-1:] == "\n": + content = content[:-1] + tw.line(content) + + tw.sep(">", "traceback") + rep.toterminal(tw) + tw.sep(">", "entering PDB") + tb = _postmortem_traceback(excinfo) + rep._pdbshown = True # type: ignore[attr-defined] + post_mortem(tb) + return rep + + +def _postmortem_traceback(excinfo: ExceptionInfo[BaseException]) -> types.TracebackType: + from doctest import UnexpectedException + + if isinstance(excinfo.value, UnexpectedException): + # A doctest.UnexpectedException is not useful for post_mortem. + # Use the underlying exception instead: + return excinfo.value.exc_info[2] + elif isinstance(excinfo.value, ConftestImportFailure): + # A config.ConftestImportFailure is not useful for post_mortem. + # Use the underlying exception instead: + assert excinfo.value.cause.__traceback__ is not None + return excinfo.value.cause.__traceback__ + else: + assert excinfo._excinfo is not None + return excinfo._excinfo[2] + + +def post_mortem(t: types.TracebackType) -> None: + p = pytestPDB._init_pdb("post_mortem") + p.reset() + p.interaction(None, t) + if p.quitting: + outcomes.exit("Quitting debugger") diff --git a/.venv/Lib/site-packages/_pytest/deprecated.py b/.venv/Lib/site-packages/_pytest/deprecated.py new file mode 100644 index 00000000..a605c24e --- /dev/null +++ b/.venv/Lib/site-packages/_pytest/deprecated.py @@ -0,0 +1,91 @@ +"""Deprecation messages and bits of code used elsewhere in the codebase that +is planned to be removed in the next pytest release. + +Keeping it in a central location makes it easy to track what is deprecated and should +be removed when the time comes. + +All constants defined in this module should be either instances of +:class:`PytestWarning`, or :class:`UnformattedWarning` +in case of warnings which need to format their messages. +""" + +from __future__ import annotations + +from warnings import warn + +from _pytest.warning_types import PytestDeprecationWarning +from _pytest.warning_types import PytestRemovedIn9Warning +from _pytest.warning_types import UnformattedWarning + + +# set of plugins which have been integrated into the core; we use this list to ignore +# them during registration to avoid conflicts +DEPRECATED_EXTERNAL_PLUGINS = { + "pytest_catchlog", + "pytest_capturelog", + "pytest_faulthandler", +} + + +# This can be* removed pytest 8, but it's harmless and common, so no rush to remove. +# * If you're in the future: "could have been". +YIELD_FIXTURE = PytestDeprecationWarning( + "@pytest.yield_fixture is deprecated.\n" + "Use @pytest.fixture instead; they are the same." +) + +# This deprecation is never really meant to be removed. +PRIVATE = PytestDeprecationWarning("A private pytest class or function was used.") + + +HOOK_LEGACY_PATH_ARG = UnformattedWarning( + PytestRemovedIn9Warning, + "The ({pylib_path_arg}: py.path.local) argument is deprecated, please use ({pathlib_path_arg}: pathlib.Path)\n" + "see https://docs.pytest.org/en/latest/deprecations.html" + "#py-path-local-arguments-for-hooks-replaced-with-pathlib-path", +) + +NODE_CTOR_FSPATH_ARG = UnformattedWarning( + PytestRemovedIn9Warning, + "The (fspath: py.path.local) argument to {node_type_name} is deprecated. " + "Please use the (path: pathlib.Path) argument instead.\n" + "See https://docs.pytest.org/en/latest/deprecations.html" + "#fspath-argument-for-node-constructors-replaced-with-pathlib-path", +) + +HOOK_LEGACY_MARKING = UnformattedWarning( + PytestDeprecationWarning, + "The hook{type} {fullname} uses old-style configuration options (marks or attributes).\n" + "Please use the pytest.hook{type}({hook_opts}) decorator instead\n" + " to configure the hooks.\n" + " See https://docs.pytest.org/en/latest/deprecations.html" + "#configuring-hook-specs-impls-using-markers", +) + +MARKED_FIXTURE = PytestRemovedIn9Warning( + "Marks applied to fixtures have no effect\n" + "See docs: https://docs.pytest.org/en/stable/deprecations.html#applying-a-mark-to-a-fixture-function" +) + +# You want to make some `__init__` or function "private". +# +# def my_private_function(some, args): +# ... +# +# Do this: +# +# def my_private_function(some, args, *, _ispytest: bool = False): +# check_ispytest(_ispytest) +# ... +# +# Change all internal/allowed calls to +# +# my_private_function(some, args, _ispytest=True) +# +# All other calls will get the default _ispytest=False and trigger +# the warning (possibly error in the future). + + +def check_ispytest(ispytest: bool) -> None: + if not ispytest: + warn(PRIVATE, stacklevel=3) diff --git a/.venv/Lib/site-packages/_pytest/doctest.py b/.venv/Lib/site-packages/_pytest/doctest.py new file mode 100644 index 00000000..384dea97 --- /dev/null +++ b/.venv/Lib/site-packages/_pytest/doctest.py @@ -0,0 +1,755 @@ +# mypy: allow-untyped-defs +"""Discover and run doctests in modules and test files.""" + +from __future__ import annotations + +import bdb +from contextlib import contextmanager +import functools +import inspect +import os +from pathlib import Path +import platform +import sys +import traceback +import types +from typing import Any +from typing import Callable +from typing import Generator +from typing import Iterable +from typing import Pattern +from typing import Sequence +from typing import TYPE_CHECKING +import warnings + +from _pytest import outcomes +from _pytest._code.code import ExceptionInfo +from _pytest._code.code import ReprFileLocation +from _pytest._code.code import TerminalRepr +from _pytest._io import TerminalWriter +from _pytest.compat import safe_getattr +from _pytest.config import Config +from _pytest.config.argparsing import Parser +from _pytest.fixtures import fixture +from _pytest.fixtures import TopRequest +from _pytest.nodes import Collector +from _pytest.nodes import Item +from _pytest.outcomes import OutcomeException +from _pytest.outcomes import skip +from _pytest.pathlib import fnmatch_ex +from _pytest.python import Module +from _pytest.python_api import approx +from _pytest.warning_types import PytestWarning + + +if TYPE_CHECKING: + import doctest + + from typing_extensions import Self + +DOCTEST_REPORT_CHOICE_NONE = "none" +DOCTEST_REPORT_CHOICE_CDIFF = "cdiff" +DOCTEST_REPORT_CHOICE_NDIFF = "ndiff" +DOCTEST_REPORT_CHOICE_UDIFF = "udiff" +DOCTEST_REPORT_CHOICE_ONLY_FIRST_FAILURE = "only_first_failure" + +DOCTEST_REPORT_CHOICES = ( + DOCTEST_REPORT_CHOICE_NONE, + DOCTEST_REPORT_CHOICE_CDIFF, + DOCTEST_REPORT_CHOICE_NDIFF, + DOCTEST_REPORT_CHOICE_UDIFF, + DOCTEST_REPORT_CHOICE_ONLY_FIRST_FAILURE, +) + +# Lazy definition of runner class +RUNNER_CLASS = None +# Lazy definition of output checker class +CHECKER_CLASS: type[doctest.OutputChecker] | None = None + + +def pytest_addoption(parser: Parser) -> None: + parser.addini( + "doctest_optionflags", + "Option flags for doctests", + type="args", + default=["ELLIPSIS"], + ) + parser.addini( + "doctest_encoding", "Encoding used for doctest files", default="utf-8" + ) + group = parser.getgroup("collect") + group.addoption( + "--doctest-modules", + action="store_true", + default=False, + help="Run doctests in all .py modules", + dest="doctestmodules", + ) + group.addoption( + "--doctest-report", + type=str.lower, + default="udiff", + help="Choose another output format for diffs on doctest failure", + choices=DOCTEST_REPORT_CHOICES, + dest="doctestreport", + ) + group.addoption( + "--doctest-glob", + action="append", + default=[], + metavar="pat", + help="Doctests file matching pattern, default: test*.txt", + dest="doctestglob", + ) + group.addoption( + "--doctest-ignore-import-errors", + action="store_true", + default=False, + help="Ignore doctest collection errors", + dest="doctest_ignore_import_errors", + ) + group.addoption( + "--doctest-continue-on-failure", + action="store_true", + default=False, + help="For a given doctest, continue to run after the first failure", + dest="doctest_continue_on_failure", + ) + + +def pytest_unconfigure() -> None: + global RUNNER_CLASS + + RUNNER_CLASS = None + + +def pytest_collect_file( + file_path: Path, + parent: Collector, +) -> DoctestModule | DoctestTextfile | None: + config = parent.config + if file_path.suffix == ".py": + if config.option.doctestmodules and not any( + (_is_setup_py(file_path), _is_main_py(file_path)) + ): + return DoctestModule.from_parent(parent, path=file_path) + elif _is_doctest(config, file_path, parent): + return DoctestTextfile.from_parent(parent, path=file_path) + return None + + +def _is_setup_py(path: Path) -> bool: + if path.name != "setup.py": + return False + contents = path.read_bytes() + return b"setuptools" in contents or b"distutils" in contents + + +def _is_doctest(config: Config, path: Path, parent: Collector) -> bool: + if path.suffix in (".txt", ".rst") and parent.session.isinitpath(path): + return True + globs = config.getoption("doctestglob") or ["test*.txt"] + return any(fnmatch_ex(glob, path) for glob in globs) + + +def _is_main_py(path: Path) -> bool: + return path.name == "__main__.py" + + +class ReprFailDoctest(TerminalRepr): + def __init__( + self, reprlocation_lines: Sequence[tuple[ReprFileLocation, Sequence[str]]] + ) -> None: + self.reprlocation_lines = reprlocation_lines + + def toterminal(self, tw: TerminalWriter) -> None: + for reprlocation, lines in self.reprlocation_lines: + for line in lines: + tw.line(line) + reprlocation.toterminal(tw) + + +class MultipleDoctestFailures(Exception): + def __init__(self, failures: Sequence[doctest.DocTestFailure]) -> None: + super().__init__() + self.failures = failures + + +def _init_runner_class() -> type[doctest.DocTestRunner]: + import doctest + + class PytestDoctestRunner(doctest.DebugRunner): + """Runner to collect failures. + + Note that the out variable in this case is a list instead of a + stdout-like object. + """ + + def __init__( + self, + checker: doctest.OutputChecker | None = None, + verbose: bool | None = None, + optionflags: int = 0, + continue_on_failure: bool = True, + ) -> None: + super().__init__(checker=checker, verbose=verbose, optionflags=optionflags) + self.continue_on_failure = continue_on_failure + + def report_failure( + self, + out, + test: doctest.DocTest, + example: doctest.Example, + got: str, + ) -> None: + failure = doctest.DocTestFailure(test, example, got) + if self.continue_on_failure: + out.append(failure) + else: + raise failure + + def report_unexpected_exception( + self, + out, + test: doctest.DocTest, + example: doctest.Example, + exc_info: tuple[type[BaseException], BaseException, types.TracebackType], + ) -> None: + if isinstance(exc_info[1], OutcomeException): + raise exc_info[1] + if isinstance(exc_info[1], bdb.BdbQuit): + outcomes.exit("Quitting debugger") + failure = doctest.UnexpectedException(test, example, exc_info) + if self.continue_on_failure: + out.append(failure) + else: + raise failure + + return PytestDoctestRunner + + +def _get_runner( + checker: doctest.OutputChecker | None = None, + verbose: bool | None = None, + optionflags: int = 0, + continue_on_failure: bool = True, +) -> doctest.DocTestRunner: + # We need this in order to do a lazy import on doctest + global RUNNER_CLASS + if RUNNER_CLASS is None: + RUNNER_CLASS = _init_runner_class() + # Type ignored because the continue_on_failure argument is only defined on + # PytestDoctestRunner, which is lazily defined so can't be used as a type. + return RUNNER_CLASS( # type: ignore + checker=checker, + verbose=verbose, + optionflags=optionflags, + continue_on_failure=continue_on_failure, + ) + + +class DoctestItem(Item): + def __init__( + self, + name: str, + parent: DoctestTextfile | DoctestModule, + runner: doctest.DocTestRunner, + dtest: doctest.DocTest, + ) -> None: + super().__init__(name, parent) + self.runner = runner + self.dtest = dtest + + # Stuff needed for fixture support. + self.obj = None + fm = self.session._fixturemanager + fixtureinfo = fm.getfixtureinfo(node=self, func=None, cls=None) + self._fixtureinfo = fixtureinfo + self.fixturenames = fixtureinfo.names_closure + self._initrequest() + + @classmethod + def from_parent( # type: ignore[override] + cls, + parent: DoctestTextfile | DoctestModule, + *, + name: str, + runner: doctest.DocTestRunner, + dtest: doctest.DocTest, + ) -> Self: + # incompatible signature due to imposed limits on subclass + """The public named constructor.""" + return super().from_parent(name=name, parent=parent, runner=runner, dtest=dtest) + + def _initrequest(self) -> None: + self.funcargs: dict[str, object] = {} + self._request = TopRequest(self, _ispytest=True) # type: ignore[arg-type] + + def setup(self) -> None: + self._request._fillfixtures() + globs = dict(getfixture=self._request.getfixturevalue) + for name, value in self._request.getfixturevalue("doctest_namespace").items(): + globs[name] = value + self.dtest.globs.update(globs) + + def runtest(self) -> None: + _check_all_skipped(self.dtest) + self._disable_output_capturing_for_darwin() + failures: list[doctest.DocTestFailure] = [] + # Type ignored because we change the type of `out` from what + # doctest expects. + self.runner.run(self.dtest, out=failures) # type: ignore[arg-type] + if failures: + raise MultipleDoctestFailures(failures) + + def _disable_output_capturing_for_darwin(self) -> None: + """Disable output capturing. Otherwise, stdout is lost to doctest (#985).""" + if platform.system() != "Darwin": + return + capman = self.config.pluginmanager.getplugin("capturemanager") + if capman: + capman.suspend_global_capture(in_=True) + out, err = capman.read_global_capture() + sys.stdout.write(out) + sys.stderr.write(err) + + # TODO: Type ignored -- breaks Liskov Substitution. + def repr_failure( # type: ignore[override] + self, + excinfo: ExceptionInfo[BaseException], + ) -> str | TerminalRepr: + import doctest + + failures: ( + Sequence[doctest.DocTestFailure | doctest.UnexpectedException] | None + ) = None + if isinstance( + excinfo.value, (doctest.DocTestFailure, doctest.UnexpectedException) + ): + failures = [excinfo.value] + elif isinstance(excinfo.value, MultipleDoctestFailures): + failures = excinfo.value.failures + + if failures is None: + return super().repr_failure(excinfo) + + reprlocation_lines = [] + for failure in failures: + example = failure.example + test = failure.test + filename = test.filename + if test.lineno is None: + lineno = None + else: + lineno = test.lineno + example.lineno + 1 + message = type(failure).__name__ + # TODO: ReprFileLocation doesn't expect a None lineno. + reprlocation = ReprFileLocation(filename, lineno, message) # type: ignore[arg-type] + checker = _get_checker() + report_choice = _get_report_choice(self.config.getoption("doctestreport")) + if lineno is not None: + assert failure.test.docstring is not None + lines = failure.test.docstring.splitlines(False) + # add line numbers to the left of the error message + assert test.lineno is not None + lines = [ + "%03d %s" % (i + test.lineno + 1, x) for (i, x) in enumerate(lines) + ] + # trim docstring error lines to 10 + lines = lines[max(example.lineno - 9, 0) : example.lineno + 1] + else: + lines = [ + "EXAMPLE LOCATION UNKNOWN, not showing all tests of that example" + ] + indent = ">>>" + for line in example.source.splitlines(): + lines.append(f"??? {indent} {line}") + indent = "..." + if isinstance(failure, doctest.DocTestFailure): + lines += checker.output_difference( + example, failure.got, report_choice + ).split("\n") + else: + inner_excinfo = ExceptionInfo.from_exc_info(failure.exc_info) + lines += [f"UNEXPECTED EXCEPTION: {inner_excinfo.value!r}"] + lines += [ + x.strip("\n") for x in traceback.format_exception(*failure.exc_info) + ] + reprlocation_lines.append((reprlocation, lines)) + return ReprFailDoctest(reprlocation_lines) + + def reportinfo(self) -> tuple[os.PathLike[str] | str, int | None, str]: + return self.path, self.dtest.lineno, f"[doctest] {self.name}" + + +def _get_flag_lookup() -> dict[str, int]: + import doctest + + return dict( + DONT_ACCEPT_TRUE_FOR_1=doctest.DONT_ACCEPT_TRUE_FOR_1, + DONT_ACCEPT_BLANKLINE=doctest.DONT_ACCEPT_BLANKLINE, + NORMALIZE_WHITESPACE=doctest.NORMALIZE_WHITESPACE, + ELLIPSIS=doctest.ELLIPSIS, + IGNORE_EXCEPTION_DETAIL=doctest.IGNORE_EXCEPTION_DETAIL, + COMPARISON_FLAGS=doctest.COMPARISON_FLAGS, + ALLOW_UNICODE=_get_allow_unicode_flag(), + ALLOW_BYTES=_get_allow_bytes_flag(), + NUMBER=_get_number_flag(), + ) + + +def get_optionflags(config: Config) -> int: + optionflags_str = config.getini("doctest_optionflags") + flag_lookup_table = _get_flag_lookup() + flag_acc = 0 + for flag in optionflags_str: + flag_acc |= flag_lookup_table[flag] + return flag_acc + + +def _get_continue_on_failure(config: Config) -> bool: + continue_on_failure: bool = config.getvalue("doctest_continue_on_failure") + if continue_on_failure: + # We need to turn off this if we use pdb since we should stop at + # the first failure. + if config.getvalue("usepdb"): + continue_on_failure = False + return continue_on_failure + + +class DoctestTextfile(Module): + obj = None + + def collect(self) -> Iterable[DoctestItem]: + import doctest + + # Inspired by doctest.testfile; ideally we would use it directly, + # but it doesn't support passing a custom checker. + encoding = self.config.getini("doctest_encoding") + text = self.path.read_text(encoding) + filename = str(self.path) + name = self.path.name + globs = {"__name__": "__main__"} + + optionflags = get_optionflags(self.config) + + runner = _get_runner( + verbose=False, + optionflags=optionflags, + checker=_get_checker(), + continue_on_failure=_get_continue_on_failure(self.config), + ) + + parser = doctest.DocTestParser() + test = parser.get_doctest(text, globs, name, filename, 0) + if test.examples: + yield DoctestItem.from_parent( + self, name=test.name, runner=runner, dtest=test + ) + + +def _check_all_skipped(test: doctest.DocTest) -> None: + """Raise pytest.skip() if all examples in the given DocTest have the SKIP + option set.""" + import doctest + + all_skipped = all(x.options.get(doctest.SKIP, False) for x in test.examples) + if all_skipped: + skip("all tests skipped by +SKIP option") + + +def _is_mocked(obj: object) -> bool: + """Return if an object is possibly a mock object by checking the + existence of a highly improbable attribute.""" + return ( + safe_getattr(obj, "pytest_mock_example_attribute_that_shouldnt_exist", None) + is not None + ) + + +@contextmanager +def _patch_unwrap_mock_aware() -> Generator[None]: + """Context manager which replaces ``inspect.unwrap`` with a version + that's aware of mock objects and doesn't recurse into them.""" + real_unwrap = inspect.unwrap + + def _mock_aware_unwrap( + func: Callable[..., Any], *, stop: Callable[[Any], Any] | None = None + ) -> Any: + try: + if stop is None or stop is _is_mocked: + return real_unwrap(func, stop=_is_mocked) + _stop = stop + return real_unwrap(func, stop=lambda obj: _is_mocked(obj) or _stop(func)) + except Exception as e: + warnings.warn( + f"Got {e!r} when unwrapping {func!r}. This is usually caused " + "by a violation of Python's object protocol; see e.g. " + "https://github.com/pytest-dev/pytest/issues/5080", + PytestWarning, + ) + raise + + inspect.unwrap = _mock_aware_unwrap + try: + yield + finally: + inspect.unwrap = real_unwrap + + +class DoctestModule(Module): + def collect(self) -> Iterable[DoctestItem]: + import doctest + + class MockAwareDocTestFinder(doctest.DocTestFinder): + py_ver_info_minor = sys.version_info[:2] + is_find_lineno_broken = ( + py_ver_info_minor < (3, 11) + or (py_ver_info_minor == (3, 11) and sys.version_info.micro < 9) + or (py_ver_info_minor == (3, 12) and sys.version_info.micro < 3) + ) + if is_find_lineno_broken: + + def _find_lineno(self, obj, source_lines): + """On older Pythons, doctest code does not take into account + `@property`. https://github.com/python/cpython/issues/61648 + + Moreover, wrapped Doctests need to be unwrapped so the correct + line number is returned. #8796 + """ + if isinstance(obj, property): + obj = getattr(obj, "fget", obj) + + if hasattr(obj, "__wrapped__"): + # Get the main obj in case of it being wrapped + obj = inspect.unwrap(obj) + + # Type ignored because this is a private function. + return super()._find_lineno( # type:ignore[misc] + obj, + source_lines, + ) + + if sys.version_info < (3, 10): + + def _find( + self, tests, obj, name, module, source_lines, globs, seen + ) -> None: + """Override _find to work around issue in stdlib. + + https://github.com/pytest-dev/pytest/issues/3456 + https://github.com/python/cpython/issues/69718 + """ + if _is_mocked(obj): + return # pragma: no cover + with _patch_unwrap_mock_aware(): + # Type ignored because this is a private function. + super()._find( # type:ignore[misc] + tests, obj, name, module, source_lines, globs, seen + ) + + if sys.version_info < (3, 13): + + def _from_module(self, module, object): + """`cached_property` objects are never considered a part + of the 'current module'. As such they are skipped by doctest. + Here we override `_from_module` to check the underlying + function instead. https://github.com/python/cpython/issues/107995 + """ + if isinstance(object, functools.cached_property): + object = object.func + + # Type ignored because this is a private function. + return super()._from_module(module, object) # type: ignore[misc] + + try: + module = self.obj + except Collector.CollectError: + if self.config.getvalue("doctest_ignore_import_errors"): + skip(f"unable to import module {self.path!r}") + else: + raise + + # While doctests currently don't support fixtures directly, we still + # need to pick up autouse fixtures. + self.session._fixturemanager.parsefactories(self) + + # Uses internal doctest module parsing mechanism. + finder = MockAwareDocTestFinder() + optionflags = get_optionflags(self.config) + runner = _get_runner( + verbose=False, + optionflags=optionflags, + checker=_get_checker(), + continue_on_failure=_get_continue_on_failure(self.config), + ) + + for test in finder.find(module, module.__name__): + if test.examples: # skip empty doctests + yield DoctestItem.from_parent( + self, name=test.name, runner=runner, dtest=test + ) + + +def _init_checker_class() -> type[doctest.OutputChecker]: + import doctest + import re + + class LiteralsOutputChecker(doctest.OutputChecker): + # Based on doctest_nose_plugin.py from the nltk project + # (https://github.com/nltk/nltk) and on the "numtest" doctest extension + # by Sebastien Boisgerault (https://github.com/boisgera/numtest). + + _unicode_literal_re = re.compile(r"(\W|^)[uU]([rR]?[\'\"])", re.UNICODE) + _bytes_literal_re = re.compile(r"(\W|^)[bB]([rR]?[\'\"])", re.UNICODE) + _number_re = re.compile( + r""" + (?P + (?P + (?P [+-]?\d*)\.(?P\d+) + | + (?P [+-]?\d+)\. + ) + (?: + [Ee] + (?P [+-]?\d+) + )? + | + (?P [+-]?\d+) + (?: + [Ee] + (?P [+-]?\d+) + ) + ) + """, + re.VERBOSE, + ) + + def check_output(self, want: str, got: str, optionflags: int) -> bool: + if super().check_output(want, got, optionflags): + return True + + allow_unicode = optionflags & _get_allow_unicode_flag() + allow_bytes = optionflags & _get_allow_bytes_flag() + allow_number = optionflags & _get_number_flag() + + if not allow_unicode and not allow_bytes and not allow_number: + return False + + def remove_prefixes(regex: Pattern[str], txt: str) -> str: + return re.sub(regex, r"\1\2", txt) + + if allow_unicode: + want = remove_prefixes(self._unicode_literal_re, want) + got = remove_prefixes(self._unicode_literal_re, got) + + if allow_bytes: + want = remove_prefixes(self._bytes_literal_re, want) + got = remove_prefixes(self._bytes_literal_re, got) + + if allow_number: + got = self._remove_unwanted_precision(want, got) + + return super().check_output(want, got, optionflags) + + def _remove_unwanted_precision(self, want: str, got: str) -> str: + wants = list(self._number_re.finditer(want)) + gots = list(self._number_re.finditer(got)) + if len(wants) != len(gots): + return got + offset = 0 + for w, g in zip(wants, gots): + fraction: str | None = w.group("fraction") + exponent: str | None = w.group("exponent1") + if exponent is None: + exponent = w.group("exponent2") + precision = 0 if fraction is None else len(fraction) + if exponent is not None: + precision -= int(exponent) + if float(w.group()) == approx(float(g.group()), abs=10**-precision): + # They're close enough. Replace the text we actually + # got with the text we want, so that it will match when we + # check the string literally. + got = ( + got[: g.start() + offset] + w.group() + got[g.end() + offset :] + ) + offset += w.end() - w.start() - (g.end() - g.start()) + return got + + return LiteralsOutputChecker + + +def _get_checker() -> doctest.OutputChecker: + """Return a doctest.OutputChecker subclass that supports some + additional options: + + * ALLOW_UNICODE and ALLOW_BYTES options to ignore u'' and b'' + prefixes (respectively) in string literals. Useful when the same + doctest should run in Python 2 and Python 3. + + * NUMBER to ignore floating-point differences smaller than the + precision of the literal number in the doctest. + + An inner class is used to avoid importing "doctest" at the module + level. + """ + global CHECKER_CLASS + if CHECKER_CLASS is None: + CHECKER_CLASS = _init_checker_class() + return CHECKER_CLASS() + + +def _get_allow_unicode_flag() -> int: + """Register and return the ALLOW_UNICODE flag.""" + import doctest + + return doctest.register_optionflag("ALLOW_UNICODE") + + +def _get_allow_bytes_flag() -> int: + """Register and return the ALLOW_BYTES flag.""" + import doctest + + return doctest.register_optionflag("ALLOW_BYTES") + + +def _get_number_flag() -> int: + """Register and return the NUMBER flag.""" + import doctest + + return doctest.register_optionflag("NUMBER") + + +def _get_report_choice(key: str) -> int: + """Return the actual `doctest` module flag value. + + We want to do it as late as possible to avoid importing `doctest` and all + its dependencies when parsing options, as it adds overhead and breaks tests. + """ + import doctest + + return { + DOCTEST_REPORT_CHOICE_UDIFF: doctest.REPORT_UDIFF, + DOCTEST_REPORT_CHOICE_CDIFF: doctest.REPORT_CDIFF, + DOCTEST_REPORT_CHOICE_NDIFF: doctest.REPORT_NDIFF, + DOCTEST_REPORT_CHOICE_ONLY_FIRST_FAILURE: doctest.REPORT_ONLY_FIRST_FAILURE, + DOCTEST_REPORT_CHOICE_NONE: 0, + }[key] + + +@fixture(scope="session") +def doctest_namespace() -> dict[str, Any]: + """Fixture that returns a :py:class:`dict` that will be injected into the + namespace of doctests. + + Usually this fixture is used in conjunction with another ``autouse`` fixture: + + .. code-block:: python + + @pytest.fixture(autouse=True) + def add_np(doctest_namespace): + doctest_namespace["np"] = numpy + + For more details: :ref:`doctest_namespace`. + """ + return dict() diff --git a/.venv/Lib/site-packages/_pytest/faulthandler.py b/.venv/Lib/site-packages/_pytest/faulthandler.py new file mode 100644 index 00000000..d16aea1e --- /dev/null +++ b/.venv/Lib/site-packages/_pytest/faulthandler.py @@ -0,0 +1,105 @@ +from __future__ import annotations + +import os +import sys +from typing import Generator + +from _pytest.config import Config +from _pytest.config.argparsing import Parser +from _pytest.nodes import Item +from _pytest.stash import StashKey +import pytest + + +fault_handler_original_stderr_fd_key = StashKey[int]() +fault_handler_stderr_fd_key = StashKey[int]() + + +def pytest_addoption(parser: Parser) -> None: + help = ( + "Dump the traceback of all threads if a test takes " + "more than TIMEOUT seconds to finish" + ) + parser.addini("faulthandler_timeout", help, default=0.0) + + +def pytest_configure(config: Config) -> None: + import faulthandler + + # at teardown we want to restore the original faulthandler fileno + # but faulthandler has no api to return the original fileno + # so here we stash the stderr fileno to be used at teardown + # sys.stderr and sys.__stderr__ may be closed or patched during the session + # so we can't rely on their values being good at that point (#11572). + stderr_fileno = get_stderr_fileno() + if faulthandler.is_enabled(): + config.stash[fault_handler_original_stderr_fd_key] = stderr_fileno + config.stash[fault_handler_stderr_fd_key] = os.dup(stderr_fileno) + faulthandler.enable(file=config.stash[fault_handler_stderr_fd_key]) + + +def pytest_unconfigure(config: Config) -> None: + import faulthandler + + faulthandler.disable() + # Close the dup file installed during pytest_configure. + if fault_handler_stderr_fd_key in config.stash: + os.close(config.stash[fault_handler_stderr_fd_key]) + del config.stash[fault_handler_stderr_fd_key] + # Re-enable the faulthandler if it was originally enabled. + if fault_handler_original_stderr_fd_key in config.stash: + faulthandler.enable(config.stash[fault_handler_original_stderr_fd_key]) + del config.stash[fault_handler_original_stderr_fd_key] + + +def get_stderr_fileno() -> int: + try: + fileno = sys.stderr.fileno() + # The Twisted Logger will return an invalid file descriptor since it is not backed + # by an FD. So, let's also forward this to the same code path as with pytest-xdist. + if fileno == -1: + raise AttributeError() + return fileno + except (AttributeError, ValueError): + # pytest-xdist monkeypatches sys.stderr with an object that is not an actual file. + # https://docs.python.org/3/library/faulthandler.html#issue-with-file-descriptors + # This is potentially dangerous, but the best we can do. + assert sys.__stderr__ is not None + return sys.__stderr__.fileno() + + +def get_timeout_config_value(config: Config) -> float: + return float(config.getini("faulthandler_timeout") or 0.0) + + +@pytest.hookimpl(wrapper=True, trylast=True) +def pytest_runtest_protocol(item: Item) -> Generator[None, object, object]: + timeout = get_timeout_config_value(item.config) + if timeout > 0: + import faulthandler + + stderr = item.config.stash[fault_handler_stderr_fd_key] + faulthandler.dump_traceback_later(timeout, file=stderr) + try: + return (yield) + finally: + faulthandler.cancel_dump_traceback_later() + else: + return (yield) + + +@pytest.hookimpl(tryfirst=True) +def pytest_enter_pdb() -> None: + """Cancel any traceback dumping due to timeout before entering pdb.""" + import faulthandler + + faulthandler.cancel_dump_traceback_later() + + +@pytest.hookimpl(tryfirst=True) +def pytest_exception_interact() -> None: + """Cancel any traceback dumping due to an interactive exception being + raised.""" + import faulthandler + + faulthandler.cancel_dump_traceback_later() diff --git a/.venv/Lib/site-packages/_pytest/fixtures.py b/.venv/Lib/site-packages/_pytest/fixtures.py new file mode 100644 index 00000000..6b882fa3 --- /dev/null +++ b/.venv/Lib/site-packages/_pytest/fixtures.py @@ -0,0 +1,1932 @@ +# mypy: allow-untyped-defs +from __future__ import annotations + +import abc +from collections import defaultdict +from collections import deque +import dataclasses +import functools +import inspect +import os +from pathlib import Path +import sys +import types +from typing import AbstractSet +from typing import Any +from typing import Callable +from typing import cast +from typing import Dict +from typing import Final +from typing import final +from typing import Generator +from typing import Generic +from typing import Iterable +from typing import Iterator +from typing import Mapping +from typing import MutableMapping +from typing import NoReturn +from typing import Optional +from typing import OrderedDict +from typing import overload +from typing import Sequence +from typing import Tuple +from typing import TYPE_CHECKING +from typing import TypeVar +from typing import Union +import warnings + +import _pytest +from _pytest import nodes +from _pytest._code import getfslineno +from _pytest._code import Source +from _pytest._code.code import FormattedExcinfo +from _pytest._code.code import TerminalRepr +from _pytest._io import TerminalWriter +from _pytest.compat import _PytestWrapper +from _pytest.compat import assert_never +from _pytest.compat import get_real_func +from _pytest.compat import get_real_method +from _pytest.compat import getfuncargnames +from _pytest.compat import getimfunc +from _pytest.compat import getlocation +from _pytest.compat import is_generator +from _pytest.compat import NOTSET +from _pytest.compat import NotSetType +from _pytest.compat import safe_getattr +from _pytest.compat import safe_isclass +from _pytest.config import _PluggyPlugin +from _pytest.config import Config +from _pytest.config import ExitCode +from _pytest.config.argparsing import Parser +from _pytest.deprecated import check_ispytest +from _pytest.deprecated import MARKED_FIXTURE +from _pytest.deprecated import YIELD_FIXTURE +from _pytest.main import Session +from _pytest.mark import Mark +from _pytest.mark import ParameterSet +from _pytest.mark.structures import MarkDecorator +from _pytest.outcomes import fail +from _pytest.outcomes import skip +from _pytest.outcomes import TEST_OUTCOME +from _pytest.pathlib import absolutepath +from _pytest.pathlib import bestrelpath +from _pytest.scope import _ScopeName +from _pytest.scope import HIGH_SCOPES +from _pytest.scope import Scope + + +if sys.version_info < (3, 11): + from exceptiongroup import BaseExceptionGroup + + +if TYPE_CHECKING: + from _pytest.python import CallSpec2 + from _pytest.python import Function + from _pytest.python import Metafunc + + +# The value of the fixture -- return/yield of the fixture function (type variable). +FixtureValue = TypeVar("FixtureValue") +# The type of the fixture function (type variable). +FixtureFunction = TypeVar("FixtureFunction", bound=Callable[..., object]) +# The type of a fixture function (type alias generic in fixture value). +_FixtureFunc = Union[ + Callable[..., FixtureValue], Callable[..., Generator[FixtureValue, None, None]] +] +# The type of FixtureDef.cached_result (type alias generic in fixture value). +_FixtureCachedResult = Union[ + Tuple[ + # The result. + FixtureValue, + # Cache key. + object, + None, + ], + Tuple[ + None, + # Cache key. + object, + # The exception and the original traceback. + Tuple[BaseException, Optional[types.TracebackType]], + ], +] + + +@dataclasses.dataclass(frozen=True) +class PseudoFixtureDef(Generic[FixtureValue]): + cached_result: _FixtureCachedResult[FixtureValue] + _scope: Scope + + +def pytest_sessionstart(session: Session) -> None: + session._fixturemanager = FixtureManager(session) + + +def get_scope_package( + node: nodes.Item, + fixturedef: FixtureDef[object], +) -> nodes.Node | None: + from _pytest.python import Package + + for parent in node.iter_parents(): + if isinstance(parent, Package) and parent.nodeid == fixturedef.baseid: + return parent + return node.session + + +def get_scope_node(node: nodes.Node, scope: Scope) -> nodes.Node | None: + import _pytest.python + + if scope is Scope.Function: + # Type ignored because this is actually safe, see: + # https://github.com/python/mypy/issues/4717 + return node.getparent(nodes.Item) # type: ignore[type-abstract] + elif scope is Scope.Class: + return node.getparent(_pytest.python.Class) + elif scope is Scope.Module: + return node.getparent(_pytest.python.Module) + elif scope is Scope.Package: + return node.getparent(_pytest.python.Package) + elif scope is Scope.Session: + return node.getparent(_pytest.main.Session) + else: + assert_never(scope) + + +def getfixturemarker(obj: object) -> FixtureFunctionMarker | None: + """Return fixturemarker or None if it doesn't exist or raised + exceptions.""" + return cast( + Optional[FixtureFunctionMarker], + safe_getattr(obj, "_pytestfixturefunction", None), + ) + + +# Algorithm for sorting on a per-parametrized resource setup basis. +# It is called for Session scope first and performs sorting +# down to the lower scopes such as to minimize number of "high scope" +# setups and teardowns. + + +@dataclasses.dataclass(frozen=True) +class FixtureArgKey: + argname: str + param_index: int + scoped_item_path: Path | None + item_cls: type | None + + +_V = TypeVar("_V") +OrderedSet = Dict[_V, None] + + +def get_parametrized_fixture_argkeys( + item: nodes.Item, scope: Scope +) -> Iterator[FixtureArgKey]: + """Return list of keys for all parametrized arguments which match + the specified scope.""" + assert scope is not Scope.Function + + try: + callspec: CallSpec2 = item.callspec # type: ignore[attr-defined] + except AttributeError: + return + + item_cls = None + if scope is Scope.Session: + scoped_item_path = None + elif scope is Scope.Package: + # Package key = module's directory. + scoped_item_path = item.path.parent + elif scope is Scope.Module: + scoped_item_path = item.path + elif scope is Scope.Class: + scoped_item_path = item.path + item_cls = item.cls # type: ignore[attr-defined] + else: + assert_never(scope) + + for argname in callspec.indices: + if callspec._arg2scope[argname] != scope: + continue + param_index = callspec.indices[argname] + yield FixtureArgKey(argname, param_index, scoped_item_path, item_cls) + + +def reorder_items(items: Sequence[nodes.Item]) -> list[nodes.Item]: + argkeys_by_item: dict[Scope, dict[nodes.Item, OrderedSet[FixtureArgKey]]] = {} + items_by_argkey: dict[ + Scope, dict[FixtureArgKey, OrderedDict[nodes.Item, None]] + ] = {} + for scope in HIGH_SCOPES: + scoped_argkeys_by_item = argkeys_by_item[scope] = {} + scoped_items_by_argkey = items_by_argkey[scope] = defaultdict(OrderedDict) + for item in items: + argkeys = dict.fromkeys(get_parametrized_fixture_argkeys(item, scope)) + if argkeys: + scoped_argkeys_by_item[item] = argkeys + for argkey in argkeys: + scoped_items_by_argkey[argkey][item] = None + + items_set = dict.fromkeys(items) + return list( + reorder_items_atscope( + items_set, argkeys_by_item, items_by_argkey, Scope.Session + ) + ) + + +def reorder_items_atscope( + items: OrderedSet[nodes.Item], + argkeys_by_item: Mapping[Scope, Mapping[nodes.Item, OrderedSet[FixtureArgKey]]], + items_by_argkey: Mapping[ + Scope, Mapping[FixtureArgKey, OrderedDict[nodes.Item, None]] + ], + scope: Scope, +) -> OrderedSet[nodes.Item]: + if scope is Scope.Function or len(items) < 3: + return items + + scoped_items_by_argkey = items_by_argkey[scope] + scoped_argkeys_by_item = argkeys_by_item[scope] + + ignore: set[FixtureArgKey] = set() + items_deque = deque(items) + items_done: OrderedSet[nodes.Item] = {} + while items_deque: + no_argkey_items: OrderedSet[nodes.Item] = {} + slicing_argkey = None + while items_deque: + item = items_deque.popleft() + if item in items_done or item in no_argkey_items: + continue + argkeys = dict.fromkeys( + k for k in scoped_argkeys_by_item.get(item, ()) if k not in ignore + ) + if not argkeys: + no_argkey_items[item] = None + else: + slicing_argkey, _ = argkeys.popitem() + # We don't have to remove relevant items from later in the + # deque because they'll just be ignored. + matching_items = [ + i for i in scoped_items_by_argkey[slicing_argkey] if i in items + ] + for i in reversed(matching_items): + items_deque.appendleft(i) + # Fix items_by_argkey order. + for other_scope in HIGH_SCOPES: + other_scoped_items_by_argkey = items_by_argkey[other_scope] + for argkey in argkeys_by_item[other_scope].get(i, ()): + other_scoped_items_by_argkey[argkey][i] = None + other_scoped_items_by_argkey[argkey].move_to_end( + i, last=False + ) + break + if no_argkey_items: + reordered_no_argkey_items = reorder_items_atscope( + no_argkey_items, argkeys_by_item, items_by_argkey, scope.next_lower() + ) + items_done.update(reordered_no_argkey_items) + if slicing_argkey is not None: + ignore.add(slicing_argkey) + return items_done + + +@dataclasses.dataclass(frozen=True) +class FuncFixtureInfo: + """Fixture-related information for a fixture-requesting item (e.g. test + function). + + This is used to examine the fixtures which an item requests statically + (known during collection). This includes autouse fixtures, fixtures + requested by the `usefixtures` marker, fixtures requested in the function + parameters, and the transitive closure of these. + + An item may also request fixtures dynamically (using `request.getfixturevalue`); + these are not reflected here. + """ + + __slots__ = ("argnames", "initialnames", "names_closure", "name2fixturedefs") + + # Fixture names that the item requests directly by function parameters. + argnames: tuple[str, ...] + # Fixture names that the item immediately requires. These include + # argnames + fixture names specified via usefixtures and via autouse=True in + # fixture definitions. + initialnames: tuple[str, ...] + # The transitive closure of the fixture names that the item requires. + # Note: can't include dynamic dependencies (`request.getfixturevalue` calls). + names_closure: list[str] + # A map from a fixture name in the transitive closure to the FixtureDefs + # matching the name which are applicable to this function. + # There may be multiple overriding fixtures with the same name. The + # sequence is ordered from furthest to closes to the function. + name2fixturedefs: dict[str, Sequence[FixtureDef[Any]]] + + def prune_dependency_tree(self) -> None: + """Recompute names_closure from initialnames and name2fixturedefs. + + Can only reduce names_closure, which means that the new closure will + always be a subset of the old one. The order is preserved. + + This method is needed because direct parametrization may shadow some + of the fixtures that were included in the originally built dependency + tree. In this way the dependency tree can get pruned, and the closure + of argnames may get reduced. + """ + closure: set[str] = set() + working_set = set(self.initialnames) + while working_set: + argname = working_set.pop() + # Argname may be something not included in the original names_closure, + # in which case we ignore it. This currently happens with pseudo + # FixtureDefs which wrap 'get_direct_param_fixture_func(request)'. + # So they introduce the new dependency 'request' which might have + # been missing in the original tree (closure). + if argname not in closure and argname in self.names_closure: + closure.add(argname) + if argname in self.name2fixturedefs: + working_set.update(self.name2fixturedefs[argname][-1].argnames) + + self.names_closure[:] = sorted(closure, key=self.names_closure.index) + + +class FixtureRequest(abc.ABC): + """The type of the ``request`` fixture. + + A request object gives access to the requesting test context and has a + ``param`` attribute in case the fixture is parametrized. + """ + + def __init__( + self, + pyfuncitem: Function, + fixturename: str | None, + arg2fixturedefs: dict[str, Sequence[FixtureDef[Any]]], + fixture_defs: dict[str, FixtureDef[Any]], + *, + _ispytest: bool = False, + ) -> None: + check_ispytest(_ispytest) + #: Fixture for which this request is being performed. + self.fixturename: Final = fixturename + self._pyfuncitem: Final = pyfuncitem + # The FixtureDefs for each fixture name requested by this item. + # Starts from the statically-known fixturedefs resolved during + # collection. Dynamically requested fixtures (using + # `request.getfixturevalue("foo")`) are added dynamically. + self._arg2fixturedefs: Final = arg2fixturedefs + # The evaluated argnames so far, mapping to the FixtureDef they resolved + # to. + self._fixture_defs: Final = fixture_defs + # Notes on the type of `param`: + # -`request.param` is only defined in parametrized fixtures, and will raise + # AttributeError otherwise. Python typing has no notion of "undefined", so + # this cannot be reflected in the type. + # - Technically `param` is only (possibly) defined on SubRequest, not + # FixtureRequest, but the typing of that is still in flux so this cheats. + # - In the future we might consider using a generic for the param type, but + # for now just using Any. + self.param: Any + + @property + def _fixturemanager(self) -> FixtureManager: + return self._pyfuncitem.session._fixturemanager + + @property + @abc.abstractmethod + def _scope(self) -> Scope: + raise NotImplementedError() + + @property + def scope(self) -> _ScopeName: + """Scope string, one of "function", "class", "module", "package", "session".""" + return self._scope.value + + @abc.abstractmethod + def _check_scope( + self, + requested_fixturedef: FixtureDef[object] | PseudoFixtureDef[object], + requested_scope: Scope, + ) -> None: + raise NotImplementedError() + + @property + def fixturenames(self) -> list[str]: + """Names of all active fixtures in this request.""" + result = list(self._pyfuncitem.fixturenames) + result.extend(set(self._fixture_defs).difference(result)) + return result + + @property + @abc.abstractmethod + def node(self): + """Underlying collection node (depends on current request scope).""" + raise NotImplementedError() + + @property + def config(self) -> Config: + """The pytest config object associated with this request.""" + return self._pyfuncitem.config + + @property + def function(self): + """Test function object if the request has a per-function scope.""" + if self.scope != "function": + raise AttributeError( + f"function not available in {self.scope}-scoped context" + ) + return self._pyfuncitem.obj + + @property + def cls(self): + """Class (can be None) where the test function was collected.""" + if self.scope not in ("class", "function"): + raise AttributeError(f"cls not available in {self.scope}-scoped context") + clscol = self._pyfuncitem.getparent(_pytest.python.Class) + if clscol: + return clscol.obj + + @property + def instance(self): + """Instance (can be None) on which test function was collected.""" + if self.scope != "function": + return None + return getattr(self._pyfuncitem, "instance", None) + + @property + def module(self): + """Python module object where the test function was collected.""" + if self.scope not in ("function", "class", "module"): + raise AttributeError(f"module not available in {self.scope}-scoped context") + mod = self._pyfuncitem.getparent(_pytest.python.Module) + assert mod is not None + return mod.obj + + @property + def path(self) -> Path: + """Path where the test function was collected.""" + if self.scope not in ("function", "class", "module", "package"): + raise AttributeError(f"path not available in {self.scope}-scoped context") + return self._pyfuncitem.path + + @property + def keywords(self) -> MutableMapping[str, Any]: + """Keywords/markers dictionary for the underlying node.""" + node: nodes.Node = self.node + return node.keywords + + @property + def session(self) -> Session: + """Pytest session object.""" + return self._pyfuncitem.session + + @abc.abstractmethod + def addfinalizer(self, finalizer: Callable[[], object]) -> None: + """Add finalizer/teardown function to be called without arguments after + the last test within the requesting test context finished execution.""" + raise NotImplementedError() + + def applymarker(self, marker: str | MarkDecorator) -> None: + """Apply a marker to a single test function invocation. + + This method is useful if you don't want to have a keyword/marker + on all function invocations. + + :param marker: + An object created by a call to ``pytest.mark.NAME(...)``. + """ + self.node.add_marker(marker) + + def raiseerror(self, msg: str | None) -> NoReturn: + """Raise a FixtureLookupError exception. + + :param msg: + An optional custom error message. + """ + raise FixtureLookupError(None, self, msg) + + def getfixturevalue(self, argname: str) -> Any: + """Dynamically run a named fixture function. + + Declaring fixtures via function argument is recommended where possible. + But if you can only decide whether to use another fixture at test + setup time, you may use this function to retrieve it inside a fixture + or test function body. + + This method can be used during the test setup phase or the test run + phase, but during the test teardown phase a fixture's value may not + be available. + + :param argname: + The fixture name. + :raises pytest.FixtureLookupError: + If the given fixture could not be found. + """ + # Note that in addition to the use case described in the docstring, + # getfixturevalue() is also called by pytest itself during item and fixture + # setup to evaluate the fixtures that are requested statically + # (using function parameters, autouse, etc). + + fixturedef = self._get_active_fixturedef(argname) + assert fixturedef.cached_result is not None, ( + f'The fixture value for "{argname}" is not available. ' + "This can happen when the fixture has already been torn down." + ) + return fixturedef.cached_result[0] + + def _iter_chain(self) -> Iterator[SubRequest]: + """Yield all SubRequests in the chain, from self up. + + Note: does *not* yield the TopRequest. + """ + current = self + while isinstance(current, SubRequest): + yield current + current = current._parent_request + + def _get_active_fixturedef( + self, argname: str + ) -> FixtureDef[object] | PseudoFixtureDef[object]: + if argname == "request": + cached_result = (self, [0], None) + return PseudoFixtureDef(cached_result, Scope.Function) + + # If we already finished computing a fixture by this name in this item, + # return it. + fixturedef = self._fixture_defs.get(argname) + if fixturedef is not None: + self._check_scope(fixturedef, fixturedef._scope) + return fixturedef + + # Find the appropriate fixturedef. + fixturedefs = self._arg2fixturedefs.get(argname, None) + if fixturedefs is None: + # We arrive here because of a dynamic call to + # getfixturevalue(argname) which was naturally + # not known at parsing/collection time. + fixturedefs = self._fixturemanager.getfixturedefs(argname, self._pyfuncitem) + if fixturedefs is not None: + self._arg2fixturedefs[argname] = fixturedefs + # No fixtures defined with this name. + if fixturedefs is None: + raise FixtureLookupError(argname, self) + # The are no fixtures with this name applicable for the function. + if not fixturedefs: + raise FixtureLookupError(argname, self) + # A fixture may override another fixture with the same name, e.g. a + # fixture in a module can override a fixture in a conftest, a fixture in + # a class can override a fixture in the module, and so on. + # An overriding fixture can request its own name (possibly indirectly); + # in this case it gets the value of the fixture it overrides, one level + # up. + # Check how many `argname`s deep we are, and take the next one. + # `fixturedefs` is sorted from furthest to closest, so use negative + # indexing to go in reverse. + index = -1 + for request in self._iter_chain(): + if request.fixturename == argname: + index -= 1 + # If already consumed all of the available levels, fail. + if -index > len(fixturedefs): + raise FixtureLookupError(argname, self) + fixturedef = fixturedefs[index] + + # Prepare a SubRequest object for calling the fixture. + try: + callspec = self._pyfuncitem.callspec + except AttributeError: + callspec = None + if callspec is not None and argname in callspec.params: + param = callspec.params[argname] + param_index = callspec.indices[argname] + # The parametrize invocation scope overrides the fixture's scope. + scope = callspec._arg2scope[argname] + else: + param = NOTSET + param_index = 0 + scope = fixturedef._scope + self._check_fixturedef_without_param(fixturedef) + self._check_scope(fixturedef, scope) + subrequest = SubRequest( + self, scope, param, param_index, fixturedef, _ispytest=True + ) + + # Make sure the fixture value is cached, running it if it isn't + fixturedef.execute(request=subrequest) + + self._fixture_defs[argname] = fixturedef + return fixturedef + + def _check_fixturedef_without_param(self, fixturedef: FixtureDef[object]) -> None: + """Check that this request is allowed to execute this fixturedef without + a param.""" + funcitem = self._pyfuncitem + has_params = fixturedef.params is not None + fixtures_not_supported = getattr(funcitem, "nofuncargs", False) + if has_params and fixtures_not_supported: + msg = ( + f"{funcitem.name} does not support fixtures, maybe unittest.TestCase subclass?\n" + f"Node id: {funcitem.nodeid}\n" + f"Function type: {type(funcitem).__name__}" + ) + fail(msg, pytrace=False) + if has_params: + frame = inspect.stack()[3] + frameinfo = inspect.getframeinfo(frame[0]) + source_path = absolutepath(frameinfo.filename) + source_lineno = frameinfo.lineno + try: + source_path_str = str(source_path.relative_to(funcitem.config.rootpath)) + except ValueError: + source_path_str = str(source_path) + location = getlocation(fixturedef.func, funcitem.config.rootpath) + msg = ( + "The requested fixture has no parameter defined for test:\n" + f" {funcitem.nodeid}\n\n" + f"Requested fixture '{fixturedef.argname}' defined in:\n" + f"{location}\n\n" + f"Requested here:\n" + f"{source_path_str}:{source_lineno}" + ) + fail(msg, pytrace=False) + + def _get_fixturestack(self) -> list[FixtureDef[Any]]: + values = [request._fixturedef for request in self._iter_chain()] + values.reverse() + return values + + +@final +class TopRequest(FixtureRequest): + """The type of the ``request`` fixture in a test function.""" + + def __init__(self, pyfuncitem: Function, *, _ispytest: bool = False) -> None: + super().__init__( + fixturename=None, + pyfuncitem=pyfuncitem, + arg2fixturedefs=pyfuncitem._fixtureinfo.name2fixturedefs.copy(), + fixture_defs={}, + _ispytest=_ispytest, + ) + + @property + def _scope(self) -> Scope: + return Scope.Function + + def _check_scope( + self, + requested_fixturedef: FixtureDef[object] | PseudoFixtureDef[object], + requested_scope: Scope, + ) -> None: + # TopRequest always has function scope so always valid. + pass + + @property + def node(self): + return self._pyfuncitem + + def __repr__(self) -> str: + return f"" + + def _fillfixtures(self) -> None: + item = self._pyfuncitem + for argname in item.fixturenames: + if argname not in item.funcargs: + item.funcargs[argname] = self.getfixturevalue(argname) + + def addfinalizer(self, finalizer: Callable[[], object]) -> None: + self.node.addfinalizer(finalizer) + + +@final +class SubRequest(FixtureRequest): + """The type of the ``request`` fixture in a fixture function requested + (transitively) by a test function.""" + + def __init__( + self, + request: FixtureRequest, + scope: Scope, + param: Any, + param_index: int, + fixturedef: FixtureDef[object], + *, + _ispytest: bool = False, + ) -> None: + super().__init__( + pyfuncitem=request._pyfuncitem, + fixturename=fixturedef.argname, + fixture_defs=request._fixture_defs, + arg2fixturedefs=request._arg2fixturedefs, + _ispytest=_ispytest, + ) + self._parent_request: Final[FixtureRequest] = request + self._scope_field: Final = scope + self._fixturedef: Final[FixtureDef[object]] = fixturedef + if param is not NOTSET: + self.param = param + self.param_index: Final = param_index + + def __repr__(self) -> str: + return f"" + + @property + def _scope(self) -> Scope: + return self._scope_field + + @property + def node(self): + scope = self._scope + if scope is Scope.Function: + # This might also be a non-function Item despite its attribute name. + node: nodes.Node | None = self._pyfuncitem + elif scope is Scope.Package: + node = get_scope_package(self._pyfuncitem, self._fixturedef) + else: + node = get_scope_node(self._pyfuncitem, scope) + if node is None and scope is Scope.Class: + # Fallback to function item itself. + node = self._pyfuncitem + assert node, f'Could not obtain a node for scope "{scope}" for function {self._pyfuncitem!r}' + return node + + def _check_scope( + self, + requested_fixturedef: FixtureDef[object] | PseudoFixtureDef[object], + requested_scope: Scope, + ) -> None: + if isinstance(requested_fixturedef, PseudoFixtureDef): + return + if self._scope > requested_scope: + # Try to report something helpful. + argname = requested_fixturedef.argname + fixture_stack = "\n".join( + self._format_fixturedef_line(fixturedef) + for fixturedef in self._get_fixturestack() + ) + requested_fixture = self._format_fixturedef_line(requested_fixturedef) + fail( + f"ScopeMismatch: You tried to access the {requested_scope.value} scoped " + f"fixture {argname} with a {self._scope.value} scoped request object. " + f"Requesting fixture stack:\n{fixture_stack}\n" + f"Requested fixture:\n{requested_fixture}", + pytrace=False, + ) + + def _format_fixturedef_line(self, fixturedef: FixtureDef[object]) -> str: + factory = fixturedef.func + path, lineno = getfslineno(factory) + if isinstance(path, Path): + path = bestrelpath(self._pyfuncitem.session.path, path) + signature = inspect.signature(factory) + return f"{path}:{lineno + 1}: def {factory.__name__}{signature}" + + def addfinalizer(self, finalizer: Callable[[], object]) -> None: + self._fixturedef.addfinalizer(finalizer) + + +@final +class FixtureLookupError(LookupError): + """Could not return a requested fixture (missing or invalid).""" + + def __init__( + self, argname: str | None, request: FixtureRequest, msg: str | None = None + ) -> None: + self.argname = argname + self.request = request + self.fixturestack = request._get_fixturestack() + self.msg = msg + + def formatrepr(self) -> FixtureLookupErrorRepr: + tblines: list[str] = [] + addline = tblines.append + stack = [self.request._pyfuncitem.obj] + stack.extend(map(lambda x: x.func, self.fixturestack)) + msg = self.msg + if msg is not None: + # The last fixture raise an error, let's present + # it at the requesting side. + stack = stack[:-1] + for function in stack: + fspath, lineno = getfslineno(function) + try: + lines, _ = inspect.getsourcelines(get_real_func(function)) + except (OSError, IndexError, TypeError): + error_msg = "file %s, line %s: source code not available" + addline(error_msg % (fspath, lineno + 1)) + else: + addline(f"file {fspath}, line {lineno + 1}") + for i, line in enumerate(lines): + line = line.rstrip() + addline(" " + line) + if line.lstrip().startswith("def"): + break + + if msg is None: + fm = self.request._fixturemanager + available = set() + parent = self.request._pyfuncitem.parent + assert parent is not None + for name, fixturedefs in fm._arg2fixturedefs.items(): + faclist = list(fm._matchfactories(fixturedefs, parent)) + if faclist: + available.add(name) + if self.argname in available: + msg = ( + f" recursive dependency involving fixture '{self.argname}' detected" + ) + else: + msg = f"fixture '{self.argname}' not found" + msg += "\n available fixtures: {}".format(", ".join(sorted(available))) + msg += "\n use 'pytest --fixtures [testpath]' for help on them." + + return FixtureLookupErrorRepr(fspath, lineno, tblines, msg, self.argname) + + +class FixtureLookupErrorRepr(TerminalRepr): + def __init__( + self, + filename: str | os.PathLike[str], + firstlineno: int, + tblines: Sequence[str], + errorstring: str, + argname: str | None, + ) -> None: + self.tblines = tblines + self.errorstring = errorstring + self.filename = filename + self.firstlineno = firstlineno + self.argname = argname + + def toterminal(self, tw: TerminalWriter) -> None: + # tw.line("FixtureLookupError: %s" %(self.argname), red=True) + for tbline in self.tblines: + tw.line(tbline.rstrip()) + lines = self.errorstring.split("\n") + if lines: + tw.line( + f"{FormattedExcinfo.fail_marker} {lines[0].strip()}", + red=True, + ) + for line in lines[1:]: + tw.line( + f"{FormattedExcinfo.flow_marker} {line.strip()}", + red=True, + ) + tw.line() + tw.line("%s:%d" % (os.fspath(self.filename), self.firstlineno + 1)) + + +def call_fixture_func( + fixturefunc: _FixtureFunc[FixtureValue], request: FixtureRequest, kwargs +) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) + fixture_result = fixturefunc(**kwargs) + return fixture_result + + +def _teardown_yield_fixture(fixturefunc, it) -> None: + """Execute the teardown of a fixture function by advancing the iterator + after the yield and ensure the iteration ends (if not it means there is + more than one yield in the function).""" + try: + next(it) + except StopIteration: + pass + else: + fs, lineno = getfslineno(fixturefunc) + fail( + f"fixture function has more than one 'yield':\n\n" + f"{Source(fixturefunc).indent()}\n" + f"{fs}:{lineno + 1}", + pytrace=False, + ) + + +def _eval_scope_callable( + scope_callable: Callable[[str, Config], _ScopeName], + fixture_name: str, + config: Config, +) -> _ScopeName: + try: + # Type ignored because there is no typing mechanism to specify + # keyword arguments, currently. + result = scope_callable(fixture_name=fixture_name, config=config) # type: ignore[call-arg] + except Exception as e: + raise TypeError( + f"Error evaluating {scope_callable} while defining fixture '{fixture_name}'.\n" + "Expected a function with the signature (*, fixture_name, config)" + ) from e + if not isinstance(result, str): + fail( + f"Expected {scope_callable} to return a 'str' while defining fixture '{fixture_name}', but it returned:\n" + f"{result!r}", + pytrace=False, + ) + return result + + +@final +class FixtureDef(Generic[FixtureValue]): + """A container for a fixture definition. + + Note: At this time, only explicitly documented fields and methods are + considered public stable API. + """ + + def __init__( + self, + config: Config, + baseid: str | None, + argname: str, + func: _FixtureFunc[FixtureValue], + scope: Scope | _ScopeName | Callable[[str, Config], _ScopeName] | None, + params: Sequence[object] | None, + ids: tuple[object | None, ...] | Callable[[Any], object | None] | None = None, + *, + _ispytest: bool = False, + ) -> None: + check_ispytest(_ispytest) + # The "base" node ID for the fixture. + # + # This is a node ID prefix. A fixture is only available to a node (e.g. + # a `Function` item) if the fixture's baseid is a nodeid of a parent of + # node. + # + # For a fixture found in a Collector's object (e.g. a `Module`s module, + # a `Class`'s class), the baseid is the Collector's nodeid. + # + # For a fixture found in a conftest plugin, the baseid is the conftest's + # directory path relative to the rootdir. + # + # For other plugins, the baseid is the empty string (always matches). + self.baseid: Final = baseid or "" + # Whether the fixture was found from a node or a conftest in the + # collection tree. Will be false for fixtures defined in non-conftest + # plugins. + self.has_location: Final = baseid is not None + # The fixture factory function. + self.func: Final = func + # The name by which the fixture may be requested. + self.argname: Final = argname + if scope is None: + scope = Scope.Function + elif callable(scope): + scope = _eval_scope_callable(scope, argname, config) + if isinstance(scope, str): + scope = Scope.from_user( + scope, descr=f"Fixture '{func.__name__}'", where=baseid + ) + self._scope: Final = scope + # If the fixture is directly parametrized, the parameter values. + self.params: Final = params + # If the fixture is directly parametrized, a tuple of explicit IDs to + # assign to the parameter values, or a callable to generate an ID given + # a parameter value. + self.ids: Final = ids + # The names requested by the fixtures. + self.argnames: Final = getfuncargnames(func, name=argname) + # If the fixture was executed, the current value of the fixture. + # Can change if the fixture is executed with different parameters. + self.cached_result: _FixtureCachedResult[FixtureValue] | None = None + self._finalizers: Final[list[Callable[[], object]]] = [] + + @property + def scope(self) -> _ScopeName: + """Scope string, one of "function", "class", "module", "package", "session".""" + return self._scope.value + + def addfinalizer(self, finalizer: Callable[[], object]) -> None: + self._finalizers.append(finalizer) + + def finish(self, request: SubRequest) -> None: + exceptions: list[BaseException] = [] + while self._finalizers: + fin = self._finalizers.pop() + try: + fin() + except BaseException as e: + exceptions.append(e) + node = request.node + node.ihook.pytest_fixture_post_finalizer(fixturedef=self, request=request) + # Even if finalization fails, we invalidate the cached fixture + # value and remove all finalizers because they may be bound methods + # which will keep instances alive. + self.cached_result = None + self._finalizers.clear() + if len(exceptions) == 1: + raise exceptions[0] + elif len(exceptions) > 1: + msg = f'errors while tearing down fixture "{self.argname}" of {node}' + raise BaseExceptionGroup(msg, exceptions[::-1]) + + def execute(self, request: SubRequest) -> FixtureValue: + """Return the value of this fixture, executing it if not cached.""" + # Ensure that the dependent fixtures requested by this fixture are loaded. + # This needs to be done before checking if we have a cached value, since + # if a dependent fixture has their cache invalidated, e.g. due to + # parametrization, they finalize themselves and fixtures depending on it + # (which will likely include this fixture) setting `self.cached_result = None`. + # See #4871 + requested_fixtures_that_should_finalize_us = [] + for argname in self.argnames: + fixturedef = request._get_active_fixturedef(argname) + # Saves requested fixtures in a list so we later can add our finalizer + # to them, ensuring that if a requested fixture gets torn down we get torn + # down first. This is generally handled by SetupState, but still currently + # needed when this fixture is not parametrized but depends on a parametrized + # fixture. + if not isinstance(fixturedef, PseudoFixtureDef): + requested_fixtures_that_should_finalize_us.append(fixturedef) + + # Check for (and return) cached value/exception. + if self.cached_result is not None: + request_cache_key = self.cache_key(request) + cache_key = self.cached_result[1] + try: + # Attempt to make a normal == check: this might fail for objects + # which do not implement the standard comparison (like numpy arrays -- #6497). + cache_hit = bool(request_cache_key == cache_key) + except (ValueError, RuntimeError): + # If the comparison raises, use 'is' as fallback. + cache_hit = request_cache_key is cache_key + + if cache_hit: + if self.cached_result[2] is not None: + exc, exc_tb = self.cached_result[2] + raise exc.with_traceback(exc_tb) + else: + result = self.cached_result[0] + return result + # We have a previous but differently parametrized fixture instance + # so we need to tear it down before creating a new one. + self.finish(request) + assert self.cached_result is None + + # Add finalizer to requested fixtures we saved previously. + # We make sure to do this after checking for cached value to avoid + # adding our finalizer multiple times. (#12135) + finalizer = functools.partial(self.finish, request=request) + for parent_fixture in requested_fixtures_that_should_finalize_us: + parent_fixture.addfinalizer(finalizer) + + ihook = request.node.ihook + try: + # Setup the fixture, run the code in it, and cache the value + # in self.cached_result + result = ihook.pytest_fixture_setup(fixturedef=self, request=request) + finally: + # schedule our finalizer, even if the setup failed + request.node.addfinalizer(finalizer) + + return result + + def cache_key(self, request: SubRequest) -> object: + return getattr(request, "param", None) + + def __repr__(self) -> str: + return f"" + + +def resolve_fixture_function( + fixturedef: FixtureDef[FixtureValue], request: FixtureRequest +) -> _FixtureFunc[FixtureValue]: + """Get the actual callable that can be called to obtain the fixture + value.""" + fixturefunc = fixturedef.func + # The fixture function needs to be bound to the actual + # request.instance so that code working with "fixturedef" behaves + # as expected. + instance = request.instance + if instance is not None: + # Handle the case where fixture is defined not in a test class, but some other class + # (for example a plugin class with a fixture), see #2270. + if hasattr(fixturefunc, "__self__") and not isinstance( + instance, + fixturefunc.__self__.__class__, + ): + return fixturefunc + fixturefunc = getimfunc(fixturedef.func) + if fixturefunc != fixturedef.func: + fixturefunc = fixturefunc.__get__(instance) + return fixturefunc + + +def pytest_fixture_setup( + fixturedef: FixtureDef[FixtureValue], request: SubRequest +) -> FixtureValue: + """Execution of fixture setup.""" + kwargs = {} + for argname in fixturedef.argnames: + kwargs[argname] = request.getfixturevalue(argname) + + fixturefunc = resolve_fixture_function(fixturedef, request) + my_cache_key = fixturedef.cache_key(request) + try: + result = call_fixture_func(fixturefunc, request, kwargs) + except TEST_OUTCOME as e: + if isinstance(e, skip.Exception): + # The test requested a fixture which caused a skip. + # Don't show the fixture as the skip location, as then the user + # wouldn't know which test skipped. + e._use_item_location = True + fixturedef.cached_result = (None, my_cache_key, (e, e.__traceback__)) + raise + fixturedef.cached_result = (result, my_cache_key, None) + return result + + +def wrap_function_to_error_out_if_called_directly( + function: FixtureFunction, + fixture_marker: FixtureFunctionMarker, +) -> FixtureFunction: + """Wrap the given fixture function so we can raise an error about it being called directly, + instead of used as an argument in a test function.""" + name = fixture_marker.name or function.__name__ + message = ( + f'Fixture "{name}" called directly. Fixtures are not meant to be called directly,\n' + "but are created automatically when test functions request them as parameters.\n" + "See https://docs.pytest.org/en/stable/explanation/fixtures.html for more information about fixtures, and\n" + "https://docs.pytest.org/en/stable/deprecations.html#calling-fixtures-directly about how to update your code." + ) + + @functools.wraps(function) + def result(*args, **kwargs): + fail(message, pytrace=False) + + # Keep reference to the original function in our own custom attribute so we don't unwrap + # further than this point and lose useful wrappings like @mock.patch (#3774). + result.__pytest_wrapped__ = _PytestWrapper(function) # type: ignore[attr-defined] + + return cast(FixtureFunction, result) + + +@final +@dataclasses.dataclass(frozen=True) +class FixtureFunctionMarker: + scope: _ScopeName | Callable[[str, Config], _ScopeName] + params: tuple[object, ...] | None + autouse: bool = False + ids: tuple[object | None, ...] | Callable[[Any], object | None] | None = None + name: str | None = None + + _ispytest: dataclasses.InitVar[bool] = False + + def __post_init__(self, _ispytest: bool) -> None: + check_ispytest(_ispytest) + + def __call__(self, function: FixtureFunction) -> FixtureFunction: + if inspect.isclass(function): + raise ValueError("class fixtures not supported (maybe in the future)") + + if getattr(function, "_pytestfixturefunction", False): + raise ValueError( + f"@pytest.fixture is being applied more than once to the same function {function.__name__!r}" + ) + + if hasattr(function, "pytestmark"): + warnings.warn(MARKED_FIXTURE, stacklevel=2) + + function = wrap_function_to_error_out_if_called_directly(function, self) + + name = self.name or function.__name__ + if name == "request": + location = getlocation(function) + fail( + f"'request' is a reserved word for fixtures, use another name:\n {location}", + pytrace=False, + ) + + # Type ignored because https://github.com/python/mypy/issues/2087. + function._pytestfixturefunction = self # type: ignore[attr-defined] + return function + + +@overload +def fixture( + fixture_function: FixtureFunction, + *, + scope: _ScopeName | Callable[[str, Config], _ScopeName] = ..., + params: Iterable[object] | None = ..., + autouse: bool = ..., + ids: Sequence[object | None] | Callable[[Any], object | None] | None = ..., + name: str | None = ..., +) -> FixtureFunction: ... + + +@overload +def fixture( + fixture_function: None = ..., + *, + scope: _ScopeName | Callable[[str, Config], _ScopeName] = ..., + params: Iterable[object] | None = ..., + autouse: bool = ..., + ids: Sequence[object | None] | Callable[[Any], object | None] | None = ..., + name: str | None = None, +) -> FixtureFunctionMarker: ... + + +def fixture( + fixture_function: FixtureFunction | None = None, + *, + scope: _ScopeName | Callable[[str, Config], _ScopeName] = "function", + params: Iterable[object] | None = None, + autouse: bool = False, + ids: Sequence[object | None] | Callable[[Any], object | None] | None = None, + name: str | None = None, +) -> FixtureFunctionMarker | FixtureFunction: + """Decorator to mark a fixture factory function. + + This decorator can be used, with or without parameters, to define a + fixture function. + + The name of the fixture function can later be referenced to cause its + invocation ahead of running tests: test modules or classes can use the + ``pytest.mark.usefixtures(fixturename)`` marker. + + Test functions can directly use fixture names as input arguments in which + case the fixture instance returned from the fixture function will be + injected. + + Fixtures can provide their values to test functions using ``return`` or + ``yield`` statements. When using ``yield`` the code block after the + ``yield`` statement is executed as teardown code regardless of the test + outcome, and must yield exactly once. + + :param scope: + The scope for which this fixture is shared; one of ``"function"`` + (default), ``"class"``, ``"module"``, ``"package"`` or ``"session"``. + + This parameter may also be a callable which receives ``(fixture_name, config)`` + as parameters, and must return a ``str`` with one of the values mentioned above. + + See :ref:`dynamic scope` in the docs for more information. + + :param params: + An optional list of parameters which will cause multiple invocations + of the fixture function and all of the tests using it. The current + parameter is available in ``request.param``. + + :param autouse: + If True, the fixture func is activated for all tests that can see it. + If False (the default), an explicit reference is needed to activate + the fixture. + + :param ids: + Sequence of ids each corresponding to the params so that they are + part of the test id. If no ids are provided they will be generated + automatically from the params. + + :param name: + The name of the fixture. This defaults to the name of the decorated + function. If a fixture is used in the same module in which it is + defined, the function name of the fixture will be shadowed by the + function arg that requests the fixture; one way to resolve this is to + name the decorated function ``fixture_`` and then use + ``@pytest.fixture(name='')``. + """ + fixture_marker = FixtureFunctionMarker( + scope=scope, + params=tuple(params) if params is not None else None, + autouse=autouse, + ids=None if ids is None else ids if callable(ids) else tuple(ids), + name=name, + _ispytest=True, + ) + + # Direct decoration. + if fixture_function: + return fixture_marker(fixture_function) + + return fixture_marker + + +def yield_fixture( + fixture_function=None, + *args, + scope="function", + params=None, + autouse=False, + ids=None, + name=None, +): + """(Return a) decorator to mark a yield-fixture factory function. + + .. deprecated:: 3.0 + Use :py:func:`pytest.fixture` directly instead. + """ + warnings.warn(YIELD_FIXTURE, stacklevel=2) + return fixture( + fixture_function, + *args, + scope=scope, + params=params, + autouse=autouse, + ids=ids, + name=name, + ) + + +@fixture(scope="session") +def pytestconfig(request: FixtureRequest) -> Config: + """Session-scoped fixture that returns the session's :class:`pytest.Config` + object. + + Example:: + + def test_foo(pytestconfig): + if pytestconfig.get_verbosity() > 0: + ... + + """ + return request.config + + +def pytest_addoption(parser: Parser) -> None: + parser.addini( + "usefixtures", + type="args", + default=[], + help="List of default fixtures to be used with this project", + ) + group = parser.getgroup("general") + group.addoption( + "--fixtures", + "--funcargs", + action="store_true", + dest="showfixtures", + default=False, + help="Show available fixtures, sorted by plugin appearance " + "(fixtures with leading '_' are only shown with '-v')", + ) + group.addoption( + "--fixtures-per-test", + action="store_true", + dest="show_fixtures_per_test", + default=False, + help="Show fixtures per test", + ) + + +def pytest_cmdline_main(config: Config) -> int | ExitCode | None: + if config.option.showfixtures: + showfixtures(config) + return 0 + if config.option.show_fixtures_per_test: + show_fixtures_per_test(config) + return 0 + return None + + +def _get_direct_parametrize_args(node: nodes.Node) -> set[str]: + """Return all direct parametrization arguments of a node, so we don't + mistake them for fixtures. + + Check https://github.com/pytest-dev/pytest/issues/5036. + + These things are done later as well when dealing with parametrization + so this could be improved. + """ + parametrize_argnames: set[str] = set() + for marker in node.iter_markers(name="parametrize"): + if not marker.kwargs.get("indirect", False): + p_argnames, _ = ParameterSet._parse_parametrize_args( + *marker.args, **marker.kwargs + ) + parametrize_argnames.update(p_argnames) + return parametrize_argnames + + +def deduplicate_names(*seqs: Iterable[str]) -> tuple[str, ...]: + """De-duplicate the sequence of names while keeping the original order.""" + # Ideally we would use a set, but it does not preserve insertion order. + return tuple(dict.fromkeys(name for seq in seqs for name in seq)) + + +class FixtureManager: + """pytest fixture definitions and information is stored and managed + from this class. + + During collection fm.parsefactories() is called multiple times to parse + fixture function definitions into FixtureDef objects and internal + data structures. + + During collection of test functions, metafunc-mechanics instantiate + a FuncFixtureInfo object which is cached per node/func-name. + This FuncFixtureInfo object is later retrieved by Function nodes + which themselves offer a fixturenames attribute. + + The FuncFixtureInfo object holds information about fixtures and FixtureDefs + relevant for a particular function. An initial list of fixtures is + assembled like this: + + - ini-defined usefixtures + - autouse-marked fixtures along the collection chain up from the function + - usefixtures markers at module/class/function level + - test function funcargs + + Subsequently the funcfixtureinfo.fixturenames attribute is computed + as the closure of the fixtures needed to setup the initial fixtures, + i.e. fixtures needed by fixture functions themselves are appended + to the fixturenames list. + + Upon the test-setup phases all fixturenames are instantiated, retrieved + by a lookup of their FuncFixtureInfo. + """ + + def __init__(self, session: Session) -> None: + self.session = session + self.config: Config = session.config + # Maps a fixture name (argname) to all of the FixtureDefs in the test + # suite/plugins defined with this name. Populated by parsefactories(). + # TODO: The order of the FixtureDefs list of each arg is significant, + # explain. + self._arg2fixturedefs: Final[dict[str, list[FixtureDef[Any]]]] = {} + self._holderobjseen: Final[set[object]] = set() + # A mapping from a nodeid to a list of autouse fixtures it defines. + self._nodeid_autousenames: Final[dict[str, list[str]]] = { + "": self.config.getini("usefixtures"), + } + session.config.pluginmanager.register(self, "funcmanage") + + def getfixtureinfo( + self, + node: nodes.Item, + func: Callable[..., object] | None, + cls: type | None, + ) -> FuncFixtureInfo: + """Calculate the :class:`FuncFixtureInfo` for an item. + + If ``func`` is None, or if the item sets an attribute + ``nofuncargs = True``, then ``func`` is not examined at all. + + :param node: + The item requesting the fixtures. + :param func: + The item's function. + :param cls: + If the function is a method, the method's class. + """ + if func is not None and not getattr(node, "nofuncargs", False): + argnames = getfuncargnames(func, name=node.name, cls=cls) + else: + argnames = () + usefixturesnames = self._getusefixturesnames(node) + autousenames = self._getautousenames(node) + initialnames = deduplicate_names(autousenames, usefixturesnames, argnames) + + direct_parametrize_args = _get_direct_parametrize_args(node) + + names_closure, arg2fixturedefs = self.getfixtureclosure( + parentnode=node, + initialnames=initialnames, + ignore_args=direct_parametrize_args, + ) + + return FuncFixtureInfo(argnames, initialnames, names_closure, arg2fixturedefs) + + def pytest_plugin_registered(self, plugin: _PluggyPlugin, plugin_name: str) -> None: + # Fixtures defined in conftest plugins are only visible to within the + # conftest's directory. This is unlike fixtures in non-conftest plugins + # which have global visibility. So for conftests, construct the base + # nodeid from the plugin name (which is the conftest path). + if plugin_name and plugin_name.endswith("conftest.py"): + # Note: we explicitly do *not* use `plugin.__file__` here -- The + # difference is that plugin_name has the correct capitalization on + # case-insensitive systems (Windows) and other normalization issues + # (issue #11816). + conftestpath = absolutepath(plugin_name) + try: + nodeid = str(conftestpath.parent.relative_to(self.config.rootpath)) + except ValueError: + nodeid = "" + if nodeid == ".": + nodeid = "" + if os.sep != nodes.SEP: + nodeid = nodeid.replace(os.sep, nodes.SEP) + else: + nodeid = None + + self.parsefactories(plugin, nodeid) + + def _getautousenames(self, node: nodes.Node) -> Iterator[str]: + """Return the names of autouse fixtures applicable to node.""" + for parentnode in node.listchain(): + basenames = self._nodeid_autousenames.get(parentnode.nodeid) + if basenames: + yield from basenames + + def _getusefixturesnames(self, node: nodes.Item) -> Iterator[str]: + """Return the names of usefixtures fixtures applicable to node.""" + for mark in node.iter_markers(name="usefixtures"): + yield from mark.args + + def getfixtureclosure( + self, + parentnode: nodes.Node, + initialnames: tuple[str, ...], + ignore_args: AbstractSet[str], + ) -> tuple[list[str], dict[str, Sequence[FixtureDef[Any]]]]: + # Collect the closure of all fixtures, starting with the given + # fixturenames as the initial set. As we have to visit all + # factory definitions anyway, we also return an arg2fixturedefs + # mapping so that the caller can reuse it and does not have + # to re-discover fixturedefs again for each fixturename + # (discovering matching fixtures for a given name/node is expensive). + + fixturenames_closure = list(initialnames) + + arg2fixturedefs: dict[str, Sequence[FixtureDef[Any]]] = {} + lastlen = -1 + while lastlen != len(fixturenames_closure): + lastlen = len(fixturenames_closure) + for argname in fixturenames_closure: + if argname in ignore_args: + continue + if argname in arg2fixturedefs: + continue + fixturedefs = self.getfixturedefs(argname, parentnode) + if fixturedefs: + arg2fixturedefs[argname] = fixturedefs + for arg in fixturedefs[-1].argnames: + if arg not in fixturenames_closure: + fixturenames_closure.append(arg) + + def sort_by_scope(arg_name: str) -> Scope: + try: + fixturedefs = arg2fixturedefs[arg_name] + except KeyError: + return Scope.Function + else: + return fixturedefs[-1]._scope + + fixturenames_closure.sort(key=sort_by_scope, reverse=True) + return fixturenames_closure, arg2fixturedefs + + def pytest_generate_tests(self, metafunc: Metafunc) -> None: + """Generate new tests based on parametrized fixtures used by the given metafunc""" + + def get_parametrize_mark_argnames(mark: Mark) -> Sequence[str]: + args, _ = ParameterSet._parse_parametrize_args(*mark.args, **mark.kwargs) + return args + + for argname in metafunc.fixturenames: + # Get the FixtureDefs for the argname. + fixture_defs = metafunc._arg2fixturedefs.get(argname) + if not fixture_defs: + # Will raise FixtureLookupError at setup time if not parametrized somewhere + # else (e.g @pytest.mark.parametrize) + continue + + # If the test itself parametrizes using this argname, give it + # precedence. + if any( + argname in get_parametrize_mark_argnames(mark) + for mark in metafunc.definition.iter_markers("parametrize") + ): + continue + + # In the common case we only look at the fixture def with the + # closest scope (last in the list). But if the fixture overrides + # another fixture, while requesting the super fixture, keep going + # in case the super fixture is parametrized (#1953). + for fixturedef in reversed(fixture_defs): + # Fixture is parametrized, apply it and stop. + if fixturedef.params is not None: + metafunc.parametrize( + argname, + fixturedef.params, + indirect=True, + scope=fixturedef.scope, + ids=fixturedef.ids, + ) + break + + # Not requesting the overridden super fixture, stop. + if argname not in fixturedef.argnames: + break + + # Try next super fixture, if any. + + def pytest_collection_modifyitems(self, items: list[nodes.Item]) -> None: + # Separate parametrized setups. + items[:] = reorder_items(items) + + def _register_fixture( + self, + *, + name: str, + func: _FixtureFunc[object], + nodeid: str | None, + scope: Scope | _ScopeName | Callable[[str, Config], _ScopeName] = "function", + params: Sequence[object] | None = None, + ids: tuple[object | None, ...] | Callable[[Any], object | None] | None = None, + autouse: bool = False, + ) -> None: + """Register a fixture + + :param name: + The fixture's name. + :param func: + The fixture's implementation function. + :param nodeid: + The visibility of the fixture. The fixture will be available to the + node with this nodeid and its children in the collection tree. + None means that the fixture is visible to the entire collection tree, + e.g. a fixture defined for general use in a plugin. + :param scope: + The fixture's scope. + :param params: + The fixture's parametrization params. + :param ids: + The fixture's IDs. + :param autouse: + Whether this is an autouse fixture. + """ + fixture_def = FixtureDef( + config=self.config, + baseid=nodeid, + argname=name, + func=func, + scope=scope, + params=params, + ids=ids, + _ispytest=True, + ) + + faclist = self._arg2fixturedefs.setdefault(name, []) + if fixture_def.has_location: + faclist.append(fixture_def) + else: + # fixturedefs with no location are at the front + # so this inserts the current fixturedef after the + # existing fixturedefs from external plugins but + # before the fixturedefs provided in conftests. + i = len([f for f in faclist if not f.has_location]) + faclist.insert(i, fixture_def) + if autouse: + self._nodeid_autousenames.setdefault(nodeid or "", []).append(name) + + @overload + def parsefactories( + self, + node_or_obj: nodes.Node, + ) -> None: + raise NotImplementedError() + + @overload + def parsefactories( + self, + node_or_obj: object, + nodeid: str | None, + ) -> None: + raise NotImplementedError() + + def parsefactories( + self, + node_or_obj: nodes.Node | object, + nodeid: str | NotSetType | None = NOTSET, + ) -> None: + """Collect fixtures from a collection node or object. + + Found fixtures are parsed into `FixtureDef`s and saved. + + If `node_or_object` is a collection node (with an underlying Python + object), the node's object is traversed and the node's nodeid is used to + determine the fixtures' visibility. `nodeid` must not be specified in + this case. + + If `node_or_object` is an object (e.g. a plugin), the object is + traversed and the given `nodeid` is used to determine the fixtures' + visibility. `nodeid` must be specified in this case; None and "" mean + total visibility. + """ + if nodeid is not NOTSET: + holderobj = node_or_obj + else: + assert isinstance(node_or_obj, nodes.Node) + holderobj = cast(object, node_or_obj.obj) # type: ignore[attr-defined] + assert isinstance(node_or_obj.nodeid, str) + nodeid = node_or_obj.nodeid + if holderobj in self._holderobjseen: + return + + # Avoid accessing `@property` (and other descriptors) when iterating fixtures. + if not safe_isclass(holderobj) and not isinstance(holderobj, types.ModuleType): + holderobj_tp: object = type(holderobj) + else: + holderobj_tp = holderobj + + self._holderobjseen.add(holderobj) + for name in dir(holderobj): + # The attribute can be an arbitrary descriptor, so the attribute + # access below can raise. safe_getattr() ignores such exceptions. + obj_ub = safe_getattr(holderobj_tp, name, None) + marker = getfixturemarker(obj_ub) + if not isinstance(marker, FixtureFunctionMarker): + # Magic globals with __getattr__ might have got us a wrong + # fixture attribute. + continue + + # OK we know it is a fixture -- now safe to look up on the _instance_. + obj = getattr(holderobj, name) + + if marker.name: + name = marker.name + + # During fixture definition we wrap the original fixture function + # to issue a warning if called directly, so here we unwrap it in + # order to not emit the warning when pytest itself calls the + # fixture function. + func = get_real_method(obj, holderobj) + + self._register_fixture( + name=name, + nodeid=nodeid, + func=func, + scope=marker.scope, + params=marker.params, + ids=marker.ids, + autouse=marker.autouse, + ) + + def getfixturedefs( + self, argname: str, node: nodes.Node + ) -> Sequence[FixtureDef[Any]] | None: + """Get FixtureDefs for a fixture name which are applicable + to a given node. + + Returns None if there are no fixtures at all defined with the given + name. (This is different from the case in which there are fixtures + with the given name, but none applicable to the node. In this case, + an empty result is returned). + + :param argname: Name of the fixture to search for. + :param node: The requesting Node. + """ + try: + fixturedefs = self._arg2fixturedefs[argname] + except KeyError: + return None + return tuple(self._matchfactories(fixturedefs, node)) + + def _matchfactories( + self, fixturedefs: Iterable[FixtureDef[Any]], node: nodes.Node + ) -> Iterator[FixtureDef[Any]]: + parentnodeids = {n.nodeid for n in node.iter_parents()} + for fixturedef in fixturedefs: + if fixturedef.baseid in parentnodeids: + yield fixturedef + + +def show_fixtures_per_test(config: Config) -> int | ExitCode: + from _pytest.main import wrap_session + + return wrap_session(config, _show_fixtures_per_test) + + +_PYTEST_DIR = Path(_pytest.__file__).parent + + +def _pretty_fixture_path(invocation_dir: Path, func) -> str: + loc = Path(getlocation(func, invocation_dir)) + prefix = Path("...", "_pytest") + try: + return str(prefix / loc.relative_to(_PYTEST_DIR)) + except ValueError: + return bestrelpath(invocation_dir, loc) + + +def _show_fixtures_per_test(config: Config, session: Session) -> None: + import _pytest.config + + session.perform_collect() + invocation_dir = config.invocation_params.dir + tw = _pytest.config.create_terminal_writer(config) + verbose = config.get_verbosity() + + def get_best_relpath(func) -> str: + loc = getlocation(func, invocation_dir) + return bestrelpath(invocation_dir, Path(loc)) + + def write_fixture(fixture_def: FixtureDef[object]) -> None: + argname = fixture_def.argname + if verbose <= 0 and argname.startswith("_"): + return + prettypath = _pretty_fixture_path(invocation_dir, fixture_def.func) + tw.write(f"{argname}", green=True) + tw.write(f" -- {prettypath}", yellow=True) + tw.write("\n") + fixture_doc = inspect.getdoc(fixture_def.func) + if fixture_doc: + write_docstring( + tw, + fixture_doc.split("\n\n", maxsplit=1)[0] + if verbose <= 0 + else fixture_doc, + ) + else: + tw.line(" no docstring available", red=True) + + def write_item(item: nodes.Item) -> None: + # Not all items have _fixtureinfo attribute. + info: FuncFixtureInfo | None = getattr(item, "_fixtureinfo", None) + if info is None or not info.name2fixturedefs: + # This test item does not use any fixtures. + return + tw.line() + tw.sep("-", f"fixtures used by {item.name}") + # TODO: Fix this type ignore. + tw.sep("-", f"({get_best_relpath(item.function)})") # type: ignore[attr-defined] + # dict key not used in loop but needed for sorting. + for _, fixturedefs in sorted(info.name2fixturedefs.items()): + assert fixturedefs is not None + if not fixturedefs: + continue + # Last item is expected to be the one used by the test item. + write_fixture(fixturedefs[-1]) + + for session_item in session.items: + write_item(session_item) + + +def showfixtures(config: Config) -> int | ExitCode: + from _pytest.main import wrap_session + + return wrap_session(config, _showfixtures_main) + + +def _showfixtures_main(config: Config, session: Session) -> None: + import _pytest.config + + session.perform_collect() + invocation_dir = config.invocation_params.dir + tw = _pytest.config.create_terminal_writer(config) + verbose = config.get_verbosity() + + fm = session._fixturemanager + + available = [] + seen: set[tuple[str, str]] = set() + + for argname, fixturedefs in fm._arg2fixturedefs.items(): + assert fixturedefs is not None + if not fixturedefs: + continue + for fixturedef in fixturedefs: + loc = getlocation(fixturedef.func, invocation_dir) + if (fixturedef.argname, loc) in seen: + continue + seen.add((fixturedef.argname, loc)) + available.append( + ( + len(fixturedef.baseid), + fixturedef.func.__module__, + _pretty_fixture_path(invocation_dir, fixturedef.func), + fixturedef.argname, + fixturedef, + ) + ) + + available.sort() + currentmodule = None + for baseid, module, prettypath, argname, fixturedef in available: + if currentmodule != module: + if not module.startswith("_pytest."): + tw.line() + tw.sep("-", f"fixtures defined from {module}") + currentmodule = module + if verbose <= 0 and argname.startswith("_"): + continue + tw.write(f"{argname}", green=True) + if fixturedef.scope != "function": + tw.write(f" [{fixturedef.scope} scope]", cyan=True) + tw.write(f" -- {prettypath}", yellow=True) + tw.write("\n") + doc = inspect.getdoc(fixturedef.func) + if doc: + write_docstring( + tw, doc.split("\n\n", maxsplit=1)[0] if verbose <= 0 else doc + ) + else: + tw.line(" no docstring available", red=True) + tw.line() + + +def write_docstring(tw: TerminalWriter, doc: str, indent: str = " ") -> None: + for line in doc.split("\n"): + tw.line(indent + line) diff --git a/.venv/Lib/site-packages/_pytest/freeze_support.py b/.venv/Lib/site-packages/_pytest/freeze_support.py new file mode 100644 index 00000000..2ba6f9b8 --- /dev/null +++ b/.venv/Lib/site-packages/_pytest/freeze_support.py @@ -0,0 +1,45 @@ +"""Provides a function to report all internal modules for using freezing +tools.""" + +from __future__ import annotations + +import types +from typing import Iterator + + +def freeze_includes() -> list[str]: + """Return a list of module names used by pytest that should be + included by cx_freeze.""" + import _pytest + + result = list(_iter_all_modules(_pytest)) + return result + + +def _iter_all_modules( + package: str | types.ModuleType, + prefix: str = "", +) -> Iterator[str]: + """Iterate over the names of all modules that can be found in the given + package, recursively. + + >>> import _pytest + >>> list(_iter_all_modules(_pytest)) + ['_pytest._argcomplete', '_pytest._code.code', ...] + """ + import os + import pkgutil + + if isinstance(package, str): + path = package + else: + # Type ignored because typeshed doesn't define ModuleType.__path__ + # (only defined on packages). + package_path = package.__path__ + path, prefix = package_path[0], package.__name__ + "." + for _, name, is_package in pkgutil.iter_modules([path]): + if is_package: + for m in _iter_all_modules(os.path.join(path, name), prefix=name + "."): + yield prefix + m + else: + yield prefix + name diff --git a/.venv/Lib/site-packages/_pytest/helpconfig.py b/.venv/Lib/site-packages/_pytest/helpconfig.py new file mode 100644 index 00000000..1886d5c9 --- /dev/null +++ b/.venv/Lib/site-packages/_pytest/helpconfig.py @@ -0,0 +1,276 @@ +# mypy: allow-untyped-defs +"""Version info, help messages, tracing configuration.""" + +from __future__ import annotations + +from argparse import Action +import os +import sys +from typing import Generator + +from _pytest.config import Config +from _pytest.config import ExitCode +from _pytest.config import PrintHelp +from _pytest.config.argparsing import Parser +from _pytest.terminal import TerminalReporter +import pytest + + +class HelpAction(Action): + """An argparse Action that will raise an exception in order to skip the + rest of the argument parsing when --help is passed. + + This prevents argparse from quitting due to missing required arguments + when any are defined, for example by ``pytest_addoption``. + This is similar to the way that the builtin argparse --help option is + implemented by raising SystemExit. + """ + + def __init__(self, option_strings, dest=None, default=False, help=None): + super().__init__( + option_strings=option_strings, + dest=dest, + const=True, + default=default, + nargs=0, + help=help, + ) + + def __call__(self, parser, namespace, values, option_string=None): + setattr(namespace, self.dest, self.const) + + # We should only skip the rest of the parsing after preparse is done. + if getattr(parser._parser, "after_preparse", False): + raise PrintHelp + + +def pytest_addoption(parser: Parser) -> None: + group = parser.getgroup("debugconfig") + group.addoption( + "--version", + "-V", + action="count", + default=0, + dest="version", + help="Display pytest version and information about plugins. " + "When given twice, also display information about plugins.", + ) + group._addoption( + "-h", + "--help", + action=HelpAction, + dest="help", + help="Show help message and configuration info", + ) + group._addoption( + "-p", + action="append", + dest="plugins", + default=[], + metavar="name", + help="Early-load given plugin module name or entry point (multi-allowed). " + "To avoid loading of plugins, use the `no:` prefix, e.g. " + "`no:doctest`.", + ) + group.addoption( + "--traceconfig", + "--trace-config", + action="store_true", + default=False, + help="Trace considerations of conftest.py files", + ) + group.addoption( + "--debug", + action="store", + nargs="?", + const="pytestdebug.log", + dest="debug", + metavar="DEBUG_FILE_NAME", + help="Store internal tracing debug information in this log file. " + "This file is opened with 'w' and truncated as a result, care advised. " + "Default: pytestdebug.log.", + ) + group._addoption( + "-o", + "--override-ini", + dest="override_ini", + action="append", + help='Override ini option with "option=value" style, ' + "e.g. `-o xfail_strict=True -o cache_dir=cache`.", + ) + + +@pytest.hookimpl(wrapper=True) +def pytest_cmdline_parse() -> Generator[None, Config, Config]: + config = yield + + if config.option.debug: + # --debug | --debug was provided. + path = config.option.debug + debugfile = open(path, "w", encoding="utf-8") + debugfile.write( + "versions pytest-{}, " + "python-{}\ninvocation_dir={}\ncwd={}\nargs={}\n\n".format( + pytest.__version__, + ".".join(map(str, sys.version_info)), + config.invocation_params.dir, + os.getcwd(), + config.invocation_params.args, + ) + ) + config.trace.root.setwriter(debugfile.write) + undo_tracing = config.pluginmanager.enable_tracing() + sys.stderr.write(f"writing pytest debug information to {path}\n") + + def unset_tracing() -> None: + debugfile.close() + sys.stderr.write(f"wrote pytest debug information to {debugfile.name}\n") + config.trace.root.setwriter(None) + undo_tracing() + + config.add_cleanup(unset_tracing) + + return config + + +def showversion(config: Config) -> None: + if config.option.version > 1: + sys.stdout.write( + f"This is pytest version {pytest.__version__}, imported from {pytest.__file__}\n" + ) + plugininfo = getpluginversioninfo(config) + if plugininfo: + for line in plugininfo: + sys.stdout.write(line + "\n") + else: + sys.stdout.write(f"pytest {pytest.__version__}\n") + + +def pytest_cmdline_main(config: Config) -> int | ExitCode | None: + if config.option.version > 0: + showversion(config) + return 0 + elif config.option.help: + config._do_configure() + showhelp(config) + config._ensure_unconfigure() + return 0 + return None + + +def showhelp(config: Config) -> None: + import textwrap + + reporter: TerminalReporter | None = config.pluginmanager.get_plugin( + "terminalreporter" + ) + assert reporter is not None + tw = reporter._tw + tw.write(config._parser.optparser.format_help()) + tw.line() + tw.line( + "[pytest] ini-options in the first " + "pytest.ini|tox.ini|setup.cfg|pyproject.toml file found:" + ) + tw.line() + + columns = tw.fullwidth # costly call + indent_len = 24 # based on argparse's max_help_position=24 + indent = " " * indent_len + for name in config._parser._ininames: + help, type, default = config._parser._inidict[name] + if type is None: + type = "string" + if help is None: + raise TypeError(f"help argument cannot be None for {name}") + spec = f"{name} ({type}):" + tw.write(f" {spec}") + spec_len = len(spec) + if spec_len > (indent_len - 3): + # Display help starting at a new line. + tw.line() + helplines = textwrap.wrap( + help, + columns, + initial_indent=indent, + subsequent_indent=indent, + break_on_hyphens=False, + ) + + for line in helplines: + tw.line(line) + else: + # Display help starting after the spec, following lines indented. + tw.write(" " * (indent_len - spec_len - 2)) + wrapped = textwrap.wrap(help, columns - indent_len, break_on_hyphens=False) + + if wrapped: + tw.line(wrapped[0]) + for line in wrapped[1:]: + tw.line(indent + line) + + tw.line() + tw.line("Environment variables:") + vars = [ + ( + "CI", + "When set (regardless of value), pytest knows it is running in a " + "CI process and does not truncate summary info", + ), + ("BUILD_NUMBER", "Equivalent to CI"), + ("PYTEST_ADDOPTS", "Extra command line options"), + ("PYTEST_PLUGINS", "Comma-separated plugins to load during startup"), + ("PYTEST_DISABLE_PLUGIN_AUTOLOAD", "Set to disable plugin auto-loading"), + ("PYTEST_DEBUG", "Set to enable debug tracing of pytest's internals"), + ] + for name, help in vars: + tw.line(f" {name:<24} {help}") + tw.line() + tw.line() + + tw.line("to see available markers type: pytest --markers") + tw.line("to see available fixtures type: pytest --fixtures") + tw.line( + "(shown according to specified file_or_dir or current dir " + "if not specified; fixtures with leading '_' are only shown " + "with the '-v' option" + ) + + for warningreport in reporter.stats.get("warnings", []): + tw.line("warning : " + warningreport.message, red=True) + + +conftest_options = [("pytest_plugins", "list of plugin names to load")] + + +def getpluginversioninfo(config: Config) -> list[str]: + lines = [] + plugininfo = config.pluginmanager.list_plugin_distinfo() + if plugininfo: + lines.append("registered third-party plugins:") + for plugin, dist in plugininfo: + loc = getattr(plugin, "__file__", repr(plugin)) + content = f"{dist.project_name}-{dist.version} at {loc}" + lines.append(" " + content) + return lines + + +def pytest_report_header(config: Config) -> list[str]: + lines = [] + if config.option.debug or config.option.traceconfig: + lines.append(f"using: pytest-{pytest.__version__}") + + verinfo = getpluginversioninfo(config) + if verinfo: + lines.extend(verinfo) + + if config.option.traceconfig: + lines.append("active plugins:") + items = config.pluginmanager.list_name_plugin() + for name, plugin in items: + if hasattr(plugin, "__file__"): + r = plugin.__file__ + else: + r = repr(plugin) + lines.append(f" {name:<20}: {r}") + return lines diff --git a/.venv/Lib/site-packages/_pytest/hookspec.py b/.venv/Lib/site-packages/_pytest/hookspec.py new file mode 100644 index 00000000..0a41b0ac --- /dev/null +++ b/.venv/Lib/site-packages/_pytest/hookspec.py @@ -0,0 +1,1333 @@ +# mypy: allow-untyped-defs +# ruff: noqa: T100 +"""Hook specifications for pytest plugins which are invoked by pytest itself +and by builtin plugins.""" + +from __future__ import annotations + +from pathlib import Path +from typing import Any +from typing import Mapping +from typing import Sequence +from typing import TYPE_CHECKING + +from pluggy import HookspecMarker + +from .deprecated import HOOK_LEGACY_PATH_ARG + + +if TYPE_CHECKING: + import pdb + from typing import Literal + import warnings + + from _pytest._code.code import ExceptionInfo + from _pytest._code.code import ExceptionRepr + from _pytest.compat import LEGACY_PATH + from _pytest.config import _PluggyPlugin + from _pytest.config import Config + from _pytest.config import ExitCode + from _pytest.config import PytestPluginManager + from _pytest.config.argparsing import Parser + from _pytest.fixtures import FixtureDef + from _pytest.fixtures import SubRequest + from _pytest.main import Session + from _pytest.nodes import Collector + from _pytest.nodes import Item + from _pytest.outcomes import Exit + from _pytest.python import Class + from _pytest.python import Function + from _pytest.python import Metafunc + from _pytest.python import Module + from _pytest.reports import CollectReport + from _pytest.reports import TestReport + from _pytest.runner import CallInfo + from _pytest.terminal import TerminalReporter + from _pytest.terminal import TestShortLogReport + + +hookspec = HookspecMarker("pytest") + +# ------------------------------------------------------------------------- +# Initialization hooks called for every plugin +# ------------------------------------------------------------------------- + + +@hookspec(historic=True) +def pytest_addhooks(pluginmanager: PytestPluginManager) -> None: + """Called at plugin registration time to allow adding new hooks via a call to + :func:`pluginmanager.add_hookspecs(module_or_class, prefix) `. + + :param pluginmanager: The pytest plugin manager. + + .. note:: + This hook is incompatible with hook wrappers. + + Use in conftest plugins + ======================= + + If a conftest plugin implements this hook, it will be called immediately + when the conftest is registered. + """ + + +@hookspec(historic=True) +def pytest_plugin_registered( + plugin: _PluggyPlugin, + plugin_name: str, + manager: PytestPluginManager, +) -> None: + """A new pytest plugin got registered. + + :param plugin: The plugin module or instance. + :param plugin_name: The name by which the plugin is registered. + :param manager: The pytest plugin manager. + + .. note:: + This hook is incompatible with hook wrappers. + + Use in conftest plugins + ======================= + + If a conftest plugin implements this hook, it will be called immediately + when the conftest is registered, once for each plugin registered thus far + (including itself!), and for all plugins thereafter when they are + registered. + """ + + +@hookspec(historic=True) +def pytest_addoption(parser: Parser, pluginmanager: PytestPluginManager) -> None: + """Register argparse-style options and ini-style config values, + called once at the beginning of a test run. + + :param parser: + To add command line options, call + :py:func:`parser.addoption(...) `. + To add ini-file values call :py:func:`parser.addini(...) + `. + + :param pluginmanager: + The pytest plugin manager, which can be used to install :py:func:`~pytest.hookspec`'s + or :py:func:`~pytest.hookimpl`'s and allow one plugin to call another plugin's hooks + to change how command line options are added. + + Options can later be accessed through the + :py:class:`config ` object, respectively: + + - :py:func:`config.getoption(name) ` to + retrieve the value of a command line option. + + - :py:func:`config.getini(name) ` to retrieve + a value read from an ini-style file. + + The config object is passed around on many internal objects via the ``.config`` + attribute or can be retrieved as the ``pytestconfig`` fixture. + + .. note:: + This hook is incompatible with hook wrappers. + + Use in conftest plugins + ======================= + + If a conftest plugin implements this hook, it will be called immediately + when the conftest is registered. + + This hook is only called for :ref:`initial conftests `. + """ + + +@hookspec(historic=True) +def pytest_configure(config: Config) -> None: + """Allow plugins and conftest files to perform initial configuration. + + .. note:: + This hook is incompatible with hook wrappers. + + :param config: The pytest config object. + + Use in conftest plugins + ======================= + + This hook is called for every :ref:`initial conftest ` file + after command line options have been parsed. After that, the hook is called + for other conftest files as they are registered. + """ + + +# ------------------------------------------------------------------------- +# Bootstrapping hooks called for plugins registered early enough: +# internal and 3rd party plugins. +# ------------------------------------------------------------------------- + + +@hookspec(firstresult=True) +def pytest_cmdline_parse( + pluginmanager: PytestPluginManager, args: list[str] +) -> Config | None: + """Return an initialized :class:`~pytest.Config`, parsing the specified args. + + Stops at first non-None result, see :ref:`firstresult`. + + .. note:: + This hook is only called for plugin classes passed to the + ``plugins`` arg when using `pytest.main`_ to perform an in-process + test run. + + :param pluginmanager: The pytest plugin manager. + :param args: List of arguments passed on the command line. + :returns: A pytest config object. + + Use in conftest plugins + ======================= + + This hook is not called for conftest files. + """ + + +def pytest_load_initial_conftests( + early_config: Config, parser: Parser, args: list[str] +) -> None: + """Called to implement the loading of :ref:`initial conftest files + ` ahead of command line option parsing. + + :param early_config: The pytest config object. + :param args: Arguments passed on the command line. + :param parser: To add command line options. + + Use in conftest plugins + ======================= + + This hook is not called for conftest files. + """ + + +@hookspec(firstresult=True) +def pytest_cmdline_main(config: Config) -> ExitCode | int | None: + """Called for performing the main command line action. + + The default implementation will invoke the configure hooks and + :hook:`pytest_runtestloop`. + + Stops at first non-None result, see :ref:`firstresult`. + + :param config: The pytest config object. + :returns: The exit code. + + Use in conftest plugins + ======================= + + This hook is only called for :ref:`initial conftests `. + """ + + +# ------------------------------------------------------------------------- +# collection hooks +# ------------------------------------------------------------------------- + + +@hookspec(firstresult=True) +def pytest_collection(session: Session) -> object | None: + """Perform the collection phase for the given session. + + Stops at first non-None result, see :ref:`firstresult`. + The return value is not used, but only stops further processing. + + The default collection phase is this (see individual hooks for full details): + + 1. Starting from ``session`` as the initial collector: + + 1. ``pytest_collectstart(collector)`` + 2. ``report = pytest_make_collect_report(collector)`` + 3. ``pytest_exception_interact(collector, call, report)`` if an interactive exception occurred + 4. For each collected node: + + 1. If an item, ``pytest_itemcollected(item)`` + 2. If a collector, recurse into it. + + 5. ``pytest_collectreport(report)`` + + 2. ``pytest_collection_modifyitems(session, config, items)`` + + 1. ``pytest_deselected(items)`` for any deselected items (may be called multiple times) + + 3. ``pytest_collection_finish(session)`` + 4. Set ``session.items`` to the list of collected items + 5. Set ``session.testscollected`` to the number of collected items + + You can implement this hook to only perform some action before collection, + for example the terminal plugin uses it to start displaying the collection + counter (and returns `None`). + + :param session: The pytest session object. + + Use in conftest plugins + ======================= + + This hook is only called for :ref:`initial conftests `. + """ + + +def pytest_collection_modifyitems( + session: Session, config: Config, items: list[Item] +) -> None: + """Called after collection has been performed. May filter or re-order + the items in-place. + + When items are deselected (filtered out from ``items``), + the hook :hook:`pytest_deselected` must be called explicitly + with the deselected items to properly notify other plugins, + e.g. with ``config.hook.pytest_deselected(deselected_items)``. + + :param session: The pytest session object. + :param config: The pytest config object. + :param items: List of item objects. + + Use in conftest plugins + ======================= + + Any conftest plugin can implement this hook. + """ + + +def pytest_collection_finish(session: Session) -> None: + """Called after collection has been performed and modified. + + :param session: The pytest session object. + + Use in conftest plugins + ======================= + + Any conftest plugin can implement this hook. + """ + + +@hookspec( + firstresult=True, + warn_on_impl_args={ + "path": HOOK_LEGACY_PATH_ARG.format( + pylib_path_arg="path", pathlib_path_arg="collection_path" + ), + }, +) +def pytest_ignore_collect( + collection_path: Path, path: LEGACY_PATH, config: Config +) -> bool | None: + """Return ``True`` to ignore this path for collection. + + Return ``None`` to let other plugins ignore the path for collection. + + Returning ``False`` will forcefully *not* ignore this path for collection, + without giving a chance for other plugins to ignore this path. + + This hook is consulted for all files and directories prior to calling + more specific hooks. + + Stops at first non-None result, see :ref:`firstresult`. + + :param collection_path: The path to analyze. + :type collection_path: pathlib.Path + :param path: The path to analyze (deprecated). + :param config: The pytest config object. + + .. versionchanged:: 7.0.0 + The ``collection_path`` parameter was added as a :class:`pathlib.Path` + equivalent of the ``path`` parameter. The ``path`` parameter + has been deprecated. + + Use in conftest plugins + ======================= + + Any conftest file can implement this hook. For a given collection path, only + conftest files in parent directories of the collection path are consulted + (if the path is a directory, its own conftest file is *not* consulted - a + directory cannot ignore itself!). + """ + + +@hookspec(firstresult=True) +def pytest_collect_directory(path: Path, parent: Collector) -> Collector | None: + """Create a :class:`~pytest.Collector` for the given directory, or None if + not relevant. + + .. versionadded:: 8.0 + + For best results, the returned collector should be a subclass of + :class:`~pytest.Directory`, but this is not required. + + The new node needs to have the specified ``parent`` as a parent. + + Stops at first non-None result, see :ref:`firstresult`. + + :param path: The path to analyze. + :type path: pathlib.Path + + See :ref:`custom directory collectors` for a simple example of use of this + hook. + + Use in conftest plugins + ======================= + + Any conftest file can implement this hook. For a given collection path, only + conftest files in parent directories of the collection path are consulted + (if the path is a directory, its own conftest file is *not* consulted - a + directory cannot collect itself!). + """ + + +@hookspec( + warn_on_impl_args={ + "path": HOOK_LEGACY_PATH_ARG.format( + pylib_path_arg="path", pathlib_path_arg="file_path" + ), + }, +) +def pytest_collect_file( + file_path: Path, path: LEGACY_PATH, parent: Collector +) -> Collector | None: + """Create a :class:`~pytest.Collector` for the given path, or None if not relevant. + + For best results, the returned collector should be a subclass of + :class:`~pytest.File`, but this is not required. + + The new node needs to have the specified ``parent`` as a parent. + + :param file_path: The path to analyze. + :type file_path: pathlib.Path + :param path: The path to collect (deprecated). + + .. versionchanged:: 7.0.0 + The ``file_path`` parameter was added as a :class:`pathlib.Path` + equivalent of the ``path`` parameter. The ``path`` parameter + has been deprecated. + + Use in conftest plugins + ======================= + + Any conftest file can implement this hook. For a given file path, only + conftest files in parent directories of the file path are consulted. + """ + + +# logging hooks for collection + + +def pytest_collectstart(collector: Collector) -> None: + """Collector starts collecting. + + :param collector: + The collector. + + Use in conftest plugins + ======================= + + Any conftest file can implement this hook. For a given collector, only + conftest files in the collector's directory and its parent directories are + consulted. + """ + + +def pytest_itemcollected(item: Item) -> None: + """We just collected a test item. + + :param item: + The item. + + Use in conftest plugins + ======================= + + Any conftest file can implement this hook. For a given item, only conftest + files in the item's directory and its parent directories are consulted. + """ + + +def pytest_collectreport(report: CollectReport) -> None: + """Collector finished collecting. + + :param report: + The collect report. + + Use in conftest plugins + ======================= + + Any conftest file can implement this hook. For a given collector, only + conftest files in the collector's directory and its parent directories are + consulted. + """ + + +def pytest_deselected(items: Sequence[Item]) -> None: + """Called for deselected test items, e.g. by keyword. + + Note that this hook has two integration aspects for plugins: + + - it can be *implemented* to be notified of deselected items + - it must be *called* from :hook:`pytest_collection_modifyitems` + implementations when items are deselected (to properly notify other plugins). + + May be called multiple times. + + :param items: + The items. + + Use in conftest plugins + ======================= + + Any conftest file can implement this hook. + """ + + +@hookspec(firstresult=True) +def pytest_make_collect_report(collector: Collector) -> CollectReport | None: + """Perform :func:`collector.collect() ` and return + a :class:`~pytest.CollectReport`. + + Stops at first non-None result, see :ref:`firstresult`. + + :param collector: + The collector. + + Use in conftest plugins + ======================= + + Any conftest file can implement this hook. For a given collector, only + conftest files in the collector's directory and its parent directories are + consulted. + """ + + +# ------------------------------------------------------------------------- +# Python test function related hooks +# ------------------------------------------------------------------------- + + +@hookspec( + firstresult=True, + warn_on_impl_args={ + "path": HOOK_LEGACY_PATH_ARG.format( + pylib_path_arg="path", pathlib_path_arg="module_path" + ), + }, +) +def pytest_pycollect_makemodule( + module_path: Path, path: LEGACY_PATH, parent +) -> Module | None: + """Return a :class:`pytest.Module` collector or None for the given path. + + This hook will be called for each matching test module path. + The :hook:`pytest_collect_file` hook needs to be used if you want to + create test modules for files that do not match as a test module. + + Stops at first non-None result, see :ref:`firstresult`. + + :param module_path: The path of the module to collect. + :type module_path: pathlib.Path + :param path: The path of the module to collect (deprecated). + + .. versionchanged:: 7.0.0 + The ``module_path`` parameter was added as a :class:`pathlib.Path` + equivalent of the ``path`` parameter. + + The ``path`` parameter has been deprecated in favor of ``fspath``. + + Use in conftest plugins + ======================= + + Any conftest file can implement this hook. For a given parent collector, + only conftest files in the collector's directory and its parent directories + are consulted. + """ + + +@hookspec(firstresult=True) +def pytest_pycollect_makeitem( + collector: Module | Class, name: str, obj: object +) -> None | Item | Collector | list[Item | Collector]: + """Return a custom item/collector for a Python object in a module, or None. + + Stops at first non-None result, see :ref:`firstresult`. + + :param collector: + The module/class collector. + :param name: + The name of the object in the module/class. + :param obj: + The object. + :returns: + The created items/collectors. + + Use in conftest plugins + ======================= + + Any conftest file can implement this hook. For a given collector, only + conftest files in the collector's directory and its parent directories + are consulted. + """ + + +@hookspec(firstresult=True) +def pytest_pyfunc_call(pyfuncitem: Function) -> object | None: + """Call underlying test function. + + Stops at first non-None result, see :ref:`firstresult`. + + :param pyfuncitem: + The function item. + + Use in conftest plugins + ======================= + + Any conftest file can implement this hook. For a given item, only + conftest files in the item's directory and its parent directories + are consulted. + """ + + +def pytest_generate_tests(metafunc: Metafunc) -> None: + """Generate (multiple) parametrized calls to a test function. + + :param metafunc: + The :class:`~pytest.Metafunc` helper for the test function. + + Use in conftest plugins + ======================= + + Any conftest file can implement this hook. For a given function definition, + only conftest files in the functions's directory and its parent directories + are consulted. + """ + + +@hookspec(firstresult=True) +def pytest_make_parametrize_id(config: Config, val: object, argname: str) -> str | None: + """Return a user-friendly string representation of the given ``val`` + that will be used by @pytest.mark.parametrize calls, or None if the hook + doesn't know about ``val``. + + The parameter name is available as ``argname``, if required. + + Stops at first non-None result, see :ref:`firstresult`. + + :param config: The pytest config object. + :param val: The parametrized value. + :param argname: The automatic parameter name produced by pytest. + + Use in conftest plugins + ======================= + + Any conftest file can implement this hook. + """ + + +# ------------------------------------------------------------------------- +# runtest related hooks +# ------------------------------------------------------------------------- + + +@hookspec(firstresult=True) +def pytest_runtestloop(session: Session) -> object | None: + """Perform the main runtest loop (after collection finished). + + The default hook implementation performs the runtest protocol for all items + collected in the session (``session.items``), unless the collection failed + or the ``collectonly`` pytest option is set. + + If at any point :py:func:`pytest.exit` is called, the loop is + terminated immediately. + + If at any point ``session.shouldfail`` or ``session.shouldstop`` are set, the + loop is terminated after the runtest protocol for the current item is finished. + + :param session: The pytest session object. + + Stops at first non-None result, see :ref:`firstresult`. + The return value is not used, but only stops further processing. + + Use in conftest plugins + ======================= + + Any conftest file can implement this hook. + """ + + +@hookspec(firstresult=True) +def pytest_runtest_protocol(item: Item, nextitem: Item | None) -> object | None: + """Perform the runtest protocol for a single test item. + + The default runtest protocol is this (see individual hooks for full details): + + - ``pytest_runtest_logstart(nodeid, location)`` + + - Setup phase: + - ``call = pytest_runtest_setup(item)`` (wrapped in ``CallInfo(when="setup")``) + - ``report = pytest_runtest_makereport(item, call)`` + - ``pytest_runtest_logreport(report)`` + - ``pytest_exception_interact(call, report)`` if an interactive exception occurred + + - Call phase, if the setup passed and the ``setuponly`` pytest option is not set: + - ``call = pytest_runtest_call(item)`` (wrapped in ``CallInfo(when="call")``) + - ``report = pytest_runtest_makereport(item, call)`` + - ``pytest_runtest_logreport(report)`` + - ``pytest_exception_interact(call, report)`` if an interactive exception occurred + + - Teardown phase: + - ``call = pytest_runtest_teardown(item, nextitem)`` (wrapped in ``CallInfo(when="teardown")``) + - ``report = pytest_runtest_makereport(item, call)`` + - ``pytest_runtest_logreport(report)`` + - ``pytest_exception_interact(call, report)`` if an interactive exception occurred + + - ``pytest_runtest_logfinish(nodeid, location)`` + + :param item: Test item for which the runtest protocol is performed. + :param nextitem: The scheduled-to-be-next test item (or None if this is the end my friend). + + Stops at first non-None result, see :ref:`firstresult`. + The return value is not used, but only stops further processing. + + Use in conftest plugins + ======================= + + Any conftest file can implement this hook. + """ + + +def pytest_runtest_logstart(nodeid: str, location: tuple[str, int | None, str]) -> None: + """Called at the start of running the runtest protocol for a single item. + + See :hook:`pytest_runtest_protocol` for a description of the runtest protocol. + + :param nodeid: Full node ID of the item. + :param location: A tuple of ``(filename, lineno, testname)`` + where ``filename`` is a file path relative to ``config.rootpath`` + and ``lineno`` is 0-based. + + Use in conftest plugins + ======================= + + Any conftest file can implement this hook. For a given item, only conftest + files in the item's directory and its parent directories are consulted. + """ + + +def pytest_runtest_logfinish( + nodeid: str, location: tuple[str, int | None, str] +) -> None: + """Called at the end of running the runtest protocol for a single item. + + See :hook:`pytest_runtest_protocol` for a description of the runtest protocol. + + :param nodeid: Full node ID of the item. + :param location: A tuple of ``(filename, lineno, testname)`` + where ``filename`` is a file path relative to ``config.rootpath`` + and ``lineno`` is 0-based. + + Use in conftest plugins + ======================= + + Any conftest file can implement this hook. For a given item, only conftest + files in the item's directory and its parent directories are consulted. + """ + + +def pytest_runtest_setup(item: Item) -> None: + """Called to perform the setup phase for a test item. + + The default implementation runs ``setup()`` on ``item`` and all of its + parents (which haven't been setup yet). This includes obtaining the + values of fixtures required by the item (which haven't been obtained + yet). + + :param item: + The item. + + Use in conftest plugins + ======================= + + Any conftest file can implement this hook. For a given item, only conftest + files in the item's directory and its parent directories are consulted. + """ + + +def pytest_runtest_call(item: Item) -> None: + """Called to run the test for test item (the call phase). + + The default implementation calls ``item.runtest()``. + + :param item: + The item. + + Use in conftest plugins + ======================= + + Any conftest file can implement this hook. For a given item, only conftest + files in the item's directory and its parent directories are consulted. + """ + + +def pytest_runtest_teardown(item: Item, nextitem: Item | None) -> None: + """Called to perform the teardown phase for a test item. + + The default implementation runs the finalizers and calls ``teardown()`` + on ``item`` and all of its parents (which need to be torn down). This + includes running the teardown phase of fixtures required by the item (if + they go out of scope). + + :param item: + The item. + :param nextitem: + The scheduled-to-be-next test item (None if no further test item is + scheduled). This argument is used to perform exact teardowns, i.e. + calling just enough finalizers so that nextitem only needs to call + setup functions. + + Use in conftest plugins + ======================= + + Any conftest file can implement this hook. For a given item, only conftest + files in the item's directory and its parent directories are consulted. + """ + + +@hookspec(firstresult=True) +def pytest_runtest_makereport(item: Item, call: CallInfo[None]) -> TestReport | None: + """Called to create a :class:`~pytest.TestReport` for each of + the setup, call and teardown runtest phases of a test item. + + See :hook:`pytest_runtest_protocol` for a description of the runtest protocol. + + :param item: The item. + :param call: The :class:`~pytest.CallInfo` for the phase. + + Stops at first non-None result, see :ref:`firstresult`. + + Use in conftest plugins + ======================= + + Any conftest file can implement this hook. For a given item, only conftest + files in the item's directory and its parent directories are consulted. + """ + + +def pytest_runtest_logreport(report: TestReport) -> None: + """Process the :class:`~pytest.TestReport` produced for each + of the setup, call and teardown runtest phases of an item. + + See :hook:`pytest_runtest_protocol` for a description of the runtest protocol. + + Use in conftest plugins + ======================= + + Any conftest file can implement this hook. For a given item, only conftest + files in the item's directory and its parent directories are consulted. + """ + + +@hookspec(firstresult=True) +def pytest_report_to_serializable( + config: Config, + report: CollectReport | TestReport, +) -> dict[str, Any] | None: + """Serialize the given report object into a data structure suitable for + sending over the wire, e.g. converted to JSON. + + :param config: The pytest config object. + :param report: The report. + + Use in conftest plugins + ======================= + + Any conftest file can implement this hook. The exact details may depend + on the plugin which calls the hook. + """ + + +@hookspec(firstresult=True) +def pytest_report_from_serializable( + config: Config, + data: dict[str, Any], +) -> CollectReport | TestReport | None: + """Restore a report object previously serialized with + :hook:`pytest_report_to_serializable`. + + :param config: The pytest config object. + + Use in conftest plugins + ======================= + + Any conftest file can implement this hook. The exact details may depend + on the plugin which calls the hook. + """ + + +# ------------------------------------------------------------------------- +# Fixture related hooks +# ------------------------------------------------------------------------- + + +@hookspec(firstresult=True) +def pytest_fixture_setup( + fixturedef: FixtureDef[Any], request: SubRequest +) -> object | None: + """Perform fixture setup execution. + + :param fixturedef: + The fixture definition object. + :param request: + The fixture request object. + :returns: + The return value of the call to the fixture function. + + Stops at first non-None result, see :ref:`firstresult`. + + .. note:: + If the fixture function returns None, other implementations of + this hook function will continue to be called, according to the + behavior of the :ref:`firstresult` option. + + Use in conftest plugins + ======================= + + Any conftest file can implement this hook. For a given fixture, only + conftest files in the fixture scope's directory and its parent directories + are consulted. + """ + + +def pytest_fixture_post_finalizer( + fixturedef: FixtureDef[Any], request: SubRequest +) -> None: + """Called after fixture teardown, but before the cache is cleared, so + the fixture result ``fixturedef.cached_result`` is still available (not + ``None``). + + :param fixturedef: + The fixture definition object. + :param request: + The fixture request object. + + Use in conftest plugins + ======================= + + Any conftest file can implement this hook. For a given fixture, only + conftest files in the fixture scope's directory and its parent directories + are consulted. + """ + + +# ------------------------------------------------------------------------- +# test session related hooks +# ------------------------------------------------------------------------- + + +def pytest_sessionstart(session: Session) -> None: + """Called after the ``Session`` object has been created and before performing collection + and entering the run test loop. + + :param session: The pytest session object. + + Use in conftest plugins + ======================= + + This hook is only called for :ref:`initial conftests `. + """ + + +def pytest_sessionfinish( + session: Session, + exitstatus: int | ExitCode, +) -> None: + """Called after whole test run finished, right before returning the exit status to the system. + + :param session: The pytest session object. + :param exitstatus: The status which pytest will return to the system. + + Use in conftest plugins + ======================= + + Any conftest file can implement this hook. + """ + + +def pytest_unconfigure(config: Config) -> None: + """Called before test process is exited. + + :param config: The pytest config object. + + Use in conftest plugins + ======================= + + Any conftest file can implement this hook. + """ + + +# ------------------------------------------------------------------------- +# hooks for customizing the assert methods +# ------------------------------------------------------------------------- + + +def pytest_assertrepr_compare( + config: Config, op: str, left: object, right: object +) -> list[str] | None: + """Return explanation for comparisons in failing assert expressions. + + Return None for no custom explanation, otherwise return a list + of strings. The strings will be joined by newlines but any newlines + *in* a string will be escaped. Note that all but the first line will + be indented slightly, the intention is for the first line to be a summary. + + :param config: The pytest config object. + :param op: The operator, e.g. `"=="`, `"!="`, `"not in"`. + :param left: The left operand. + :param right: The right operand. + + Use in conftest plugins + ======================= + + Any conftest file can implement this hook. For a given item, only conftest + files in the item's directory and its parent directories are consulted. + """ + + +def pytest_assertion_pass(item: Item, lineno: int, orig: str, expl: str) -> None: + """Called whenever an assertion passes. + + .. versionadded:: 5.0 + + Use this hook to do some processing after a passing assertion. + The original assertion information is available in the `orig` string + and the pytest introspected assertion information is available in the + `expl` string. + + This hook must be explicitly enabled by the ``enable_assertion_pass_hook`` + ini-file option: + + .. code-block:: ini + + [pytest] + enable_assertion_pass_hook=true + + You need to **clean the .pyc** files in your project directory and interpreter libraries + when enabling this option, as assertions will require to be re-written. + + :param item: pytest item object of current test. + :param lineno: Line number of the assert statement. + :param orig: String with the original assertion. + :param expl: String with the assert explanation. + + Use in conftest plugins + ======================= + + Any conftest file can implement this hook. For a given item, only conftest + files in the item's directory and its parent directories are consulted. + """ + + +# ------------------------------------------------------------------------- +# Hooks for influencing reporting (invoked from _pytest_terminal). +# ------------------------------------------------------------------------- + + +@hookspec( + warn_on_impl_args={ + "startdir": HOOK_LEGACY_PATH_ARG.format( + pylib_path_arg="startdir", pathlib_path_arg="start_path" + ), + }, +) +def pytest_report_header( # type:ignore[empty-body] + config: Config, start_path: Path, startdir: LEGACY_PATH +) -> str | list[str]: + """Return a string or list of strings to be displayed as header info for terminal reporting. + + :param config: The pytest config object. + :param start_path: The starting dir. + :type start_path: pathlib.Path + :param startdir: The starting dir (deprecated). + + .. note:: + + Lines returned by a plugin are displayed before those of plugins which + ran before it. + If you want to have your line(s) displayed first, use + :ref:`trylast=True `. + + .. versionchanged:: 7.0.0 + The ``start_path`` parameter was added as a :class:`pathlib.Path` + equivalent of the ``startdir`` parameter. The ``startdir`` parameter + has been deprecated. + + Use in conftest plugins + ======================= + + This hook is only called for :ref:`initial conftests `. + """ + + +@hookspec( + warn_on_impl_args={ + "startdir": HOOK_LEGACY_PATH_ARG.format( + pylib_path_arg="startdir", pathlib_path_arg="start_path" + ), + }, +) +def pytest_report_collectionfinish( # type:ignore[empty-body] + config: Config, + start_path: Path, + startdir: LEGACY_PATH, + items: Sequence[Item], +) -> str | list[str]: + """Return a string or list of strings to be displayed after collection + has finished successfully. + + These strings will be displayed after the standard "collected X items" message. + + .. versionadded:: 3.2 + + :param config: The pytest config object. + :param start_path: The starting dir. + :type start_path: pathlib.Path + :param startdir: The starting dir (deprecated). + :param items: List of pytest items that are going to be executed; this list should not be modified. + + .. note:: + + Lines returned by a plugin are displayed before those of plugins which + ran before it. + If you want to have your line(s) displayed first, use + :ref:`trylast=True `. + + .. versionchanged:: 7.0.0 + The ``start_path`` parameter was added as a :class:`pathlib.Path` + equivalent of the ``startdir`` parameter. The ``startdir`` parameter + has been deprecated. + + Use in conftest plugins + ======================= + + Any conftest plugin can implement this hook. + """ + + +@hookspec(firstresult=True) +def pytest_report_teststatus( # type:ignore[empty-body] + report: CollectReport | TestReport, config: Config +) -> TestShortLogReport | tuple[str, str, str | tuple[str, Mapping[str, bool]]]: + """Return result-category, shortletter and verbose word for status + reporting. + + The result-category is a category in which to count the result, for + example "passed", "skipped", "error" or the empty string. + + The shortletter is shown as testing progresses, for example ".", "s", + "E" or the empty string. + + The verbose word is shown as testing progresses in verbose mode, for + example "PASSED", "SKIPPED", "ERROR" or the empty string. + + pytest may style these implicitly according to the report outcome. + To provide explicit styling, return a tuple for the verbose word, + for example ``"rerun", "R", ("RERUN", {"yellow": True})``. + + :param report: The report object whose status is to be returned. + :param config: The pytest config object. + :returns: The test status. + + Stops at first non-None result, see :ref:`firstresult`. + + Use in conftest plugins + ======================= + + Any conftest plugin can implement this hook. + """ + + +def pytest_terminal_summary( + terminalreporter: TerminalReporter, + exitstatus: ExitCode, + config: Config, +) -> None: + """Add a section to terminal summary reporting. + + :param terminalreporter: The internal terminal reporter object. + :param exitstatus: The exit status that will be reported back to the OS. + :param config: The pytest config object. + + .. versionadded:: 4.2 + The ``config`` parameter. + + Use in conftest plugins + ======================= + + Any conftest plugin can implement this hook. + """ + + +@hookspec(historic=True) +def pytest_warning_recorded( + warning_message: warnings.WarningMessage, + when: Literal["config", "collect", "runtest"], + nodeid: str, + location: tuple[str, int, str] | None, +) -> None: + """Process a warning captured by the internal pytest warnings plugin. + + :param warning_message: + The captured warning. This is the same object produced by :class:`warnings.catch_warnings`, + and contains the same attributes as the parameters of :py:func:`warnings.showwarning`. + + :param when: + Indicates when the warning was captured. Possible values: + + * ``"config"``: during pytest configuration/initialization stage. + * ``"collect"``: during test collection. + * ``"runtest"``: during test execution. + + :param nodeid: + Full id of the item. Empty string for warnings that are not specific to + a particular node. + + :param location: + When available, holds information about the execution context of the captured + warning (filename, linenumber, function). ``function`` evaluates to + when the execution context is at the module level. + + .. versionadded:: 6.0 + + Use in conftest plugins + ======================= + + Any conftest file can implement this hook. If the warning is specific to a + particular node, only conftest files in parent directories of the node are + consulted. + """ + + +# ------------------------------------------------------------------------- +# Hooks for influencing skipping +# ------------------------------------------------------------------------- + + +def pytest_markeval_namespace( # type:ignore[empty-body] + config: Config, +) -> dict[str, Any]: + """Called when constructing the globals dictionary used for + evaluating string conditions in xfail/skipif markers. + + This is useful when the condition for a marker requires + objects that are expensive or impossible to obtain during + collection time, which is required by normal boolean + conditions. + + .. versionadded:: 6.2 + + :param config: The pytest config object. + :returns: A dictionary of additional globals to add. + + Use in conftest plugins + ======================= + + Any conftest file can implement this hook. For a given item, only conftest + files in parent directories of the item are consulted. + """ + + +# ------------------------------------------------------------------------- +# error handling and internal debugging hooks +# ------------------------------------------------------------------------- + + +def pytest_internalerror( + excrepr: ExceptionRepr, + excinfo: ExceptionInfo[BaseException], +) -> bool | None: + """Called for internal errors. + + Return True to suppress the fallback handling of printing an + INTERNALERROR message directly to sys.stderr. + + :param excrepr: The exception repr object. + :param excinfo: The exception info. + + Use in conftest plugins + ======================= + + Any conftest plugin can implement this hook. + """ + + +def pytest_keyboard_interrupt( + excinfo: ExceptionInfo[KeyboardInterrupt | Exit], +) -> None: + """Called for keyboard interrupt. + + :param excinfo: The exception info. + + Use in conftest plugins + ======================= + + Any conftest plugin can implement this hook. + """ + + +def pytest_exception_interact( + node: Item | Collector, + call: CallInfo[Any], + report: CollectReport | TestReport, +) -> None: + """Called when an exception was raised which can potentially be + interactively handled. + + May be called during collection (see :hook:`pytest_make_collect_report`), + in which case ``report`` is a :class:`~pytest.CollectReport`. + + May be called during runtest of an item (see :hook:`pytest_runtest_protocol`), + in which case ``report`` is a :class:`~pytest.TestReport`. + + This hook is not called if the exception that was raised is an internal + exception like ``skip.Exception``. + + :param node: + The item or collector. + :param call: + The call information. Contains the exception. + :param report: + The collection or test report. + + Use in conftest plugins + ======================= + + Any conftest file can implement this hook. For a given node, only conftest + files in parent directories of the node are consulted. + """ + + +def pytest_enter_pdb(config: Config, pdb: pdb.Pdb) -> None: + """Called upon pdb.set_trace(). + + Can be used by plugins to take special action just before the python + debugger enters interactive mode. + + :param config: The pytest config object. + :param pdb: The Pdb instance. + + Use in conftest plugins + ======================= + + Any conftest plugin can implement this hook. + """ + + +def pytest_leave_pdb(config: Config, pdb: pdb.Pdb) -> None: + """Called when leaving pdb (e.g. with continue after pdb.set_trace()). + + Can be used by plugins to take special action just after the python + debugger leaves interactive mode. + + :param config: The pytest config object. + :param pdb: The Pdb instance. + + Use in conftest plugins + ======================= + + Any conftest plugin can implement this hook. + """ diff --git a/.venv/Lib/site-packages/_pytest/junitxml.py b/.venv/Lib/site-packages/_pytest/junitxml.py new file mode 100644 index 00000000..3a2cb59a --- /dev/null +++ b/.venv/Lib/site-packages/_pytest/junitxml.py @@ -0,0 +1,697 @@ +# mypy: allow-untyped-defs +"""Report test results in JUnit-XML format, for use with Jenkins and build +integration servers. + +Based on initial code from Ross Lawley. + +Output conforms to +https://github.com/jenkinsci/xunit-plugin/blob/master/src/main/resources/org/jenkinsci/plugins/xunit/types/model/xsd/junit-10.xsd +""" + +from __future__ import annotations + +from datetime import datetime +from datetime import timezone +import functools +import os +import platform +import re +from typing import Callable +from typing import Match +import xml.etree.ElementTree as ET + +from _pytest import nodes +from _pytest import timing +from _pytest._code.code import ExceptionRepr +from _pytest._code.code import ReprFileLocation +from _pytest.config import Config +from _pytest.config import filename_arg +from _pytest.config.argparsing import Parser +from _pytest.fixtures import FixtureRequest +from _pytest.reports import TestReport +from _pytest.stash import StashKey +from _pytest.terminal import TerminalReporter +import pytest + + +xml_key = StashKey["LogXML"]() + + +def bin_xml_escape(arg: object) -> str: + r"""Visually escape invalid XML characters. + + For example, transforms + 'hello\aworld\b' + into + 'hello#x07world#x08' + Note that the #xABs are *not* XML escapes - missing the ampersand «. + The idea is to escape visually for the user rather than for XML itself. + """ + + def repl(matchobj: Match[str]) -> str: + i = ord(matchobj.group()) + if i <= 0xFF: + return f"#x{i:02X}" + else: + return f"#x{i:04X}" + + # The spec range of valid chars is: + # Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF] + # For an unknown(?) reason, we disallow #x7F (DEL) as well. + illegal_xml_re = ( + "[^\u0009\u000a\u000d\u0020-\u007e\u0080-\ud7ff\ue000-\ufffd\u10000-\u10ffff]" + ) + return re.sub(illegal_xml_re, repl, str(arg)) + + +def merge_family(left, right) -> None: + result = {} + for kl, vl in left.items(): + for kr, vr in right.items(): + if not isinstance(vl, list): + raise TypeError(type(vl)) + result[kl] = vl + vr + left.update(result) + + +families = {} +families["_base"] = {"testcase": ["classname", "name"]} +families["_base_legacy"] = {"testcase": ["file", "line", "url"]} + +# xUnit 1.x inherits legacy attributes. +families["xunit1"] = families["_base"].copy() +merge_family(families["xunit1"], families["_base_legacy"]) + +# xUnit 2.x uses strict base attributes. +families["xunit2"] = families["_base"] + + +class _NodeReporter: + def __init__(self, nodeid: str | TestReport, xml: LogXML) -> None: + self.id = nodeid + self.xml = xml + self.add_stats = self.xml.add_stats + self.family = self.xml.family + self.duration = 0.0 + self.properties: list[tuple[str, str]] = [] + self.nodes: list[ET.Element] = [] + self.attrs: dict[str, str] = {} + + def append(self, node: ET.Element) -> None: + self.xml.add_stats(node.tag) + self.nodes.append(node) + + def add_property(self, name: str, value: object) -> None: + self.properties.append((str(name), bin_xml_escape(value))) + + def add_attribute(self, name: str, value: object) -> None: + self.attrs[str(name)] = bin_xml_escape(value) + + def make_properties_node(self) -> ET.Element | None: + """Return a Junit node containing custom properties, if any.""" + if self.properties: + properties = ET.Element("properties") + for name, value in self.properties: + properties.append(ET.Element("property", name=name, value=value)) + return properties + return None + + def record_testreport(self, testreport: TestReport) -> None: + names = mangle_test_address(testreport.nodeid) + existing_attrs = self.attrs + classnames = names[:-1] + if self.xml.prefix: + classnames.insert(0, self.xml.prefix) + attrs: dict[str, str] = { + "classname": ".".join(classnames), + "name": bin_xml_escape(names[-1]), + "file": testreport.location[0], + } + if testreport.location[1] is not None: + attrs["line"] = str(testreport.location[1]) + if hasattr(testreport, "url"): + attrs["url"] = testreport.url + self.attrs = attrs + self.attrs.update(existing_attrs) # Restore any user-defined attributes. + + # Preserve legacy testcase behavior. + if self.family == "xunit1": + return + + # Filter out attributes not permitted by this test family. + # Including custom attributes because they are not valid here. + temp_attrs = {} + for key in self.attrs: + if key in families[self.family]["testcase"]: + temp_attrs[key] = self.attrs[key] + self.attrs = temp_attrs + + def to_xml(self) -> ET.Element: + testcase = ET.Element("testcase", self.attrs, time=f"{self.duration:.3f}") + properties = self.make_properties_node() + if properties is not None: + testcase.append(properties) + testcase.extend(self.nodes) + return testcase + + def _add_simple(self, tag: str, message: str, data: str | None = None) -> None: + node = ET.Element(tag, message=message) + node.text = bin_xml_escape(data) + self.append(node) + + def write_captured_output(self, report: TestReport) -> None: + if not self.xml.log_passing_tests and report.passed: + return + + content_out = report.capstdout + content_log = report.caplog + content_err = report.capstderr + if self.xml.logging == "no": + return + content_all = "" + if self.xml.logging in ["log", "all"]: + content_all = self._prepare_content(content_log, " Captured Log ") + if self.xml.logging in ["system-out", "out-err", "all"]: + content_all += self._prepare_content(content_out, " Captured Out ") + self._write_content(report, content_all, "system-out") + content_all = "" + if self.xml.logging in ["system-err", "out-err", "all"]: + content_all += self._prepare_content(content_err, " Captured Err ") + self._write_content(report, content_all, "system-err") + content_all = "" + if content_all: + self._write_content(report, content_all, "system-out") + + def _prepare_content(self, content: str, header: str) -> str: + return "\n".join([header.center(80, "-"), content, ""]) + + def _write_content(self, report: TestReport, content: str, jheader: str) -> None: + tag = ET.Element(jheader) + tag.text = bin_xml_escape(content) + self.append(tag) + + def append_pass(self, report: TestReport) -> None: + self.add_stats("passed") + + def append_failure(self, report: TestReport) -> None: + # msg = str(report.longrepr.reprtraceback.extraline) + if hasattr(report, "wasxfail"): + self._add_simple("skipped", "xfail-marked test passes unexpectedly") + else: + assert report.longrepr is not None + reprcrash: ReprFileLocation | None = getattr( + report.longrepr, "reprcrash", None + ) + if reprcrash is not None: + message = reprcrash.message + else: + message = str(report.longrepr) + message = bin_xml_escape(message) + self._add_simple("failure", message, str(report.longrepr)) + + def append_collect_error(self, report: TestReport) -> None: + # msg = str(report.longrepr.reprtraceback.extraline) + assert report.longrepr is not None + self._add_simple("error", "collection failure", str(report.longrepr)) + + def append_collect_skipped(self, report: TestReport) -> None: + self._add_simple("skipped", "collection skipped", str(report.longrepr)) + + def append_error(self, report: TestReport) -> None: + assert report.longrepr is not None + reprcrash: ReprFileLocation | None = getattr(report.longrepr, "reprcrash", None) + if reprcrash is not None: + reason = reprcrash.message + else: + reason = str(report.longrepr) + + if report.when == "teardown": + msg = f'failed on teardown with "{reason}"' + else: + msg = f'failed on setup with "{reason}"' + self._add_simple("error", bin_xml_escape(msg), str(report.longrepr)) + + def append_skipped(self, report: TestReport) -> None: + if hasattr(report, "wasxfail"): + xfailreason = report.wasxfail + if xfailreason.startswith("reason: "): + xfailreason = xfailreason[8:] + xfailreason = bin_xml_escape(xfailreason) + skipped = ET.Element("skipped", type="pytest.xfail", message=xfailreason) + self.append(skipped) + else: + assert isinstance(report.longrepr, tuple) + filename, lineno, skipreason = report.longrepr + if skipreason.startswith("Skipped: "): + skipreason = skipreason[9:] + details = f"{filename}:{lineno}: {skipreason}" + + skipped = ET.Element( + "skipped", type="pytest.skip", message=bin_xml_escape(skipreason) + ) + skipped.text = bin_xml_escape(details) + self.append(skipped) + self.write_captured_output(report) + + def finalize(self) -> None: + data = self.to_xml() + self.__dict__.clear() + # Type ignored because mypy doesn't like overriding a method. + # Also the return value doesn't match... + self.to_xml = lambda: data # type: ignore[method-assign] + + +def _warn_incompatibility_with_xunit2( + request: FixtureRequest, fixture_name: str +) -> None: + """Emit a PytestWarning about the given fixture being incompatible with newer xunit revisions.""" + from _pytest.warning_types import PytestWarning + + xml = request.config.stash.get(xml_key, None) + if xml is not None and xml.family not in ("xunit1", "legacy"): + request.node.warn( + PytestWarning( + f"{fixture_name} is incompatible with junit_family '{xml.family}' (use 'legacy' or 'xunit1')" + ) + ) + + +@pytest.fixture +def record_property(request: FixtureRequest) -> Callable[[str, object], None]: + """Add extra properties to the calling test. + + User properties become part of the test report and are available to the + configured reporters, like JUnit XML. + + The fixture is callable with ``name, value``. The value is automatically + XML-encoded. + + Example:: + + def test_function(record_property): + record_property("example_key", 1) + """ + _warn_incompatibility_with_xunit2(request, "record_property") + + def append_property(name: str, value: object) -> None: + request.node.user_properties.append((name, value)) + + return append_property + + +@pytest.fixture +def record_xml_attribute(request: FixtureRequest) -> Callable[[str, object], None]: + """Add extra xml attributes to the tag for the calling test. + + The fixture is callable with ``name, value``. The value is + automatically XML-encoded. + """ + from _pytest.warning_types import PytestExperimentalApiWarning + + request.node.warn( + PytestExperimentalApiWarning("record_xml_attribute is an experimental feature") + ) + + _warn_incompatibility_with_xunit2(request, "record_xml_attribute") + + # Declare noop + def add_attr_noop(name: str, value: object) -> None: + pass + + attr_func = add_attr_noop + + xml = request.config.stash.get(xml_key, None) + if xml is not None: + node_reporter = xml.node_reporter(request.node.nodeid) + attr_func = node_reporter.add_attribute + + return attr_func + + +def _check_record_param_type(param: str, v: str) -> None: + """Used by record_testsuite_property to check that the given parameter name is of the proper + type.""" + __tracebackhide__ = True + if not isinstance(v, str): + msg = "{param} parameter needs to be a string, but {g} given" # type: ignore[unreachable] + raise TypeError(msg.format(param=param, g=type(v).__name__)) + + +@pytest.fixture(scope="session") +def record_testsuite_property(request: FixtureRequest) -> Callable[[str, object], None]: + """Record a new ```` tag as child of the root ````. + + This is suitable to writing global information regarding the entire test + suite, and is compatible with ``xunit2`` JUnit family. + + This is a ``session``-scoped fixture which is called with ``(name, value)``. Example: + + .. code-block:: python + + def test_foo(record_testsuite_property): + record_testsuite_property("ARCH", "PPC") + record_testsuite_property("STORAGE_TYPE", "CEPH") + + :param name: + The property name. + :param value: + The property value. Will be converted to a string. + + .. warning:: + + Currently this fixture **does not work** with the + `pytest-xdist `__ plugin. See + :issue:`7767` for details. + """ + __tracebackhide__ = True + + def record_func(name: str, value: object) -> None: + """No-op function in case --junit-xml was not passed in the command-line.""" + __tracebackhide__ = True + _check_record_param_type("name", name) + + xml = request.config.stash.get(xml_key, None) + if xml is not None: + record_func = xml.add_global_property + return record_func + + +def pytest_addoption(parser: Parser) -> None: + group = parser.getgroup("terminal reporting") + group.addoption( + "--junitxml", + "--junit-xml", + action="store", + dest="xmlpath", + metavar="path", + type=functools.partial(filename_arg, optname="--junitxml"), + default=None, + help="Create junit-xml style report file at given path", + ) + group.addoption( + "--junitprefix", + "--junit-prefix", + action="store", + metavar="str", + default=None, + help="Prepend prefix to classnames in junit-xml output", + ) + parser.addini( + "junit_suite_name", "Test suite name for JUnit report", default="pytest" + ) + parser.addini( + "junit_logging", + "Write captured log messages to JUnit report: " + "one of no|log|system-out|system-err|out-err|all", + default="no", + ) + parser.addini( + "junit_log_passing_tests", + "Capture log information for passing tests to JUnit report: ", + type="bool", + default=True, + ) + parser.addini( + "junit_duration_report", + "Duration time to report: one of total|call", + default="total", + ) # choices=['total', 'call']) + parser.addini( + "junit_family", + "Emit XML for schema: one of legacy|xunit1|xunit2", + default="xunit2", + ) + + +def pytest_configure(config: Config) -> None: + xmlpath = config.option.xmlpath + # Prevent opening xmllog on worker nodes (xdist). + if xmlpath and not hasattr(config, "workerinput"): + junit_family = config.getini("junit_family") + config.stash[xml_key] = LogXML( + xmlpath, + config.option.junitprefix, + config.getini("junit_suite_name"), + config.getini("junit_logging"), + config.getini("junit_duration_report"), + junit_family, + config.getini("junit_log_passing_tests"), + ) + config.pluginmanager.register(config.stash[xml_key]) + + +def pytest_unconfigure(config: Config) -> None: + xml = config.stash.get(xml_key, None) + if xml: + del config.stash[xml_key] + config.pluginmanager.unregister(xml) + + +def mangle_test_address(address: str) -> list[str]: + path, possible_open_bracket, params = address.partition("[") + names = path.split("::") + # Convert file path to dotted path. + names[0] = names[0].replace(nodes.SEP, ".") + names[0] = re.sub(r"\.py$", "", names[0]) + # Put any params back. + names[-1] += possible_open_bracket + params + return names + + +class LogXML: + def __init__( + self, + logfile, + prefix: str | None, + suite_name: str = "pytest", + logging: str = "no", + report_duration: str = "total", + family="xunit1", + log_passing_tests: bool = True, + ) -> None: + logfile = os.path.expanduser(os.path.expandvars(logfile)) + self.logfile = os.path.normpath(os.path.abspath(logfile)) + self.prefix = prefix + self.suite_name = suite_name + self.logging = logging + self.log_passing_tests = log_passing_tests + self.report_duration = report_duration + self.family = family + self.stats: dict[str, int] = dict.fromkeys( + ["error", "passed", "failure", "skipped"], 0 + ) + self.node_reporters: dict[tuple[str | TestReport, object], _NodeReporter] = {} + self.node_reporters_ordered: list[_NodeReporter] = [] + self.global_properties: list[tuple[str, str]] = [] + + # List of reports that failed on call but teardown is pending. + self.open_reports: list[TestReport] = [] + self.cnt_double_fail_tests = 0 + + # Replaces convenience family with real family. + if self.family == "legacy": + self.family = "xunit1" + + def finalize(self, report: TestReport) -> None: + nodeid = getattr(report, "nodeid", report) + # Local hack to handle xdist report order. + workernode = getattr(report, "node", None) + reporter = self.node_reporters.pop((nodeid, workernode)) + + for propname, propvalue in report.user_properties: + reporter.add_property(propname, str(propvalue)) + + if reporter is not None: + reporter.finalize() + + def node_reporter(self, report: TestReport | str) -> _NodeReporter: + nodeid: str | TestReport = getattr(report, "nodeid", report) + # Local hack to handle xdist report order. + workernode = getattr(report, "node", None) + + key = nodeid, workernode + + if key in self.node_reporters: + # TODO: breaks for --dist=each + return self.node_reporters[key] + + reporter = _NodeReporter(nodeid, self) + + self.node_reporters[key] = reporter + self.node_reporters_ordered.append(reporter) + + return reporter + + def add_stats(self, key: str) -> None: + if key in self.stats: + self.stats[key] += 1 + + def _opentestcase(self, report: TestReport) -> _NodeReporter: + reporter = self.node_reporter(report) + reporter.record_testreport(report) + return reporter + + def pytest_runtest_logreport(self, report: TestReport) -> None: + """Handle a setup/call/teardown report, generating the appropriate + XML tags as necessary. + + Note: due to plugins like xdist, this hook may be called in interlaced + order with reports from other nodes. For example: + + Usual call order: + -> setup node1 + -> call node1 + -> teardown node1 + -> setup node2 + -> call node2 + -> teardown node2 + + Possible call order in xdist: + -> setup node1 + -> call node1 + -> setup node2 + -> call node2 + -> teardown node2 + -> teardown node1 + """ + close_report = None + if report.passed: + if report.when == "call": # ignore setup/teardown + reporter = self._opentestcase(report) + reporter.append_pass(report) + elif report.failed: + if report.when == "teardown": + # The following vars are needed when xdist plugin is used. + report_wid = getattr(report, "worker_id", None) + report_ii = getattr(report, "item_index", None) + close_report = next( + ( + rep + for rep in self.open_reports + if ( + rep.nodeid == report.nodeid + and getattr(rep, "item_index", None) == report_ii + and getattr(rep, "worker_id", None) == report_wid + ) + ), + None, + ) + if close_report: + # We need to open new testcase in case we have failure in + # call and error in teardown in order to follow junit + # schema. + self.finalize(close_report) + self.cnt_double_fail_tests += 1 + reporter = self._opentestcase(report) + if report.when == "call": + reporter.append_failure(report) + self.open_reports.append(report) + if not self.log_passing_tests: + reporter.write_captured_output(report) + else: + reporter.append_error(report) + elif report.skipped: + reporter = self._opentestcase(report) + reporter.append_skipped(report) + self.update_testcase_duration(report) + if report.when == "teardown": + reporter = self._opentestcase(report) + reporter.write_captured_output(report) + + self.finalize(report) + report_wid = getattr(report, "worker_id", None) + report_ii = getattr(report, "item_index", None) + close_report = next( + ( + rep + for rep in self.open_reports + if ( + rep.nodeid == report.nodeid + and getattr(rep, "item_index", None) == report_ii + and getattr(rep, "worker_id", None) == report_wid + ) + ), + None, + ) + if close_report: + self.open_reports.remove(close_report) + + def update_testcase_duration(self, report: TestReport) -> None: + """Accumulate total duration for nodeid from given report and update + the Junit.testcase with the new total if already created.""" + if self.report_duration in {"total", report.when}: + reporter = self.node_reporter(report) + reporter.duration += getattr(report, "duration", 0.0) + + def pytest_collectreport(self, report: TestReport) -> None: + if not report.passed: + reporter = self._opentestcase(report) + if report.failed: + reporter.append_collect_error(report) + else: + reporter.append_collect_skipped(report) + + def pytest_internalerror(self, excrepr: ExceptionRepr) -> None: + reporter = self.node_reporter("internal") + reporter.attrs.update(classname="pytest", name="internal") + reporter._add_simple("error", "internal error", str(excrepr)) + + def pytest_sessionstart(self) -> None: + self.suite_start_time = timing.time() + + def pytest_sessionfinish(self) -> None: + dirname = os.path.dirname(os.path.abspath(self.logfile)) + # exist_ok avoids filesystem race conditions between checking path existence and requesting creation + os.makedirs(dirname, exist_ok=True) + + with open(self.logfile, "w", encoding="utf-8") as logfile: + suite_stop_time = timing.time() + suite_time_delta = suite_stop_time - self.suite_start_time + + numtests = ( + self.stats["passed"] + + self.stats["failure"] + + self.stats["skipped"] + + self.stats["error"] + - self.cnt_double_fail_tests + ) + logfile.write('') + + suite_node = ET.Element( + "testsuite", + name=self.suite_name, + errors=str(self.stats["error"]), + failures=str(self.stats["failure"]), + skipped=str(self.stats["skipped"]), + tests=str(numtests), + time=f"{suite_time_delta:.3f}", + timestamp=datetime.fromtimestamp(self.suite_start_time, timezone.utc) + .astimezone() + .isoformat(), + hostname=platform.node(), + ) + global_properties = self._get_global_properties_node() + if global_properties is not None: + suite_node.append(global_properties) + for node_reporter in self.node_reporters_ordered: + suite_node.append(node_reporter.to_xml()) + testsuites = ET.Element("testsuites") + testsuites.append(suite_node) + logfile.write(ET.tostring(testsuites, encoding="unicode")) + + def pytest_terminal_summary(self, terminalreporter: TerminalReporter) -> None: + terminalreporter.write_sep("-", f"generated xml file: {self.logfile}") + + def add_global_property(self, name: str, value: object) -> None: + __tracebackhide__ = True + _check_record_param_type("name", name) + self.global_properties.append((name, bin_xml_escape(value))) + + def _get_global_properties_node(self) -> ET.Element | None: + """Return a Junit node containing custom properties, if any.""" + if self.global_properties: + properties = ET.Element("properties") + for name, value in self.global_properties: + properties.append(ET.Element("property", name=name, value=value)) + return properties + return None diff --git a/.venv/Lib/site-packages/_pytest/legacypath.py b/.venv/Lib/site-packages/_pytest/legacypath.py new file mode 100644 index 00000000..61476d68 --- /dev/null +++ b/.venv/Lib/site-packages/_pytest/legacypath.py @@ -0,0 +1,473 @@ +# mypy: allow-untyped-defs +"""Add backward compatibility support for the legacy py path type.""" + +from __future__ import annotations + +import dataclasses +from pathlib import Path +import shlex +import subprocess +from typing import Final +from typing import final +from typing import TYPE_CHECKING + +from iniconfig import SectionWrapper + +from _pytest.cacheprovider import Cache +from _pytest.compat import LEGACY_PATH +from _pytest.compat import legacy_path +from _pytest.config import Config +from _pytest.config import hookimpl +from _pytest.config import PytestPluginManager +from _pytest.deprecated import check_ispytest +from _pytest.fixtures import fixture +from _pytest.fixtures import FixtureRequest +from _pytest.main import Session +from _pytest.monkeypatch import MonkeyPatch +from _pytest.nodes import Collector +from _pytest.nodes import Item +from _pytest.nodes import Node +from _pytest.pytester import HookRecorder +from _pytest.pytester import Pytester +from _pytest.pytester import RunResult +from _pytest.terminal import TerminalReporter +from _pytest.tmpdir import TempPathFactory + + +if TYPE_CHECKING: + import pexpect + + +@final +class Testdir: + """ + Similar to :class:`Pytester`, but this class works with legacy legacy_path objects instead. + + All methods just forward to an internal :class:`Pytester` instance, converting results + to `legacy_path` objects as necessary. + """ + + __test__ = False + + CLOSE_STDIN: Final = Pytester.CLOSE_STDIN + TimeoutExpired: Final = Pytester.TimeoutExpired + + def __init__(self, pytester: Pytester, *, _ispytest: bool = False) -> None: + check_ispytest(_ispytest) + self._pytester = pytester + + @property + def tmpdir(self) -> LEGACY_PATH: + """Temporary directory where tests are executed.""" + return legacy_path(self._pytester.path) + + @property + def test_tmproot(self) -> LEGACY_PATH: + return legacy_path(self._pytester._test_tmproot) + + @property + def request(self): + return self._pytester._request + + @property + def plugins(self): + return self._pytester.plugins + + @plugins.setter + def plugins(self, plugins): + self._pytester.plugins = plugins + + @property + def monkeypatch(self) -> MonkeyPatch: + return self._pytester._monkeypatch + + def make_hook_recorder(self, pluginmanager) -> HookRecorder: + """See :meth:`Pytester.make_hook_recorder`.""" + return self._pytester.make_hook_recorder(pluginmanager) + + def chdir(self) -> None: + """See :meth:`Pytester.chdir`.""" + return self._pytester.chdir() + + def finalize(self) -> None: + return self._pytester._finalize() + + def makefile(self, ext, *args, **kwargs) -> LEGACY_PATH: + """See :meth:`Pytester.makefile`.""" + if ext and not ext.startswith("."): + # pytester.makefile is going to throw a ValueError in a way that + # testdir.makefile did not, because + # pathlib.Path is stricter suffixes than py.path + # This ext arguments is likely user error, but since testdir has + # allowed this, we will prepend "." as a workaround to avoid breaking + # testdir usage that worked before + ext = "." + ext + return legacy_path(self._pytester.makefile(ext, *args, **kwargs)) + + def makeconftest(self, source) -> LEGACY_PATH: + """See :meth:`Pytester.makeconftest`.""" + return legacy_path(self._pytester.makeconftest(source)) + + def makeini(self, source) -> LEGACY_PATH: + """See :meth:`Pytester.makeini`.""" + return legacy_path(self._pytester.makeini(source)) + + def getinicfg(self, source: str) -> SectionWrapper: + """See :meth:`Pytester.getinicfg`.""" + return self._pytester.getinicfg(source) + + def makepyprojecttoml(self, source) -> LEGACY_PATH: + """See :meth:`Pytester.makepyprojecttoml`.""" + return legacy_path(self._pytester.makepyprojecttoml(source)) + + def makepyfile(self, *args, **kwargs) -> LEGACY_PATH: + """See :meth:`Pytester.makepyfile`.""" + return legacy_path(self._pytester.makepyfile(*args, **kwargs)) + + def maketxtfile(self, *args, **kwargs) -> LEGACY_PATH: + """See :meth:`Pytester.maketxtfile`.""" + return legacy_path(self._pytester.maketxtfile(*args, **kwargs)) + + def syspathinsert(self, path=None) -> None: + """See :meth:`Pytester.syspathinsert`.""" + return self._pytester.syspathinsert(path) + + def mkdir(self, name) -> LEGACY_PATH: + """See :meth:`Pytester.mkdir`.""" + return legacy_path(self._pytester.mkdir(name)) + + def mkpydir(self, name) -> LEGACY_PATH: + """See :meth:`Pytester.mkpydir`.""" + return legacy_path(self._pytester.mkpydir(name)) + + def copy_example(self, name=None) -> LEGACY_PATH: + """See :meth:`Pytester.copy_example`.""" + return legacy_path(self._pytester.copy_example(name)) + + def getnode(self, config: Config, arg) -> Item | Collector | None: + """See :meth:`Pytester.getnode`.""" + return self._pytester.getnode(config, arg) + + def getpathnode(self, path): + """See :meth:`Pytester.getpathnode`.""" + return self._pytester.getpathnode(path) + + def genitems(self, colitems: list[Item | Collector]) -> list[Item]: + """See :meth:`Pytester.genitems`.""" + return self._pytester.genitems(colitems) + + def runitem(self, source): + """See :meth:`Pytester.runitem`.""" + return self._pytester.runitem(source) + + def inline_runsource(self, source, *cmdlineargs): + """See :meth:`Pytester.inline_runsource`.""" + return self._pytester.inline_runsource(source, *cmdlineargs) + + def inline_genitems(self, *args): + """See :meth:`Pytester.inline_genitems`.""" + return self._pytester.inline_genitems(*args) + + def inline_run(self, *args, plugins=(), no_reraise_ctrlc: bool = False): + """See :meth:`Pytester.inline_run`.""" + return self._pytester.inline_run( + *args, plugins=plugins, no_reraise_ctrlc=no_reraise_ctrlc + ) + + def runpytest_inprocess(self, *args, **kwargs) -> RunResult: + """See :meth:`Pytester.runpytest_inprocess`.""" + return self._pytester.runpytest_inprocess(*args, **kwargs) + + def runpytest(self, *args, **kwargs) -> RunResult: + """See :meth:`Pytester.runpytest`.""" + return self._pytester.runpytest(*args, **kwargs) + + def parseconfig(self, *args) -> Config: + """See :meth:`Pytester.parseconfig`.""" + return self._pytester.parseconfig(*args) + + def parseconfigure(self, *args) -> Config: + """See :meth:`Pytester.parseconfigure`.""" + return self._pytester.parseconfigure(*args) + + def getitem(self, source, funcname="test_func"): + """See :meth:`Pytester.getitem`.""" + return self._pytester.getitem(source, funcname) + + def getitems(self, source): + """See :meth:`Pytester.getitems`.""" + return self._pytester.getitems(source) + + def getmodulecol(self, source, configargs=(), withinit=False): + """See :meth:`Pytester.getmodulecol`.""" + return self._pytester.getmodulecol( + source, configargs=configargs, withinit=withinit + ) + + def collect_by_name(self, modcol: Collector, name: str) -> Item | Collector | None: + """See :meth:`Pytester.collect_by_name`.""" + return self._pytester.collect_by_name(modcol, name) + + def popen( + self, + cmdargs, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + stdin=CLOSE_STDIN, + **kw, + ): + """See :meth:`Pytester.popen`.""" + return self._pytester.popen(cmdargs, stdout, stderr, stdin, **kw) + + def run(self, *cmdargs, timeout=None, stdin=CLOSE_STDIN) -> RunResult: + """See :meth:`Pytester.run`.""" + return self._pytester.run(*cmdargs, timeout=timeout, stdin=stdin) + + def runpython(self, script) -> RunResult: + """See :meth:`Pytester.runpython`.""" + return self._pytester.runpython(script) + + def runpython_c(self, command): + """See :meth:`Pytester.runpython_c`.""" + return self._pytester.runpython_c(command) + + def runpytest_subprocess(self, *args, timeout=None) -> RunResult: + """See :meth:`Pytester.runpytest_subprocess`.""" + return self._pytester.runpytest_subprocess(*args, timeout=timeout) + + def spawn_pytest(self, string: str, expect_timeout: float = 10.0) -> pexpect.spawn: + """See :meth:`Pytester.spawn_pytest`.""" + return self._pytester.spawn_pytest(string, expect_timeout=expect_timeout) + + def spawn(self, cmd: str, expect_timeout: float = 10.0) -> pexpect.spawn: + """See :meth:`Pytester.spawn`.""" + return self._pytester.spawn(cmd, expect_timeout=expect_timeout) + + def __repr__(self) -> str: + return f"" + + def __str__(self) -> str: + return str(self.tmpdir) + + +class LegacyTestdirPlugin: + @staticmethod + @fixture + def testdir(pytester: Pytester) -> Testdir: + """ + Identical to :fixture:`pytester`, and provides an instance whose methods return + legacy ``LEGACY_PATH`` objects instead when applicable. + + New code should avoid using :fixture:`testdir` in favor of :fixture:`pytester`. + """ + return Testdir(pytester, _ispytest=True) + + +@final +@dataclasses.dataclass +class TempdirFactory: + """Backward compatibility wrapper that implements ``py.path.local`` + for :class:`TempPathFactory`. + + .. note:: + These days, it is preferred to use ``tmp_path_factory``. + + :ref:`About the tmpdir and tmpdir_factory fixtures`. + + """ + + _tmppath_factory: TempPathFactory + + def __init__( + self, tmppath_factory: TempPathFactory, *, _ispytest: bool = False + ) -> None: + check_ispytest(_ispytest) + self._tmppath_factory = tmppath_factory + + def mktemp(self, basename: str, numbered: bool = True) -> LEGACY_PATH: + """Same as :meth:`TempPathFactory.mktemp`, but returns a ``py.path.local`` object.""" + return legacy_path(self._tmppath_factory.mktemp(basename, numbered).resolve()) + + def getbasetemp(self) -> LEGACY_PATH: + """Same as :meth:`TempPathFactory.getbasetemp`, but returns a ``py.path.local`` object.""" + return legacy_path(self._tmppath_factory.getbasetemp().resolve()) + + +class LegacyTmpdirPlugin: + @staticmethod + @fixture(scope="session") + def tmpdir_factory(request: FixtureRequest) -> TempdirFactory: + """Return a :class:`pytest.TempdirFactory` instance for the test session.""" + # Set dynamically by pytest_configure(). + return request.config._tmpdirhandler # type: ignore + + @staticmethod + @fixture + def tmpdir(tmp_path: Path) -> LEGACY_PATH: + """Return a temporary directory path object which is unique to each test + function invocation, created as a sub directory of the base temporary + directory. + + By default, a new base temporary directory is created each test session, + and old bases are removed after 3 sessions, to aid in debugging. If + ``--basetemp`` is used then it is cleared each session. See + :ref:`temporary directory location and retention`. + + The returned object is a `legacy_path`_ object. + + .. note:: + These days, it is preferred to use ``tmp_path``. + + :ref:`About the tmpdir and tmpdir_factory fixtures`. + + .. _legacy_path: https://py.readthedocs.io/en/latest/path.html + """ + return legacy_path(tmp_path) + + +def Cache_makedir(self: Cache, name: str) -> LEGACY_PATH: + """Return a directory path object with the given name. + + Same as :func:`mkdir`, but returns a legacy py path instance. + """ + return legacy_path(self.mkdir(name)) + + +def FixtureRequest_fspath(self: FixtureRequest) -> LEGACY_PATH: + """(deprecated) The file system path of the test module which collected this test.""" + return legacy_path(self.path) + + +def TerminalReporter_startdir(self: TerminalReporter) -> LEGACY_PATH: + """The directory from which pytest was invoked. + + Prefer to use ``startpath`` which is a :class:`pathlib.Path`. + + :type: LEGACY_PATH + """ + return legacy_path(self.startpath) + + +def Config_invocation_dir(self: Config) -> LEGACY_PATH: + """The directory from which pytest was invoked. + + Prefer to use :attr:`invocation_params.dir `, + which is a :class:`pathlib.Path`. + + :type: LEGACY_PATH + """ + return legacy_path(str(self.invocation_params.dir)) + + +def Config_rootdir(self: Config) -> LEGACY_PATH: + """The path to the :ref:`rootdir `. + + Prefer to use :attr:`rootpath`, which is a :class:`pathlib.Path`. + + :type: LEGACY_PATH + """ + return legacy_path(str(self.rootpath)) + + +def Config_inifile(self: Config) -> LEGACY_PATH | None: + """The path to the :ref:`configfile `. + + Prefer to use :attr:`inipath`, which is a :class:`pathlib.Path`. + + :type: Optional[LEGACY_PATH] + """ + return legacy_path(str(self.inipath)) if self.inipath else None + + +def Session_startdir(self: Session) -> LEGACY_PATH: + """The path from which pytest was invoked. + + Prefer to use ``startpath`` which is a :class:`pathlib.Path`. + + :type: LEGACY_PATH + """ + return legacy_path(self.startpath) + + +def Config__getini_unknown_type(self, name: str, type: str, value: str | list[str]): + if type == "pathlist": + # TODO: This assert is probably not valid in all cases. + assert self.inipath is not None + dp = self.inipath.parent + input_values = shlex.split(value) if isinstance(value, str) else value + return [legacy_path(str(dp / x)) for x in input_values] + else: + raise ValueError(f"unknown configuration type: {type}", value) + + +def Node_fspath(self: Node) -> LEGACY_PATH: + """(deprecated) returns a legacy_path copy of self.path""" + return legacy_path(self.path) + + +def Node_fspath_set(self: Node, value: LEGACY_PATH) -> None: + self.path = Path(value) + + +@hookimpl(tryfirst=True) +def pytest_load_initial_conftests(early_config: Config) -> None: + """Monkeypatch legacy path attributes in several classes, as early as possible.""" + mp = MonkeyPatch() + early_config.add_cleanup(mp.undo) + + # Add Cache.makedir(). + mp.setattr(Cache, "makedir", Cache_makedir, raising=False) + + # Add FixtureRequest.fspath property. + mp.setattr(FixtureRequest, "fspath", property(FixtureRequest_fspath), raising=False) + + # Add TerminalReporter.startdir property. + mp.setattr( + TerminalReporter, "startdir", property(TerminalReporter_startdir), raising=False + ) + + # Add Config.{invocation_dir,rootdir,inifile} properties. + mp.setattr(Config, "invocation_dir", property(Config_invocation_dir), raising=False) + mp.setattr(Config, "rootdir", property(Config_rootdir), raising=False) + mp.setattr(Config, "inifile", property(Config_inifile), raising=False) + + # Add Session.startdir property. + mp.setattr(Session, "startdir", property(Session_startdir), raising=False) + + # Add pathlist configuration type. + mp.setattr(Config, "_getini_unknown_type", Config__getini_unknown_type) + + # Add Node.fspath property. + mp.setattr(Node, "fspath", property(Node_fspath, Node_fspath_set), raising=False) + + +@hookimpl +def pytest_configure(config: Config) -> None: + """Installs the LegacyTmpdirPlugin if the ``tmpdir`` plugin is also installed.""" + if config.pluginmanager.has_plugin("tmpdir"): + mp = MonkeyPatch() + config.add_cleanup(mp.undo) + # Create TmpdirFactory and attach it to the config object. + # + # This is to comply with existing plugins which expect the handler to be + # available at pytest_configure time, but ideally should be moved entirely + # to the tmpdir_factory session fixture. + try: + tmp_path_factory = config._tmp_path_factory # type: ignore[attr-defined] + except AttributeError: + # tmpdir plugin is blocked. + pass + else: + _tmpdirhandler = TempdirFactory(tmp_path_factory, _ispytest=True) + mp.setattr(config, "_tmpdirhandler", _tmpdirhandler, raising=False) + + config.pluginmanager.register(LegacyTmpdirPlugin, "legacypath-tmpdir") + + +@hookimpl +def pytest_plugin_registered(plugin: object, manager: PytestPluginManager) -> None: + # pytester is not loaded by default and is commonly loaded from a conftest, + # so checking for it in `pytest_configure` is not enough. + is_pytester = plugin is manager.get_plugin("pytester") + if is_pytester and not manager.is_registered(LegacyTestdirPlugin): + manager.register(LegacyTestdirPlugin, "legacypath-pytester") diff --git a/.venv/Lib/site-packages/_pytest/logging.py b/.venv/Lib/site-packages/_pytest/logging.py new file mode 100644 index 00000000..08c826ff --- /dev/null +++ b/.venv/Lib/site-packages/_pytest/logging.py @@ -0,0 +1,955 @@ +# mypy: allow-untyped-defs +"""Access and control log capturing.""" + +from __future__ import annotations + +from contextlib import contextmanager +from contextlib import nullcontext +from datetime import datetime +from datetime import timedelta +from datetime import timezone +import io +from io import StringIO +import logging +from logging import LogRecord +import os +from pathlib import Path +import re +from types import TracebackType +from typing import AbstractSet +from typing import Dict +from typing import final +from typing import Generator +from typing import Generic +from typing import List +from typing import Literal +from typing import Mapping +from typing import TYPE_CHECKING +from typing import TypeVar + +from _pytest import nodes +from _pytest._io import TerminalWriter +from _pytest.capture import CaptureManager +from _pytest.config import _strtobool +from _pytest.config import Config +from _pytest.config import create_terminal_writer +from _pytest.config import hookimpl +from _pytest.config import UsageError +from _pytest.config.argparsing import Parser +from _pytest.deprecated import check_ispytest +from _pytest.fixtures import fixture +from _pytest.fixtures import FixtureRequest +from _pytest.main import Session +from _pytest.stash import StashKey +from _pytest.terminal import TerminalReporter + + +if TYPE_CHECKING: + logging_StreamHandler = logging.StreamHandler[StringIO] +else: + logging_StreamHandler = logging.StreamHandler + +DEFAULT_LOG_FORMAT = "%(levelname)-8s %(name)s:%(filename)s:%(lineno)d %(message)s" +DEFAULT_LOG_DATE_FORMAT = "%H:%M:%S" +_ANSI_ESCAPE_SEQ = re.compile(r"\x1b\[[\d;]+m") +caplog_handler_key = StashKey["LogCaptureHandler"]() +caplog_records_key = StashKey[Dict[str, List[logging.LogRecord]]]() + + +def _remove_ansi_escape_sequences(text: str) -> str: + return _ANSI_ESCAPE_SEQ.sub("", text) + + +class DatetimeFormatter(logging.Formatter): + """A logging formatter which formats record with + :func:`datetime.datetime.strftime` formatter instead of + :func:`time.strftime` in case of microseconds in format string. + """ + + def formatTime(self, record: LogRecord, datefmt: str | None = None) -> str: + if datefmt and "%f" in datefmt: + ct = self.converter(record.created) + tz = timezone(timedelta(seconds=ct.tm_gmtoff), ct.tm_zone) + # Construct `datetime.datetime` object from `struct_time` + # and msecs information from `record` + # Using int() instead of round() to avoid it exceeding 1_000_000 and causing a ValueError (#11861). + dt = datetime(*ct[0:6], microsecond=int(record.msecs * 1000), tzinfo=tz) + return dt.strftime(datefmt) + # Use `logging.Formatter` for non-microsecond formats + return super().formatTime(record, datefmt) + + +class ColoredLevelFormatter(DatetimeFormatter): + """A logging formatter which colorizes the %(levelname)..s part of the + log format passed to __init__.""" + + LOGLEVEL_COLOROPTS: Mapping[int, AbstractSet[str]] = { + logging.CRITICAL: {"red"}, + logging.ERROR: {"red", "bold"}, + logging.WARNING: {"yellow"}, + logging.WARN: {"yellow"}, + logging.INFO: {"green"}, + logging.DEBUG: {"purple"}, + logging.NOTSET: set(), + } + LEVELNAME_FMT_REGEX = re.compile(r"%\(levelname\)([+-.]?\d*(?:\.\d+)?s)") + + def __init__(self, terminalwriter: TerminalWriter, *args, **kwargs) -> None: + super().__init__(*args, **kwargs) + self._terminalwriter = terminalwriter + self._original_fmt = self._style._fmt + self._level_to_fmt_mapping: dict[int, str] = {} + + for level, color_opts in self.LOGLEVEL_COLOROPTS.items(): + self.add_color_level(level, *color_opts) + + def add_color_level(self, level: int, *color_opts: str) -> None: + """Add or update color opts for a log level. + + :param level: + Log level to apply a style to, e.g. ``logging.INFO``. + :param color_opts: + ANSI escape sequence color options. Capitalized colors indicates + background color, i.e. ``'green', 'Yellow', 'bold'`` will give bold + green text on yellow background. + + .. warning:: + This is an experimental API. + """ + assert self._fmt is not None + levelname_fmt_match = self.LEVELNAME_FMT_REGEX.search(self._fmt) + if not levelname_fmt_match: + return + levelname_fmt = levelname_fmt_match.group() + + formatted_levelname = levelname_fmt % {"levelname": logging.getLevelName(level)} + + # add ANSI escape sequences around the formatted levelname + color_kwargs = {name: True for name in color_opts} + colorized_formatted_levelname = self._terminalwriter.markup( + formatted_levelname, **color_kwargs + ) + self._level_to_fmt_mapping[level] = self.LEVELNAME_FMT_REGEX.sub( + colorized_formatted_levelname, self._fmt + ) + + def format(self, record: logging.LogRecord) -> str: + fmt = self._level_to_fmt_mapping.get(record.levelno, self._original_fmt) + self._style._fmt = fmt + return super().format(record) + + +class PercentStyleMultiline(logging.PercentStyle): + """A logging style with special support for multiline messages. + + If the message of a record consists of multiple lines, this style + formats the message as if each line were logged separately. + """ + + def __init__(self, fmt: str, auto_indent: int | str | bool | None) -> None: + super().__init__(fmt) + self._auto_indent = self._get_auto_indent(auto_indent) + + @staticmethod + def _get_auto_indent(auto_indent_option: int | str | bool | None) -> int: + """Determine the current auto indentation setting. + + Specify auto indent behavior (on/off/fixed) by passing in + extra={"auto_indent": [value]} to the call to logging.log() or + using a --log-auto-indent [value] command line or the + log_auto_indent [value] config option. + + Default behavior is auto-indent off. + + Using the string "True" or "on" or the boolean True as the value + turns auto indent on, using the string "False" or "off" or the + boolean False or the int 0 turns it off, and specifying a + positive integer fixes the indentation position to the value + specified. + + Any other values for the option are invalid, and will silently be + converted to the default. + + :param None|bool|int|str auto_indent_option: + User specified option for indentation from command line, config + or extra kwarg. Accepts int, bool or str. str option accepts the + same range of values as boolean config options, as well as + positive integers represented in str form. + + :returns: + Indentation value, which can be + -1 (automatically determine indentation) or + 0 (auto-indent turned off) or + >0 (explicitly set indentation position). + """ + if auto_indent_option is None: + return 0 + elif isinstance(auto_indent_option, bool): + if auto_indent_option: + return -1 + else: + return 0 + elif isinstance(auto_indent_option, int): + return int(auto_indent_option) + elif isinstance(auto_indent_option, str): + try: + return int(auto_indent_option) + except ValueError: + pass + try: + if _strtobool(auto_indent_option): + return -1 + except ValueError: + return 0 + + return 0 + + def format(self, record: logging.LogRecord) -> str: + if "\n" in record.message: + if hasattr(record, "auto_indent"): + # Passed in from the "extra={}" kwarg on the call to logging.log(). + auto_indent = self._get_auto_indent(record.auto_indent) + else: + auto_indent = self._auto_indent + + if auto_indent: + lines = record.message.splitlines() + formatted = self._fmt % {**record.__dict__, "message": lines[0]} + + if auto_indent < 0: + indentation = _remove_ansi_escape_sequences(formatted).find( + lines[0] + ) + else: + # Optimizes logging by allowing a fixed indentation. + indentation = auto_indent + lines[0] = formatted + return ("\n" + " " * indentation).join(lines) + return self._fmt % record.__dict__ + + +def get_option_ini(config: Config, *names: str): + for name in names: + ret = config.getoption(name) # 'default' arg won't work as expected + if ret is None: + ret = config.getini(name) + if ret: + return ret + + +def pytest_addoption(parser: Parser) -> None: + """Add options to control log capturing.""" + group = parser.getgroup("logging") + + def add_option_ini(option, dest, default=None, type=None, **kwargs): + parser.addini( + dest, default=default, type=type, help="Default value for " + option + ) + group.addoption(option, dest=dest, **kwargs) + + add_option_ini( + "--log-level", + dest="log_level", + default=None, + metavar="LEVEL", + help=( + "Level of messages to catch/display." + " Not set by default, so it depends on the root/parent log handler's" + ' effective level, where it is "WARNING" by default.' + ), + ) + add_option_ini( + "--log-format", + dest="log_format", + default=DEFAULT_LOG_FORMAT, + help="Log format used by the logging module", + ) + add_option_ini( + "--log-date-format", + dest="log_date_format", + default=DEFAULT_LOG_DATE_FORMAT, + help="Log date format used by the logging module", + ) + parser.addini( + "log_cli", + default=False, + type="bool", + help='Enable log display during test run (also known as "live logging")', + ) + add_option_ini( + "--log-cli-level", dest="log_cli_level", default=None, help="CLI logging level" + ) + add_option_ini( + "--log-cli-format", + dest="log_cli_format", + default=None, + help="Log format used by the logging module", + ) + add_option_ini( + "--log-cli-date-format", + dest="log_cli_date_format", + default=None, + help="Log date format used by the logging module", + ) + add_option_ini( + "--log-file", + dest="log_file", + default=None, + help="Path to a file when logging will be written to", + ) + add_option_ini( + "--log-file-mode", + dest="log_file_mode", + default="w", + choices=["w", "a"], + help="Log file open mode", + ) + add_option_ini( + "--log-file-level", + dest="log_file_level", + default=None, + help="Log file logging level", + ) + add_option_ini( + "--log-file-format", + dest="log_file_format", + default=None, + help="Log format used by the logging module", + ) + add_option_ini( + "--log-file-date-format", + dest="log_file_date_format", + default=None, + help="Log date format used by the logging module", + ) + add_option_ini( + "--log-auto-indent", + dest="log_auto_indent", + default=None, + help="Auto-indent multiline messages passed to the logging module. Accepts true|on, false|off or an integer.", + ) + group.addoption( + "--log-disable", + action="append", + default=[], + dest="logger_disable", + help="Disable a logger by name. Can be passed multiple times.", + ) + + +_HandlerType = TypeVar("_HandlerType", bound=logging.Handler) + + +# Not using @contextmanager for performance reasons. +class catching_logs(Generic[_HandlerType]): + """Context manager that prepares the whole logging machinery properly.""" + + __slots__ = ("handler", "level", "orig_level") + + def __init__(self, handler: _HandlerType, level: int | None = None) -> None: + self.handler = handler + self.level = level + + def __enter__(self) -> _HandlerType: + root_logger = logging.getLogger() + if self.level is not None: + self.handler.setLevel(self.level) + root_logger.addHandler(self.handler) + if self.level is not None: + self.orig_level = root_logger.level + root_logger.setLevel(min(self.orig_level, self.level)) + return self.handler + + def __exit__( + self, + exc_type: type[BaseException] | None, + exc_val: BaseException | None, + exc_tb: TracebackType | None, + ) -> None: + root_logger = logging.getLogger() + if self.level is not None: + root_logger.setLevel(self.orig_level) + root_logger.removeHandler(self.handler) + + +class LogCaptureHandler(logging_StreamHandler): + """A logging handler that stores log records and the log text.""" + + def __init__(self) -> None: + """Create a new log handler.""" + super().__init__(StringIO()) + self.records: list[logging.LogRecord] = [] + + def emit(self, record: logging.LogRecord) -> None: + """Keep the log records in a list in addition to the log text.""" + self.records.append(record) + super().emit(record) + + def reset(self) -> None: + self.records = [] + self.stream = StringIO() + + def clear(self) -> None: + self.records.clear() + self.stream = StringIO() + + def handleError(self, record: logging.LogRecord) -> None: + if logging.raiseExceptions: + # Fail the test if the log message is bad (emit failed). + # The default behavior of logging is to print "Logging error" + # to stderr with the call stack and some extra details. + # pytest wants to make such mistakes visible during testing. + raise # noqa: PLE0704 + + +@final +class LogCaptureFixture: + """Provides access and control of log capturing.""" + + def __init__(self, item: nodes.Node, *, _ispytest: bool = False) -> None: + check_ispytest(_ispytest) + self._item = item + self._initial_handler_level: int | None = None + # Dict of log name -> log level. + self._initial_logger_levels: dict[str | None, int] = {} + self._initial_disabled_logging_level: int | None = None + + def _finalize(self) -> None: + """Finalize the fixture. + + This restores the log levels and the disabled logging levels changed by :meth:`set_level`. + """ + # Restore log levels. + if self._initial_handler_level is not None: + self.handler.setLevel(self._initial_handler_level) + for logger_name, level in self._initial_logger_levels.items(): + logger = logging.getLogger(logger_name) + logger.setLevel(level) + # Disable logging at the original disabled logging level. + if self._initial_disabled_logging_level is not None: + logging.disable(self._initial_disabled_logging_level) + self._initial_disabled_logging_level = None + + @property + def handler(self) -> LogCaptureHandler: + """Get the logging handler used by the fixture.""" + return self._item.stash[caplog_handler_key] + + def get_records( + self, when: Literal["setup", "call", "teardown"] + ) -> list[logging.LogRecord]: + """Get the logging records for one of the possible test phases. + + :param when: + Which test phase to obtain the records from. + Valid values are: "setup", "call" and "teardown". + + :returns: The list of captured records at the given stage. + + .. versionadded:: 3.4 + """ + return self._item.stash[caplog_records_key].get(when, []) + + @property + def text(self) -> str: + """The formatted log text.""" + return _remove_ansi_escape_sequences(self.handler.stream.getvalue()) + + @property + def records(self) -> list[logging.LogRecord]: + """The list of log records.""" + return self.handler.records + + @property + def record_tuples(self) -> list[tuple[str, int, str]]: + """A list of a stripped down version of log records intended + for use in assertion comparison. + + The format of the tuple is: + + (logger_name, log_level, message) + """ + return [(r.name, r.levelno, r.getMessage()) for r in self.records] + + @property + def messages(self) -> list[str]: + """A list of format-interpolated log messages. + + Unlike 'records', which contains the format string and parameters for + interpolation, log messages in this list are all interpolated. + + Unlike 'text', which contains the output from the handler, log + messages in this list are unadorned with levels, timestamps, etc, + making exact comparisons more reliable. + + Note that traceback or stack info (from :func:`logging.exception` or + the `exc_info` or `stack_info` arguments to the logging functions) is + not included, as this is added by the formatter in the handler. + + .. versionadded:: 3.7 + """ + return [r.getMessage() for r in self.records] + + def clear(self) -> None: + """Reset the list of log records and the captured log text.""" + self.handler.clear() + + def _force_enable_logging( + self, level: int | str, logger_obj: logging.Logger + ) -> int: + """Enable the desired logging level if the global level was disabled via ``logging.disabled``. + + Only enables logging levels greater than or equal to the requested ``level``. + + Does nothing if the desired ``level`` wasn't disabled. + + :param level: + The logger level caplog should capture. + All logging is enabled if a non-standard logging level string is supplied. + Valid level strings are in :data:`logging._nameToLevel`. + :param logger_obj: The logger object to check. + + :return: The original disabled logging level. + """ + original_disable_level: int = logger_obj.manager.disable + + if isinstance(level, str): + # Try to translate the level string to an int for `logging.disable()` + level = logging.getLevelName(level) + + if not isinstance(level, int): + # The level provided was not valid, so just un-disable all logging. + logging.disable(logging.NOTSET) + elif not logger_obj.isEnabledFor(level): + # Each level is `10` away from other levels. + # https://docs.python.org/3/library/logging.html#logging-levels + disable_level = max(level - 10, logging.NOTSET) + logging.disable(disable_level) + + return original_disable_level + + def set_level(self, level: int | str, logger: str | None = None) -> None: + """Set the threshold level of a logger for the duration of a test. + + Logging messages which are less severe than this level will not be captured. + + .. versionchanged:: 3.4 + The levels of the loggers changed by this function will be + restored to their initial values at the end of the test. + + Will enable the requested logging level if it was disabled via :func:`logging.disable`. + + :param level: The level. + :param logger: The logger to update. If not given, the root logger. + """ + logger_obj = logging.getLogger(logger) + # Save the original log-level to restore it during teardown. + self._initial_logger_levels.setdefault(logger, logger_obj.level) + logger_obj.setLevel(level) + if self._initial_handler_level is None: + self._initial_handler_level = self.handler.level + self.handler.setLevel(level) + initial_disabled_logging_level = self._force_enable_logging(level, logger_obj) + if self._initial_disabled_logging_level is None: + self._initial_disabled_logging_level = initial_disabled_logging_level + + @contextmanager + def at_level(self, level: int | str, logger: str | None = None) -> Generator[None]: + """Context manager that sets the level for capturing of logs. After + the end of the 'with' statement the level is restored to its original + value. + + Will enable the requested logging level if it was disabled via :func:`logging.disable`. + + :param level: The level. + :param logger: The logger to update. If not given, the root logger. + """ + logger_obj = logging.getLogger(logger) + orig_level = logger_obj.level + logger_obj.setLevel(level) + handler_orig_level = self.handler.level + self.handler.setLevel(level) + original_disable_level = self._force_enable_logging(level, logger_obj) + try: + yield + finally: + logger_obj.setLevel(orig_level) + self.handler.setLevel(handler_orig_level) + logging.disable(original_disable_level) + + @contextmanager + def filtering(self, filter_: logging.Filter) -> Generator[None]: + """Context manager that temporarily adds the given filter to the caplog's + :meth:`handler` for the 'with' statement block, and removes that filter at the + end of the block. + + :param filter_: A custom :class:`logging.Filter` object. + + .. versionadded:: 7.5 + """ + self.handler.addFilter(filter_) + try: + yield + finally: + self.handler.removeFilter(filter_) + + +@fixture +def caplog(request: FixtureRequest) -> Generator[LogCaptureFixture]: + """Access and control log capturing. + + Captured logs are available through the following properties/methods:: + + * caplog.messages -> list of format-interpolated log messages + * caplog.text -> string containing formatted log output + * caplog.records -> list of logging.LogRecord instances + * caplog.record_tuples -> list of (logger_name, level, message) tuples + * caplog.clear() -> clear captured records and formatted log output string + """ + result = LogCaptureFixture(request.node, _ispytest=True) + yield result + result._finalize() + + +def get_log_level_for_setting(config: Config, *setting_names: str) -> int | None: + for setting_name in setting_names: + log_level = config.getoption(setting_name) + if log_level is None: + log_level = config.getini(setting_name) + if log_level: + break + else: + return None + + if isinstance(log_level, str): + log_level = log_level.upper() + try: + return int(getattr(logging, log_level, log_level)) + except ValueError as e: + # Python logging does not recognise this as a logging level + raise UsageError( + f"'{log_level}' is not recognized as a logging level name for " + f"'{setting_name}'. Please consider passing the " + "logging level num instead." + ) from e + + +# run after terminalreporter/capturemanager are configured +@hookimpl(trylast=True) +def pytest_configure(config: Config) -> None: + config.pluginmanager.register(LoggingPlugin(config), "logging-plugin") + + +class LoggingPlugin: + """Attaches to the logging module and captures log messages for each test.""" + + def __init__(self, config: Config) -> None: + """Create a new plugin to capture log messages. + + The formatter can be safely shared across all handlers so + create a single one for the entire test session here. + """ + self._config = config + + # Report logging. + self.formatter = self._create_formatter( + get_option_ini(config, "log_format"), + get_option_ini(config, "log_date_format"), + get_option_ini(config, "log_auto_indent"), + ) + self.log_level = get_log_level_for_setting(config, "log_level") + self.caplog_handler = LogCaptureHandler() + self.caplog_handler.setFormatter(self.formatter) + self.report_handler = LogCaptureHandler() + self.report_handler.setFormatter(self.formatter) + + # File logging. + self.log_file_level = get_log_level_for_setting( + config, "log_file_level", "log_level" + ) + log_file = get_option_ini(config, "log_file") or os.devnull + if log_file != os.devnull: + directory = os.path.dirname(os.path.abspath(log_file)) + if not os.path.isdir(directory): + os.makedirs(directory) + + self.log_file_mode = get_option_ini(config, "log_file_mode") or "w" + self.log_file_handler = _FileHandler( + log_file, mode=self.log_file_mode, encoding="UTF-8" + ) + log_file_format = get_option_ini(config, "log_file_format", "log_format") + log_file_date_format = get_option_ini( + config, "log_file_date_format", "log_date_format" + ) + + log_file_formatter = DatetimeFormatter( + log_file_format, datefmt=log_file_date_format + ) + self.log_file_handler.setFormatter(log_file_formatter) + + # CLI/live logging. + self.log_cli_level = get_log_level_for_setting( + config, "log_cli_level", "log_level" + ) + if self._log_cli_enabled(): + terminal_reporter = config.pluginmanager.get_plugin("terminalreporter") + # Guaranteed by `_log_cli_enabled()`. + assert terminal_reporter is not None + capture_manager = config.pluginmanager.get_plugin("capturemanager") + # if capturemanager plugin is disabled, live logging still works. + self.log_cli_handler: ( + _LiveLoggingStreamHandler | _LiveLoggingNullHandler + ) = _LiveLoggingStreamHandler(terminal_reporter, capture_manager) + else: + self.log_cli_handler = _LiveLoggingNullHandler() + log_cli_formatter = self._create_formatter( + get_option_ini(config, "log_cli_format", "log_format"), + get_option_ini(config, "log_cli_date_format", "log_date_format"), + get_option_ini(config, "log_auto_indent"), + ) + self.log_cli_handler.setFormatter(log_cli_formatter) + self._disable_loggers(loggers_to_disable=config.option.logger_disable) + + def _disable_loggers(self, loggers_to_disable: list[str]) -> None: + if not loggers_to_disable: + return + + for name in loggers_to_disable: + logger = logging.getLogger(name) + logger.disabled = True + + def _create_formatter(self, log_format, log_date_format, auto_indent): + # Color option doesn't exist if terminal plugin is disabled. + color = getattr(self._config.option, "color", "no") + if color != "no" and ColoredLevelFormatter.LEVELNAME_FMT_REGEX.search( + log_format + ): + formatter: logging.Formatter = ColoredLevelFormatter( + create_terminal_writer(self._config), log_format, log_date_format + ) + else: + formatter = DatetimeFormatter(log_format, log_date_format) + + formatter._style = PercentStyleMultiline( + formatter._style._fmt, auto_indent=auto_indent + ) + + return formatter + + def set_log_path(self, fname: str) -> None: + """Set the filename parameter for Logging.FileHandler(). + + Creates parent directory if it does not exist. + + .. warning:: + This is an experimental API. + """ + fpath = Path(fname) + + if not fpath.is_absolute(): + fpath = self._config.rootpath / fpath + + if not fpath.parent.exists(): + fpath.parent.mkdir(exist_ok=True, parents=True) + + # https://github.com/python/mypy/issues/11193 + stream: io.TextIOWrapper = fpath.open(mode=self.log_file_mode, encoding="UTF-8") # type: ignore[assignment] + old_stream = self.log_file_handler.setStream(stream) + if old_stream: + old_stream.close() + + def _log_cli_enabled(self) -> bool: + """Return whether live logging is enabled.""" + enabled = self._config.getoption( + "--log-cli-level" + ) is not None or self._config.getini("log_cli") + if not enabled: + return False + + terminal_reporter = self._config.pluginmanager.get_plugin("terminalreporter") + if terminal_reporter is None: + # terminal reporter is disabled e.g. by pytest-xdist. + return False + + return True + + @hookimpl(wrapper=True, tryfirst=True) + def pytest_sessionstart(self) -> Generator[None]: + self.log_cli_handler.set_when("sessionstart") + + with catching_logs(self.log_cli_handler, level=self.log_cli_level): + with catching_logs(self.log_file_handler, level=self.log_file_level): + return (yield) + + @hookimpl(wrapper=True, tryfirst=True) + def pytest_collection(self) -> Generator[None]: + self.log_cli_handler.set_when("collection") + + with catching_logs(self.log_cli_handler, level=self.log_cli_level): + with catching_logs(self.log_file_handler, level=self.log_file_level): + return (yield) + + @hookimpl(wrapper=True) + def pytest_runtestloop(self, session: Session) -> Generator[None, object, object]: + if session.config.option.collectonly: + return (yield) + + if self._log_cli_enabled() and self._config.get_verbosity() < 1: + # The verbose flag is needed to avoid messy test progress output. + self._config.option.verbose = 1 + + with catching_logs(self.log_cli_handler, level=self.log_cli_level): + with catching_logs(self.log_file_handler, level=self.log_file_level): + return (yield) # Run all the tests. + + @hookimpl + def pytest_runtest_logstart(self) -> None: + self.log_cli_handler.reset() + self.log_cli_handler.set_when("start") + + @hookimpl + def pytest_runtest_logreport(self) -> None: + self.log_cli_handler.set_when("logreport") + + def _runtest_for(self, item: nodes.Item, when: str) -> Generator[None]: + """Implement the internals of the pytest_runtest_xxx() hooks.""" + with catching_logs( + self.caplog_handler, + level=self.log_level, + ) as caplog_handler, catching_logs( + self.report_handler, + level=self.log_level, + ) as report_handler: + caplog_handler.reset() + report_handler.reset() + item.stash[caplog_records_key][when] = caplog_handler.records + item.stash[caplog_handler_key] = caplog_handler + + try: + yield + finally: + log = report_handler.stream.getvalue().strip() + item.add_report_section(when, "log", log) + + @hookimpl(wrapper=True) + def pytest_runtest_setup(self, item: nodes.Item) -> Generator[None]: + self.log_cli_handler.set_when("setup") + + empty: dict[str, list[logging.LogRecord]] = {} + item.stash[caplog_records_key] = empty + yield from self._runtest_for(item, "setup") + + @hookimpl(wrapper=True) + def pytest_runtest_call(self, item: nodes.Item) -> Generator[None]: + self.log_cli_handler.set_when("call") + + yield from self._runtest_for(item, "call") + + @hookimpl(wrapper=True) + def pytest_runtest_teardown(self, item: nodes.Item) -> Generator[None]: + self.log_cli_handler.set_when("teardown") + + try: + yield from self._runtest_for(item, "teardown") + finally: + del item.stash[caplog_records_key] + del item.stash[caplog_handler_key] + + @hookimpl + def pytest_runtest_logfinish(self) -> None: + self.log_cli_handler.set_when("finish") + + @hookimpl(wrapper=True, tryfirst=True) + def pytest_sessionfinish(self) -> Generator[None]: + self.log_cli_handler.set_when("sessionfinish") + + with catching_logs(self.log_cli_handler, level=self.log_cli_level): + with catching_logs(self.log_file_handler, level=self.log_file_level): + return (yield) + + @hookimpl + def pytest_unconfigure(self) -> None: + # Close the FileHandler explicitly. + # (logging.shutdown might have lost the weakref?!) + self.log_file_handler.close() + + +class _FileHandler(logging.FileHandler): + """A logging FileHandler with pytest tweaks.""" + + def handleError(self, record: logging.LogRecord) -> None: + # Handled by LogCaptureHandler. + pass + + +class _LiveLoggingStreamHandler(logging_StreamHandler): + """A logging StreamHandler used by the live logging feature: it will + write a newline before the first log message in each test. + + During live logging we must also explicitly disable stdout/stderr + capturing otherwise it will get captured and won't appear in the + terminal. + """ + + # Officially stream needs to be a IO[str], but TerminalReporter + # isn't. So force it. + stream: TerminalReporter = None # type: ignore + + def __init__( + self, + terminal_reporter: TerminalReporter, + capture_manager: CaptureManager | None, + ) -> None: + super().__init__(stream=terminal_reporter) # type: ignore[arg-type] + self.capture_manager = capture_manager + self.reset() + self.set_when(None) + self._test_outcome_written = False + + def reset(self) -> None: + """Reset the handler; should be called before the start of each test.""" + self._first_record_emitted = False + + def set_when(self, when: str | None) -> None: + """Prepare for the given test phase (setup/call/teardown).""" + self._when = when + self._section_name_shown = False + if when == "start": + self._test_outcome_written = False + + def emit(self, record: logging.LogRecord) -> None: + ctx_manager = ( + self.capture_manager.global_and_fixture_disabled() + if self.capture_manager + else nullcontext() + ) + with ctx_manager: + if not self._first_record_emitted: + self.stream.write("\n") + self._first_record_emitted = True + elif self._when in ("teardown", "finish"): + if not self._test_outcome_written: + self._test_outcome_written = True + self.stream.write("\n") + if not self._section_name_shown and self._when: + self.stream.section("live log " + self._when, sep="-", bold=True) + self._section_name_shown = True + super().emit(record) + + def handleError(self, record: logging.LogRecord) -> None: + # Handled by LogCaptureHandler. + pass + + +class _LiveLoggingNullHandler(logging.NullHandler): + """A logging handler used when live logging is disabled.""" + + def reset(self) -> None: + pass + + def set_when(self, when: str) -> None: + pass + + def handleError(self, record: logging.LogRecord) -> None: + # Handled by LogCaptureHandler. + pass diff --git a/.venv/Lib/site-packages/_pytest/main.py b/.venv/Lib/site-packages/_pytest/main.py new file mode 100644 index 00000000..e5534e98 --- /dev/null +++ b/.venv/Lib/site-packages/_pytest/main.py @@ -0,0 +1,1072 @@ +"""Core implementation of the testing process: init, session, runtest loop.""" + +from __future__ import annotations + +import argparse +import dataclasses +import fnmatch +import functools +import importlib +import importlib.util +import os +from pathlib import Path +import sys +from typing import AbstractSet +from typing import Callable +from typing import Dict +from typing import final +from typing import Iterable +from typing import Iterator +from typing import Literal +from typing import overload +from typing import Sequence +from typing import TYPE_CHECKING +import warnings + +import pluggy + +from _pytest import nodes +import _pytest._code +from _pytest.config import Config +from _pytest.config import directory_arg +from _pytest.config import ExitCode +from _pytest.config import hookimpl +from _pytest.config import PytestPluginManager +from _pytest.config import UsageError +from _pytest.config.argparsing import Parser +from _pytest.config.compat import PathAwareHookProxy +from _pytest.outcomes import exit +from _pytest.pathlib import absolutepath +from _pytest.pathlib import bestrelpath +from _pytest.pathlib import fnmatch_ex +from _pytest.pathlib import safe_exists +from _pytest.pathlib import scandir +from _pytest.reports import CollectReport +from _pytest.reports import TestReport +from _pytest.runner import collect_one_node +from _pytest.runner import SetupState +from _pytest.warning_types import PytestWarning + + +if TYPE_CHECKING: + from typing_extensions import Self + + from _pytest.fixtures import FixtureManager + + +def pytest_addoption(parser: Parser) -> None: + parser.addini( + "norecursedirs", + "Directory patterns to avoid for recursion", + type="args", + default=[ + "*.egg", + ".*", + "_darcs", + "build", + "CVS", + "dist", + "node_modules", + "venv", + "{arch}", + ], + ) + parser.addini( + "testpaths", + "Directories to search for tests when no files or directories are given on the " + "command line", + type="args", + default=[], + ) + group = parser.getgroup("general", "Running and selection options") + group._addoption( + "-x", + "--exitfirst", + action="store_const", + dest="maxfail", + const=1, + help="Exit instantly on first error or failed test", + ) + group = parser.getgroup("pytest-warnings") + group.addoption( + "-W", + "--pythonwarnings", + action="append", + help="Set which warnings to report, see -W option of Python itself", + ) + parser.addini( + "filterwarnings", + type="linelist", + help="Each line specifies a pattern for " + "warnings.filterwarnings. " + "Processed after -W/--pythonwarnings.", + ) + group._addoption( + "--maxfail", + metavar="num", + action="store", + type=int, + dest="maxfail", + default=0, + help="Exit after first num failures or errors", + ) + group._addoption( + "--strict-config", + action="store_true", + help="Any warnings encountered while parsing the `pytest` section of the " + "configuration file raise errors", + ) + group._addoption( + "--strict-markers", + action="store_true", + help="Markers not registered in the `markers` section of the configuration " + "file raise errors", + ) + group._addoption( + "--strict", + action="store_true", + help="(Deprecated) alias to --strict-markers", + ) + group._addoption( + "-c", + "--config-file", + metavar="FILE", + type=str, + dest="inifilename", + help="Load configuration from `FILE` instead of trying to locate one of the " + "implicit configuration files.", + ) + group._addoption( + "--continue-on-collection-errors", + action="store_true", + default=False, + dest="continue_on_collection_errors", + help="Force test execution even if collection errors occur", + ) + group._addoption( + "--rootdir", + action="store", + dest="rootdir", + help="Define root directory for tests. Can be relative path: 'root_dir', './root_dir', " + "'root_dir/another_dir/'; absolute path: '/home/user/root_dir'; path with variables: " + "'$HOME/root_dir'.", + ) + + group = parser.getgroup("collect", "collection") + group.addoption( + "--collectonly", + "--collect-only", + "--co", + action="store_true", + help="Only collect tests, don't execute them", + ) + group.addoption( + "--pyargs", + action="store_true", + help="Try to interpret all arguments as Python packages", + ) + group.addoption( + "--ignore", + action="append", + metavar="path", + help="Ignore path during collection (multi-allowed)", + ) + group.addoption( + "--ignore-glob", + action="append", + metavar="path", + help="Ignore path pattern during collection (multi-allowed)", + ) + group.addoption( + "--deselect", + action="append", + metavar="nodeid_prefix", + help="Deselect item (via node id prefix) during collection (multi-allowed)", + ) + group.addoption( + "--confcutdir", + dest="confcutdir", + default=None, + metavar="dir", + type=functools.partial(directory_arg, optname="--confcutdir"), + help="Only load conftest.py's relative to specified dir", + ) + group.addoption( + "--noconftest", + action="store_true", + dest="noconftest", + default=False, + help="Don't load any conftest.py files", + ) + group.addoption( + "--keepduplicates", + "--keep-duplicates", + action="store_true", + dest="keepduplicates", + default=False, + help="Keep duplicate tests", + ) + group.addoption( + "--collect-in-virtualenv", + action="store_true", + dest="collect_in_virtualenv", + default=False, + help="Don't ignore tests in a local virtualenv directory", + ) + group.addoption( + "--import-mode", + default="prepend", + choices=["prepend", "append", "importlib"], + dest="importmode", + help="Prepend/append to sys.path when importing test modules and conftest " + "files. Default: prepend.", + ) + parser.addini( + "consider_namespace_packages", + type="bool", + default=False, + help="Consider namespace packages when resolving module names during import", + ) + + group = parser.getgroup("debugconfig", "test session debugging and configuration") + group.addoption( + "--basetemp", + dest="basetemp", + default=None, + type=validate_basetemp, + metavar="dir", + help=( + "Base temporary directory for this test run. " + "(Warning: this directory is removed if it exists.)" + ), + ) + + +def validate_basetemp(path: str) -> str: + # GH 7119 + msg = "basetemp must not be empty, the current working directory or any parent directory of it" + + # empty path + if not path: + raise argparse.ArgumentTypeError(msg) + + def is_ancestor(base: Path, query: Path) -> bool: + """Return whether query is an ancestor of base.""" + if base == query: + return True + return query in base.parents + + # check if path is an ancestor of cwd + if is_ancestor(Path.cwd(), Path(path).absolute()): + raise argparse.ArgumentTypeError(msg) + + # check symlinks for ancestors + if is_ancestor(Path.cwd().resolve(), Path(path).resolve()): + raise argparse.ArgumentTypeError(msg) + + return path + + +def wrap_session( + config: Config, doit: Callable[[Config, Session], int | ExitCode | None] +) -> int | ExitCode: + """Skeleton command line program.""" + session = Session.from_config(config) + session.exitstatus = ExitCode.OK + initstate = 0 + try: + try: + config._do_configure() + initstate = 1 + config.hook.pytest_sessionstart(session=session) + initstate = 2 + session.exitstatus = doit(config, session) or 0 + except UsageError: + session.exitstatus = ExitCode.USAGE_ERROR + raise + except Failed: + session.exitstatus = ExitCode.TESTS_FAILED + except (KeyboardInterrupt, exit.Exception): + excinfo = _pytest._code.ExceptionInfo.from_current() + exitstatus: int | ExitCode = ExitCode.INTERRUPTED + if isinstance(excinfo.value, exit.Exception): + if excinfo.value.returncode is not None: + exitstatus = excinfo.value.returncode + if initstate < 2: + sys.stderr.write(f"{excinfo.typename}: {excinfo.value.msg}\n") + config.hook.pytest_keyboard_interrupt(excinfo=excinfo) + session.exitstatus = exitstatus + except BaseException: + session.exitstatus = ExitCode.INTERNAL_ERROR + excinfo = _pytest._code.ExceptionInfo.from_current() + try: + config.notify_exception(excinfo, config.option) + except exit.Exception as exc: + if exc.returncode is not None: + session.exitstatus = exc.returncode + sys.stderr.write(f"{type(exc).__name__}: {exc}\n") + else: + if isinstance(excinfo.value, SystemExit): + sys.stderr.write("mainloop: caught unexpected SystemExit!\n") + + finally: + # Explicitly break reference cycle. + excinfo = None # type: ignore + os.chdir(session.startpath) + if initstate >= 2: + try: + config.hook.pytest_sessionfinish( + session=session, exitstatus=session.exitstatus + ) + except exit.Exception as exc: + if exc.returncode is not None: + session.exitstatus = exc.returncode + sys.stderr.write(f"{type(exc).__name__}: {exc}\n") + config._ensure_unconfigure() + return session.exitstatus + + +def pytest_cmdline_main(config: Config) -> int | ExitCode: + return wrap_session(config, _main) + + +def _main(config: Config, session: Session) -> int | ExitCode | None: + """Default command line protocol for initialization, session, + running tests and reporting.""" + config.hook.pytest_collection(session=session) + config.hook.pytest_runtestloop(session=session) + + if session.testsfailed: + return ExitCode.TESTS_FAILED + elif session.testscollected == 0: + return ExitCode.NO_TESTS_COLLECTED + return None + + +def pytest_collection(session: Session) -> None: + session.perform_collect() + + +def pytest_runtestloop(session: Session) -> bool: + if session.testsfailed and not session.config.option.continue_on_collection_errors: + raise session.Interrupted( + "%d error%s during collection" + % (session.testsfailed, "s" if session.testsfailed != 1 else "") + ) + + if session.config.option.collectonly: + return True + + for i, item in enumerate(session.items): + nextitem = session.items[i + 1] if i + 1 < len(session.items) else None + item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) + if session.shouldfail: + raise session.Failed(session.shouldfail) + if session.shouldstop: + raise session.Interrupted(session.shouldstop) + return True + + +def _in_venv(path: Path) -> bool: + """Attempt to detect if ``path`` is the root of a Virtual Environment by + checking for the existence of the pyvenv.cfg file. + + [https://peps.python.org/pep-0405/] + + For regression protection we also check for conda environments that do not include pyenv.cfg yet -- + https://github.com/conda/conda/issues/13337 is the conda issue tracking adding pyenv.cfg. + + Checking for the `conda-meta/history` file per https://github.com/pytest-dev/pytest/issues/12652#issuecomment-2246336902. + + """ + try: + return ( + path.joinpath("pyvenv.cfg").is_file() + or path.joinpath("conda-meta", "history").is_file() + ) + except OSError: + return False + + +def pytest_ignore_collect(collection_path: Path, config: Config) -> bool | None: + if collection_path.name == "__pycache__": + return True + + ignore_paths = config._getconftest_pathlist( + "collect_ignore", path=collection_path.parent + ) + ignore_paths = ignore_paths or [] + excludeopt = config.getoption("ignore") + if excludeopt: + ignore_paths.extend(absolutepath(x) for x in excludeopt) + + if collection_path in ignore_paths: + return True + + ignore_globs = config._getconftest_pathlist( + "collect_ignore_glob", path=collection_path.parent + ) + ignore_globs = ignore_globs or [] + excludeglobopt = config.getoption("ignore_glob") + if excludeglobopt: + ignore_globs.extend(absolutepath(x) for x in excludeglobopt) + + if any(fnmatch.fnmatch(str(collection_path), str(glob)) for glob in ignore_globs): + return True + + allow_in_venv = config.getoption("collect_in_virtualenv") + if not allow_in_venv and _in_venv(collection_path): + return True + + if collection_path.is_dir(): + norecursepatterns = config.getini("norecursedirs") + if any(fnmatch_ex(pat, collection_path) for pat in norecursepatterns): + return True + + return None + + +def pytest_collect_directory( + path: Path, parent: nodes.Collector +) -> nodes.Collector | None: + return Dir.from_parent(parent, path=path) + + +def pytest_collection_modifyitems(items: list[nodes.Item], config: Config) -> None: + deselect_prefixes = tuple(config.getoption("deselect") or []) + if not deselect_prefixes: + return + + remaining = [] + deselected = [] + for colitem in items: + if colitem.nodeid.startswith(deselect_prefixes): + deselected.append(colitem) + else: + remaining.append(colitem) + + if deselected: + config.hook.pytest_deselected(items=deselected) + items[:] = remaining + + +class FSHookProxy: + def __init__( + self, + pm: PytestPluginManager, + remove_mods: AbstractSet[object], + ) -> None: + self.pm = pm + self.remove_mods = remove_mods + + def __getattr__(self, name: str) -> pluggy.HookCaller: + x = self.pm.subset_hook_caller(name, remove_plugins=self.remove_mods) + self.__dict__[name] = x + return x + + +class Interrupted(KeyboardInterrupt): + """Signals that the test run was interrupted.""" + + __module__ = "builtins" # For py3. + + +class Failed(Exception): + """Signals a stop as failed test run.""" + + +@dataclasses.dataclass +class _bestrelpath_cache(Dict[Path, str]): + __slots__ = ("path",) + + path: Path + + def __missing__(self, path: Path) -> str: + r = bestrelpath(self.path, path) + self[path] = r + return r + + +@final +class Dir(nodes.Directory): + """Collector of files in a file system directory. + + .. versionadded:: 8.0 + + .. note:: + + Python directories with an `__init__.py` file are instead collected by + :class:`~pytest.Package` by default. Both are :class:`~pytest.Directory` + collectors. + """ + + @classmethod + def from_parent( # type: ignore[override] + cls, + parent: nodes.Collector, + *, + path: Path, + ) -> Self: + """The public constructor. + + :param parent: The parent collector of this Dir. + :param path: The directory's path. + :type path: pathlib.Path + """ + return super().from_parent(parent=parent, path=path) + + def collect(self) -> Iterable[nodes.Item | nodes.Collector]: + config = self.config + col: nodes.Collector | None + cols: Sequence[nodes.Collector] + ihook = self.ihook + for direntry in scandir(self.path): + if direntry.is_dir(): + path = Path(direntry.path) + if not self.session.isinitpath(path, with_parents=True): + if ihook.pytest_ignore_collect(collection_path=path, config=config): + continue + col = ihook.pytest_collect_directory(path=path, parent=self) + if col is not None: + yield col + + elif direntry.is_file(): + path = Path(direntry.path) + if not self.session.isinitpath(path): + if ihook.pytest_ignore_collect(collection_path=path, config=config): + continue + cols = ihook.pytest_collect_file(file_path=path, parent=self) + yield from cols + + +@final +class Session(nodes.Collector): + """The root of the collection tree. + + ``Session`` collects the initial paths given as arguments to pytest. + """ + + Interrupted = Interrupted + Failed = Failed + # Set on the session by runner.pytest_sessionstart. + _setupstate: SetupState + # Set on the session by fixtures.pytest_sessionstart. + _fixturemanager: FixtureManager + exitstatus: int | ExitCode + + def __init__(self, config: Config) -> None: + super().__init__( + name="", + path=config.rootpath, + fspath=None, + parent=None, + config=config, + session=self, + nodeid="", + ) + self.testsfailed = 0 + self.testscollected = 0 + self._shouldstop: bool | str = False + self._shouldfail: bool | str = False + self.trace = config.trace.root.get("collection") + self._initialpaths: frozenset[Path] = frozenset() + self._initialpaths_with_parents: frozenset[Path] = frozenset() + self._notfound: list[tuple[str, Sequence[nodes.Collector]]] = [] + self._initial_parts: list[CollectionArgument] = [] + self._collection_cache: dict[nodes.Collector, CollectReport] = {} + self.items: list[nodes.Item] = [] + + self._bestrelpathcache: dict[Path, str] = _bestrelpath_cache(config.rootpath) + + self.config.pluginmanager.register(self, name="session") + + @classmethod + def from_config(cls, config: Config) -> Session: + session: Session = cls._create(config=config) + return session + + def __repr__(self) -> str: + return "<%s %s exitstatus=%r testsfailed=%d testscollected=%d>" % ( + self.__class__.__name__, + self.name, + getattr(self, "exitstatus", ""), + self.testsfailed, + self.testscollected, + ) + + @property + def shouldstop(self) -> bool | str: + return self._shouldstop + + @shouldstop.setter + def shouldstop(self, value: bool | str) -> None: + # The runner checks shouldfail and assumes that if it is set we are + # definitely stopping, so prevent unsetting it. + if value is False and self._shouldstop: + warnings.warn( + PytestWarning( + "session.shouldstop cannot be unset after it has been set; ignoring." + ), + stacklevel=2, + ) + return + self._shouldstop = value + + @property + def shouldfail(self) -> bool | str: + return self._shouldfail + + @shouldfail.setter + def shouldfail(self, value: bool | str) -> None: + # The runner checks shouldfail and assumes that if it is set we are + # definitely stopping, so prevent unsetting it. + if value is False and self._shouldfail: + warnings.warn( + PytestWarning( + "session.shouldfail cannot be unset after it has been set; ignoring." + ), + stacklevel=2, + ) + return + self._shouldfail = value + + @property + def startpath(self) -> Path: + """The path from which pytest was invoked. + + .. versionadded:: 7.0.0 + """ + return self.config.invocation_params.dir + + def _node_location_to_relpath(self, node_path: Path) -> str: + # bestrelpath is a quite slow function. + return self._bestrelpathcache[node_path] + + @hookimpl(tryfirst=True) + def pytest_collectstart(self) -> None: + if self.shouldfail: + raise self.Failed(self.shouldfail) + if self.shouldstop: + raise self.Interrupted(self.shouldstop) + + @hookimpl(tryfirst=True) + def pytest_runtest_logreport(self, report: TestReport | CollectReport) -> None: + if report.failed and not hasattr(report, "wasxfail"): + self.testsfailed += 1 + maxfail = self.config.getvalue("maxfail") + if maxfail and self.testsfailed >= maxfail: + self.shouldfail = "stopping after %d failures" % (self.testsfailed) + + pytest_collectreport = pytest_runtest_logreport + + def isinitpath( + self, + path: str | os.PathLike[str], + *, + with_parents: bool = False, + ) -> bool: + """Is path an initial path? + + An initial path is a path explicitly given to pytest on the command + line. + + :param with_parents: + If set, also return True if the path is a parent of an initial path. + + .. versionchanged:: 8.0 + Added the ``with_parents`` parameter. + """ + # Optimization: Path(Path(...)) is much slower than isinstance. + path_ = path if isinstance(path, Path) else Path(path) + if with_parents: + return path_ in self._initialpaths_with_parents + else: + return path_ in self._initialpaths + + def gethookproxy(self, fspath: os.PathLike[str]) -> pluggy.HookRelay: + # Optimization: Path(Path(...)) is much slower than isinstance. + path = fspath if isinstance(fspath, Path) else Path(fspath) + pm = self.config.pluginmanager + # Check if we have the common case of running + # hooks with all conftest.py files. + my_conftestmodules = pm._getconftestmodules(path) + remove_mods = pm._conftest_plugins.difference(my_conftestmodules) + proxy: pluggy.HookRelay + if remove_mods: + # One or more conftests are not in use at this path. + proxy = PathAwareHookProxy(FSHookProxy(pm, remove_mods)) # type: ignore[arg-type,assignment] + else: + # All plugins are active for this fspath. + proxy = self.config.hook + return proxy + + def _collect_path( + self, + path: Path, + path_cache: dict[Path, Sequence[nodes.Collector]], + ) -> Sequence[nodes.Collector]: + """Create a Collector for the given path. + + `path_cache` makes it so the same Collectors are returned for the same + path. + """ + if path in path_cache: + return path_cache[path] + + if path.is_dir(): + ihook = self.gethookproxy(path.parent) + col: nodes.Collector | None = ihook.pytest_collect_directory( + path=path, parent=self + ) + cols: Sequence[nodes.Collector] = (col,) if col is not None else () + + elif path.is_file(): + ihook = self.gethookproxy(path) + cols = ihook.pytest_collect_file(file_path=path, parent=self) + + else: + # Broken symlink or invalid/missing file. + cols = () + + path_cache[path] = cols + return cols + + @overload + def perform_collect( + self, args: Sequence[str] | None = ..., genitems: Literal[True] = ... + ) -> Sequence[nodes.Item]: ... + + @overload + def perform_collect( + self, args: Sequence[str] | None = ..., genitems: bool = ... + ) -> Sequence[nodes.Item | nodes.Collector]: ... + + def perform_collect( + self, args: Sequence[str] | None = None, genitems: bool = True + ) -> Sequence[nodes.Item | nodes.Collector]: + """Perform the collection phase for this session. + + This is called by the default :hook:`pytest_collection` hook + implementation; see the documentation of this hook for more details. + For testing purposes, it may also be called directly on a fresh + ``Session``. + + This function normally recursively expands any collectors collected + from the session to their items, and only items are returned. For + testing purposes, this may be suppressed by passing ``genitems=False``, + in which case the return value contains these collectors unexpanded, + and ``session.items`` is empty. + """ + if args is None: + args = self.config.args + + self.trace("perform_collect", self, args) + self.trace.root.indent += 1 + + hook = self.config.hook + + self._notfound = [] + self._initial_parts = [] + self._collection_cache = {} + self.items = [] + items: Sequence[nodes.Item | nodes.Collector] = self.items + try: + initialpaths: list[Path] = [] + initialpaths_with_parents: list[Path] = [] + for arg in args: + collection_argument = resolve_collection_argument( + self.config.invocation_params.dir, + arg, + as_pypath=self.config.option.pyargs, + ) + self._initial_parts.append(collection_argument) + initialpaths.append(collection_argument.path) + initialpaths_with_parents.append(collection_argument.path) + initialpaths_with_parents.extend(collection_argument.path.parents) + self._initialpaths = frozenset(initialpaths) + self._initialpaths_with_parents = frozenset(initialpaths_with_parents) + + rep = collect_one_node(self) + self.ihook.pytest_collectreport(report=rep) + self.trace.root.indent -= 1 + if self._notfound: + errors = [] + for arg, collectors in self._notfound: + if collectors: + errors.append( + f"not found: {arg}\n(no match in any of {collectors!r})" + ) + else: + errors.append(f"found no collectors for {arg}") + + raise UsageError(*errors) + + if not genitems: + items = rep.result + else: + if rep.passed: + for node in rep.result: + self.items.extend(self.genitems(node)) + + self.config.pluginmanager.check_pending() + hook.pytest_collection_modifyitems( + session=self, config=self.config, items=items + ) + finally: + self._notfound = [] + self._initial_parts = [] + self._collection_cache = {} + hook.pytest_collection_finish(session=self) + + if genitems: + self.testscollected = len(items) + + return items + + def _collect_one_node( + self, + node: nodes.Collector, + handle_dupes: bool = True, + ) -> tuple[CollectReport, bool]: + if node in self._collection_cache and handle_dupes: + rep = self._collection_cache[node] + return rep, True + else: + rep = collect_one_node(node) + self._collection_cache[node] = rep + return rep, False + + def collect(self) -> Iterator[nodes.Item | nodes.Collector]: + # This is a cache for the root directories of the initial paths. + # We can't use collection_cache for Session because of its special + # role as the bootstrapping collector. + path_cache: dict[Path, Sequence[nodes.Collector]] = {} + + pm = self.config.pluginmanager + + for collection_argument in self._initial_parts: + self.trace("processing argument", collection_argument) + self.trace.root.indent += 1 + + argpath = collection_argument.path + names = collection_argument.parts + module_name = collection_argument.module_name + + # resolve_collection_argument() ensures this. + if argpath.is_dir(): + assert not names, f"invalid arg {(argpath, names)!r}" + + paths = [argpath] + # Add relevant parents of the path, from the root, e.g. + # /a/b/c.py -> [/, /a, /a/b, /a/b/c.py] + if module_name is None: + # Paths outside of the confcutdir should not be considered. + for path in argpath.parents: + if not pm._is_in_confcutdir(path): + break + paths.insert(0, path) + else: + # For --pyargs arguments, only consider paths matching the module + # name. Paths beyond the package hierarchy are not included. + module_name_parts = module_name.split(".") + for i, path in enumerate(argpath.parents, 2): + if i > len(module_name_parts) or path.stem != module_name_parts[-i]: + break + paths.insert(0, path) + + # Start going over the parts from the root, collecting each level + # and discarding all nodes which don't match the level's part. + any_matched_in_initial_part = False + notfound_collectors = [] + work: list[tuple[nodes.Collector | nodes.Item, list[Path | str]]] = [ + (self, [*paths, *names]) + ] + while work: + matchnode, matchparts = work.pop() + + # Pop'd all of the parts, this is a match. + if not matchparts: + yield matchnode + any_matched_in_initial_part = True + continue + + # Should have been matched by now, discard. + if not isinstance(matchnode, nodes.Collector): + continue + + # Collect this level of matching. + # Collecting Session (self) is done directly to avoid endless + # recursion to this function. + subnodes: Sequence[nodes.Collector | nodes.Item] + if isinstance(matchnode, Session): + assert isinstance(matchparts[0], Path) + subnodes = matchnode._collect_path(matchparts[0], path_cache) + else: + # For backward compat, files given directly multiple + # times on the command line should not be deduplicated. + handle_dupes = not ( + len(matchparts) == 1 + and isinstance(matchparts[0], Path) + and matchparts[0].is_file() + ) + rep, duplicate = self._collect_one_node(matchnode, handle_dupes) + if not duplicate and not rep.passed: + # Report collection failures here to avoid failing to + # run some test specified in the command line because + # the module could not be imported (#134). + matchnode.ihook.pytest_collectreport(report=rep) + if not rep.passed: + continue + subnodes = rep.result + + # Prune this level. + any_matched_in_collector = False + for node in reversed(subnodes): + # Path part e.g. `/a/b/` in `/a/b/test_file.py::TestIt::test_it`. + if isinstance(matchparts[0], Path): + is_match = node.path == matchparts[0] + if sys.platform == "win32" and not is_match: + # In case the file paths do not match, fallback to samefile() to + # account for short-paths on Windows (#11895). + same_file = os.path.samefile(node.path, matchparts[0]) + # We don't want to match links to the current node, + # otherwise we would match the same file more than once (#12039). + is_match = same_file and ( + os.path.islink(node.path) + == os.path.islink(matchparts[0]) + ) + + # Name part e.g. `TestIt` in `/a/b/test_file.py::TestIt::test_it`. + else: + # TODO: Remove parametrized workaround once collection structure contains + # parametrization. + is_match = ( + node.name == matchparts[0] + or node.name.split("[")[0] == matchparts[0] + ) + if is_match: + work.append((node, matchparts[1:])) + any_matched_in_collector = True + + if not any_matched_in_collector: + notfound_collectors.append(matchnode) + + if not any_matched_in_initial_part: + report_arg = "::".join((str(argpath), *names)) + self._notfound.append((report_arg, notfound_collectors)) + + self.trace.root.indent -= 1 + + def genitems(self, node: nodes.Item | nodes.Collector) -> Iterator[nodes.Item]: + self.trace("genitems", node) + if isinstance(node, nodes.Item): + node.ihook.pytest_itemcollected(item=node) + yield node + else: + assert isinstance(node, nodes.Collector) + keepduplicates = self.config.getoption("keepduplicates") + # For backward compat, dedup only applies to files. + handle_dupes = not (keepduplicates and isinstance(node, nodes.File)) + rep, duplicate = self._collect_one_node(node, handle_dupes) + if duplicate and not keepduplicates: + return + if rep.passed: + for subnode in rep.result: + yield from self.genitems(subnode) + if not duplicate: + node.ihook.pytest_collectreport(report=rep) + + +def search_pypath(module_name: str) -> str | None: + """Search sys.path for the given a dotted module name, and return its file + system path if found.""" + try: + spec = importlib.util.find_spec(module_name) + # AttributeError: looks like package module, but actually filename + # ImportError: module does not exist + # ValueError: not a module name + except (AttributeError, ImportError, ValueError): + return None + if spec is None or spec.origin is None or spec.origin == "namespace": + return None + elif spec.submodule_search_locations: + return os.path.dirname(spec.origin) + else: + return spec.origin + + +@dataclasses.dataclass(frozen=True) +class CollectionArgument: + """A resolved collection argument.""" + + path: Path + parts: Sequence[str] + module_name: str | None + + +def resolve_collection_argument( + invocation_path: Path, arg: str, *, as_pypath: bool = False +) -> CollectionArgument: + """Parse path arguments optionally containing selection parts and return (fspath, names). + + Command-line arguments can point to files and/or directories, and optionally contain + parts for specific tests selection, for example: + + "pkg/tests/test_foo.py::TestClass::test_foo" + + This function ensures the path exists, and returns a resolved `CollectionArgument`: + + CollectionArgument( + path=Path("/full/path/to/pkg/tests/test_foo.py"), + parts=["TestClass", "test_foo"], + module_name=None, + ) + + When as_pypath is True, expects that the command-line argument actually contains + module paths instead of file-system paths: + + "pkg.tests.test_foo::TestClass::test_foo" + + In which case we search sys.path for a matching module, and then return the *path* to the + found module, which may look like this: + + CollectionArgument( + path=Path("/home/u/myvenv/lib/site-packages/pkg/tests/test_foo.py"), + parts=["TestClass", "test_foo"], + module_name="pkg.tests.test_foo", + ) + + If the path doesn't exist, raise UsageError. + If the path is a directory and selection parts are present, raise UsageError. + """ + base, squacket, rest = str(arg).partition("[") + strpath, *parts = base.split("::") + if parts: + parts[-1] = f"{parts[-1]}{squacket}{rest}" + module_name = None + if as_pypath: + pyarg_strpath = search_pypath(strpath) + if pyarg_strpath is not None: + module_name = strpath + strpath = pyarg_strpath + fspath = invocation_path / strpath + fspath = absolutepath(fspath) + if not safe_exists(fspath): + msg = ( + "module or package not found: {arg} (missing __init__.py?)" + if as_pypath + else "file or directory not found: {arg}" + ) + raise UsageError(msg.format(arg=arg)) + if parts and fspath.is_dir(): + msg = ( + "package argument cannot contain :: selection parts: {arg}" + if as_pypath + else "directory argument cannot contain :: selection parts: {arg}" + ) + raise UsageError(msg.format(arg=arg)) + return CollectionArgument( + path=fspath, + parts=parts, + module_name=module_name, + ) diff --git a/.venv/Lib/site-packages/_pytest/mark/__init__.py b/.venv/Lib/site-packages/_pytest/mark/__init__.py new file mode 100644 index 00000000..a4f942c5 --- /dev/null +++ b/.venv/Lib/site-packages/_pytest/mark/__init__.py @@ -0,0 +1,292 @@ +"""Generic mechanism for marking and selecting python functions.""" + +from __future__ import annotations + +import collections +import dataclasses +from typing import AbstractSet +from typing import Collection +from typing import Iterable +from typing import Optional +from typing import TYPE_CHECKING + +from .expression import Expression +from .expression import ParseError +from .structures import EMPTY_PARAMETERSET_OPTION +from .structures import get_empty_parameterset_mark +from .structures import Mark +from .structures import MARK_GEN +from .structures import MarkDecorator +from .structures import MarkGenerator +from .structures import ParameterSet +from _pytest.config import Config +from _pytest.config import ExitCode +from _pytest.config import hookimpl +from _pytest.config import UsageError +from _pytest.config.argparsing import NOT_SET +from _pytest.config.argparsing import Parser +from _pytest.stash import StashKey + + +if TYPE_CHECKING: + from _pytest.nodes import Item + + +__all__ = [ + "MARK_GEN", + "Mark", + "MarkDecorator", + "MarkGenerator", + "ParameterSet", + "get_empty_parameterset_mark", +] + + +old_mark_config_key = StashKey[Optional[Config]]() + + +def param( + *values: object, + marks: MarkDecorator | Collection[MarkDecorator | Mark] = (), + id: str | None = None, +) -> ParameterSet: + """Specify a parameter in `pytest.mark.parametrize`_ calls or + :ref:`parametrized fixtures `. + + .. code-block:: python + + @pytest.mark.parametrize( + "test_input,expected", + [ + ("3+5", 8), + pytest.param("6*9", 42, marks=pytest.mark.xfail), + ], + ) + def test_eval(test_input, expected): + assert eval(test_input) == expected + + :param values: Variable args of the values of the parameter set, in order. + :param marks: A single mark or a list of marks to be applied to this parameter set. + :param id: The id to attribute to this parameter set. + """ + return ParameterSet.param(*values, marks=marks, id=id) + + +def pytest_addoption(parser: Parser) -> None: + group = parser.getgroup("general") + group._addoption( + "-k", + action="store", + dest="keyword", + default="", + metavar="EXPRESSION", + help="Only run tests which match the given substring expression. " + "An expression is a Python evaluable expression " + "where all names are substring-matched against test names " + "and their parent classes. Example: -k 'test_method or test_" + "other' matches all test functions and classes whose name " + "contains 'test_method' or 'test_other', while -k 'not test_method' " + "matches those that don't contain 'test_method' in their names. " + "-k 'not test_method and not test_other' will eliminate the matches. " + "Additionally keywords are matched to classes and functions " + "containing extra names in their 'extra_keyword_matches' set, " + "as well as functions which have names assigned directly to them. " + "The matching is case-insensitive.", + ) + + group._addoption( + "-m", + action="store", + dest="markexpr", + default="", + metavar="MARKEXPR", + help="Only run tests matching given mark expression. " + "For example: -m 'mark1 and not mark2'.", + ) + + group.addoption( + "--markers", + action="store_true", + help="show markers (builtin, plugin and per-project ones).", + ) + + parser.addini("markers", "Register new markers for test functions", "linelist") + parser.addini(EMPTY_PARAMETERSET_OPTION, "Default marker for empty parametersets") + + +@hookimpl(tryfirst=True) +def pytest_cmdline_main(config: Config) -> int | ExitCode | None: + import _pytest.config + + if config.option.markers: + config._do_configure() + tw = _pytest.config.create_terminal_writer(config) + for line in config.getini("markers"): + parts = line.split(":", 1) + name = parts[0] + rest = parts[1] if len(parts) == 2 else "" + tw.write(f"@pytest.mark.{name}:", bold=True) + tw.line(rest) + tw.line() + config._ensure_unconfigure() + return 0 + + return None + + +@dataclasses.dataclass +class KeywordMatcher: + """A matcher for keywords. + + Given a list of names, matches any substring of one of these names. The + string inclusion check is case-insensitive. + + Will match on the name of colitem, including the names of its parents. + Only matches names of items which are either a :class:`Class` or a + :class:`Function`. + + Additionally, matches on names in the 'extra_keyword_matches' set of + any item, as well as names directly assigned to test functions. + """ + + __slots__ = ("_names",) + + _names: AbstractSet[str] + + @classmethod + def from_item(cls, item: Item) -> KeywordMatcher: + mapped_names = set() + + # Add the names of the current item and any parent items, + # except the Session and root Directory's which are not + # interesting for matching. + import pytest + + for node in item.listchain(): + if isinstance(node, pytest.Session): + continue + if isinstance(node, pytest.Directory) and isinstance( + node.parent, pytest.Session + ): + continue + mapped_names.add(node.name) + + # Add the names added as extra keywords to current or parent items. + mapped_names.update(item.listextrakeywords()) + + # Add the names attached to the current function through direct assignment. + function_obj = getattr(item, "function", None) + if function_obj: + mapped_names.update(function_obj.__dict__) + + # Add the markers to the keywords as we no longer handle them correctly. + mapped_names.update(mark.name for mark in item.iter_markers()) + + return cls(mapped_names) + + def __call__(self, subname: str, /, **kwargs: str | int | bool | None) -> bool: + if kwargs: + raise UsageError("Keyword expressions do not support call parameters.") + subname = subname.lower() + names = (name.lower() for name in self._names) + + for name in names: + if subname in name: + return True + return False + + +def deselect_by_keyword(items: list[Item], config: Config) -> None: + keywordexpr = config.option.keyword.lstrip() + if not keywordexpr: + return + + expr = _parse_expression(keywordexpr, "Wrong expression passed to '-k'") + + remaining = [] + deselected = [] + for colitem in items: + if not expr.evaluate(KeywordMatcher.from_item(colitem)): + deselected.append(colitem) + else: + remaining.append(colitem) + + if deselected: + config.hook.pytest_deselected(items=deselected) + items[:] = remaining + + +@dataclasses.dataclass +class MarkMatcher: + """A matcher for markers which are present. + + Tries to match on any marker names, attached to the given colitem. + """ + + __slots__ = ("own_mark_name_mapping",) + + own_mark_name_mapping: dict[str, list[Mark]] + + @classmethod + def from_markers(cls, markers: Iterable[Mark]) -> MarkMatcher: + mark_name_mapping = collections.defaultdict(list) + for mark in markers: + mark_name_mapping[mark.name].append(mark) + return cls(mark_name_mapping) + + def __call__(self, name: str, /, **kwargs: str | int | bool | None) -> bool: + if not (matches := self.own_mark_name_mapping.get(name, [])): + return False + + for mark in matches: + if all(mark.kwargs.get(k, NOT_SET) == v for k, v in kwargs.items()): + return True + + return False + + +def deselect_by_mark(items: list[Item], config: Config) -> None: + matchexpr = config.option.markexpr + if not matchexpr: + return + + expr = _parse_expression(matchexpr, "Wrong expression passed to '-m'") + remaining: list[Item] = [] + deselected: list[Item] = [] + for item in items: + if expr.evaluate(MarkMatcher.from_markers(item.iter_markers())): + remaining.append(item) + else: + deselected.append(item) + if deselected: + config.hook.pytest_deselected(items=deselected) + items[:] = remaining + + +def _parse_expression(expr: str, exc_message: str) -> Expression: + try: + return Expression.compile(expr) + except ParseError as e: + raise UsageError(f"{exc_message}: {expr}: {e}") from None + + +def pytest_collection_modifyitems(items: list[Item], config: Config) -> None: + deselect_by_keyword(items, config) + deselect_by_mark(items, config) + + +def pytest_configure(config: Config) -> None: + config.stash[old_mark_config_key] = MARK_GEN._config + MARK_GEN._config = config + + empty_parameterset = config.getini(EMPTY_PARAMETERSET_OPTION) + + if empty_parameterset not in ("skip", "xfail", "fail_at_collect", None, ""): + raise UsageError( + f"{EMPTY_PARAMETERSET_OPTION!s} must be one of skip, xfail or fail_at_collect" + f" but it is {empty_parameterset!r}" + ) + + +def pytest_unconfigure(config: Config) -> None: + MARK_GEN._config = config.stash.get(old_mark_config_key, None) diff --git a/.venv/Lib/site-packages/_pytest/mark/expression.py b/.venv/Lib/site-packages/_pytest/mark/expression.py new file mode 100644 index 00000000..89cc0e94 --- /dev/null +++ b/.venv/Lib/site-packages/_pytest/mark/expression.py @@ -0,0 +1,333 @@ +r"""Evaluate match expressions, as used by `-k` and `-m`. + +The grammar is: + +expression: expr? EOF +expr: and_expr ('or' and_expr)* +and_expr: not_expr ('and' not_expr)* +not_expr: 'not' not_expr | '(' expr ')' | ident kwargs? + +ident: (\w|:|\+|-|\.|\[|\]|\\|/)+ +kwargs: ('(' name '=' value ( ', ' name '=' value )* ')') +name: a valid ident, but not a reserved keyword +value: (unescaped) string literal | (-)?[0-9]+ | 'False' | 'True' | 'None' + +The semantics are: + +- Empty expression evaluates to False. +- ident evaluates to True or False according to a provided matcher function. +- or/and/not evaluate according to the usual boolean semantics. +- ident with parentheses and keyword arguments evaluates to True or False according to a provided matcher function. +""" + +from __future__ import annotations + +import ast +import dataclasses +import enum +import keyword +import re +import types +from typing import Iterator +from typing import Literal +from typing import Mapping +from typing import NoReturn +from typing import overload +from typing import Protocol +from typing import Sequence + + +__all__ = [ + "Expression", + "ParseError", +] + + +class TokenType(enum.Enum): + LPAREN = "left parenthesis" + RPAREN = "right parenthesis" + OR = "or" + AND = "and" + NOT = "not" + IDENT = "identifier" + EOF = "end of input" + EQUAL = "=" + STRING = "string literal" + COMMA = "," + + +@dataclasses.dataclass(frozen=True) +class Token: + __slots__ = ("type", "value", "pos") + type: TokenType + value: str + pos: int + + +class ParseError(Exception): + """The expression contains invalid syntax. + + :param column: The column in the line where the error occurred (1-based). + :param message: A description of the error. + """ + + def __init__(self, column: int, message: str) -> None: + self.column = column + self.message = message + + def __str__(self) -> str: + return f"at column {self.column}: {self.message}" + + +class Scanner: + __slots__ = ("tokens", "current") + + def __init__(self, input: str) -> None: + self.tokens = self.lex(input) + self.current = next(self.tokens) + + def lex(self, input: str) -> Iterator[Token]: + pos = 0 + while pos < len(input): + if input[pos] in (" ", "\t"): + pos += 1 + elif input[pos] == "(": + yield Token(TokenType.LPAREN, "(", pos) + pos += 1 + elif input[pos] == ")": + yield Token(TokenType.RPAREN, ")", pos) + pos += 1 + elif input[pos] == "=": + yield Token(TokenType.EQUAL, "=", pos) + pos += 1 + elif input[pos] == ",": + yield Token(TokenType.COMMA, ",", pos) + pos += 1 + elif (quote_char := input[pos]) in ("'", '"'): + end_quote_pos = input.find(quote_char, pos + 1) + if end_quote_pos == -1: + raise ParseError( + pos + 1, + f'closing quote "{quote_char}" is missing', + ) + value = input[pos : end_quote_pos + 1] + if (backslash_pos := input.find("\\")) != -1: + raise ParseError( + backslash_pos + 1, + r'escaping with "\" not supported in marker expression', + ) + yield Token(TokenType.STRING, value, pos) + pos += len(value) + else: + match = re.match(r"(:?\w|:|\+|-|\.|\[|\]|\\|/)+", input[pos:]) + if match: + value = match.group(0) + if value == "or": + yield Token(TokenType.OR, value, pos) + elif value == "and": + yield Token(TokenType.AND, value, pos) + elif value == "not": + yield Token(TokenType.NOT, value, pos) + else: + yield Token(TokenType.IDENT, value, pos) + pos += len(value) + else: + raise ParseError( + pos + 1, + f'unexpected character "{input[pos]}"', + ) + yield Token(TokenType.EOF, "", pos) + + @overload + def accept(self, type: TokenType, *, reject: Literal[True]) -> Token: ... + + @overload + def accept( + self, type: TokenType, *, reject: Literal[False] = False + ) -> Token | None: ... + + def accept(self, type: TokenType, *, reject: bool = False) -> Token | None: + if self.current.type is type: + token = self.current + if token.type is not TokenType.EOF: + self.current = next(self.tokens) + return token + if reject: + self.reject((type,)) + return None + + def reject(self, expected: Sequence[TokenType]) -> NoReturn: + raise ParseError( + self.current.pos + 1, + "expected {}; got {}".format( + " OR ".join(type.value for type in expected), + self.current.type.value, + ), + ) + + +# True, False and None are legal match expression identifiers, +# but illegal as Python identifiers. To fix this, this prefix +# is added to identifiers in the conversion to Python AST. +IDENT_PREFIX = "$" + + +def expression(s: Scanner) -> ast.Expression: + if s.accept(TokenType.EOF): + ret: ast.expr = ast.Constant(False) + else: + ret = expr(s) + s.accept(TokenType.EOF, reject=True) + return ast.fix_missing_locations(ast.Expression(ret)) + + +def expr(s: Scanner) -> ast.expr: + ret = and_expr(s) + while s.accept(TokenType.OR): + rhs = and_expr(s) + ret = ast.BoolOp(ast.Or(), [ret, rhs]) + return ret + + +def and_expr(s: Scanner) -> ast.expr: + ret = not_expr(s) + while s.accept(TokenType.AND): + rhs = not_expr(s) + ret = ast.BoolOp(ast.And(), [ret, rhs]) + return ret + + +def not_expr(s: Scanner) -> ast.expr: + if s.accept(TokenType.NOT): + return ast.UnaryOp(ast.Not(), not_expr(s)) + if s.accept(TokenType.LPAREN): + ret = expr(s) + s.accept(TokenType.RPAREN, reject=True) + return ret + ident = s.accept(TokenType.IDENT) + if ident: + name = ast.Name(IDENT_PREFIX + ident.value, ast.Load()) + if s.accept(TokenType.LPAREN): + ret = ast.Call(func=name, args=[], keywords=all_kwargs(s)) + s.accept(TokenType.RPAREN, reject=True) + else: + ret = name + return ret + + s.reject((TokenType.NOT, TokenType.LPAREN, TokenType.IDENT)) + + +BUILTIN_MATCHERS = {"True": True, "False": False, "None": None} + + +def single_kwarg(s: Scanner) -> ast.keyword: + keyword_name = s.accept(TokenType.IDENT, reject=True) + if not keyword_name.value.isidentifier(): + raise ParseError( + keyword_name.pos + 1, + f"not a valid python identifier {keyword_name.value}", + ) + if keyword.iskeyword(keyword_name.value): + raise ParseError( + keyword_name.pos + 1, + f"unexpected reserved python keyword `{keyword_name.value}`", + ) + s.accept(TokenType.EQUAL, reject=True) + + if value_token := s.accept(TokenType.STRING): + value: str | int | bool | None = value_token.value[1:-1] # strip quotes + else: + value_token = s.accept(TokenType.IDENT, reject=True) + if ( + (number := value_token.value).isdigit() + or number.startswith("-") + and number[1:].isdigit() + ): + value = int(number) + elif value_token.value in BUILTIN_MATCHERS: + value = BUILTIN_MATCHERS[value_token.value] + else: + raise ParseError( + value_token.pos + 1, + f'unexpected character/s "{value_token.value}"', + ) + + ret = ast.keyword(keyword_name.value, ast.Constant(value)) + return ret + + +def all_kwargs(s: Scanner) -> list[ast.keyword]: + ret = [single_kwarg(s)] + while s.accept(TokenType.COMMA): + ret.append(single_kwarg(s)) + return ret + + +class MatcherCall(Protocol): + def __call__(self, name: str, /, **kwargs: str | int | bool | None) -> bool: ... + + +@dataclasses.dataclass +class MatcherNameAdapter: + matcher: MatcherCall + name: str + + def __bool__(self) -> bool: + return self.matcher(self.name) + + def __call__(self, **kwargs: str | int | bool | None) -> bool: + return self.matcher(self.name, **kwargs) + + +class MatcherAdapter(Mapping[str, MatcherNameAdapter]): + """Adapts a matcher function to a locals mapping as required by eval().""" + + def __init__(self, matcher: MatcherCall) -> None: + self.matcher = matcher + + def __getitem__(self, key: str) -> MatcherNameAdapter: + return MatcherNameAdapter(matcher=self.matcher, name=key[len(IDENT_PREFIX) :]) + + def __iter__(self) -> Iterator[str]: + raise NotImplementedError() + + def __len__(self) -> int: + raise NotImplementedError() + + +class Expression: + """A compiled match expression as used by -k and -m. + + The expression can be evaluated against different matchers. + """ + + __slots__ = ("code",) + + def __init__(self, code: types.CodeType) -> None: + self.code = code + + @classmethod + def compile(self, input: str) -> Expression: + """Compile a match expression. + + :param input: The input expression - one line. + """ + astexpr = expression(Scanner(input)) + code: types.CodeType = compile( + astexpr, + filename="", + mode="eval", + ) + return Expression(code) + + def evaluate(self, matcher: MatcherCall) -> bool: + """Evaluate the match expression. + + :param matcher: + Given an identifier, should return whether it matches or not. + Should be prepared to handle arbitrary strings as input. + + :returns: Whether the expression matches or not. + """ + ret: bool = bool(eval(self.code, {"__builtins__": {}}, MatcherAdapter(matcher))) + return ret diff --git a/.venv/Lib/site-packages/_pytest/mark/structures.py b/.venv/Lib/site-packages/_pytest/mark/structures.py new file mode 100644 index 00000000..92ade55f --- /dev/null +++ b/.venv/Lib/site-packages/_pytest/mark/structures.py @@ -0,0 +1,615 @@ +# mypy: allow-untyped-defs +from __future__ import annotations + +import collections.abc +import dataclasses +import inspect +from typing import Any +from typing import Callable +from typing import Collection +from typing import final +from typing import Iterable +from typing import Iterator +from typing import Mapping +from typing import MutableMapping +from typing import NamedTuple +from typing import overload +from typing import Sequence +from typing import TYPE_CHECKING +from typing import TypeVar +from typing import Union +import warnings + +from .._code import getfslineno +from ..compat import ascii_escaped +from ..compat import NOTSET +from ..compat import NotSetType +from _pytest.config import Config +from _pytest.deprecated import check_ispytest +from _pytest.deprecated import MARKED_FIXTURE +from _pytest.outcomes import fail +from _pytest.scope import _ScopeName +from _pytest.warning_types import PytestUnknownMarkWarning + + +if TYPE_CHECKING: + from ..nodes import Node + + +EMPTY_PARAMETERSET_OPTION = "empty_parameter_set_mark" + + +def istestfunc(func) -> bool: + return callable(func) and getattr(func, "__name__", "") != "" + + +def get_empty_parameterset_mark( + config: Config, argnames: Sequence[str], func +) -> MarkDecorator: + from ..nodes import Collector + + fs, lineno = getfslineno(func) + reason = "got empty parameter set %r, function %s at %s:%d" % ( + argnames, + func.__name__, + fs, + lineno, + ) + + requested_mark = config.getini(EMPTY_PARAMETERSET_OPTION) + if requested_mark in ("", None, "skip"): + mark = MARK_GEN.skip(reason=reason) + elif requested_mark == "xfail": + mark = MARK_GEN.xfail(reason=reason, run=False) + elif requested_mark == "fail_at_collect": + f_name = func.__name__ + _, lineno = getfslineno(func) + raise Collector.CollectError( + "Empty parameter set in '%s' at line %d" % (f_name, lineno + 1) + ) + else: + raise LookupError(requested_mark) + return mark + + +class ParameterSet(NamedTuple): + values: Sequence[object | NotSetType] + marks: Collection[MarkDecorator | Mark] + id: str | None + + @classmethod + def param( + cls, + *values: object, + marks: MarkDecorator | Collection[MarkDecorator | Mark] = (), + id: str | None = None, + ) -> ParameterSet: + if isinstance(marks, MarkDecorator): + marks = (marks,) + else: + assert isinstance(marks, collections.abc.Collection) + + if id is not None: + if not isinstance(id, str): + raise TypeError(f"Expected id to be a string, got {type(id)}: {id!r}") + id = ascii_escaped(id) + return cls(values, marks, id) + + @classmethod + def extract_from( + cls, + parameterset: ParameterSet | Sequence[object] | object, + force_tuple: bool = False, + ) -> ParameterSet: + """Extract from an object or objects. + + :param parameterset: + A legacy style parameterset that may or may not be a tuple, + and may or may not be wrapped into a mess of mark objects. + + :param force_tuple: + Enforce tuple wrapping so single argument tuple values + don't get decomposed and break tests. + """ + if isinstance(parameterset, cls): + return parameterset + if force_tuple: + return cls.param(parameterset) + else: + # TODO: Refactor to fix this type-ignore. Currently the following + # passes type-checking but crashes: + # + # @pytest.mark.parametrize(('x', 'y'), [1, 2]) + # def test_foo(x, y): pass + return cls(parameterset, marks=[], id=None) # type: ignore[arg-type] + + @staticmethod + def _parse_parametrize_args( + argnames: str | Sequence[str], + argvalues: Iterable[ParameterSet | Sequence[object] | object], + *args, + **kwargs, + ) -> tuple[Sequence[str], bool]: + if isinstance(argnames, str): + argnames = [x.strip() for x in argnames.split(",") if x.strip()] + force_tuple = len(argnames) == 1 + else: + force_tuple = False + return argnames, force_tuple + + @staticmethod + def _parse_parametrize_parameters( + argvalues: Iterable[ParameterSet | Sequence[object] | object], + force_tuple: bool, + ) -> list[ParameterSet]: + return [ + ParameterSet.extract_from(x, force_tuple=force_tuple) for x in argvalues + ] + + @classmethod + def _for_parametrize( + cls, + argnames: str | Sequence[str], + argvalues: Iterable[ParameterSet | Sequence[object] | object], + func, + config: Config, + nodeid: str, + ) -> tuple[Sequence[str], list[ParameterSet]]: + argnames, force_tuple = cls._parse_parametrize_args(argnames, argvalues) + parameters = cls._parse_parametrize_parameters(argvalues, force_tuple) + del argvalues + + if parameters: + # Check all parameter sets have the correct number of values. + for param in parameters: + if len(param.values) != len(argnames): + msg = ( + '{nodeid}: in "parametrize" the number of names ({names_len}):\n' + " {names}\n" + "must be equal to the number of values ({values_len}):\n" + " {values}" + ) + fail( + msg.format( + nodeid=nodeid, + values=param.values, + names=argnames, + names_len=len(argnames), + values_len=len(param.values), + ), + pytrace=False, + ) + else: + # Empty parameter set (likely computed at runtime): create a single + # parameter set with NOTSET values, with the "empty parameter set" mark applied to it. + mark = get_empty_parameterset_mark(config, argnames, func) + parameters.append( + ParameterSet(values=(NOTSET,) * len(argnames), marks=[mark], id=None) + ) + return argnames, parameters + + +@final +@dataclasses.dataclass(frozen=True) +class Mark: + """A pytest mark.""" + + #: Name of the mark. + name: str + #: Positional arguments of the mark decorator. + args: tuple[Any, ...] + #: Keyword arguments of the mark decorator. + kwargs: Mapping[str, Any] + + #: Source Mark for ids with parametrize Marks. + _param_ids_from: Mark | None = dataclasses.field(default=None, repr=False) + #: Resolved/generated ids with parametrize Marks. + _param_ids_generated: Sequence[str] | None = dataclasses.field( + default=None, repr=False + ) + + def __init__( + self, + name: str, + args: tuple[Any, ...], + kwargs: Mapping[str, Any], + param_ids_from: Mark | None = None, + param_ids_generated: Sequence[str] | None = None, + *, + _ispytest: bool = False, + ) -> None: + """:meta private:""" + check_ispytest(_ispytest) + # Weirdness to bypass frozen=True. + object.__setattr__(self, "name", name) + object.__setattr__(self, "args", args) + object.__setattr__(self, "kwargs", kwargs) + object.__setattr__(self, "_param_ids_from", param_ids_from) + object.__setattr__(self, "_param_ids_generated", param_ids_generated) + + def _has_param_ids(self) -> bool: + return "ids" in self.kwargs or len(self.args) >= 4 + + def combined_with(self, other: Mark) -> Mark: + """Return a new Mark which is a combination of this + Mark and another Mark. + + Combines by appending args and merging kwargs. + + :param Mark other: The mark to combine with. + :rtype: Mark + """ + assert self.name == other.name + + # Remember source of ids with parametrize Marks. + param_ids_from: Mark | None = None + if self.name == "parametrize": + if other._has_param_ids(): + param_ids_from = other + elif self._has_param_ids(): + param_ids_from = self + + return Mark( + self.name, + self.args + other.args, + dict(self.kwargs, **other.kwargs), + param_ids_from=param_ids_from, + _ispytest=True, + ) + + +# A generic parameter designating an object to which a Mark may +# be applied -- a test function (callable) or class. +# Note: a lambda is not allowed, but this can't be represented. +Markable = TypeVar("Markable", bound=Union[Callable[..., object], type]) + + +@dataclasses.dataclass +class MarkDecorator: + """A decorator for applying a mark on test functions and classes. + + ``MarkDecorators`` are created with ``pytest.mark``:: + + mark1 = pytest.mark.NAME # Simple MarkDecorator + mark2 = pytest.mark.NAME(name1=value) # Parametrized MarkDecorator + + and can then be applied as decorators to test functions:: + + @mark2 + def test_function(): + pass + + When a ``MarkDecorator`` is called, it does the following: + + 1. If called with a single class as its only positional argument and no + additional keyword arguments, it attaches the mark to the class so it + gets applied automatically to all test cases found in that class. + + 2. If called with a single function as its only positional argument and + no additional keyword arguments, it attaches the mark to the function, + containing all the arguments already stored internally in the + ``MarkDecorator``. + + 3. When called in any other case, it returns a new ``MarkDecorator`` + instance with the original ``MarkDecorator``'s content updated with + the arguments passed to this call. + + Note: The rules above prevent a ``MarkDecorator`` from storing only a + single function or class reference as its positional argument with no + additional keyword or positional arguments. You can work around this by + using `with_args()`. + """ + + mark: Mark + + def __init__(self, mark: Mark, *, _ispytest: bool = False) -> None: + """:meta private:""" + check_ispytest(_ispytest) + self.mark = mark + + @property + def name(self) -> str: + """Alias for mark.name.""" + return self.mark.name + + @property + def args(self) -> tuple[Any, ...]: + """Alias for mark.args.""" + return self.mark.args + + @property + def kwargs(self) -> Mapping[str, Any]: + """Alias for mark.kwargs.""" + return self.mark.kwargs + + @property + def markname(self) -> str: + """:meta private:""" + return self.name # for backward-compat (2.4.1 had this attr) + + def with_args(self, *args: object, **kwargs: object) -> MarkDecorator: + """Return a MarkDecorator with extra arguments added. + + Unlike calling the MarkDecorator, with_args() can be used even + if the sole argument is a callable/class. + """ + mark = Mark(self.name, args, kwargs, _ispytest=True) + return MarkDecorator(self.mark.combined_with(mark), _ispytest=True) + + # Type ignored because the overloads overlap with an incompatible + # return type. Not much we can do about that. Thankfully mypy picks + # the first match so it works out even if we break the rules. + @overload + def __call__(self, arg: Markable) -> Markable: # type: ignore[overload-overlap] + pass + + @overload + def __call__(self, *args: object, **kwargs: object) -> MarkDecorator: + pass + + def __call__(self, *args: object, **kwargs: object): + """Call the MarkDecorator.""" + if args and not kwargs: + func = args[0] + is_class = inspect.isclass(func) + if len(args) == 1 and (istestfunc(func) or is_class): + store_mark(func, self.mark, stacklevel=3) + return func + return self.with_args(*args, **kwargs) + + +def get_unpacked_marks( + obj: object | type, + *, + consider_mro: bool = True, +) -> list[Mark]: + """Obtain the unpacked marks that are stored on an object. + + If obj is a class and consider_mro is true, return marks applied to + this class and all of its super-classes in MRO order. If consider_mro + is false, only return marks applied directly to this class. + """ + if isinstance(obj, type): + if not consider_mro: + mark_lists = [obj.__dict__.get("pytestmark", [])] + else: + mark_lists = [ + x.__dict__.get("pytestmark", []) for x in reversed(obj.__mro__) + ] + mark_list = [] + for item in mark_lists: + if isinstance(item, list): + mark_list.extend(item) + else: + mark_list.append(item) + else: + mark_attribute = getattr(obj, "pytestmark", []) + if isinstance(mark_attribute, list): + mark_list = mark_attribute + else: + mark_list = [mark_attribute] + return list(normalize_mark_list(mark_list)) + + +def normalize_mark_list( + mark_list: Iterable[Mark | MarkDecorator], +) -> Iterable[Mark]: + """ + Normalize an iterable of Mark or MarkDecorator objects into a list of marks + by retrieving the `mark` attribute on MarkDecorator instances. + + :param mark_list: marks to normalize + :returns: A new list of the extracted Mark objects + """ + for mark in mark_list: + mark_obj = getattr(mark, "mark", mark) + if not isinstance(mark_obj, Mark): + raise TypeError(f"got {mark_obj!r} instead of Mark") + yield mark_obj + + +def store_mark(obj, mark: Mark, *, stacklevel: int = 2) -> None: + """Store a Mark on an object. + + This is used to implement the Mark declarations/decorators correctly. + """ + assert isinstance(mark, Mark), mark + + from ..fixtures import getfixturemarker + + if getfixturemarker(obj) is not None: + warnings.warn(MARKED_FIXTURE, stacklevel=stacklevel) + + # Always reassign name to avoid updating pytestmark in a reference that + # was only borrowed. + obj.pytestmark = [*get_unpacked_marks(obj, consider_mro=False), mark] + + +# Typing for builtin pytest marks. This is cheating; it gives builtin marks +# special privilege, and breaks modularity. But practicality beats purity... +if TYPE_CHECKING: + + class _SkipMarkDecorator(MarkDecorator): + @overload # type: ignore[override,no-overload-impl] + def __call__(self, arg: Markable) -> Markable: ... + + @overload + def __call__(self, reason: str = ...) -> MarkDecorator: ... + + class _SkipifMarkDecorator(MarkDecorator): + def __call__( # type: ignore[override] + self, + condition: str | bool = ..., + *conditions: str | bool, + reason: str = ..., + ) -> MarkDecorator: ... + + class _XfailMarkDecorator(MarkDecorator): + @overload # type: ignore[override,no-overload-impl] + def __call__(self, arg: Markable) -> Markable: ... + + @overload + def __call__( + self, + condition: str | bool = False, + *conditions: str | bool, + reason: str = ..., + run: bool = ..., + raises: None | type[BaseException] | tuple[type[BaseException], ...] = ..., + strict: bool = ..., + ) -> MarkDecorator: ... + + class _ParametrizeMarkDecorator(MarkDecorator): + def __call__( # type: ignore[override] + self, + argnames: str | Sequence[str], + argvalues: Iterable[ParameterSet | Sequence[object] | object], + *, + indirect: bool | Sequence[str] = ..., + ids: Iterable[None | str | float | int | bool] + | Callable[[Any], object | None] + | None = ..., + scope: _ScopeName | None = ..., + ) -> MarkDecorator: ... + + class _UsefixturesMarkDecorator(MarkDecorator): + def __call__(self, *fixtures: str) -> MarkDecorator: # type: ignore[override] + ... + + class _FilterwarningsMarkDecorator(MarkDecorator): + def __call__(self, *filters: str) -> MarkDecorator: # type: ignore[override] + ... + + +@final +class MarkGenerator: + """Factory for :class:`MarkDecorator` objects - exposed as + a ``pytest.mark`` singleton instance. + + Example:: + + import pytest + + + @pytest.mark.slowtest + def test_function(): + pass + + applies a 'slowtest' :class:`Mark` on ``test_function``. + """ + + # See TYPE_CHECKING above. + if TYPE_CHECKING: + skip: _SkipMarkDecorator + skipif: _SkipifMarkDecorator + xfail: _XfailMarkDecorator + parametrize: _ParametrizeMarkDecorator + usefixtures: _UsefixturesMarkDecorator + filterwarnings: _FilterwarningsMarkDecorator + + def __init__(self, *, _ispytest: bool = False) -> None: + check_ispytest(_ispytest) + self._config: Config | None = None + self._markers: set[str] = set() + + def __getattr__(self, name: str) -> MarkDecorator: + """Generate a new :class:`MarkDecorator` with the given name.""" + if name[0] == "_": + raise AttributeError("Marker name must NOT start with underscore") + + if self._config is not None: + # We store a set of markers as a performance optimisation - if a mark + # name is in the set we definitely know it, but a mark may be known and + # not in the set. We therefore start by updating the set! + if name not in self._markers: + for line in self._config.getini("markers"): + # example lines: "skipif(condition): skip the given test if..." + # or "hypothesis: tests which use Hypothesis", so to get the + # marker name we split on both `:` and `(`. + marker = line.split(":")[0].split("(")[0].strip() + self._markers.add(marker) + + # If the name is not in the set of known marks after updating, + # then it really is time to issue a warning or an error. + if name not in self._markers: + if self._config.option.strict_markers or self._config.option.strict: + fail( + f"{name!r} not found in `markers` configuration option", + pytrace=False, + ) + + # Raise a specific error for common misspellings of "parametrize". + if name in ["parameterize", "parametrise", "parameterise"]: + __tracebackhide__ = True + fail(f"Unknown '{name}' mark, did you mean 'parametrize'?") + + warnings.warn( + f"Unknown pytest.mark.{name} - is this a typo? You can register " + "custom marks to avoid this warning - for details, see " + "https://docs.pytest.org/en/stable/how-to/mark.html", + PytestUnknownMarkWarning, + 2, + ) + + return MarkDecorator(Mark(name, (), {}, _ispytest=True), _ispytest=True) + + +MARK_GEN = MarkGenerator(_ispytest=True) + + +@final +class NodeKeywords(MutableMapping[str, Any]): + __slots__ = ("node", "parent", "_markers") + + def __init__(self, node: Node) -> None: + self.node = node + self.parent = node.parent + self._markers = {node.name: True} + + def __getitem__(self, key: str) -> Any: + try: + return self._markers[key] + except KeyError: + if self.parent is None: + raise + return self.parent.keywords[key] + + def __setitem__(self, key: str, value: Any) -> None: + self._markers[key] = value + + # Note: we could've avoided explicitly implementing some of the methods + # below and use the collections.abc fallback, but that would be slow. + + def __contains__(self, key: object) -> bool: + return ( + key in self._markers + or self.parent is not None + and key in self.parent.keywords + ) + + def update( # type: ignore[override] + self, + other: Mapping[str, Any] | Iterable[tuple[str, Any]] = (), + **kwds: Any, + ) -> None: + self._markers.update(other) + self._markers.update(kwds) + + def __delitem__(self, key: str) -> None: + raise ValueError("cannot delete key in keywords dict") + + def __iter__(self) -> Iterator[str]: + # Doesn't need to be fast. + yield from self._markers + if self.parent is not None: + for keyword in self.parent.keywords: + # self._marks and self.parent.keywords can have duplicates. + if keyword not in self._markers: + yield keyword + + def __len__(self) -> int: + # Doesn't need to be fast. + return sum(1 for keyword in self) + + def __repr__(self) -> str: + return f"" diff --git a/.venv/Lib/site-packages/_pytest/monkeypatch.py b/.venv/Lib/site-packages/_pytest/monkeypatch.py new file mode 100644 index 00000000..46eb1724 --- /dev/null +++ b/.venv/Lib/site-packages/_pytest/monkeypatch.py @@ -0,0 +1,415 @@ +# mypy: allow-untyped-defs +"""Monkeypatching and mocking functionality.""" + +from __future__ import annotations + +from contextlib import contextmanager +import os +import re +import sys +from typing import Any +from typing import final +from typing import Generator +from typing import Mapping +from typing import MutableMapping +from typing import overload +from typing import TypeVar +import warnings + +from _pytest.fixtures import fixture +from _pytest.warning_types import PytestWarning + + +RE_IMPORT_ERROR_NAME = re.compile(r"^No module named (.*)$") + + +K = TypeVar("K") +V = TypeVar("V") + + +@fixture +def monkeypatch() -> Generator[MonkeyPatch]: + """A convenient fixture for monkey-patching. + + The fixture provides these methods to modify objects, dictionaries, or + :data:`os.environ`: + + * :meth:`monkeypatch.setattr(obj, name, value, raising=True) ` + * :meth:`monkeypatch.delattr(obj, name, raising=True) ` + * :meth:`monkeypatch.setitem(mapping, name, value) ` + * :meth:`monkeypatch.delitem(obj, name, raising=True) ` + * :meth:`monkeypatch.setenv(name, value, prepend=None) ` + * :meth:`monkeypatch.delenv(name, raising=True) ` + * :meth:`monkeypatch.syspath_prepend(path) ` + * :meth:`monkeypatch.chdir(path) ` + * :meth:`monkeypatch.context() ` + + All modifications will be undone after the requesting test function or + fixture has finished. The ``raising`` parameter determines if a :class:`KeyError` + or :class:`AttributeError` will be raised if the set/deletion operation does not have the + specified target. + + To undo modifications done by the fixture in a contained scope, + use :meth:`context() `. + """ + mpatch = MonkeyPatch() + yield mpatch + mpatch.undo() + + +def resolve(name: str) -> object: + # Simplified from zope.dottedname. + parts = name.split(".") + + used = parts.pop(0) + found: object = __import__(used) + for part in parts: + used += "." + part + try: + found = getattr(found, part) + except AttributeError: + pass + else: + continue + # We use explicit un-nesting of the handling block in order + # to avoid nested exceptions. + try: + __import__(used) + except ImportError as ex: + expected = str(ex).split()[-1] + if expected == used: + raise + else: + raise ImportError(f"import error in {used}: {ex}") from ex + found = annotated_getattr(found, part, used) + return found + + +def annotated_getattr(obj: object, name: str, ann: str) -> object: + try: + obj = getattr(obj, name) + except AttributeError as e: + raise AttributeError( + f"{type(obj).__name__!r} object at {ann} has no attribute {name!r}" + ) from e + return obj + + +def derive_importpath(import_path: str, raising: bool) -> tuple[str, object]: + if not isinstance(import_path, str) or "." not in import_path: + raise TypeError(f"must be absolute import path string, not {import_path!r}") + module, attr = import_path.rsplit(".", 1) + target = resolve(module) + if raising: + annotated_getattr(target, attr, ann=module) + return attr, target + + +class Notset: + def __repr__(self) -> str: + return "" + + +notset = Notset() + + +@final +class MonkeyPatch: + """Helper to conveniently monkeypatch attributes/items/environment + variables/syspath. + + Returned by the :fixture:`monkeypatch` fixture. + + .. versionchanged:: 6.2 + Can now also be used directly as `pytest.MonkeyPatch()`, for when + the fixture is not available. In this case, use + :meth:`with MonkeyPatch.context() as mp: ` or remember to call + :meth:`undo` explicitly. + """ + + def __init__(self) -> None: + self._setattr: list[tuple[object, str, object]] = [] + self._setitem: list[tuple[Mapping[Any, Any], object, object]] = [] + self._cwd: str | None = None + self._savesyspath: list[str] | None = None + + @classmethod + @contextmanager + def context(cls) -> Generator[MonkeyPatch]: + """Context manager that returns a new :class:`MonkeyPatch` object + which undoes any patching done inside the ``with`` block upon exit. + + Example: + + .. code-block:: python + + import functools + + + def test_partial(monkeypatch): + with monkeypatch.context() as m: + m.setattr(functools, "partial", 3) + + Useful in situations where it is desired to undo some patches before the test ends, + such as mocking ``stdlib`` functions that might break pytest itself if mocked (for examples + of this see :issue:`3290`). + """ + m = cls() + try: + yield m + finally: + m.undo() + + @overload + def setattr( + self, + target: str, + name: object, + value: Notset = ..., + raising: bool = ..., + ) -> None: ... + + @overload + def setattr( + self, + target: object, + name: str, + value: object, + raising: bool = ..., + ) -> None: ... + + def setattr( + self, + target: str | object, + name: object | str, + value: object = notset, + raising: bool = True, + ) -> None: + """ + Set attribute value on target, memorizing the old value. + + For example: + + .. code-block:: python + + import os + + monkeypatch.setattr(os, "getcwd", lambda: "/") + + The code above replaces the :func:`os.getcwd` function by a ``lambda`` which + always returns ``"/"``. + + For convenience, you can specify a string as ``target`` which + will be interpreted as a dotted import path, with the last part + being the attribute name: + + .. code-block:: python + + monkeypatch.setattr("os.getcwd", lambda: "/") + + Raises :class:`AttributeError` if the attribute does not exist, unless + ``raising`` is set to False. + + **Where to patch** + + ``monkeypatch.setattr`` works by (temporarily) changing the object that a name points to with another one. + There can be many names pointing to any individual object, so for patching to work you must ensure + that you patch the name used by the system under test. + + See the section :ref:`Where to patch ` in the :mod:`unittest.mock` + docs for a complete explanation, which is meant for :func:`unittest.mock.patch` but + applies to ``monkeypatch.setattr`` as well. + """ + __tracebackhide__ = True + import inspect + + if isinstance(value, Notset): + if not isinstance(target, str): + raise TypeError( + "use setattr(target, name, value) or " + "setattr(target, value) with target being a dotted " + "import string" + ) + value = name + name, target = derive_importpath(target, raising) + else: + if not isinstance(name, str): + raise TypeError( + "use setattr(target, name, value) with name being a string or " + "setattr(target, value) with target being a dotted " + "import string" + ) + + oldval = getattr(target, name, notset) + if raising and oldval is notset: + raise AttributeError(f"{target!r} has no attribute {name!r}") + + # avoid class descriptors like staticmethod/classmethod + if inspect.isclass(target): + oldval = target.__dict__.get(name, notset) + self._setattr.append((target, name, oldval)) + setattr(target, name, value) + + def delattr( + self, + target: object | str, + name: str | Notset = notset, + raising: bool = True, + ) -> None: + """Delete attribute ``name`` from ``target``. + + If no ``name`` is specified and ``target`` is a string + it will be interpreted as a dotted import path with the + last part being the attribute name. + + Raises AttributeError it the attribute does not exist, unless + ``raising`` is set to False. + """ + __tracebackhide__ = True + import inspect + + if isinstance(name, Notset): + if not isinstance(target, str): + raise TypeError( + "use delattr(target, name) or " + "delattr(target) with target being a dotted " + "import string" + ) + name, target = derive_importpath(target, raising) + + if not hasattr(target, name): + if raising: + raise AttributeError(name) + else: + oldval = getattr(target, name, notset) + # Avoid class descriptors like staticmethod/classmethod. + if inspect.isclass(target): + oldval = target.__dict__.get(name, notset) + self._setattr.append((target, name, oldval)) + delattr(target, name) + + def setitem(self, dic: Mapping[K, V], name: K, value: V) -> None: + """Set dictionary entry ``name`` to value.""" + self._setitem.append((dic, name, dic.get(name, notset))) + # Not all Mapping types support indexing, but MutableMapping doesn't support TypedDict + dic[name] = value # type: ignore[index] + + def delitem(self, dic: Mapping[K, V], name: K, raising: bool = True) -> None: + """Delete ``name`` from dict. + + Raises ``KeyError`` if it doesn't exist, unless ``raising`` is set to + False. + """ + if name not in dic: + if raising: + raise KeyError(name) + else: + self._setitem.append((dic, name, dic.get(name, notset))) + # Not all Mapping types support indexing, but MutableMapping doesn't support TypedDict + del dic[name] # type: ignore[attr-defined] + + def setenv(self, name: str, value: str, prepend: str | None = None) -> None: + """Set environment variable ``name`` to ``value``. + + If ``prepend`` is a character, read the current environment variable + value and prepend the ``value`` adjoined with the ``prepend`` + character. + """ + if not isinstance(value, str): + warnings.warn( # type: ignore[unreachable] + PytestWarning( + f"Value of environment variable {name} type should be str, but got " + f"{value!r} (type: {type(value).__name__}); converted to str implicitly" + ), + stacklevel=2, + ) + value = str(value) + if prepend and name in os.environ: + value = value + prepend + os.environ[name] + self.setitem(os.environ, name, value) + + def delenv(self, name: str, raising: bool = True) -> None: + """Delete ``name`` from the environment. + + Raises ``KeyError`` if it does not exist, unless ``raising`` is set to + False. + """ + environ: MutableMapping[str, str] = os.environ + self.delitem(environ, name, raising=raising) + + def syspath_prepend(self, path) -> None: + """Prepend ``path`` to ``sys.path`` list of import locations.""" + if self._savesyspath is None: + self._savesyspath = sys.path[:] + sys.path.insert(0, str(path)) + + # https://github.com/pypa/setuptools/blob/d8b901bc/docs/pkg_resources.txt#L162-L171 + # this is only needed when pkg_resources was already loaded by the namespace package + if "pkg_resources" in sys.modules: + from pkg_resources import fixup_namespace_packages + + fixup_namespace_packages(str(path)) + + # A call to syspathinsert() usually means that the caller wants to + # import some dynamically created files, thus with python3 we + # invalidate its import caches. + # This is especially important when any namespace package is in use, + # since then the mtime based FileFinder cache (that gets created in + # this case already) gets not invalidated when writing the new files + # quickly afterwards. + from importlib import invalidate_caches + + invalidate_caches() + + def chdir(self, path: str | os.PathLike[str]) -> None: + """Change the current working directory to the specified path. + + :param path: + The path to change into. + """ + if self._cwd is None: + self._cwd = os.getcwd() + os.chdir(path) + + def undo(self) -> None: + """Undo previous changes. + + This call consumes the undo stack. Calling it a second time has no + effect unless you do more monkeypatching after the undo call. + + There is generally no need to call `undo()`, since it is + called automatically during tear-down. + + .. note:: + The same `monkeypatch` fixture is used across a + single test function invocation. If `monkeypatch` is used both by + the test function itself and one of the test fixtures, + calling `undo()` will undo all of the changes made in + both functions. + + Prefer to use :meth:`context() ` instead. + """ + for obj, name, value in reversed(self._setattr): + if value is not notset: + setattr(obj, name, value) + else: + delattr(obj, name) + self._setattr[:] = [] + for dictionary, key, value in reversed(self._setitem): + if value is notset: + try: + # Not all Mapping types support indexing, but MutableMapping doesn't support TypedDict + del dictionary[key] # type: ignore[attr-defined] + except KeyError: + pass # Was already deleted, so we have the desired state. + else: + # Not all Mapping types support indexing, but MutableMapping doesn't support TypedDict + dictionary[key] = value # type: ignore[index] + self._setitem[:] = [] + if self._savesyspath is not None: + sys.path[:] = self._savesyspath + self._savesyspath = None + + if self._cwd is not None: + os.chdir(self._cwd) + self._cwd = None diff --git a/.venv/Lib/site-packages/_pytest/nodes.py b/.venv/Lib/site-packages/_pytest/nodes.py new file mode 100644 index 00000000..51bc5174 --- /dev/null +++ b/.venv/Lib/site-packages/_pytest/nodes.py @@ -0,0 +1,766 @@ +# mypy: allow-untyped-defs +from __future__ import annotations + +import abc +from functools import cached_property +from inspect import signature +import os +import pathlib +from pathlib import Path +from typing import Any +from typing import Callable +from typing import cast +from typing import Iterable +from typing import Iterator +from typing import MutableMapping +from typing import NoReturn +from typing import overload +from typing import TYPE_CHECKING +from typing import TypeVar +import warnings + +import pluggy + +import _pytest._code +from _pytest._code import getfslineno +from _pytest._code.code import ExceptionInfo +from _pytest._code.code import TerminalRepr +from _pytest._code.code import Traceback +from _pytest._code.code import TracebackStyle +from _pytest.compat import LEGACY_PATH +from _pytest.config import Config +from _pytest.config import ConftestImportFailure +from _pytest.config.compat import _check_path +from _pytest.deprecated import NODE_CTOR_FSPATH_ARG +from _pytest.mark.structures import Mark +from _pytest.mark.structures import MarkDecorator +from _pytest.mark.structures import NodeKeywords +from _pytest.outcomes import fail +from _pytest.pathlib import absolutepath +from _pytest.pathlib import commonpath +from _pytest.stash import Stash +from _pytest.warning_types import PytestWarning + + +if TYPE_CHECKING: + from typing_extensions import Self + + # Imported here due to circular import. + from _pytest.main import Session + + +SEP = "/" + +tracebackcutdir = Path(_pytest.__file__).parent + + +_T = TypeVar("_T") + + +def _imply_path( + node_type: type[Node], + path: Path | None, + fspath: LEGACY_PATH | None, +) -> Path: + if fspath is not None: + warnings.warn( + NODE_CTOR_FSPATH_ARG.format( + node_type_name=node_type.__name__, + ), + stacklevel=6, + ) + if path is not None: + if fspath is not None: + _check_path(path, fspath) + return path + else: + assert fspath is not None + return Path(fspath) + + +_NodeType = TypeVar("_NodeType", bound="Node") + + +class NodeMeta(abc.ABCMeta): + """Metaclass used by :class:`Node` to enforce that direct construction raises + :class:`Failed`. + + This behaviour supports the indirection introduced with :meth:`Node.from_parent`, + the named constructor to be used instead of direct construction. The design + decision to enforce indirection with :class:`NodeMeta` was made as a + temporary aid for refactoring the collection tree, which was diagnosed to + have :class:`Node` objects whose creational patterns were overly entangled. + Once the refactoring is complete, this metaclass can be removed. + + See https://github.com/pytest-dev/pytest/projects/3 for an overview of the + progress on detangling the :class:`Node` classes. + """ + + def __call__(cls, *k, **kw) -> NoReturn: + msg = ( + "Direct construction of {name} has been deprecated, please use {name}.from_parent.\n" + "See " + "https://docs.pytest.org/en/stable/deprecations.html#node-construction-changed-to-node-from-parent" + " for more details." + ).format(name=f"{cls.__module__}.{cls.__name__}") + fail(msg, pytrace=False) + + def _create(cls: type[_T], *k, **kw) -> _T: + try: + return super().__call__(*k, **kw) # type: ignore[no-any-return,misc] + except TypeError: + sig = signature(getattr(cls, "__init__")) + known_kw = {k: v for k, v in kw.items() if k in sig.parameters} + from .warning_types import PytestDeprecationWarning + + warnings.warn( + PytestDeprecationWarning( + f"{cls} is not using a cooperative constructor and only takes {set(known_kw)}.\n" + "See https://docs.pytest.org/en/stable/deprecations.html" + "#constructors-of-custom-pytest-node-subclasses-should-take-kwargs " + "for more details." + ) + ) + + return super().__call__(*k, **known_kw) # type: ignore[no-any-return,misc] + + +class Node(abc.ABC, metaclass=NodeMeta): + r"""Base class of :class:`Collector` and :class:`Item`, the components of + the test collection tree. + + ``Collector``\'s are the internal nodes of the tree, and ``Item``\'s are the + leaf nodes. + """ + + # Implemented in the legacypath plugin. + #: A ``LEGACY_PATH`` copy of the :attr:`path` attribute. Intended for usage + #: for methods not migrated to ``pathlib.Path`` yet, such as + #: :meth:`Item.reportinfo `. Will be deprecated in + #: a future release, prefer using :attr:`path` instead. + fspath: LEGACY_PATH + + # Use __slots__ to make attribute access faster. + # Note that __dict__ is still available. + __slots__ = ( + "name", + "parent", + "config", + "session", + "path", + "_nodeid", + "_store", + "__dict__", + ) + + def __init__( + self, + name: str, + parent: Node | None = None, + config: Config | None = None, + session: Session | None = None, + fspath: LEGACY_PATH | None = None, + path: Path | None = None, + nodeid: str | None = None, + ) -> None: + #: A unique name within the scope of the parent node. + self.name: str = name + + #: The parent collector node. + self.parent = parent + + if config: + #: The pytest config object. + self.config: Config = config + else: + if not parent: + raise TypeError("config or parent must be provided") + self.config = parent.config + + if session: + #: The pytest session this node is part of. + self.session: Session = session + else: + if not parent: + raise TypeError("session or parent must be provided") + self.session = parent.session + + if path is None and fspath is None: + path = getattr(parent, "path", None) + #: Filesystem path where this node was collected from (can be None). + self.path: pathlib.Path = _imply_path(type(self), path, fspath=fspath) + + # The explicit annotation is to avoid publicly exposing NodeKeywords. + #: Keywords/markers collected from all scopes. + self.keywords: MutableMapping[str, Any] = NodeKeywords(self) + + #: The marker objects belonging to this node. + self.own_markers: list[Mark] = [] + + #: Allow adding of extra keywords to use for matching. + self.extra_keyword_matches: set[str] = set() + + if nodeid is not None: + assert "::()" not in nodeid + self._nodeid = nodeid + else: + if not self.parent: + raise TypeError("nodeid or parent must be provided") + self._nodeid = self.parent.nodeid + "::" + self.name + + #: A place where plugins can store information on the node for their + #: own use. + self.stash: Stash = Stash() + # Deprecated alias. Was never public. Can be removed in a few releases. + self._store = self.stash + + @classmethod + def from_parent(cls, parent: Node, **kw) -> Self: + """Public constructor for Nodes. + + This indirection got introduced in order to enable removing + the fragile logic from the node constructors. + + Subclasses can use ``super().from_parent(...)`` when overriding the + construction. + + :param parent: The parent node of this Node. + """ + if "config" in kw: + raise TypeError("config is not a valid argument for from_parent") + if "session" in kw: + raise TypeError("session is not a valid argument for from_parent") + return cls._create(parent=parent, **kw) + + @property + def ihook(self) -> pluggy.HookRelay: + """fspath-sensitive hook proxy used to call pytest hooks.""" + return self.session.gethookproxy(self.path) + + def __repr__(self) -> str: + return "<{} {}>".format(self.__class__.__name__, getattr(self, "name", None)) + + def warn(self, warning: Warning) -> None: + """Issue a warning for this Node. + + Warnings will be displayed after the test session, unless explicitly suppressed. + + :param Warning warning: + The warning instance to issue. + + :raises ValueError: If ``warning`` instance is not a subclass of Warning. + + Example usage: + + .. code-block:: python + + node.warn(PytestWarning("some message")) + node.warn(UserWarning("some message")) + + .. versionchanged:: 6.2 + Any subclass of :class:`Warning` is now accepted, rather than only + :class:`PytestWarning ` subclasses. + """ + # enforce type checks here to avoid getting a generic type error later otherwise. + if not isinstance(warning, Warning): + raise ValueError( + f"warning must be an instance of Warning or subclass, got {warning!r}" + ) + path, lineno = get_fslocation_from_item(self) + assert lineno is not None + warnings.warn_explicit( + warning, + category=None, + filename=str(path), + lineno=lineno + 1, + ) + + # Methods for ordering nodes. + + @property + def nodeid(self) -> str: + """A ::-separated string denoting its collection tree address.""" + return self._nodeid + + def __hash__(self) -> int: + return hash(self._nodeid) + + def setup(self) -> None: + pass + + def teardown(self) -> None: + pass + + def iter_parents(self) -> Iterator[Node]: + """Iterate over all parent collectors starting from and including self + up to the root of the collection tree. + + .. versionadded:: 8.1 + """ + parent: Node | None = self + while parent is not None: + yield parent + parent = parent.parent + + def listchain(self) -> list[Node]: + """Return a list of all parent collectors starting from the root of the + collection tree down to and including self.""" + chain = [] + item: Node | None = self + while item is not None: + chain.append(item) + item = item.parent + chain.reverse() + return chain + + def add_marker(self, marker: str | MarkDecorator, append: bool = True) -> None: + """Dynamically add a marker object to the node. + + :param marker: + The marker. + :param append: + Whether to append the marker, or prepend it. + """ + from _pytest.mark import MARK_GEN + + if isinstance(marker, MarkDecorator): + marker_ = marker + elif isinstance(marker, str): + marker_ = getattr(MARK_GEN, marker) + else: + raise ValueError("is not a string or pytest.mark.* Marker") + self.keywords[marker_.name] = marker_ + if append: + self.own_markers.append(marker_.mark) + else: + self.own_markers.insert(0, marker_.mark) + + def iter_markers(self, name: str | None = None) -> Iterator[Mark]: + """Iterate over all markers of the node. + + :param name: If given, filter the results by the name attribute. + :returns: An iterator of the markers of the node. + """ + return (x[1] for x in self.iter_markers_with_node(name=name)) + + def iter_markers_with_node( + self, name: str | None = None + ) -> Iterator[tuple[Node, Mark]]: + """Iterate over all markers of the node. + + :param name: If given, filter the results by the name attribute. + :returns: An iterator of (node, mark) tuples. + """ + for node in self.iter_parents(): + for mark in node.own_markers: + if name is None or getattr(mark, "name", None) == name: + yield node, mark + + @overload + def get_closest_marker(self, name: str) -> Mark | None: ... + + @overload + def get_closest_marker(self, name: str, default: Mark) -> Mark: ... + + def get_closest_marker(self, name: str, default: Mark | None = None) -> Mark | None: + """Return the first marker matching the name, from closest (for + example function) to farther level (for example module level). + + :param default: Fallback return value if no marker was found. + :param name: Name to filter by. + """ + return next(self.iter_markers(name=name), default) + + def listextrakeywords(self) -> set[str]: + """Return a set of all extra keywords in self and any parents.""" + extra_keywords: set[str] = set() + for item in self.listchain(): + extra_keywords.update(item.extra_keyword_matches) + return extra_keywords + + def listnames(self) -> list[str]: + return [x.name for x in self.listchain()] + + def addfinalizer(self, fin: Callable[[], object]) -> None: + """Register a function to be called without arguments when this node is + finalized. + + This method can only be called when this node is active + in a setup chain, for example during self.setup(). + """ + self.session._setupstate.addfinalizer(fin, self) + + def getparent(self, cls: type[_NodeType]) -> _NodeType | None: + """Get the closest parent node (including self) which is an instance of + the given class. + + :param cls: The node class to search for. + :returns: The node, if found. + """ + for node in self.iter_parents(): + if isinstance(node, cls): + return node + return None + + def _traceback_filter(self, excinfo: ExceptionInfo[BaseException]) -> Traceback: + return excinfo.traceback + + def _repr_failure_py( + self, + excinfo: ExceptionInfo[BaseException], + style: TracebackStyle | None = None, + ) -> TerminalRepr: + from _pytest.fixtures import FixtureLookupError + + if isinstance(excinfo.value, ConftestImportFailure): + excinfo = ExceptionInfo.from_exception(excinfo.value.cause) + if isinstance(excinfo.value, fail.Exception): + if not excinfo.value.pytrace: + style = "value" + if isinstance(excinfo.value, FixtureLookupError): + return excinfo.value.formatrepr() + + tbfilter: bool | Callable[[ExceptionInfo[BaseException]], Traceback] + if self.config.getoption("fulltrace", False): + style = "long" + tbfilter = False + else: + tbfilter = self._traceback_filter + if style == "auto": + style = "long" + # XXX should excinfo.getrepr record all data and toterminal() process it? + if style is None: + if self.config.getoption("tbstyle", "auto") == "short": + style = "short" + else: + style = "long" + + if self.config.get_verbosity() > 1: + truncate_locals = False + else: + truncate_locals = True + + truncate_args = False if self.config.get_verbosity() > 2 else True + + # excinfo.getrepr() formats paths relative to the CWD if `abspath` is False. + # It is possible for a fixture/test to change the CWD while this code runs, which + # would then result in the user seeing confusing paths in the failure message. + # To fix this, if the CWD changed, always display the full absolute path. + # It will be better to just always display paths relative to invocation_dir, but + # this requires a lot of plumbing (#6428). + try: + abspath = Path(os.getcwd()) != self.config.invocation_params.dir + except OSError: + abspath = True + + return excinfo.getrepr( + funcargs=True, + abspath=abspath, + showlocals=self.config.getoption("showlocals", False), + style=style, + tbfilter=tbfilter, + truncate_locals=truncate_locals, + truncate_args=truncate_args, + ) + + def repr_failure( + self, + excinfo: ExceptionInfo[BaseException], + style: TracebackStyle | None = None, + ) -> str | TerminalRepr: + """Return a representation of a collection or test failure. + + .. seealso:: :ref:`non-python tests` + + :param excinfo: Exception information for the failure. + """ + return self._repr_failure_py(excinfo, style) + + +def get_fslocation_from_item(node: Node) -> tuple[str | Path, int | None]: + """Try to extract the actual location from a node, depending on available attributes: + + * "location": a pair (path, lineno) + * "obj": a Python object that the node wraps. + * "path": just a path + + :rtype: A tuple of (str|Path, int) with filename and 0-based line number. + """ + # See Item.location. + location: tuple[str, int | None, str] | None = getattr(node, "location", None) + if location is not None: + return location[:2] + obj = getattr(node, "obj", None) + if obj is not None: + return getfslineno(obj) + return getattr(node, "path", "unknown location"), -1 + + +class Collector(Node, abc.ABC): + """Base class of all collectors. + + Collector create children through `collect()` and thus iteratively build + the collection tree. + """ + + class CollectError(Exception): + """An error during collection, contains a custom message.""" + + @abc.abstractmethod + def collect(self) -> Iterable[Item | Collector]: + """Collect children (items and collectors) for this collector.""" + raise NotImplementedError("abstract") + + # TODO: This omits the style= parameter which breaks Liskov Substitution. + def repr_failure( # type: ignore[override] + self, excinfo: ExceptionInfo[BaseException] + ) -> str | TerminalRepr: + """Return a representation of a collection failure. + + :param excinfo: Exception information for the failure. + """ + if isinstance(excinfo.value, self.CollectError) and not self.config.getoption( + "fulltrace", False + ): + exc = excinfo.value + return str(exc.args[0]) + + # Respect explicit tbstyle option, but default to "short" + # (_repr_failure_py uses "long" with "fulltrace" option always). + tbstyle = self.config.getoption("tbstyle", "auto") + if tbstyle == "auto": + tbstyle = "short" + + return self._repr_failure_py(excinfo, style=tbstyle) + + def _traceback_filter(self, excinfo: ExceptionInfo[BaseException]) -> Traceback: + if hasattr(self, "path"): + traceback = excinfo.traceback + ntraceback = traceback.cut(path=self.path) + if ntraceback == traceback: + ntraceback = ntraceback.cut(excludepath=tracebackcutdir) + return ntraceback.filter(excinfo) + return excinfo.traceback + + +def _check_initialpaths_for_relpath(session: Session, path: Path) -> str | None: + for initial_path in session._initialpaths: + if commonpath(path, initial_path) == initial_path: + rel = str(path.relative_to(initial_path)) + return "" if rel == "." else rel + return None + + +class FSCollector(Collector, abc.ABC): + """Base class for filesystem collectors.""" + + def __init__( + self, + fspath: LEGACY_PATH | None = None, + path_or_parent: Path | Node | None = None, + path: Path | None = None, + name: str | None = None, + parent: Node | None = None, + config: Config | None = None, + session: Session | None = None, + nodeid: str | None = None, + ) -> None: + if path_or_parent: + if isinstance(path_or_parent, Node): + assert parent is None + parent = cast(FSCollector, path_or_parent) + elif isinstance(path_or_parent, Path): + assert path is None + path = path_or_parent + + path = _imply_path(type(self), path, fspath=fspath) + if name is None: + name = path.name + if parent is not None and parent.path != path: + try: + rel = path.relative_to(parent.path) + except ValueError: + pass + else: + name = str(rel) + name = name.replace(os.sep, SEP) + self.path = path + + if session is None: + assert parent is not None + session = parent.session + + if nodeid is None: + try: + nodeid = str(self.path.relative_to(session.config.rootpath)) + except ValueError: + nodeid = _check_initialpaths_for_relpath(session, path) + + if nodeid and os.sep != SEP: + nodeid = nodeid.replace(os.sep, SEP) + + super().__init__( + name=name, + parent=parent, + config=config, + session=session, + nodeid=nodeid, + path=path, + ) + + @classmethod + def from_parent( + cls, + parent, + *, + fspath: LEGACY_PATH | None = None, + path: Path | None = None, + **kw, + ) -> Self: + """The public constructor.""" + return super().from_parent(parent=parent, fspath=fspath, path=path, **kw) + + +class File(FSCollector, abc.ABC): + """Base class for collecting tests from a file. + + :ref:`non-python tests`. + """ + + +class Directory(FSCollector, abc.ABC): + """Base class for collecting files from a directory. + + A basic directory collector does the following: goes over the files and + sub-directories in the directory and creates collectors for them by calling + the hooks :hook:`pytest_collect_directory` and :hook:`pytest_collect_file`, + after checking that they are not ignored using + :hook:`pytest_ignore_collect`. + + The default directory collectors are :class:`~pytest.Dir` and + :class:`~pytest.Package`. + + .. versionadded:: 8.0 + + :ref:`custom directory collectors`. + """ + + +class Item(Node, abc.ABC): + """Base class of all test invocation items. + + Note that for a single function there might be multiple test invocation items. + """ + + nextitem = None + + def __init__( + self, + name, + parent=None, + config: Config | None = None, + session: Session | None = None, + nodeid: str | None = None, + **kw, + ) -> None: + # The first two arguments are intentionally passed positionally, + # to keep plugins who define a node type which inherits from + # (pytest.Item, pytest.File) working (see issue #8435). + # They can be made kwargs when the deprecation above is done. + super().__init__( + name, + parent, + config=config, + session=session, + nodeid=nodeid, + **kw, + ) + self._report_sections: list[tuple[str, str, str]] = [] + + #: A list of tuples (name, value) that holds user defined properties + #: for this test. + self.user_properties: list[tuple[str, object]] = [] + + self._check_item_and_collector_diamond_inheritance() + + def _check_item_and_collector_diamond_inheritance(self) -> None: + """ + Check if the current type inherits from both File and Collector + at the same time, emitting a warning accordingly (#8447). + """ + cls = type(self) + + # We inject an attribute in the type to avoid issuing this warning + # for the same class more than once, which is not helpful. + # It is a hack, but was deemed acceptable in order to avoid + # flooding the user in the common case. + attr_name = "_pytest_diamond_inheritance_warning_shown" + if getattr(cls, attr_name, False): + return + setattr(cls, attr_name, True) + + problems = ", ".join( + base.__name__ for base in cls.__bases__ if issubclass(base, Collector) + ) + if problems: + warnings.warn( + f"{cls.__name__} is an Item subclass and should not be a collector, " + f"however its bases {problems} are collectors.\n" + "Please split the Collectors and the Item into separate node types.\n" + "Pytest Doc example: https://docs.pytest.org/en/latest/example/nonpython.html\n" + "example pull request on a plugin: https://github.com/asmeurer/pytest-flakes/pull/40/", + PytestWarning, + ) + + @abc.abstractmethod + def runtest(self) -> None: + """Run the test case for this item. + + Must be implemented by subclasses. + + .. seealso:: :ref:`non-python tests` + """ + raise NotImplementedError("runtest must be implemented by Item subclass") + + def add_report_section(self, when: str, key: str, content: str) -> None: + """Add a new report section, similar to what's done internally to add + stdout and stderr captured output:: + + item.add_report_section("call", "stdout", "report section contents") + + :param str when: + One of the possible capture states, ``"setup"``, ``"call"``, ``"teardown"``. + :param str key: + Name of the section, can be customized at will. Pytest uses ``"stdout"`` and + ``"stderr"`` internally. + :param str content: + The full contents as a string. + """ + if content: + self._report_sections.append((when, key, content)) + + def reportinfo(self) -> tuple[os.PathLike[str] | str, int | None, str]: + """Get location information for this item for test reports. + + Returns a tuple with three elements: + + - The path of the test (default ``self.path``) + - The 0-based line number of the test (default ``None``) + - A name of the test to be shown (default ``""``) + + .. seealso:: :ref:`non-python tests` + """ + return self.path, None, "" + + @cached_property + def location(self) -> tuple[str, int | None, str]: + """ + Returns a tuple of ``(relfspath, lineno, testname)`` for this item + where ``relfspath`` is file path relative to ``config.rootpath`` + and lineno is a 0-based line number. + """ + location = self.reportinfo() + path = absolutepath(location[0]) + relfspath = self.session._node_location_to_relpath(path) + assert type(location[2]) is str + return (relfspath, location[1], location[2]) diff --git a/.venv/Lib/site-packages/_pytest/outcomes.py b/.venv/Lib/site-packages/_pytest/outcomes.py new file mode 100644 index 00000000..5b20803e --- /dev/null +++ b/.venv/Lib/site-packages/_pytest/outcomes.py @@ -0,0 +1,318 @@ +"""Exception classes and constants handling test outcomes as well as +functions creating them.""" + +from __future__ import annotations + +import sys +from typing import Any +from typing import Callable +from typing import cast +from typing import NoReturn +from typing import Protocol +from typing import Type +from typing import TypeVar + +from .warning_types import PytestDeprecationWarning + + +class OutcomeException(BaseException): + """OutcomeException and its subclass instances indicate and contain info + about test and collection outcomes.""" + + def __init__(self, msg: str | None = None, pytrace: bool = True) -> None: + if msg is not None and not isinstance(msg, str): + error_msg = ( # type: ignore[unreachable] + "{} expected string as 'msg' parameter, got '{}' instead.\n" + "Perhaps you meant to use a mark?" + ) + raise TypeError(error_msg.format(type(self).__name__, type(msg).__name__)) + super().__init__(msg) + self.msg = msg + self.pytrace = pytrace + + def __repr__(self) -> str: + if self.msg is not None: + return self.msg + return f"<{self.__class__.__name__} instance>" + + __str__ = __repr__ + + +TEST_OUTCOME = (OutcomeException, Exception) + + +class Skipped(OutcomeException): + # XXX hackish: on 3k we fake to live in the builtins + # in order to have Skipped exception printing shorter/nicer + __module__ = "builtins" + + def __init__( + self, + msg: str | None = None, + pytrace: bool = True, + allow_module_level: bool = False, + *, + _use_item_location: bool = False, + ) -> None: + super().__init__(msg=msg, pytrace=pytrace) + self.allow_module_level = allow_module_level + # If true, the skip location is reported as the item's location, + # instead of the place that raises the exception/calls skip(). + self._use_item_location = _use_item_location + + +class Failed(OutcomeException): + """Raised from an explicit call to pytest.fail().""" + + __module__ = "builtins" + + +class Exit(Exception): + """Raised for immediate program exits (no tracebacks/summaries).""" + + def __init__( + self, msg: str = "unknown reason", returncode: int | None = None + ) -> None: + self.msg = msg + self.returncode = returncode + super().__init__(msg) + + +# Elaborate hack to work around https://github.com/python/mypy/issues/2087. +# Ideally would just be `exit.Exception = Exit` etc. + +_F = TypeVar("_F", bound=Callable[..., object]) +_ET = TypeVar("_ET", bound=Type[BaseException]) + + +class _WithException(Protocol[_F, _ET]): + Exception: _ET + __call__: _F + + +def _with_exception(exception_type: _ET) -> Callable[[_F], _WithException[_F, _ET]]: + def decorate(func: _F) -> _WithException[_F, _ET]: + func_with_exception = cast(_WithException[_F, _ET], func) + func_with_exception.Exception = exception_type + return func_with_exception + + return decorate + + +# Exposed helper methods. + + +@_with_exception(Exit) +def exit( + reason: str = "", + returncode: int | None = None, +) -> NoReturn: + """Exit testing process. + + :param reason: + The message to show as the reason for exiting pytest. reason has a default value + only because `msg` is deprecated. + + :param returncode: + Return code to be used when exiting pytest. None means the same as ``0`` (no error), same as :func:`sys.exit`. + + :raises pytest.exit.Exception: + The exception that is raised. + """ + __tracebackhide__ = True + raise Exit(reason, returncode) + + +@_with_exception(Skipped) +def skip( + reason: str = "", + *, + allow_module_level: bool = False, +) -> NoReturn: + """Skip an executing test with the given message. + + This function should be called only during testing (setup, call or teardown) or + during collection by using the ``allow_module_level`` flag. This function can + be called in doctests as well. + + :param reason: + The message to show the user as reason for the skip. + + :param allow_module_level: + Allows this function to be called at module level. + Raising the skip exception at module level will stop + the execution of the module and prevent the collection of all tests in the module, + even those defined before the `skip` call. + + Defaults to False. + + :raises pytest.skip.Exception: + The exception that is raised. + + .. note:: + It is better to use the :ref:`pytest.mark.skipif ref` marker when + possible to declare a test to be skipped under certain conditions + like mismatching platforms or dependencies. + Similarly, use the ``# doctest: +SKIP`` directive (see :py:data:`doctest.SKIP`) + to skip a doctest statically. + """ + __tracebackhide__ = True + raise Skipped(msg=reason, allow_module_level=allow_module_level) + + +@_with_exception(Failed) +def fail(reason: str = "", pytrace: bool = True) -> NoReturn: + """Explicitly fail an executing test with the given message. + + :param reason: + The message to show the user as reason for the failure. + + :param pytrace: + If False, msg represents the full failure information and no + python traceback will be reported. + + :raises pytest.fail.Exception: + The exception that is raised. + """ + __tracebackhide__ = True + raise Failed(msg=reason, pytrace=pytrace) + + +class XFailed(Failed): + """Raised from an explicit call to pytest.xfail().""" + + +@_with_exception(XFailed) +def xfail(reason: str = "") -> NoReturn: + """Imperatively xfail an executing test or setup function with the given reason. + + This function should be called only during testing (setup, call or teardown). + + No other code is executed after using ``xfail()`` (it is implemented + internally by raising an exception). + + :param reason: + The message to show the user as reason for the xfail. + + .. note:: + It is better to use the :ref:`pytest.mark.xfail ref` marker when + possible to declare a test to be xfailed under certain conditions + like known bugs or missing features. + + :raises pytest.xfail.Exception: + The exception that is raised. + """ + __tracebackhide__ = True + raise XFailed(reason) + + +def importorskip( + modname: str, + minversion: str | None = None, + reason: str | None = None, + *, + exc_type: type[ImportError] | None = None, +) -> Any: + """Import and return the requested module ``modname``, or skip the + current test if the module cannot be imported. + + :param modname: + The name of the module to import. + :param minversion: + If given, the imported module's ``__version__`` attribute must be at + least this minimal version, otherwise the test is still skipped. + :param reason: + If given, this reason is shown as the message when the module cannot + be imported. + :param exc_type: + The exception that should be captured in order to skip modules. + Must be :py:class:`ImportError` or a subclass. + + If the module can be imported but raises :class:`ImportError`, pytest will + issue a warning to the user, as often users expect the module not to be + found (which would raise :class:`ModuleNotFoundError` instead). + + This warning can be suppressed by passing ``exc_type=ImportError`` explicitly. + + See :ref:`import-or-skip-import-error` for details. + + + :returns: + The imported module. This should be assigned to its canonical name. + + :raises pytest.skip.Exception: + If the module cannot be imported. + + Example:: + + docutils = pytest.importorskip("docutils") + + .. versionadded:: 8.2 + + The ``exc_type`` parameter. + """ + import warnings + + __tracebackhide__ = True + compile(modname, "", "eval") # to catch syntaxerrors + + # Until pytest 9.1, we will warn the user if we catch ImportError (instead of ModuleNotFoundError), + # as this might be hiding an installation/environment problem, which is not usually what is intended + # when using importorskip() (#11523). + # In 9.1, to keep the function signature compatible, we just change the code below to: + # 1. Use `exc_type = ModuleNotFoundError` if `exc_type` is not given. + # 2. Remove `warn_on_import` and the warning handling. + if exc_type is None: + exc_type = ImportError + warn_on_import_error = True + else: + warn_on_import_error = False + + skipped: Skipped | None = None + warning: Warning | None = None + + with warnings.catch_warnings(): + # Make sure to ignore ImportWarnings that might happen because + # of existing directories with the same name we're trying to + # import but without a __init__.py file. + warnings.simplefilter("ignore") + + try: + __import__(modname) + except exc_type as exc: + # Do not raise or issue warnings inside the catch_warnings() block. + if reason is None: + reason = f"could not import {modname!r}: {exc}" + skipped = Skipped(reason, allow_module_level=True) + + if warn_on_import_error and not isinstance(exc, ModuleNotFoundError): + lines = [ + "", + f"Module '{modname}' was found, but when imported by pytest it raised:", + f" {exc!r}", + "In pytest 9.1 this warning will become an error by default.", + "You can fix the underlying problem, or alternatively overwrite this behavior and silence this " + "warning by passing exc_type=ImportError explicitly.", + "See https://docs.pytest.org/en/stable/deprecations.html#pytest-importorskip-default-behavior-regarding-importerror", + ] + warning = PytestDeprecationWarning("\n".join(lines)) + + if warning: + warnings.warn(warning, stacklevel=2) + if skipped: + raise skipped + + mod = sys.modules[modname] + if minversion is None: + return mod + verattr = getattr(mod, "__version__", None) + if minversion is not None: + # Imported lazily to improve start-up time. + from packaging.version import Version + + if verattr is None or Version(verattr) < Version(minversion): + raise Skipped( + f"module {modname!r} has __version__ {verattr!r}, required is: {minversion!r}", + allow_module_level=True, + ) + return mod diff --git a/.venv/Lib/site-packages/_pytest/pastebin.py b/.venv/Lib/site-packages/_pytest/pastebin.py new file mode 100644 index 00000000..69c011ed --- /dev/null +++ b/.venv/Lib/site-packages/_pytest/pastebin.py @@ -0,0 +1,113 @@ +# mypy: allow-untyped-defs +"""Submit failure or test session information to a pastebin service.""" + +from __future__ import annotations + +from io import StringIO +import tempfile +from typing import IO + +from _pytest.config import Config +from _pytest.config import create_terminal_writer +from _pytest.config.argparsing import Parser +from _pytest.stash import StashKey +from _pytest.terminal import TerminalReporter +import pytest + + +pastebinfile_key = StashKey[IO[bytes]]() + + +def pytest_addoption(parser: Parser) -> None: + group = parser.getgroup("terminal reporting") + group._addoption( + "--pastebin", + metavar="mode", + action="store", + dest="pastebin", + default=None, + choices=["failed", "all"], + help="Send failed|all info to bpaste.net pastebin service", + ) + + +@pytest.hookimpl(trylast=True) +def pytest_configure(config: Config) -> None: + if config.option.pastebin == "all": + tr = config.pluginmanager.getplugin("terminalreporter") + # If no terminal reporter plugin is present, nothing we can do here; + # this can happen when this function executes in a worker node + # when using pytest-xdist, for example. + if tr is not None: + # pastebin file will be UTF-8 encoded binary file. + config.stash[pastebinfile_key] = tempfile.TemporaryFile("w+b") + oldwrite = tr._tw.write + + def tee_write(s, **kwargs): + oldwrite(s, **kwargs) + if isinstance(s, str): + s = s.encode("utf-8") + config.stash[pastebinfile_key].write(s) + + tr._tw.write = tee_write + + +def pytest_unconfigure(config: Config) -> None: + if pastebinfile_key in config.stash: + pastebinfile = config.stash[pastebinfile_key] + # Get terminal contents and delete file. + pastebinfile.seek(0) + sessionlog = pastebinfile.read() + pastebinfile.close() + del config.stash[pastebinfile_key] + # Undo our patching in the terminal reporter. + tr = config.pluginmanager.getplugin("terminalreporter") + del tr._tw.__dict__["write"] + # Write summary. + tr.write_sep("=", "Sending information to Paste Service") + pastebinurl = create_new_paste(sessionlog) + tr.write_line(f"pastebin session-log: {pastebinurl}\n") + + +def create_new_paste(contents: str | bytes) -> str: + """Create a new paste using the bpaste.net service. + + :contents: Paste contents string. + :returns: URL to the pasted contents, or an error message. + """ + import re + from urllib.parse import urlencode + from urllib.request import urlopen + + params = {"code": contents, "lexer": "text", "expiry": "1week"} + url = "https://bpa.st" + try: + response: str = ( + urlopen(url, data=urlencode(params).encode("ascii")).read().decode("utf-8") + ) + except OSError as exc_info: # urllib errors + return f"bad response: {exc_info}" + m = re.search(r'href="/raw/(\w+)"', response) + if m: + return f"{url}/show/{m.group(1)}" + else: + return "bad response: invalid format ('" + response + "')" + + +def pytest_terminal_summary(terminalreporter: TerminalReporter) -> None: + if terminalreporter.config.option.pastebin != "failed": + return + if "failed" in terminalreporter.stats: + terminalreporter.write_sep("=", "Sending information to Paste Service") + for rep in terminalreporter.stats["failed"]: + try: + msg = rep.longrepr.reprtraceback.reprentries[-1].reprfileloc + except AttributeError: + msg = terminalreporter._getfailureheadline(rep) + file = StringIO() + tw = create_terminal_writer(terminalreporter.config, file) + rep.toterminal(tw) + s = file.getvalue() + assert len(s) + pastebinurl = create_new_paste(s) + terminalreporter.write_line(f"{msg} --> {pastebinurl}") diff --git a/.venv/Lib/site-packages/_pytest/pathlib.py b/.venv/Lib/site-packages/_pytest/pathlib.py new file mode 100644 index 00000000..81e52ea7 --- /dev/null +++ b/.venv/Lib/site-packages/_pytest/pathlib.py @@ -0,0 +1,975 @@ +from __future__ import annotations + +import atexit +import contextlib +from enum import Enum +from errno import EBADF +from errno import ELOOP +from errno import ENOENT +from errno import ENOTDIR +import fnmatch +from functools import partial +from importlib.machinery import ModuleSpec +import importlib.util +import itertools +import os +from os.path import expanduser +from os.path import expandvars +from os.path import isabs +from os.path import sep +from pathlib import Path +from pathlib import PurePath +from posixpath import sep as posix_sep +import shutil +import sys +import types +from types import ModuleType +from typing import Any +from typing import Callable +from typing import Iterable +from typing import Iterator +from typing import TypeVar +import uuid +import warnings + +from _pytest.compat import assert_never +from _pytest.outcomes import skip +from _pytest.warning_types import PytestWarning + + +LOCK_TIMEOUT = 60 * 60 * 24 * 3 + + +_AnyPurePath = TypeVar("_AnyPurePath", bound=PurePath) + +# The following function, variables and comments were +# copied from cpython 3.9 Lib/pathlib.py file. + +# EBADF - guard against macOS `stat` throwing EBADF +_IGNORED_ERRORS = (ENOENT, ENOTDIR, EBADF, ELOOP) + +_IGNORED_WINERRORS = ( + 21, # ERROR_NOT_READY - drive exists but is not accessible + 1921, # ERROR_CANT_RESOLVE_FILENAME - fix for broken symlink pointing to itself +) + + +def _ignore_error(exception: Exception) -> bool: + return ( + getattr(exception, "errno", None) in _IGNORED_ERRORS + or getattr(exception, "winerror", None) in _IGNORED_WINERRORS + ) + + +def get_lock_path(path: _AnyPurePath) -> _AnyPurePath: + return path.joinpath(".lock") + + +def on_rm_rf_error( + func: Callable[..., Any] | None, + path: str, + excinfo: BaseException + | tuple[type[BaseException], BaseException, types.TracebackType | None], + *, + start_path: Path, +) -> bool: + """Handle known read-only errors during rmtree. + + The returned value is used only by our own tests. + """ + if isinstance(excinfo, BaseException): + exc = excinfo + else: + exc = excinfo[1] + + # Another process removed the file in the middle of the "rm_rf" (xdist for example). + # More context: https://github.com/pytest-dev/pytest/issues/5974#issuecomment-543799018 + if isinstance(exc, FileNotFoundError): + return False + + if not isinstance(exc, PermissionError): + warnings.warn( + PytestWarning(f"(rm_rf) error removing {path}\n{type(exc)}: {exc}") + ) + return False + + if func not in (os.rmdir, os.remove, os.unlink): + if func not in (os.open,): + warnings.warn( + PytestWarning( + f"(rm_rf) unknown function {func} when removing {path}:\n{type(exc)}: {exc}" + ) + ) + return False + + # Chmod + retry. + import stat + + def chmod_rw(p: str) -> None: + mode = os.stat(p).st_mode + os.chmod(p, mode | stat.S_IRUSR | stat.S_IWUSR) + + # For files, we need to recursively go upwards in the directories to + # ensure they all are also writable. + p = Path(path) + if p.is_file(): + for parent in p.parents: + chmod_rw(str(parent)) + # Stop when we reach the original path passed to rm_rf. + if parent == start_path: + break + chmod_rw(str(path)) + + func(path) + return True + + +def ensure_extended_length_path(path: Path) -> Path: + """Get the extended-length version of a path (Windows). + + On Windows, by default, the maximum length of a path (MAX_PATH) is 260 + characters, and operations on paths longer than that fail. But it is possible + to overcome this by converting the path to "extended-length" form before + performing the operation: + https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file#maximum-path-length-limitation + + On Windows, this function returns the extended-length absolute version of path. + On other platforms it returns path unchanged. + """ + if sys.platform.startswith("win32"): + path = path.resolve() + path = Path(get_extended_length_path_str(str(path))) + return path + + +def get_extended_length_path_str(path: str) -> str: + """Convert a path to a Windows extended length path.""" + long_path_prefix = "\\\\?\\" + unc_long_path_prefix = "\\\\?\\UNC\\" + if path.startswith((long_path_prefix, unc_long_path_prefix)): + return path + # UNC + if path.startswith("\\\\"): + return unc_long_path_prefix + path[2:] + return long_path_prefix + path + + +def rm_rf(path: Path) -> None: + """Remove the path contents recursively, even if some elements + are read-only.""" + path = ensure_extended_length_path(path) + onerror = partial(on_rm_rf_error, start_path=path) + if sys.version_info >= (3, 12): + shutil.rmtree(str(path), onexc=onerror) + else: + shutil.rmtree(str(path), onerror=onerror) + + +def find_prefixed(root: Path, prefix: str) -> Iterator[os.DirEntry[str]]: + """Find all elements in root that begin with the prefix, case-insensitive.""" + l_prefix = prefix.lower() + for x in os.scandir(root): + if x.name.lower().startswith(l_prefix): + yield x + + +def extract_suffixes(iter: Iterable[os.DirEntry[str]], prefix: str) -> Iterator[str]: + """Return the parts of the paths following the prefix. + + :param iter: Iterator over path names. + :param prefix: Expected prefix of the path names. + """ + p_len = len(prefix) + for entry in iter: + yield entry.name[p_len:] + + +def find_suffixes(root: Path, prefix: str) -> Iterator[str]: + """Combine find_prefixes and extract_suffixes.""" + return extract_suffixes(find_prefixed(root, prefix), prefix) + + +def parse_num(maybe_num: str) -> int: + """Parse number path suffixes, returns -1 on error.""" + try: + return int(maybe_num) + except ValueError: + return -1 + + +def _force_symlink(root: Path, target: str | PurePath, link_to: str | Path) -> None: + """Helper to create the current symlink. + + It's full of race conditions that are reasonably OK to ignore + for the context of best effort linking to the latest test run. + + The presumption being that in case of much parallelism + the inaccuracy is going to be acceptable. + """ + current_symlink = root.joinpath(target) + try: + current_symlink.unlink() + except OSError: + pass + try: + current_symlink.symlink_to(link_to) + except Exception: + pass + + +def make_numbered_dir(root: Path, prefix: str, mode: int = 0o700) -> Path: + """Create a directory with an increased number as suffix for the given prefix.""" + for i in range(10): + # try up to 10 times to create the folder + max_existing = max(map(parse_num, find_suffixes(root, prefix)), default=-1) + new_number = max_existing + 1 + new_path = root.joinpath(f"{prefix}{new_number}") + try: + new_path.mkdir(mode=mode) + except Exception: + pass + else: + _force_symlink(root, prefix + "current", new_path) + return new_path + else: + raise OSError( + "could not create numbered dir with prefix " + f"{prefix} in {root} after 10 tries" + ) + + +def create_cleanup_lock(p: Path) -> Path: + """Create a lock to prevent premature folder cleanup.""" + lock_path = get_lock_path(p) + try: + fd = os.open(str(lock_path), os.O_WRONLY | os.O_CREAT | os.O_EXCL, 0o644) + except FileExistsError as e: + raise OSError(f"cannot create lockfile in {p}") from e + else: + pid = os.getpid() + spid = str(pid).encode() + os.write(fd, spid) + os.close(fd) + if not lock_path.is_file(): + raise OSError("lock path got renamed after successful creation") + return lock_path + + +def register_cleanup_lock_removal( + lock_path: Path, register: Any = atexit.register +) -> Any: + """Register a cleanup function for removing a lock, by default on atexit.""" + pid = os.getpid() + + def cleanup_on_exit(lock_path: Path = lock_path, original_pid: int = pid) -> None: + current_pid = os.getpid() + if current_pid != original_pid: + # fork + return + try: + lock_path.unlink() + except OSError: + pass + + return register(cleanup_on_exit) + + +def maybe_delete_a_numbered_dir(path: Path) -> None: + """Remove a numbered directory if its lock can be obtained and it does + not seem to be in use.""" + path = ensure_extended_length_path(path) + lock_path = None + try: + lock_path = create_cleanup_lock(path) + parent = path.parent + + garbage = parent.joinpath(f"garbage-{uuid.uuid4()}") + path.rename(garbage) + rm_rf(garbage) + except OSError: + # known races: + # * other process did a cleanup at the same time + # * deletable folder was found + # * process cwd (Windows) + return + finally: + # If we created the lock, ensure we remove it even if we failed + # to properly remove the numbered dir. + if lock_path is not None: + try: + lock_path.unlink() + except OSError: + pass + + +def ensure_deletable(path: Path, consider_lock_dead_if_created_before: float) -> bool: + """Check if `path` is deletable based on whether the lock file is expired.""" + if path.is_symlink(): + return False + lock = get_lock_path(path) + try: + if not lock.is_file(): + return True + except OSError: + # we might not have access to the lock file at all, in this case assume + # we don't have access to the entire directory (#7491). + return False + try: + lock_time = lock.stat().st_mtime + except Exception: + return False + else: + if lock_time < consider_lock_dead_if_created_before: + # We want to ignore any errors while trying to remove the lock such as: + # - PermissionDenied, like the file permissions have changed since the lock creation; + # - FileNotFoundError, in case another pytest process got here first; + # and any other cause of failure. + with contextlib.suppress(OSError): + lock.unlink() + return True + return False + + +def try_cleanup(path: Path, consider_lock_dead_if_created_before: float) -> None: + """Try to cleanup a folder if we can ensure it's deletable.""" + if ensure_deletable(path, consider_lock_dead_if_created_before): + maybe_delete_a_numbered_dir(path) + + +def cleanup_candidates(root: Path, prefix: str, keep: int) -> Iterator[Path]: + """List candidates for numbered directories to be removed - follows py.path.""" + max_existing = max(map(parse_num, find_suffixes(root, prefix)), default=-1) + max_delete = max_existing - keep + entries = find_prefixed(root, prefix) + entries, entries2 = itertools.tee(entries) + numbers = map(parse_num, extract_suffixes(entries2, prefix)) + for entry, number in zip(entries, numbers): + if number <= max_delete: + yield Path(entry) + + +def cleanup_dead_symlinks(root: Path) -> None: + for left_dir in root.iterdir(): + if left_dir.is_symlink(): + if not left_dir.resolve().exists(): + left_dir.unlink() + + +def cleanup_numbered_dir( + root: Path, prefix: str, keep: int, consider_lock_dead_if_created_before: float +) -> None: + """Cleanup for lock driven numbered directories.""" + if not root.exists(): + return + for path in cleanup_candidates(root, prefix, keep): + try_cleanup(path, consider_lock_dead_if_created_before) + for path in root.glob("garbage-*"): + try_cleanup(path, consider_lock_dead_if_created_before) + + cleanup_dead_symlinks(root) + + +def make_numbered_dir_with_cleanup( + root: Path, + prefix: str, + keep: int, + lock_timeout: float, + mode: int, +) -> Path: + """Create a numbered dir with a cleanup lock and remove old ones.""" + e = None + for i in range(10): + try: + p = make_numbered_dir(root, prefix, mode) + # Only lock the current dir when keep is not 0 + if keep != 0: + lock_path = create_cleanup_lock(p) + register_cleanup_lock_removal(lock_path) + except Exception as exc: + e = exc + else: + consider_lock_dead_if_created_before = p.stat().st_mtime - lock_timeout + # Register a cleanup for program exit + atexit.register( + cleanup_numbered_dir, + root, + prefix, + keep, + consider_lock_dead_if_created_before, + ) + return p + assert e is not None + raise e + + +def resolve_from_str(input: str, rootpath: Path) -> Path: + input = expanduser(input) + input = expandvars(input) + if isabs(input): + return Path(input) + else: + return rootpath.joinpath(input) + + +def fnmatch_ex(pattern: str, path: str | os.PathLike[str]) -> bool: + """A port of FNMatcher from py.path.common which works with PurePath() instances. + + The difference between this algorithm and PurePath.match() is that the + latter matches "**" glob expressions for each part of the path, while + this algorithm uses the whole path instead. + + For example: + "tests/foo/bar/doc/test_foo.py" matches pattern "tests/**/doc/test*.py" + with this algorithm, but not with PurePath.match(). + + This algorithm was ported to keep backward-compatibility with existing + settings which assume paths match according this logic. + + References: + * https://bugs.python.org/issue29249 + * https://bugs.python.org/issue34731 + """ + path = PurePath(path) + iswin32 = sys.platform.startswith("win") + + if iswin32 and sep not in pattern and posix_sep in pattern: + # Running on Windows, the pattern has no Windows path separators, + # and the pattern has one or more Posix path separators. Replace + # the Posix path separators with the Windows path separator. + pattern = pattern.replace(posix_sep, sep) + + if sep not in pattern: + name = path.name + else: + name = str(path) + if path.is_absolute() and not os.path.isabs(pattern): + pattern = f"*{os.sep}{pattern}" + return fnmatch.fnmatch(name, pattern) + + +def parts(s: str) -> set[str]: + parts = s.split(sep) + return {sep.join(parts[: i + 1]) or sep for i in range(len(parts))} + + +def symlink_or_skip( + src: os.PathLike[str] | str, + dst: os.PathLike[str] | str, + **kwargs: Any, +) -> None: + """Make a symlink, or skip the test in case symlinks are not supported.""" + try: + os.symlink(src, dst, **kwargs) + except OSError as e: + skip(f"symlinks not supported: {e}") + + +class ImportMode(Enum): + """Possible values for `mode` parameter of `import_path`.""" + + prepend = "prepend" + append = "append" + importlib = "importlib" + + +class ImportPathMismatchError(ImportError): + """Raised on import_path() if there is a mismatch of __file__'s. + + This can happen when `import_path` is called multiple times with different filenames that has + the same basename but reside in packages + (for example "/tests1/test_foo.py" and "/tests2/test_foo.py"). + """ + + +def import_path( + path: str | os.PathLike[str], + *, + mode: str | ImportMode = ImportMode.prepend, + root: Path, + consider_namespace_packages: bool, +) -> ModuleType: + """ + Import and return a module from the given path, which can be a file (a module) or + a directory (a package). + + :param path: + Path to the file to import. + + :param mode: + Controls the underlying import mechanism that will be used: + + * ImportMode.prepend: the directory containing the module (or package, taking + `__init__.py` files into account) will be put at the *start* of `sys.path` before + being imported with `importlib.import_module`. + + * ImportMode.append: same as `prepend`, but the directory will be appended + to the end of `sys.path`, if not already in `sys.path`. + + * ImportMode.importlib: uses more fine control mechanisms provided by `importlib` + to import the module, which avoids having to muck with `sys.path` at all. It effectively + allows having same-named test modules in different places. + + :param root: + Used as an anchor when mode == ImportMode.importlib to obtain + a unique name for the module being imported so it can safely be stored + into ``sys.modules``. + + :param consider_namespace_packages: + If True, consider namespace packages when resolving module names. + + :raises ImportPathMismatchError: + If after importing the given `path` and the module `__file__` + are different. Only raised in `prepend` and `append` modes. + """ + path = Path(path) + mode = ImportMode(mode) + + if not path.exists(): + raise ImportError(path) + + if mode is ImportMode.importlib: + # Try to import this module using the standard import mechanisms, but + # without touching sys.path. + try: + pkg_root, module_name = resolve_pkg_root_and_module_name( + path, consider_namespace_packages=consider_namespace_packages + ) + except CouldNotResolvePathError: + pass + else: + # If the given module name is already in sys.modules, do not import it again. + with contextlib.suppress(KeyError): + return sys.modules[module_name] + + mod = _import_module_using_spec( + module_name, path, pkg_root, insert_modules=False + ) + if mod is not None: + return mod + + # Could not import the module with the current sys.path, so we fall back + # to importing the file as a single module, not being a part of a package. + module_name = module_name_from_path(path, root) + with contextlib.suppress(KeyError): + return sys.modules[module_name] + + mod = _import_module_using_spec( + module_name, path, path.parent, insert_modules=True + ) + if mod is None: + raise ImportError(f"Can't find module {module_name} at location {path}") + return mod + + try: + pkg_root, module_name = resolve_pkg_root_and_module_name( + path, consider_namespace_packages=consider_namespace_packages + ) + except CouldNotResolvePathError: + pkg_root, module_name = path.parent, path.stem + + # Change sys.path permanently: restoring it at the end of this function would cause surprising + # problems because of delayed imports: for example, a conftest.py file imported by this function + # might have local imports, which would fail at runtime if we restored sys.path. + if mode is ImportMode.append: + if str(pkg_root) not in sys.path: + sys.path.append(str(pkg_root)) + elif mode is ImportMode.prepend: + if str(pkg_root) != sys.path[0]: + sys.path.insert(0, str(pkg_root)) + else: + assert_never(mode) + + importlib.import_module(module_name) + + mod = sys.modules[module_name] + if path.name == "__init__.py": + return mod + + ignore = os.environ.get("PY_IGNORE_IMPORTMISMATCH", "") + if ignore != "1": + module_file = mod.__file__ + if module_file is None: + raise ImportPathMismatchError(module_name, module_file, path) + + if module_file.endswith((".pyc", ".pyo")): + module_file = module_file[:-1] + if module_file.endswith(os.sep + "__init__.py"): + module_file = module_file[: -(len(os.sep + "__init__.py"))] + + try: + is_same = _is_same(str(path), module_file) + except FileNotFoundError: + is_same = False + + if not is_same: + raise ImportPathMismatchError(module_name, module_file, path) + + return mod + + +def _import_module_using_spec( + module_name: str, module_path: Path, module_location: Path, *, insert_modules: bool +) -> ModuleType | None: + """ + Tries to import a module by its canonical name, path to the .py file, and its + parent location. + + :param insert_modules: + If True, will call insert_missing_modules to create empty intermediate modules + for made-up module names (when importing test files not reachable from sys.path). + """ + # Checking with sys.meta_path first in case one of its hooks can import this module, + # such as our own assertion-rewrite hook. + for meta_importer in sys.meta_path: + spec = meta_importer.find_spec( + module_name, [str(module_location), str(module_path)] + ) + if spec_matches_module_path(spec, module_path): + break + else: + spec = importlib.util.spec_from_file_location(module_name, str(module_path)) + + if spec_matches_module_path(spec, module_path): + assert spec is not None + # Attempt to import the parent module, seems is our responsibility: + # https://github.com/python/cpython/blob/73906d5c908c1e0b73c5436faeff7d93698fc074/Lib/importlib/_bootstrap.py#L1308-L1311 + parent_module_name, _, name = module_name.rpartition(".") + parent_module: ModuleType | None = None + if parent_module_name: + parent_module = sys.modules.get(parent_module_name) + if parent_module is None: + # Find the directory of this module's parent. + parent_dir = ( + module_path.parent.parent + if module_path.name == "__init__.py" + else module_path.parent + ) + # Consider the parent module path as its __init__.py file, if it has one. + parent_module_path = ( + parent_dir / "__init__.py" + if (parent_dir / "__init__.py").is_file() + else parent_dir + ) + parent_module = _import_module_using_spec( + parent_module_name, + parent_module_path, + parent_dir, + insert_modules=insert_modules, + ) + + # Find spec and import this module. + mod = importlib.util.module_from_spec(spec) + sys.modules[module_name] = mod + spec.loader.exec_module(mod) # type: ignore[union-attr] + + # Set this module as an attribute of the parent module (#12194). + if parent_module is not None: + setattr(parent_module, name, mod) + + if insert_modules: + insert_missing_modules(sys.modules, module_name) + return mod + + return None + + +def spec_matches_module_path(module_spec: ModuleSpec | None, module_path: Path) -> bool: + """Return true if the given ModuleSpec can be used to import the given module path.""" + if module_spec is None or module_spec.origin is None: + return False + + return Path(module_spec.origin) == module_path + + +# Implement a special _is_same function on Windows which returns True if the two filenames +# compare equal, to circumvent os.path.samefile returning False for mounts in UNC (#7678). +if sys.platform.startswith("win"): + + def _is_same(f1: str, f2: str) -> bool: + return Path(f1) == Path(f2) or os.path.samefile(f1, f2) + +else: + + def _is_same(f1: str, f2: str) -> bool: + return os.path.samefile(f1, f2) + + +def module_name_from_path(path: Path, root: Path) -> str: + """ + Return a dotted module name based on the given path, anchored on root. + + For example: path="projects/src/tests/test_foo.py" and root="/projects", the + resulting module name will be "src.tests.test_foo". + """ + path = path.with_suffix("") + try: + relative_path = path.relative_to(root) + except ValueError: + # If we can't get a relative path to root, use the full path, except + # for the first part ("d:\\" or "/" depending on the platform, for example). + path_parts = path.parts[1:] + else: + # Use the parts for the relative path to the root path. + path_parts = relative_path.parts + + # Module name for packages do not contain the __init__ file, unless + # the `__init__.py` file is at the root. + if len(path_parts) >= 2 and path_parts[-1] == "__init__": + path_parts = path_parts[:-1] + + # Module names cannot contain ".", normalize them to "_". This prevents + # a directory having a "." in the name (".env.310" for example) causing extra intermediate modules. + # Also, important to replace "." at the start of paths, as those are considered relative imports. + path_parts = tuple(x.replace(".", "_") for x in path_parts) + + return ".".join(path_parts) + + +def insert_missing_modules(modules: dict[str, ModuleType], module_name: str) -> None: + """ + Used by ``import_path`` to create intermediate modules when using mode=importlib. + + When we want to import a module as "src.tests.test_foo" for example, we need + to create empty modules "src" and "src.tests" after inserting "src.tests.test_foo", + otherwise "src.tests.test_foo" is not importable by ``__import__``. + """ + module_parts = module_name.split(".") + while module_name: + parent_module_name, _, child_name = module_name.rpartition(".") + if parent_module_name: + parent_module = modules.get(parent_module_name) + if parent_module is None: + try: + # If sys.meta_path is empty, calling import_module will issue + # a warning and raise ModuleNotFoundError. To avoid the + # warning, we check sys.meta_path explicitly and raise the error + # ourselves to fall back to creating a dummy module. + if not sys.meta_path: + raise ModuleNotFoundError + parent_module = importlib.import_module(parent_module_name) + except ModuleNotFoundError: + parent_module = ModuleType( + module_name, + doc="Empty module created by pytest's importmode=importlib.", + ) + modules[parent_module_name] = parent_module + + # Add child attribute to the parent that can reference the child + # modules. + if not hasattr(parent_module, child_name): + setattr(parent_module, child_name, modules[module_name]) + + module_parts.pop(-1) + module_name = ".".join(module_parts) + + +def resolve_package_path(path: Path) -> Path | None: + """Return the Python package path by looking for the last + directory upwards which still contains an __init__.py. + + Returns None if it cannot be determined. + """ + result = None + for parent in itertools.chain((path,), path.parents): + if parent.is_dir(): + if not (parent / "__init__.py").is_file(): + break + if not parent.name.isidentifier(): + break + result = parent + return result + + +def resolve_pkg_root_and_module_name( + path: Path, *, consider_namespace_packages: bool = False +) -> tuple[Path, str]: + """ + Return the path to the directory of the root package that contains the + given Python file, and its module name: + + src/ + app/ + __init__.py + core/ + __init__.py + models.py + + Passing the full path to `models.py` will yield Path("src") and "app.core.models". + + If consider_namespace_packages is True, then we additionally check upwards in the hierarchy + for namespace packages: + + https://packaging.python.org/en/latest/guides/packaging-namespace-packages + + Raises CouldNotResolvePathError if the given path does not belong to a package (missing any __init__.py files). + """ + pkg_root: Path | None = None + pkg_path = resolve_package_path(path) + if pkg_path is not None: + pkg_root = pkg_path.parent + if consider_namespace_packages: + start = pkg_root if pkg_root is not None else path.parent + for candidate in (start, *start.parents): + module_name = compute_module_name(candidate, path) + if module_name and is_importable(module_name, path): + # Point the pkg_root to the root of the namespace package. + pkg_root = candidate + break + + if pkg_root is not None: + module_name = compute_module_name(pkg_root, path) + if module_name: + return pkg_root, module_name + + raise CouldNotResolvePathError(f"Could not resolve for {path}") + + +def is_importable(module_name: str, module_path: Path) -> bool: + """ + Return if the given module path could be imported normally by Python, akin to the user + entering the REPL and importing the corresponding module name directly, and corresponds + to the module_path specified. + + :param module_name: + Full module name that we want to check if is importable. + For example, "app.models". + + :param module_path: + Full path to the python module/package we want to check if is importable. + For example, "/projects/src/app/models.py". + """ + try: + # Note this is different from what we do in ``_import_module_using_spec``, where we explicitly search through + # sys.meta_path to be able to pass the path of the module that we want to import (``meta_importer.find_spec``). + # Using importlib.util.find_spec() is different, it gives the same results as trying to import + # the module normally in the REPL. + spec = importlib.util.find_spec(module_name) + except (ImportError, ValueError, ImportWarning): + return False + else: + return spec_matches_module_path(spec, module_path) + + +def compute_module_name(root: Path, module_path: Path) -> str | None: + """Compute a module name based on a path and a root anchor.""" + try: + path_without_suffix = module_path.with_suffix("") + except ValueError: + # Empty paths (such as Path.cwd()) might break meta_path hooks (like our own assertion rewriter). + return None + + try: + relative = path_without_suffix.relative_to(root) + except ValueError: # pragma: no cover + return None + names = list(relative.parts) + if not names: + return None + if names[-1] == "__init__": + names.pop() + return ".".join(names) + + +class CouldNotResolvePathError(Exception): + """Custom exception raised by resolve_pkg_root_and_module_name.""" + + +def scandir( + path: str | os.PathLike[str], + sort_key: Callable[[os.DirEntry[str]], object] = lambda entry: entry.name, +) -> list[os.DirEntry[str]]: + """Scan a directory recursively, in breadth-first order. + + The returned entries are sorted according to the given key. + The default is to sort by name. + """ + entries = [] + with os.scandir(path) as s: + # Skip entries with symlink loops and other brokenness, so the caller + # doesn't have to deal with it. + for entry in s: + try: + entry.is_file() + except OSError as err: + if _ignore_error(err): + continue + raise + entries.append(entry) + entries.sort(key=sort_key) # type: ignore[arg-type] + return entries + + +def visit( + path: str | os.PathLike[str], recurse: Callable[[os.DirEntry[str]], bool] +) -> Iterator[os.DirEntry[str]]: + """Walk a directory recursively, in breadth-first order. + + The `recurse` predicate determines whether a directory is recursed. + + Entries at each directory level are sorted. + """ + entries = scandir(path) + yield from entries + for entry in entries: + if entry.is_dir() and recurse(entry): + yield from visit(entry.path, recurse) + + +def absolutepath(path: str | os.PathLike[str]) -> Path: + """Convert a path to an absolute path using os.path.abspath. + + Prefer this over Path.resolve() (see #6523). + Prefer this over Path.absolute() (not public, doesn't normalize). + """ + return Path(os.path.abspath(path)) + + +def commonpath(path1: Path, path2: Path) -> Path | None: + """Return the common part shared with the other path, or None if there is + no common part. + + If one path is relative and one is absolute, returns None. + """ + try: + return Path(os.path.commonpath((str(path1), str(path2)))) + except ValueError: + return None + + +def bestrelpath(directory: Path, dest: Path) -> str: + """Return a string which is a relative path from directory to dest such + that directory/bestrelpath == dest. + + The paths must be either both absolute or both relative. + + If no such path can be determined, returns dest. + """ + assert isinstance(directory, Path) + assert isinstance(dest, Path) + if dest == directory: + return os.curdir + # Find the longest common directory. + base = commonpath(directory, dest) + # Can be the case on Windows for two absolute paths on different drives. + # Can be the case for two relative paths without common prefix. + # Can be the case for a relative path and an absolute path. + if not base: + return str(dest) + reldirectory = directory.relative_to(base) + reldest = dest.relative_to(base) + return os.path.join( + # Back from directory to base. + *([os.pardir] * len(reldirectory.parts)), + # Forward from base to dest. + *reldest.parts, + ) + + +def safe_exists(p: Path) -> bool: + """Like Path.exists(), but account for input arguments that might be too long (#11394).""" + try: + return p.exists() + except (ValueError, OSError): + # ValueError: stat: path too long for Windows + # OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect + return False diff --git a/.venv/Lib/site-packages/_pytest/py.typed b/.venv/Lib/site-packages/_pytest/py.typed new file mode 100644 index 00000000..e69de29b diff --git a/.venv/Lib/site-packages/_pytest/pytester.py b/.venv/Lib/site-packages/_pytest/pytester.py new file mode 100644 index 00000000..3f7520ee --- /dev/null +++ b/.venv/Lib/site-packages/_pytest/pytester.py @@ -0,0 +1,1766 @@ +# mypy: allow-untyped-defs +"""(Disabled by default) support for testing pytest and pytest plugins. + +PYTEST_DONT_REWRITE +""" + +from __future__ import annotations + +import collections.abc +import contextlib +from fnmatch import fnmatch +import gc +import importlib +from io import StringIO +import locale +import os +from pathlib import Path +import platform +import re +import shutil +import subprocess +import sys +import traceback +from typing import Any +from typing import Callable +from typing import Final +from typing import final +from typing import Generator +from typing import IO +from typing import Iterable +from typing import Literal +from typing import overload +from typing import Sequence +from typing import TextIO +from typing import TYPE_CHECKING +from weakref import WeakKeyDictionary + +from iniconfig import IniConfig +from iniconfig import SectionWrapper + +from _pytest import timing +from _pytest._code import Source +from _pytest.capture import _get_multicapture +from _pytest.compat import NOTSET +from _pytest.compat import NotSetType +from _pytest.config import _PluggyPlugin +from _pytest.config import Config +from _pytest.config import ExitCode +from _pytest.config import hookimpl +from _pytest.config import main +from _pytest.config import PytestPluginManager +from _pytest.config.argparsing import Parser +from _pytest.deprecated import check_ispytest +from _pytest.fixtures import fixture +from _pytest.fixtures import FixtureRequest +from _pytest.main import Session +from _pytest.monkeypatch import MonkeyPatch +from _pytest.nodes import Collector +from _pytest.nodes import Item +from _pytest.outcomes import fail +from _pytest.outcomes import importorskip +from _pytest.outcomes import skip +from _pytest.pathlib import bestrelpath +from _pytest.pathlib import make_numbered_dir +from _pytest.reports import CollectReport +from _pytest.reports import TestReport +from _pytest.tmpdir import TempPathFactory +from _pytest.warning_types import PytestWarning + + +if TYPE_CHECKING: + import pexpect + + +pytest_plugins = ["pytester_assertions"] + + +IGNORE_PAM = [ # filenames added when obtaining details about the current user + "/var/lib/sss/mc/passwd" +] + + +def pytest_addoption(parser: Parser) -> None: + parser.addoption( + "--lsof", + action="store_true", + dest="lsof", + default=False, + help="Run FD checks if lsof is available", + ) + + parser.addoption( + "--runpytest", + default="inprocess", + dest="runpytest", + choices=("inprocess", "subprocess"), + help=( + "Run pytest sub runs in tests using an 'inprocess' " + "or 'subprocess' (python -m main) method" + ), + ) + + parser.addini( + "pytester_example_dir", help="Directory to take the pytester example files from" + ) + + +def pytest_configure(config: Config) -> None: + if config.getvalue("lsof"): + checker = LsofFdLeakChecker() + if checker.matching_platform(): + config.pluginmanager.register(checker) + + config.addinivalue_line( + "markers", + "pytester_example_path(*path_segments): join the given path " + "segments to `pytester_example_dir` for this test.", + ) + + +class LsofFdLeakChecker: + def get_open_files(self) -> list[tuple[str, str]]: + if sys.version_info >= (3, 11): + # New in Python 3.11, ignores utf-8 mode + encoding = locale.getencoding() + else: + encoding = locale.getpreferredencoding(False) + out = subprocess.run( + ("lsof", "-Ffn0", "-p", str(os.getpid())), + stdout=subprocess.PIPE, + stderr=subprocess.DEVNULL, + check=True, + text=True, + encoding=encoding, + ).stdout + + def isopen(line: str) -> bool: + return line.startswith("f") and ( + "deleted" not in line + and "mem" not in line + and "txt" not in line + and "cwd" not in line + ) + + open_files = [] + + for line in out.split("\n"): + if isopen(line): + fields = line.split("\0") + fd = fields[0][1:] + filename = fields[1][1:] + if filename in IGNORE_PAM: + continue + if filename.startswith("/"): + open_files.append((fd, filename)) + + return open_files + + def matching_platform(self) -> bool: + try: + subprocess.run(("lsof", "-v"), check=True) + except (OSError, subprocess.CalledProcessError): + return False + else: + return True + + @hookimpl(wrapper=True, tryfirst=True) + def pytest_runtest_protocol(self, item: Item) -> Generator[None, object, object]: + lines1 = self.get_open_files() + try: + return (yield) + finally: + if hasattr(sys, "pypy_version_info"): + gc.collect() + lines2 = self.get_open_files() + + new_fds = {t[0] for t in lines2} - {t[0] for t in lines1} + leaked_files = [t for t in lines2 if t[0] in new_fds] + if leaked_files: + error = [ + f"***** {len(leaked_files)} FD leakage detected", + *(str(f) for f in leaked_files), + "*** Before:", + *(str(f) for f in lines1), + "*** After:", + *(str(f) for f in lines2), + f"***** {len(leaked_files)} FD leakage detected", + "*** function {}:{}: {} ".format(*item.location), + "See issue #2366", + ] + item.warn(PytestWarning("\n".join(error))) + + +# used at least by pytest-xdist plugin + + +@fixture +def _pytest(request: FixtureRequest) -> PytestArg: + """Return a helper which offers a gethookrecorder(hook) method which + returns a HookRecorder instance which helps to make assertions about called + hooks.""" + return PytestArg(request) + + +class PytestArg: + def __init__(self, request: FixtureRequest) -> None: + self._request = request + + def gethookrecorder(self, hook) -> HookRecorder: + hookrecorder = HookRecorder(hook._pm) + self._request.addfinalizer(hookrecorder.finish_recording) + return hookrecorder + + +def get_public_names(values: Iterable[str]) -> list[str]: + """Only return names from iterator values without a leading underscore.""" + return [x for x in values if x[0] != "_"] + + +@final +class RecordedHookCall: + """A recorded call to a hook. + + The arguments to the hook call are set as attributes. + For example: + + .. code-block:: python + + calls = hook_recorder.getcalls("pytest_runtest_setup") + # Suppose pytest_runtest_setup was called once with `item=an_item`. + assert calls[0].item is an_item + """ + + def __init__(self, name: str, kwargs) -> None: + self.__dict__.update(kwargs) + self._name = name + + def __repr__(self) -> str: + d = self.__dict__.copy() + del d["_name"] + return f"" + + if TYPE_CHECKING: + # The class has undetermined attributes, this tells mypy about it. + def __getattr__(self, key: str): ... + + +@final +class HookRecorder: + """Record all hooks called in a plugin manager. + + Hook recorders are created by :class:`Pytester`. + + This wraps all the hook calls in the plugin manager, recording each call + before propagating the normal calls. + """ + + def __init__( + self, pluginmanager: PytestPluginManager, *, _ispytest: bool = False + ) -> None: + check_ispytest(_ispytest) + + self._pluginmanager = pluginmanager + self.calls: list[RecordedHookCall] = [] + self.ret: int | ExitCode | None = None + + def before(hook_name: str, hook_impls, kwargs) -> None: + self.calls.append(RecordedHookCall(hook_name, kwargs)) + + def after(outcome, hook_name: str, hook_impls, kwargs) -> None: + pass + + self._undo_wrapping = pluginmanager.add_hookcall_monitoring(before, after) + + def finish_recording(self) -> None: + self._undo_wrapping() + + def getcalls(self, names: str | Iterable[str]) -> list[RecordedHookCall]: + """Get all recorded calls to hooks with the given names (or name).""" + if isinstance(names, str): + names = names.split() + return [call for call in self.calls if call._name in names] + + def assert_contains(self, entries: Sequence[tuple[str, str]]) -> None: + __tracebackhide__ = True + i = 0 + entries = list(entries) + # Since Python 3.13, f_locals is not a dict, but eval requires a dict. + backlocals = dict(sys._getframe(1).f_locals) + while entries: + name, check = entries.pop(0) + for ind, call in enumerate(self.calls[i:]): + if call._name == name: + print("NAMEMATCH", name, call) + if eval(check, backlocals, call.__dict__): + print("CHECKERMATCH", repr(check), "->", call) + else: + print("NOCHECKERMATCH", repr(check), "-", call) + continue + i += ind + 1 + break + print("NONAMEMATCH", name, "with", call) + else: + fail(f"could not find {name!r} check {check!r}") + + def popcall(self, name: str) -> RecordedHookCall: + __tracebackhide__ = True + for i, call in enumerate(self.calls): + if call._name == name: + del self.calls[i] + return call + lines = [f"could not find call {name!r}, in:"] + lines.extend([f" {x}" for x in self.calls]) + fail("\n".join(lines)) + + def getcall(self, name: str) -> RecordedHookCall: + values = self.getcalls(name) + assert len(values) == 1, (name, values) + return values[0] + + # functionality for test reports + + @overload + def getreports( + self, + names: Literal["pytest_collectreport"], + ) -> Sequence[CollectReport]: ... + + @overload + def getreports( + self, + names: Literal["pytest_runtest_logreport"], + ) -> Sequence[TestReport]: ... + + @overload + def getreports( + self, + names: str | Iterable[str] = ( + "pytest_collectreport", + "pytest_runtest_logreport", + ), + ) -> Sequence[CollectReport | TestReport]: ... + + def getreports( + self, + names: str | Iterable[str] = ( + "pytest_collectreport", + "pytest_runtest_logreport", + ), + ) -> Sequence[CollectReport | TestReport]: + return [x.report for x in self.getcalls(names)] + + def matchreport( + self, + inamepart: str = "", + names: str | Iterable[str] = ( + "pytest_runtest_logreport", + "pytest_collectreport", + ), + when: str | None = None, + ) -> CollectReport | TestReport: + """Return a testreport whose dotted import path matches.""" + values = [] + for rep in self.getreports(names=names): + if not when and rep.when != "call" and rep.passed: + # setup/teardown passing reports - let's ignore those + continue + if when and rep.when != when: + continue + if not inamepart or inamepart in rep.nodeid.split("::"): + values.append(rep) + if not values: + raise ValueError( + f"could not find test report matching {inamepart!r}: " + "no test reports at all!" + ) + if len(values) > 1: + raise ValueError( + f"found 2 or more testreports matching {inamepart!r}: {values}" + ) + return values[0] + + @overload + def getfailures( + self, + names: Literal["pytest_collectreport"], + ) -> Sequence[CollectReport]: ... + + @overload + def getfailures( + self, + names: Literal["pytest_runtest_logreport"], + ) -> Sequence[TestReport]: ... + + @overload + def getfailures( + self, + names: str | Iterable[str] = ( + "pytest_collectreport", + "pytest_runtest_logreport", + ), + ) -> Sequence[CollectReport | TestReport]: ... + + def getfailures( + self, + names: str | Iterable[str] = ( + "pytest_collectreport", + "pytest_runtest_logreport", + ), + ) -> Sequence[CollectReport | TestReport]: + return [rep for rep in self.getreports(names) if rep.failed] + + def getfailedcollections(self) -> Sequence[CollectReport]: + return self.getfailures("pytest_collectreport") + + def listoutcomes( + self, + ) -> tuple[ + Sequence[TestReport], + Sequence[CollectReport | TestReport], + Sequence[CollectReport | TestReport], + ]: + passed = [] + skipped = [] + failed = [] + for rep in self.getreports( + ("pytest_collectreport", "pytest_runtest_logreport") + ): + if rep.passed: + if rep.when == "call": + assert isinstance(rep, TestReport) + passed.append(rep) + elif rep.skipped: + skipped.append(rep) + else: + assert rep.failed, f"Unexpected outcome: {rep!r}" + failed.append(rep) + return passed, skipped, failed + + def countoutcomes(self) -> list[int]: + return [len(x) for x in self.listoutcomes()] + + def assertoutcome(self, passed: int = 0, skipped: int = 0, failed: int = 0) -> None: + __tracebackhide__ = True + from _pytest.pytester_assertions import assertoutcome + + outcomes = self.listoutcomes() + assertoutcome( + outcomes, + passed=passed, + skipped=skipped, + failed=failed, + ) + + def clear(self) -> None: + self.calls[:] = [] + + +@fixture +def linecomp() -> LineComp: + """A :class: `LineComp` instance for checking that an input linearly + contains a sequence of strings.""" + return LineComp() + + +@fixture(name="LineMatcher") +def LineMatcher_fixture(request: FixtureRequest) -> type[LineMatcher]: + """A reference to the :class: `LineMatcher`. + + This is instantiable with a list of lines (without their trailing newlines). + This is useful for testing large texts, such as the output of commands. + """ + return LineMatcher + + +@fixture +def pytester( + request: FixtureRequest, tmp_path_factory: TempPathFactory, monkeypatch: MonkeyPatch +) -> Pytester: + """ + Facilities to write tests/configuration files, execute pytest in isolation, and match + against expected output, perfect for black-box testing of pytest plugins. + + It attempts to isolate the test run from external factors as much as possible, modifying + the current working directory to ``path`` and environment variables during initialization. + + It is particularly useful for testing plugins. It is similar to the :fixture:`tmp_path` + fixture but provides methods which aid in testing pytest itself. + """ + return Pytester(request, tmp_path_factory, monkeypatch, _ispytest=True) + + +@fixture +def _sys_snapshot() -> Generator[None]: + snappaths = SysPathsSnapshot() + snapmods = SysModulesSnapshot() + yield + snapmods.restore() + snappaths.restore() + + +@fixture +def _config_for_test() -> Generator[Config]: + from _pytest.config import get_config + + config = get_config() + yield config + config._ensure_unconfigure() # cleanup, e.g. capman closing tmpfiles. + + +# Regex to match the session duration string in the summary: "74.34s". +rex_session_duration = re.compile(r"\d+\.\d\ds") +# Regex to match all the counts and phrases in the summary line: "34 passed, 111 skipped". +rex_outcome = re.compile(r"(\d+) (\w+)") + + +@final +class RunResult: + """The result of running a command from :class:`~pytest.Pytester`.""" + + def __init__( + self, + ret: int | ExitCode, + outlines: list[str], + errlines: list[str], + duration: float, + ) -> None: + try: + self.ret: int | ExitCode = ExitCode(ret) + """The return value.""" + except ValueError: + self.ret = ret + self.outlines = outlines + """List of lines captured from stdout.""" + self.errlines = errlines + """List of lines captured from stderr.""" + self.stdout = LineMatcher(outlines) + """:class:`~pytest.LineMatcher` of stdout. + + Use e.g. :func:`str(stdout) ` to reconstruct stdout, or the commonly used + :func:`stdout.fnmatch_lines() ` method. + """ + self.stderr = LineMatcher(errlines) + """:class:`~pytest.LineMatcher` of stderr.""" + self.duration = duration + """Duration in seconds.""" + + def __repr__(self) -> str: + return ( + "" + % (self.ret, len(self.stdout.lines), len(self.stderr.lines), self.duration) + ) + + def parseoutcomes(self) -> dict[str, int]: + """Return a dictionary of outcome noun -> count from parsing the terminal + output that the test process produced. + + The returned nouns will always be in plural form:: + + ======= 1 failed, 1 passed, 1 warning, 1 error in 0.13s ==== + + Will return ``{"failed": 1, "passed": 1, "warnings": 1, "errors": 1}``. + """ + return self.parse_summary_nouns(self.outlines) + + @classmethod + def parse_summary_nouns(cls, lines) -> dict[str, int]: + """Extract the nouns from a pytest terminal summary line. + + It always returns the plural noun for consistency:: + + ======= 1 failed, 1 passed, 1 warning, 1 error in 0.13s ==== + + Will return ``{"failed": 1, "passed": 1, "warnings": 1, "errors": 1}``. + """ + for line in reversed(lines): + if rex_session_duration.search(line): + outcomes = rex_outcome.findall(line) + ret = {noun: int(count) for (count, noun) in outcomes} + break + else: + raise ValueError("Pytest terminal summary report not found") + + to_plural = { + "warning": "warnings", + "error": "errors", + } + return {to_plural.get(k, k): v for k, v in ret.items()} + + def assert_outcomes( + self, + passed: int = 0, + skipped: int = 0, + failed: int = 0, + errors: int = 0, + xpassed: int = 0, + xfailed: int = 0, + warnings: int | None = None, + deselected: int | None = None, + ) -> None: + """ + Assert that the specified outcomes appear with the respective + numbers (0 means it didn't occur) in the text output from a test run. + + ``warnings`` and ``deselected`` are only checked if not None. + """ + __tracebackhide__ = True + from _pytest.pytester_assertions import assert_outcomes + + outcomes = self.parseoutcomes() + assert_outcomes( + outcomes, + passed=passed, + skipped=skipped, + failed=failed, + errors=errors, + xpassed=xpassed, + xfailed=xfailed, + warnings=warnings, + deselected=deselected, + ) + + +class SysModulesSnapshot: + def __init__(self, preserve: Callable[[str], bool] | None = None) -> None: + self.__preserve = preserve + self.__saved = dict(sys.modules) + + def restore(self) -> None: + if self.__preserve: + self.__saved.update( + (k, m) for k, m in sys.modules.items() if self.__preserve(k) + ) + sys.modules.clear() + sys.modules.update(self.__saved) + + +class SysPathsSnapshot: + def __init__(self) -> None: + self.__saved = list(sys.path), list(sys.meta_path) + + def restore(self) -> None: + sys.path[:], sys.meta_path[:] = self.__saved + + +@final +class Pytester: + """ + Facilities to write tests/configuration files, execute pytest in isolation, and match + against expected output, perfect for black-box testing of pytest plugins. + + It attempts to isolate the test run from external factors as much as possible, modifying + the current working directory to :attr:`path` and environment variables during initialization. + """ + + __test__ = False + + CLOSE_STDIN: Final = NOTSET + + class TimeoutExpired(Exception): + pass + + def __init__( + self, + request: FixtureRequest, + tmp_path_factory: TempPathFactory, + monkeypatch: MonkeyPatch, + *, + _ispytest: bool = False, + ) -> None: + check_ispytest(_ispytest) + self._request = request + self._mod_collections: WeakKeyDictionary[Collector, list[Item | Collector]] = ( + WeakKeyDictionary() + ) + if request.function: + name: str = request.function.__name__ + else: + name = request.node.name + self._name = name + self._path: Path = tmp_path_factory.mktemp(name, numbered=True) + #: A list of plugins to use with :py:meth:`parseconfig` and + #: :py:meth:`runpytest`. Initially this is an empty list but plugins can + #: be added to the list. The type of items to add to the list depends on + #: the method using them so refer to them for details. + self.plugins: list[str | _PluggyPlugin] = [] + self._sys_path_snapshot = SysPathsSnapshot() + self._sys_modules_snapshot = self.__take_sys_modules_snapshot() + self._request.addfinalizer(self._finalize) + self._method = self._request.config.getoption("--runpytest") + self._test_tmproot = tmp_path_factory.mktemp(f"tmp-{name}", numbered=True) + + self._monkeypatch = mp = monkeypatch + self.chdir() + mp.setenv("PYTEST_DEBUG_TEMPROOT", str(self._test_tmproot)) + # Ensure no unexpected caching via tox. + mp.delenv("TOX_ENV_DIR", raising=False) + # Discard outer pytest options. + mp.delenv("PYTEST_ADDOPTS", raising=False) + # Ensure no user config is used. + tmphome = str(self.path) + mp.setenv("HOME", tmphome) + mp.setenv("USERPROFILE", tmphome) + # Do not use colors for inner runs by default. + mp.setenv("PY_COLORS", "0") + + @property + def path(self) -> Path: + """Temporary directory path used to create files/run tests from, etc.""" + return self._path + + def __repr__(self) -> str: + return f"" + + def _finalize(self) -> None: + """ + Clean up global state artifacts. + + Some methods modify the global interpreter state and this tries to + clean this up. It does not remove the temporary directory however so + it can be looked at after the test run has finished. + """ + self._sys_modules_snapshot.restore() + self._sys_path_snapshot.restore() + + def __take_sys_modules_snapshot(self) -> SysModulesSnapshot: + # Some zope modules used by twisted-related tests keep internal state + # and can't be deleted; we had some trouble in the past with + # `zope.interface` for example. + # + # Preserve readline due to https://bugs.python.org/issue41033. + # pexpect issues a SIGWINCH. + def preserve_module(name): + return name.startswith(("zope", "readline")) + + return SysModulesSnapshot(preserve=preserve_module) + + def make_hook_recorder(self, pluginmanager: PytestPluginManager) -> HookRecorder: + """Create a new :class:`HookRecorder` for a :class:`PytestPluginManager`.""" + pluginmanager.reprec = reprec = HookRecorder(pluginmanager, _ispytest=True) # type: ignore[attr-defined] + self._request.addfinalizer(reprec.finish_recording) + return reprec + + def chdir(self) -> None: + """Cd into the temporary directory. + + This is done automatically upon instantiation. + """ + self._monkeypatch.chdir(self.path) + + def _makefile( + self, + ext: str, + lines: Sequence[Any | bytes], + files: dict[str, str], + encoding: str = "utf-8", + ) -> Path: + items = list(files.items()) + + if ext is None: + raise TypeError("ext must not be None") + + if ext and not ext.startswith("."): + raise ValueError( + f"pytester.makefile expects a file extension, try .{ext} instead of {ext}" + ) + + def to_text(s: Any | bytes) -> str: + return s.decode(encoding) if isinstance(s, bytes) else str(s) + + if lines: + source = "\n".join(to_text(x) for x in lines) + basename = self._name + items.insert(0, (basename, source)) + + ret = None + for basename, value in items: + p = self.path.joinpath(basename).with_suffix(ext) + p.parent.mkdir(parents=True, exist_ok=True) + source_ = Source(value) + source = "\n".join(to_text(line) for line in source_.lines) + p.write_text(source.strip(), encoding=encoding) + if ret is None: + ret = p + assert ret is not None + return ret + + def makefile(self, ext: str, *args: str, **kwargs: str) -> Path: + r"""Create new text file(s) in the test directory. + + :param ext: + The extension the file(s) should use, including the dot, e.g. `.py`. + :param args: + All args are treated as strings and joined using newlines. + The result is written as contents to the file. The name of the + file is based on the test function requesting this fixture. + :param kwargs: + Each keyword is the name of a file, while the value of it will + be written as contents of the file. + :returns: + The first created file. + + Examples: + + .. code-block:: python + + pytester.makefile(".txt", "line1", "line2") + + pytester.makefile(".ini", pytest="[pytest]\naddopts=-rs\n") + + To create binary files, use :meth:`pathlib.Path.write_bytes` directly: + + .. code-block:: python + + filename = pytester.path.joinpath("foo.bin") + filename.write_bytes(b"...") + """ + return self._makefile(ext, args, kwargs) + + def makeconftest(self, source: str) -> Path: + """Write a conftest.py file. + + :param source: The contents. + :returns: The conftest.py file. + """ + return self.makepyfile(conftest=source) + + def makeini(self, source: str) -> Path: + """Write a tox.ini file. + + :param source: The contents. + :returns: The tox.ini file. + """ + return self.makefile(".ini", tox=source) + + def getinicfg(self, source: str) -> SectionWrapper: + """Return the pytest section from the tox.ini config file.""" + p = self.makeini(source) + return IniConfig(str(p))["pytest"] + + def makepyprojecttoml(self, source: str) -> Path: + """Write a pyproject.toml file. + + :param source: The contents. + :returns: The pyproject.ini file. + + .. versionadded:: 6.0 + """ + return self.makefile(".toml", pyproject=source) + + def makepyfile(self, *args, **kwargs) -> Path: + r"""Shortcut for .makefile() with a .py extension. + + Defaults to the test name with a '.py' extension, e.g test_foobar.py, overwriting + existing files. + + Examples: + + .. code-block:: python + + def test_something(pytester): + # Initial file is created test_something.py. + pytester.makepyfile("foobar") + # To create multiple files, pass kwargs accordingly. + pytester.makepyfile(custom="foobar") + # At this point, both 'test_something.py' & 'custom.py' exist in the test directory. + + """ + return self._makefile(".py", args, kwargs) + + def maketxtfile(self, *args, **kwargs) -> Path: + r"""Shortcut for .makefile() with a .txt extension. + + Defaults to the test name with a '.txt' extension, e.g test_foobar.txt, overwriting + existing files. + + Examples: + + .. code-block:: python + + def test_something(pytester): + # Initial file is created test_something.txt. + pytester.maketxtfile("foobar") + # To create multiple files, pass kwargs accordingly. + pytester.maketxtfile(custom="foobar") + # At this point, both 'test_something.txt' & 'custom.txt' exist in the test directory. + + """ + return self._makefile(".txt", args, kwargs) + + def syspathinsert(self, path: str | os.PathLike[str] | None = None) -> None: + """Prepend a directory to sys.path, defaults to :attr:`path`. + + This is undone automatically when this object dies at the end of each + test. + + :param path: + The path. + """ + if path is None: + path = self.path + + self._monkeypatch.syspath_prepend(str(path)) + + def mkdir(self, name: str | os.PathLike[str]) -> Path: + """Create a new (sub)directory. + + :param name: + The name of the directory, relative to the pytester path. + :returns: + The created directory. + :rtype: pathlib.Path + """ + p = self.path / name + p.mkdir() + return p + + def mkpydir(self, name: str | os.PathLike[str]) -> Path: + """Create a new python package. + + This creates a (sub)directory with an empty ``__init__.py`` file so it + gets recognised as a Python package. + """ + p = self.path / name + p.mkdir() + p.joinpath("__init__.py").touch() + return p + + def copy_example(self, name: str | None = None) -> Path: + """Copy file from project's directory into the testdir. + + :param name: + The name of the file to copy. + :return: + Path to the copied directory (inside ``self.path``). + :rtype: pathlib.Path + """ + example_dir_ = self._request.config.getini("pytester_example_dir") + if example_dir_ is None: + raise ValueError("pytester_example_dir is unset, can't copy examples") + example_dir: Path = self._request.config.rootpath / example_dir_ + + for extra_element in self._request.node.iter_markers("pytester_example_path"): + assert extra_element.args + example_dir = example_dir.joinpath(*extra_element.args) + + if name is None: + func_name = self._name + maybe_dir = example_dir / func_name + maybe_file = example_dir / (func_name + ".py") + + if maybe_dir.is_dir(): + example_path = maybe_dir + elif maybe_file.is_file(): + example_path = maybe_file + else: + raise LookupError( + f"{func_name} can't be found as module or package in {example_dir}" + ) + else: + example_path = example_dir.joinpath(name) + + if example_path.is_dir() and not example_path.joinpath("__init__.py").is_file(): + shutil.copytree(example_path, self.path, symlinks=True, dirs_exist_ok=True) + return self.path + elif example_path.is_file(): + result = self.path.joinpath(example_path.name) + shutil.copy(example_path, result) + return result + else: + raise LookupError( + f'example "{example_path}" is not found as a file or directory' + ) + + def getnode(self, config: Config, arg: str | os.PathLike[str]) -> Collector | Item: + """Get the collection node of a file. + + :param config: + A pytest config. + See :py:meth:`parseconfig` and :py:meth:`parseconfigure` for creating it. + :param arg: + Path to the file. + :returns: + The node. + """ + session = Session.from_config(config) + assert "::" not in str(arg) + p = Path(os.path.abspath(arg)) + config.hook.pytest_sessionstart(session=session) + res = session.perform_collect([str(p)], genitems=False)[0] + config.hook.pytest_sessionfinish(session=session, exitstatus=ExitCode.OK) + return res + + def getpathnode(self, path: str | os.PathLike[str]) -> Collector | Item: + """Return the collection node of a file. + + This is like :py:meth:`getnode` but uses :py:meth:`parseconfigure` to + create the (configured) pytest Config instance. + + :param path: + Path to the file. + :returns: + The node. + """ + path = Path(path) + config = self.parseconfigure(path) + session = Session.from_config(config) + x = bestrelpath(session.path, path) + config.hook.pytest_sessionstart(session=session) + res = session.perform_collect([x], genitems=False)[0] + config.hook.pytest_sessionfinish(session=session, exitstatus=ExitCode.OK) + return res + + def genitems(self, colitems: Sequence[Item | Collector]) -> list[Item]: + """Generate all test items from a collection node. + + This recurses into the collection node and returns a list of all the + test items contained within. + + :param colitems: + The collection nodes. + :returns: + The collected items. + """ + session = colitems[0].session + result: list[Item] = [] + for colitem in colitems: + result.extend(session.genitems(colitem)) + return result + + def runitem(self, source: str) -> Any: + """Run the "test_func" Item. + + The calling test instance (class containing the test method) must + provide a ``.getrunner()`` method which should return a runner which + can run the test protocol for a single item, e.g. + ``_pytest.runner.runtestprotocol``. + """ + # used from runner functional tests + item = self.getitem(source) + # the test class where we are called from wants to provide the runner + testclassinstance = self._request.instance + runner = testclassinstance.getrunner() + return runner(item) + + def inline_runsource(self, source: str, *cmdlineargs) -> HookRecorder: + """Run a test module in process using ``pytest.main()``. + + This run writes "source" into a temporary file and runs + ``pytest.main()`` on it, returning a :py:class:`HookRecorder` instance + for the result. + + :param source: The source code of the test module. + :param cmdlineargs: Any extra command line arguments to use. + """ + p = self.makepyfile(source) + values = [*list(cmdlineargs), p] + return self.inline_run(*values) + + def inline_genitems(self, *args) -> tuple[list[Item], HookRecorder]: + """Run ``pytest.main(['--collect-only'])`` in-process. + + Runs the :py:func:`pytest.main` function to run all of pytest inside + the test process itself like :py:meth:`inline_run`, but returns a + tuple of the collected items and a :py:class:`HookRecorder` instance. + """ + rec = self.inline_run("--collect-only", *args) + items = [x.item for x in rec.getcalls("pytest_itemcollected")] + return items, rec + + def inline_run( + self, + *args: str | os.PathLike[str], + plugins=(), + no_reraise_ctrlc: bool = False, + ) -> HookRecorder: + """Run ``pytest.main()`` in-process, returning a HookRecorder. + + Runs the :py:func:`pytest.main` function to run all of pytest inside + the test process itself. This means it can return a + :py:class:`HookRecorder` instance which gives more detailed results + from that run than can be done by matching stdout/stderr from + :py:meth:`runpytest`. + + :param args: + Command line arguments to pass to :py:func:`pytest.main`. + :param plugins: + Extra plugin instances the ``pytest.main()`` instance should use. + :param no_reraise_ctrlc: + Typically we reraise keyboard interrupts from the child run. If + True, the KeyboardInterrupt exception is captured. + """ + # (maybe a cpython bug?) the importlib cache sometimes isn't updated + # properly between file creation and inline_run (especially if imports + # are interspersed with file creation) + importlib.invalidate_caches() + + plugins = list(plugins) + finalizers = [] + try: + # Any sys.module or sys.path changes done while running pytest + # inline should be reverted after the test run completes to avoid + # clashing with later inline tests run within the same pytest test, + # e.g. just because they use matching test module names. + finalizers.append(self.__take_sys_modules_snapshot().restore) + finalizers.append(SysPathsSnapshot().restore) + + # Important note: + # - our tests should not leave any other references/registrations + # laying around other than possibly loaded test modules + # referenced from sys.modules, as nothing will clean those up + # automatically + + rec = [] + + class Collect: + def pytest_configure(x, config: Config) -> None: + rec.append(self.make_hook_recorder(config.pluginmanager)) + + plugins.append(Collect()) + ret = main([str(x) for x in args], plugins=plugins) + if len(rec) == 1: + reprec = rec.pop() + else: + + class reprec: # type: ignore + pass + + reprec.ret = ret + + # Typically we reraise keyboard interrupts from the child run + # because it's our user requesting interruption of the testing. + if ret == ExitCode.INTERRUPTED and not no_reraise_ctrlc: + calls = reprec.getcalls("pytest_keyboard_interrupt") + if calls and calls[-1].excinfo.type == KeyboardInterrupt: + raise KeyboardInterrupt() + return reprec + finally: + for finalizer in finalizers: + finalizer() + + def runpytest_inprocess( + self, *args: str | os.PathLike[str], **kwargs: Any + ) -> RunResult: + """Return result of running pytest in-process, providing a similar + interface to what self.runpytest() provides.""" + syspathinsert = kwargs.pop("syspathinsert", False) + + if syspathinsert: + self.syspathinsert() + now = timing.time() + capture = _get_multicapture("sys") + capture.start_capturing() + try: + try: + reprec = self.inline_run(*args, **kwargs) + except SystemExit as e: + ret = e.args[0] + try: + ret = ExitCode(e.args[0]) + except ValueError: + pass + + class reprec: # type: ignore + ret = ret + + except Exception: + traceback.print_exc() + + class reprec: # type: ignore + ret = ExitCode(3) + + finally: + out, err = capture.readouterr() + capture.stop_capturing() + sys.stdout.write(out) + sys.stderr.write(err) + + assert reprec.ret is not None + res = RunResult( + reprec.ret, out.splitlines(), err.splitlines(), timing.time() - now + ) + res.reprec = reprec # type: ignore + return res + + def runpytest(self, *args: str | os.PathLike[str], **kwargs: Any) -> RunResult: + """Run pytest inline or in a subprocess, depending on the command line + option "--runpytest" and return a :py:class:`~pytest.RunResult`.""" + new_args = self._ensure_basetemp(args) + if self._method == "inprocess": + return self.runpytest_inprocess(*new_args, **kwargs) + elif self._method == "subprocess": + return self.runpytest_subprocess(*new_args, **kwargs) + raise RuntimeError(f"Unrecognized runpytest option: {self._method}") + + def _ensure_basetemp( + self, args: Sequence[str | os.PathLike[str]] + ) -> list[str | os.PathLike[str]]: + new_args = list(args) + for x in new_args: + if str(x).startswith("--basetemp"): + break + else: + new_args.append( + "--basetemp={}".format(self.path.parent.joinpath("basetemp")) + ) + return new_args + + def parseconfig(self, *args: str | os.PathLike[str]) -> Config: + """Return a new pytest :class:`pytest.Config` instance from given + commandline args. + + This invokes the pytest bootstrapping code in _pytest.config to create a + new :py:class:`pytest.PytestPluginManager` and call the + :hook:`pytest_cmdline_parse` hook to create a new :class:`pytest.Config` + instance. + + If :attr:`plugins` has been populated they should be plugin modules + to be registered with the plugin manager. + """ + import _pytest.config + + new_args = self._ensure_basetemp(args) + new_args = [str(x) for x in new_args] + + config = _pytest.config._prepareconfig(new_args, self.plugins) # type: ignore[arg-type] + # we don't know what the test will do with this half-setup config + # object and thus we make sure it gets unconfigured properly in any + # case (otherwise capturing could still be active, for example) + self._request.addfinalizer(config._ensure_unconfigure) + return config + + def parseconfigure(self, *args: str | os.PathLike[str]) -> Config: + """Return a new pytest configured Config instance. + + Returns a new :py:class:`pytest.Config` instance like + :py:meth:`parseconfig`, but also calls the :hook:`pytest_configure` + hook. + """ + config = self.parseconfig(*args) + config._do_configure() + return config + + def getitem( + self, source: str | os.PathLike[str], funcname: str = "test_func" + ) -> Item: + """Return the test item for a test function. + + Writes the source to a python file and runs pytest's collection on + the resulting module, returning the test item for the requested + function name. + + :param source: + The module source. + :param funcname: + The name of the test function for which to return a test item. + :returns: + The test item. + """ + items = self.getitems(source) + for item in items: + if item.name == funcname: + return item + assert 0, f"{funcname!r} item not found in module:\n{source}\nitems: {items}" + + def getitems(self, source: str | os.PathLike[str]) -> list[Item]: + """Return all test items collected from the module. + + Writes the source to a Python file and runs pytest's collection on + the resulting module, returning all test items contained within. + """ + modcol = self.getmodulecol(source) + return self.genitems([modcol]) + + def getmodulecol( + self, + source: str | os.PathLike[str], + configargs=(), + *, + withinit: bool = False, + ): + """Return the module collection node for ``source``. + + Writes ``source`` to a file using :py:meth:`makepyfile` and then + runs the pytest collection on it, returning the collection node for the + test module. + + :param source: + The source code of the module to collect. + + :param configargs: + Any extra arguments to pass to :py:meth:`parseconfigure`. + + :param withinit: + Whether to also write an ``__init__.py`` file to the same + directory to ensure it is a package. + """ + if isinstance(source, os.PathLike): + path = self.path.joinpath(source) + assert not withinit, "not supported for paths" + else: + kw = {self._name: str(source)} + path = self.makepyfile(**kw) + if withinit: + self.makepyfile(__init__="#") + self.config = config = self.parseconfigure(path, *configargs) + return self.getnode(config, path) + + def collect_by_name(self, modcol: Collector, name: str) -> Item | Collector | None: + """Return the collection node for name from the module collection. + + Searches a module collection node for a collection node matching the + given name. + + :param modcol: A module collection node; see :py:meth:`getmodulecol`. + :param name: The name of the node to return. + """ + if modcol not in self._mod_collections: + self._mod_collections[modcol] = list(modcol.collect()) + for colitem in self._mod_collections[modcol]: + if colitem.name == name: + return colitem + return None + + def popen( + self, + cmdargs: Sequence[str | os.PathLike[str]], + stdout: int | TextIO = subprocess.PIPE, + stderr: int | TextIO = subprocess.PIPE, + stdin: NotSetType | bytes | IO[Any] | int = CLOSE_STDIN, + **kw, + ): + """Invoke :py:class:`subprocess.Popen`. + + Calls :py:class:`subprocess.Popen` making sure the current working + directory is in ``PYTHONPATH``. + + You probably want to use :py:meth:`run` instead. + """ + env = os.environ.copy() + env["PYTHONPATH"] = os.pathsep.join( + filter(None, [os.getcwd(), env.get("PYTHONPATH", "")]) + ) + kw["env"] = env + + if stdin is self.CLOSE_STDIN: + kw["stdin"] = subprocess.PIPE + elif isinstance(stdin, bytes): + kw["stdin"] = subprocess.PIPE + else: + kw["stdin"] = stdin + + popen = subprocess.Popen(cmdargs, stdout=stdout, stderr=stderr, **kw) + if stdin is self.CLOSE_STDIN: + assert popen.stdin is not None + popen.stdin.close() + elif isinstance(stdin, bytes): + assert popen.stdin is not None + popen.stdin.write(stdin) + + return popen + + def run( + self, + *cmdargs: str | os.PathLike[str], + timeout: float | None = None, + stdin: NotSetType | bytes | IO[Any] | int = CLOSE_STDIN, + ) -> RunResult: + """Run a command with arguments. + + Run a process using :py:class:`subprocess.Popen` saving the stdout and + stderr. + + :param cmdargs: + The sequence of arguments to pass to :py:class:`subprocess.Popen`, + with path-like objects being converted to :py:class:`str` + automatically. + :param timeout: + The period in seconds after which to timeout and raise + :py:class:`Pytester.TimeoutExpired`. + :param stdin: + Optional standard input. + + - If it is ``CLOSE_STDIN`` (Default), then this method calls + :py:class:`subprocess.Popen` with ``stdin=subprocess.PIPE``, and + the standard input is closed immediately after the new command is + started. + + - If it is of type :py:class:`bytes`, these bytes are sent to the + standard input of the command. + + - Otherwise, it is passed through to :py:class:`subprocess.Popen`. + For further information in this case, consult the document of the + ``stdin`` parameter in :py:class:`subprocess.Popen`. + :type stdin: _pytest.compat.NotSetType | bytes | IO[Any] | int + :returns: + The result. + + """ + __tracebackhide__ = True + + cmdargs = tuple(os.fspath(arg) for arg in cmdargs) + p1 = self.path.joinpath("stdout") + p2 = self.path.joinpath("stderr") + print("running:", *cmdargs) + print(" in:", Path.cwd()) + + with p1.open("w", encoding="utf8") as f1, p2.open("w", encoding="utf8") as f2: + now = timing.time() + popen = self.popen( + cmdargs, + stdin=stdin, + stdout=f1, + stderr=f2, + close_fds=(sys.platform != "win32"), + ) + if popen.stdin is not None: + popen.stdin.close() + + def handle_timeout() -> None: + __tracebackhide__ = True + + timeout_message = f"{timeout} second timeout expired running: {cmdargs}" + + popen.kill() + popen.wait() + raise self.TimeoutExpired(timeout_message) + + if timeout is None: + ret = popen.wait() + else: + try: + ret = popen.wait(timeout) + except subprocess.TimeoutExpired: + handle_timeout() + + with p1.open(encoding="utf8") as f1, p2.open(encoding="utf8") as f2: + out = f1.read().splitlines() + err = f2.read().splitlines() + + self._dump_lines(out, sys.stdout) + self._dump_lines(err, sys.stderr) + + with contextlib.suppress(ValueError): + ret = ExitCode(ret) + return RunResult(ret, out, err, timing.time() - now) + + def _dump_lines(self, lines, fp): + try: + for line in lines: + print(line, file=fp) + except UnicodeEncodeError: + print(f"couldn't print to {fp} because of encoding") + + def _getpytestargs(self) -> tuple[str, ...]: + return sys.executable, "-mpytest" + + def runpython(self, script: os.PathLike[str]) -> RunResult: + """Run a python script using sys.executable as interpreter.""" + return self.run(sys.executable, script) + + def runpython_c(self, command: str) -> RunResult: + """Run ``python -c "command"``.""" + return self.run(sys.executable, "-c", command) + + def runpytest_subprocess( + self, *args: str | os.PathLike[str], timeout: float | None = None + ) -> RunResult: + """Run pytest as a subprocess with given arguments. + + Any plugins added to the :py:attr:`plugins` list will be added using the + ``-p`` command line option. Additionally ``--basetemp`` is used to put + any temporary files and directories in a numbered directory prefixed + with "runpytest-" to not conflict with the normal numbered pytest + location for temporary files and directories. + + :param args: + The sequence of arguments to pass to the pytest subprocess. + :param timeout: + The period in seconds after which to timeout and raise + :py:class:`Pytester.TimeoutExpired`. + :returns: + The result. + """ + __tracebackhide__ = True + p = make_numbered_dir(root=self.path, prefix="runpytest-", mode=0o700) + args = (f"--basetemp={p}", *args) + plugins = [x for x in self.plugins if isinstance(x, str)] + if plugins: + args = ("-p", plugins[0], *args) + args = self._getpytestargs() + args + return self.run(*args, timeout=timeout) + + def spawn_pytest(self, string: str, expect_timeout: float = 10.0) -> pexpect.spawn: + """Run pytest using pexpect. + + This makes sure to use the right pytest and sets up the temporary + directory locations. + + The pexpect child is returned. + """ + basetemp = self.path / "temp-pexpect" + basetemp.mkdir(mode=0o700) + invoke = " ".join(map(str, self._getpytestargs())) + cmd = f"{invoke} --basetemp={basetemp} {string}" + return self.spawn(cmd, expect_timeout=expect_timeout) + + def spawn(self, cmd: str, expect_timeout: float = 10.0) -> pexpect.spawn: + """Run a command using pexpect. + + The pexpect child is returned. + """ + pexpect = importorskip("pexpect", "3.0") + if hasattr(sys, "pypy_version_info") and "64" in platform.machine(): + skip("pypy-64 bit not supported") + if not hasattr(pexpect, "spawn"): + skip("pexpect.spawn not available") + logfile = self.path.joinpath("spawn.out").open("wb") + + child = pexpect.spawn(cmd, logfile=logfile, timeout=expect_timeout) + self._request.addfinalizer(logfile.close) + return child + + +class LineComp: + def __init__(self) -> None: + self.stringio = StringIO() + """:class:`python:io.StringIO()` instance used for input.""" + + def assert_contains_lines(self, lines2: Sequence[str]) -> None: + """Assert that ``lines2`` are contained (linearly) in :attr:`stringio`'s value. + + Lines are matched using :func:`LineMatcher.fnmatch_lines `. + """ + __tracebackhide__ = True + val = self.stringio.getvalue() + self.stringio.truncate(0) + self.stringio.seek(0) + lines1 = val.split("\n") + LineMatcher(lines1).fnmatch_lines(lines2) + + +class LineMatcher: + """Flexible matching of text. + + This is a convenience class to test large texts like the output of + commands. + + The constructor takes a list of lines without their trailing newlines, i.e. + ``text.splitlines()``. + """ + + def __init__(self, lines: list[str]) -> None: + self.lines = lines + self._log_output: list[str] = [] + + def __str__(self) -> str: + """Return the entire original text. + + .. versionadded:: 6.2 + You can use :meth:`str` in older versions. + """ + return "\n".join(self.lines) + + def _getlines(self, lines2: str | Sequence[str] | Source) -> Sequence[str]: + if isinstance(lines2, str): + lines2 = Source(lines2) + if isinstance(lines2, Source): + lines2 = lines2.strip().lines + return lines2 + + def fnmatch_lines_random(self, lines2: Sequence[str]) -> None: + """Check lines exist in the output in any order (using :func:`python:fnmatch.fnmatch`).""" + __tracebackhide__ = True + self._match_lines_random(lines2, fnmatch) + + def re_match_lines_random(self, lines2: Sequence[str]) -> None: + """Check lines exist in the output in any order (using :func:`python:re.match`).""" + __tracebackhide__ = True + self._match_lines_random(lines2, lambda name, pat: bool(re.match(pat, name))) + + def _match_lines_random( + self, lines2: Sequence[str], match_func: Callable[[str, str], bool] + ) -> None: + __tracebackhide__ = True + lines2 = self._getlines(lines2) + for line in lines2: + for x in self.lines: + if line == x or match_func(x, line): + self._log("matched: ", repr(line)) + break + else: + msg = f"line {line!r} not found in output" + self._log(msg) + self._fail(msg) + + def get_lines_after(self, fnline: str) -> Sequence[str]: + """Return all lines following the given line in the text. + + The given line can contain glob wildcards. + """ + for i, line in enumerate(self.lines): + if fnline == line or fnmatch(line, fnline): + return self.lines[i + 1 :] + raise ValueError(f"line {fnline!r} not found in output") + + def _log(self, *args) -> None: + self._log_output.append(" ".join(str(x) for x in args)) + + @property + def _log_text(self) -> str: + return "\n".join(self._log_output) + + def fnmatch_lines( + self, lines2: Sequence[str], *, consecutive: bool = False + ) -> None: + """Check lines exist in the output (using :func:`python:fnmatch.fnmatch`). + + The argument is a list of lines which have to match and can use glob + wildcards. If they do not match a pytest.fail() is called. The + matches and non-matches are also shown as part of the error message. + + :param lines2: String patterns to match. + :param consecutive: Match lines consecutively? + """ + __tracebackhide__ = True + self._match_lines(lines2, fnmatch, "fnmatch", consecutive=consecutive) + + def re_match_lines( + self, lines2: Sequence[str], *, consecutive: bool = False + ) -> None: + """Check lines exist in the output (using :func:`python:re.match`). + + The argument is a list of lines which have to match using ``re.match``. + If they do not match a pytest.fail() is called. + + The matches and non-matches are also shown as part of the error message. + + :param lines2: string patterns to match. + :param consecutive: match lines consecutively? + """ + __tracebackhide__ = True + self._match_lines( + lines2, + lambda name, pat: bool(re.match(pat, name)), + "re.match", + consecutive=consecutive, + ) + + def _match_lines( + self, + lines2: Sequence[str], + match_func: Callable[[str, str], bool], + match_nickname: str, + *, + consecutive: bool = False, + ) -> None: + """Underlying implementation of ``fnmatch_lines`` and ``re_match_lines``. + + :param Sequence[str] lines2: + List of string patterns to match. The actual format depends on + ``match_func``. + :param match_func: + A callable ``match_func(line, pattern)`` where line is the + captured line from stdout/stderr and pattern is the matching + pattern. + :param str match_nickname: + The nickname for the match function that will be logged to stdout + when a match occurs. + :param consecutive: + Match lines consecutively? + """ + if not isinstance(lines2, collections.abc.Sequence): + raise TypeError(f"invalid type for lines2: {type(lines2).__name__}") + lines2 = self._getlines(lines2) + lines1 = self.lines[:] + extralines = [] + __tracebackhide__ = True + wnick = len(match_nickname) + 1 + started = False + for line in lines2: + nomatchprinted = False + while lines1: + nextline = lines1.pop(0) + if line == nextline: + self._log("exact match:", repr(line)) + started = True + break + elif match_func(nextline, line): + self._log(f"{match_nickname}:", repr(line)) + self._log( + "{:>{width}}".format("with:", width=wnick), repr(nextline) + ) + started = True + break + else: + if consecutive and started: + msg = f"no consecutive match: {line!r}" + self._log(msg) + self._log( + "{:>{width}}".format("with:", width=wnick), repr(nextline) + ) + self._fail(msg) + if not nomatchprinted: + self._log( + "{:>{width}}".format("nomatch:", width=wnick), repr(line) + ) + nomatchprinted = True + self._log("{:>{width}}".format("and:", width=wnick), repr(nextline)) + extralines.append(nextline) + else: + msg = f"remains unmatched: {line!r}" + self._log(msg) + self._fail(msg) + self._log_output = [] + + def no_fnmatch_line(self, pat: str) -> None: + """Ensure captured lines do not match the given pattern, using ``fnmatch.fnmatch``. + + :param str pat: The pattern to match lines. + """ + __tracebackhide__ = True + self._no_match_line(pat, fnmatch, "fnmatch") + + def no_re_match_line(self, pat: str) -> None: + """Ensure captured lines do not match the given pattern, using ``re.match``. + + :param str pat: The regular expression to match lines. + """ + __tracebackhide__ = True + self._no_match_line( + pat, lambda name, pat: bool(re.match(pat, name)), "re.match" + ) + + def _no_match_line( + self, pat: str, match_func: Callable[[str, str], bool], match_nickname: str + ) -> None: + """Ensure captured lines does not have a the given pattern, using ``fnmatch.fnmatch``. + + :param str pat: The pattern to match lines. + """ + __tracebackhide__ = True + nomatch_printed = False + wnick = len(match_nickname) + 1 + for line in self.lines: + if match_func(line, pat): + msg = f"{match_nickname}: {pat!r}" + self._log(msg) + self._log("{:>{width}}".format("with:", width=wnick), repr(line)) + self._fail(msg) + else: + if not nomatch_printed: + self._log("{:>{width}}".format("nomatch:", width=wnick), repr(pat)) + nomatch_printed = True + self._log("{:>{width}}".format("and:", width=wnick), repr(line)) + self._log_output = [] + + def _fail(self, msg: str) -> None: + __tracebackhide__ = True + log_text = self._log_text + self._log_output = [] + fail(log_text) + + def str(self) -> str: + """Return the entire original text.""" + return str(self) diff --git a/.venv/Lib/site-packages/_pytest/pytester_assertions.py b/.venv/Lib/site-packages/_pytest/pytester_assertions.py new file mode 100644 index 00000000..d543798f --- /dev/null +++ b/.venv/Lib/site-packages/_pytest/pytester_assertions.py @@ -0,0 +1,74 @@ +"""Helper plugin for pytester; should not be loaded on its own.""" + +# This plugin contains assertions used by pytester. pytester cannot +# contain them itself, since it is imported by the `pytest` module, +# hence cannot be subject to assertion rewriting, which requires a +# module to not be already imported. +from __future__ import annotations + +from typing import Sequence + +from _pytest.reports import CollectReport +from _pytest.reports import TestReport + + +def assertoutcome( + outcomes: tuple[ + Sequence[TestReport], + Sequence[CollectReport | TestReport], + Sequence[CollectReport | TestReport], + ], + passed: int = 0, + skipped: int = 0, + failed: int = 0, +) -> None: + __tracebackhide__ = True + + realpassed, realskipped, realfailed = outcomes + obtained = { + "passed": len(realpassed), + "skipped": len(realskipped), + "failed": len(realfailed), + } + expected = {"passed": passed, "skipped": skipped, "failed": failed} + assert obtained == expected, outcomes + + +def assert_outcomes( + outcomes: dict[str, int], + passed: int = 0, + skipped: int = 0, + failed: int = 0, + errors: int = 0, + xpassed: int = 0, + xfailed: int = 0, + warnings: int | None = None, + deselected: int | None = None, +) -> None: + """Assert that the specified outcomes appear with the respective + numbers (0 means it didn't occur) in the text output from a test run.""" + __tracebackhide__ = True + + obtained = { + "passed": outcomes.get("passed", 0), + "skipped": outcomes.get("skipped", 0), + "failed": outcomes.get("failed", 0), + "errors": outcomes.get("errors", 0), + "xpassed": outcomes.get("xpassed", 0), + "xfailed": outcomes.get("xfailed", 0), + } + expected = { + "passed": passed, + "skipped": skipped, + "failed": failed, + "errors": errors, + "xpassed": xpassed, + "xfailed": xfailed, + } + if warnings is not None: + obtained["warnings"] = outcomes.get("warnings", 0) + expected["warnings"] = warnings + if deselected is not None: + obtained["deselected"] = outcomes.get("deselected", 0) + expected["deselected"] = deselected + assert obtained == expected diff --git a/.venv/Lib/site-packages/_pytest/python.py b/.venv/Lib/site-packages/_pytest/python.py new file mode 100644 index 00000000..3478c34c --- /dev/null +++ b/.venv/Lib/site-packages/_pytest/python.py @@ -0,0 +1,1679 @@ +# mypy: allow-untyped-defs +"""Python test discovery, setup and run of test functions.""" + +from __future__ import annotations + +import abc +from collections import Counter +from collections import defaultdict +import dataclasses +import enum +import fnmatch +from functools import partial +import inspect +import itertools +import os +from pathlib import Path +import types +from typing import Any +from typing import Callable +from typing import Dict +from typing import final +from typing import Generator +from typing import Iterable +from typing import Iterator +from typing import Literal +from typing import Mapping +from typing import Pattern +from typing import Sequence +from typing import TYPE_CHECKING +import warnings + +import _pytest +from _pytest import fixtures +from _pytest import nodes +from _pytest._code import filter_traceback +from _pytest._code import getfslineno +from _pytest._code.code import ExceptionInfo +from _pytest._code.code import TerminalRepr +from _pytest._code.code import Traceback +from _pytest._io.saferepr import saferepr +from _pytest.compat import ascii_escaped +from _pytest.compat import get_default_arg_names +from _pytest.compat import get_real_func +from _pytest.compat import getimfunc +from _pytest.compat import is_async_function +from _pytest.compat import is_generator +from _pytest.compat import LEGACY_PATH +from _pytest.compat import NOTSET +from _pytest.compat import safe_getattr +from _pytest.compat import safe_isclass +from _pytest.config import Config +from _pytest.config import hookimpl +from _pytest.config.argparsing import Parser +from _pytest.deprecated import check_ispytest +from _pytest.fixtures import FixtureDef +from _pytest.fixtures import FixtureRequest +from _pytest.fixtures import FuncFixtureInfo +from _pytest.fixtures import get_scope_node +from _pytest.main import Session +from _pytest.mark import MARK_GEN +from _pytest.mark import ParameterSet +from _pytest.mark.structures import get_unpacked_marks +from _pytest.mark.structures import Mark +from _pytest.mark.structures import MarkDecorator +from _pytest.mark.structures import normalize_mark_list +from _pytest.outcomes import fail +from _pytest.outcomes import skip +from _pytest.pathlib import fnmatch_ex +from _pytest.pathlib import import_path +from _pytest.pathlib import ImportPathMismatchError +from _pytest.pathlib import scandir +from _pytest.scope import _ScopeName +from _pytest.scope import Scope +from _pytest.stash import StashKey +from _pytest.warning_types import PytestCollectionWarning +from _pytest.warning_types import PytestReturnNotNoneWarning +from _pytest.warning_types import PytestUnhandledCoroutineWarning + + +if TYPE_CHECKING: + from typing_extensions import Self + + +def pytest_addoption(parser: Parser) -> None: + parser.addini( + "python_files", + type="args", + # NOTE: default is also used in AssertionRewritingHook. + default=["test_*.py", "*_test.py"], + help="Glob-style file patterns for Python test module discovery", + ) + parser.addini( + "python_classes", + type="args", + default=["Test"], + help="Prefixes or glob names for Python test class discovery", + ) + parser.addini( + "python_functions", + type="args", + default=["test"], + help="Prefixes or glob names for Python test function and method discovery", + ) + parser.addini( + "disable_test_id_escaping_and_forfeit_all_rights_to_community_support", + type="bool", + default=False, + help="Disable string escape non-ASCII characters, might cause unwanted " + "side effects(use at your own risk)", + ) + + +def pytest_generate_tests(metafunc: Metafunc) -> None: + for marker in metafunc.definition.iter_markers(name="parametrize"): + metafunc.parametrize(*marker.args, **marker.kwargs, _param_mark=marker) + + +def pytest_configure(config: Config) -> None: + config.addinivalue_line( + "markers", + "parametrize(argnames, argvalues): call a test function multiple " + "times passing in different arguments in turn. argvalues generally " + "needs to be a list of values if argnames specifies only one name " + "or a list of tuples of values if argnames specifies multiple names. " + "Example: @parametrize('arg1', [1,2]) would lead to two calls of the " + "decorated test function, one with arg1=1 and another with arg1=2." + "see https://docs.pytest.org/en/stable/how-to/parametrize.html for more info " + "and examples.", + ) + config.addinivalue_line( + "markers", + "usefixtures(fixturename1, fixturename2, ...): mark tests as needing " + "all of the specified fixtures. see " + "https://docs.pytest.org/en/stable/explanation/fixtures.html#usefixtures ", + ) + + +def async_warn_and_skip(nodeid: str) -> None: + msg = "async def functions are not natively supported and have been skipped.\n" + msg += ( + "You need to install a suitable plugin for your async framework, for example:\n" + ) + msg += " - anyio\n" + msg += " - pytest-asyncio\n" + msg += " - pytest-tornasync\n" + msg += " - pytest-trio\n" + msg += " - pytest-twisted" + warnings.warn(PytestUnhandledCoroutineWarning(msg.format(nodeid))) + skip(reason="async def function and no async plugin installed (see warnings)") + + +@hookimpl(trylast=True) +def pytest_pyfunc_call(pyfuncitem: Function) -> object | None: + testfunction = pyfuncitem.obj + if is_async_function(testfunction): + async_warn_and_skip(pyfuncitem.nodeid) + funcargs = pyfuncitem.funcargs + testargs = {arg: funcargs[arg] for arg in pyfuncitem._fixtureinfo.argnames} + result = testfunction(**testargs) + if hasattr(result, "__await__") or hasattr(result, "__aiter__"): + async_warn_and_skip(pyfuncitem.nodeid) + elif result is not None: + warnings.warn( + PytestReturnNotNoneWarning( + f"Expected None, but {pyfuncitem.nodeid} returned {result!r}, which will be an error in a " + "future version of pytest. Did you mean to use `assert` instead of `return`?" + ) + ) + return True + + +def pytest_collect_directory( + path: Path, parent: nodes.Collector +) -> nodes.Collector | None: + pkginit = path / "__init__.py" + try: + has_pkginit = pkginit.is_file() + except PermissionError: + # See https://github.com/pytest-dev/pytest/issues/12120#issuecomment-2106349096. + return None + if has_pkginit: + return Package.from_parent(parent, path=path) + return None + + +def pytest_collect_file(file_path: Path, parent: nodes.Collector) -> Module | None: + if file_path.suffix == ".py": + if not parent.session.isinitpath(file_path): + if not path_matches_patterns( + file_path, parent.config.getini("python_files") + ): + return None + ihook = parent.session.gethookproxy(file_path) + module: Module = ihook.pytest_pycollect_makemodule( + module_path=file_path, parent=parent + ) + return module + return None + + +def path_matches_patterns(path: Path, patterns: Iterable[str]) -> bool: + """Return whether path matches any of the patterns in the list of globs given.""" + return any(fnmatch_ex(pattern, path) for pattern in patterns) + + +def pytest_pycollect_makemodule(module_path: Path, parent) -> Module: + return Module.from_parent(parent, path=module_path) + + +@hookimpl(trylast=True) +def pytest_pycollect_makeitem( + collector: Module | Class, name: str, obj: object +) -> None | nodes.Item | nodes.Collector | list[nodes.Item | nodes.Collector]: + assert isinstance(collector, (Class, Module)), type(collector) + # Nothing was collected elsewhere, let's do it here. + if safe_isclass(obj): + if collector.istestclass(obj, name): + return Class.from_parent(collector, name=name, obj=obj) + elif collector.istestfunction(obj, name): + # mock seems to store unbound methods (issue473), normalize it. + obj = getattr(obj, "__func__", obj) + # We need to try and unwrap the function if it's a functools.partial + # or a functools.wrapped. + # We mustn't if it's been wrapped with mock.patch (python 2 only). + if not (inspect.isfunction(obj) or inspect.isfunction(get_real_func(obj))): + filename, lineno = getfslineno(obj) + warnings.warn_explicit( + message=PytestCollectionWarning( + f"cannot collect {name!r} because it is not a function." + ), + category=None, + filename=str(filename), + lineno=lineno + 1, + ) + elif getattr(obj, "__test__", True): + if is_generator(obj): + res = Function.from_parent(collector, name=name) + reason = ( + f"yield tests were removed in pytest 4.0 - {name} will be ignored" + ) + res.add_marker(MARK_GEN.xfail(run=False, reason=reason)) + res.warn(PytestCollectionWarning(reason)) + return res + else: + return list(collector._genfunctions(name, obj)) + return None + + +class PyobjMixin(nodes.Node): + """this mix-in inherits from Node to carry over the typing information + + as its intended to always mix in before a node + its position in the mro is unaffected""" + + _ALLOW_MARKERS = True + + @property + def module(self): + """Python module object this node was collected from (can be None).""" + node = self.getparent(Module) + return node.obj if node is not None else None + + @property + def cls(self): + """Python class object this node was collected from (can be None).""" + node = self.getparent(Class) + return node.obj if node is not None else None + + @property + def instance(self): + """Python instance object the function is bound to. + + Returns None if not a test method, e.g. for a standalone test function, + a class or a module. + """ + # Overridden by Function. + return None + + @property + def obj(self): + """Underlying Python object.""" + obj = getattr(self, "_obj", None) + if obj is None: + self._obj = obj = self._getobj() + # XXX evil hack + # used to avoid Function marker duplication + if self._ALLOW_MARKERS: + self.own_markers.extend(get_unpacked_marks(self.obj)) + # This assumes that `obj` is called before there is a chance + # to add custom keys to `self.keywords`, so no fear of overriding. + self.keywords.update((mark.name, mark) for mark in self.own_markers) + return obj + + @obj.setter + def obj(self, value): + self._obj = value + + def _getobj(self): + """Get the underlying Python object. May be overwritten by subclasses.""" + # TODO: Improve the type of `parent` such that assert/ignore aren't needed. + assert self.parent is not None + obj = self.parent.obj # type: ignore[attr-defined] + return getattr(obj, self.name) + + def getmodpath(self, stopatmodule: bool = True, includemodule: bool = False) -> str: + """Return Python path relative to the containing module.""" + parts = [] + for node in self.iter_parents(): + name = node.name + if isinstance(node, Module): + name = os.path.splitext(name)[0] + if stopatmodule: + if includemodule: + parts.append(name) + break + parts.append(name) + parts.reverse() + return ".".join(parts) + + def reportinfo(self) -> tuple[os.PathLike[str] | str, int | None, str]: + # XXX caching? + path, lineno = getfslineno(self.obj) + modpath = self.getmodpath() + return path, lineno, modpath + + +# As an optimization, these builtin attribute names are pre-ignored when +# iterating over an object during collection -- the pytest_pycollect_makeitem +# hook is not called for them. +# fmt: off +class _EmptyClass: pass # noqa: E701 +IGNORED_ATTRIBUTES = frozenset.union( + frozenset(), + # Module. + dir(types.ModuleType("empty_module")), + # Some extra module attributes the above doesn't catch. + {"__builtins__", "__file__", "__cached__"}, + # Class. + dir(_EmptyClass), + # Instance. + dir(_EmptyClass()), +) +del _EmptyClass +# fmt: on + + +class PyCollector(PyobjMixin, nodes.Collector, abc.ABC): + def funcnamefilter(self, name: str) -> bool: + return self._matches_prefix_or_glob_option("python_functions", name) + + def isnosetest(self, obj: object) -> bool: + """Look for the __test__ attribute, which is applied by the + @nose.tools.istest decorator. + """ + # We explicitly check for "is True" here to not mistakenly treat + # classes with a custom __getattr__ returning something truthy (like a + # function) as test classes. + return safe_getattr(obj, "__test__", False) is True + + def classnamefilter(self, name: str) -> bool: + return self._matches_prefix_or_glob_option("python_classes", name) + + def istestfunction(self, obj: object, name: str) -> bool: + if self.funcnamefilter(name) or self.isnosetest(obj): + if isinstance(obj, (staticmethod, classmethod)): + # staticmethods and classmethods need to be unwrapped. + obj = safe_getattr(obj, "__func__", False) + return callable(obj) and fixtures.getfixturemarker(obj) is None + else: + return False + + def istestclass(self, obj: object, name: str) -> bool: + if not (self.classnamefilter(name) or self.isnosetest(obj)): + return False + if inspect.isabstract(obj): + return False + return True + + def _matches_prefix_or_glob_option(self, option_name: str, name: str) -> bool: + """Check if the given name matches the prefix or glob-pattern defined + in ini configuration.""" + for option in self.config.getini(option_name): + if name.startswith(option): + return True + # Check that name looks like a glob-string before calling fnmatch + # because this is called for every name in each collected module, + # and fnmatch is somewhat expensive to call. + elif ("*" in option or "?" in option or "[" in option) and fnmatch.fnmatch( + name, option + ): + return True + return False + + def collect(self) -> Iterable[nodes.Item | nodes.Collector]: + if not getattr(self.obj, "__test__", True): + return [] + + # Avoid random getattrs and peek in the __dict__ instead. + dicts = [getattr(self.obj, "__dict__", {})] + if isinstance(self.obj, type): + for basecls in self.obj.__mro__: + dicts.append(basecls.__dict__) + + # In each class, nodes should be definition ordered. + # __dict__ is definition ordered. + seen: set[str] = set() + dict_values: list[list[nodes.Item | nodes.Collector]] = [] + ihook = self.ihook + for dic in dicts: + values: list[nodes.Item | nodes.Collector] = [] + # Note: seems like the dict can change during iteration - + # be careful not to remove the list() without consideration. + for name, obj in list(dic.items()): + if name in IGNORED_ATTRIBUTES: + continue + if name in seen: + continue + seen.add(name) + res = ihook.pytest_pycollect_makeitem( + collector=self, name=name, obj=obj + ) + if res is None: + continue + elif isinstance(res, list): + values.extend(res) + else: + values.append(res) + dict_values.append(values) + + # Between classes in the class hierarchy, reverse-MRO order -- nodes + # inherited from base classes should come before subclasses. + result = [] + for values in reversed(dict_values): + result.extend(values) + return result + + def _genfunctions(self, name: str, funcobj) -> Iterator[Function]: + modulecol = self.getparent(Module) + assert modulecol is not None + module = modulecol.obj + clscol = self.getparent(Class) + cls = clscol and clscol.obj or None + + definition = FunctionDefinition.from_parent(self, name=name, callobj=funcobj) + fixtureinfo = definition._fixtureinfo + + # pytest_generate_tests impls call metafunc.parametrize() which fills + # metafunc._calls, the outcome of the hook. + metafunc = Metafunc( + definition=definition, + fixtureinfo=fixtureinfo, + config=self.config, + cls=cls, + module=module, + _ispytest=True, + ) + methods = [] + if hasattr(module, "pytest_generate_tests"): + methods.append(module.pytest_generate_tests) + if cls is not None and hasattr(cls, "pytest_generate_tests"): + methods.append(cls().pytest_generate_tests) + self.ihook.pytest_generate_tests.call_extra(methods, dict(metafunc=metafunc)) + + if not metafunc._calls: + yield Function.from_parent(self, name=name, fixtureinfo=fixtureinfo) + else: + # Direct parametrizations taking place in module/class-specific + # `metafunc.parametrize` calls may have shadowed some fixtures, so make sure + # we update what the function really needs a.k.a its fixture closure. Note that + # direct parametrizations using `@pytest.mark.parametrize` have already been considered + # into making the closure using `ignore_args` arg to `getfixtureclosure`. + fixtureinfo.prune_dependency_tree() + + for callspec in metafunc._calls: + subname = f"{name}[{callspec.id}]" + yield Function.from_parent( + self, + name=subname, + callspec=callspec, + fixtureinfo=fixtureinfo, + keywords={callspec.id: True}, + originalname=name, + ) + + +def importtestmodule( + path: Path, + config: Config, +): + # We assume we are only called once per module. + importmode = config.getoption("--import-mode") + try: + mod = import_path( + path, + mode=importmode, + root=config.rootpath, + consider_namespace_packages=config.getini("consider_namespace_packages"), + ) + except SyntaxError as e: + raise nodes.Collector.CollectError( + ExceptionInfo.from_current().getrepr(style="short") + ) from e + except ImportPathMismatchError as e: + raise nodes.Collector.CollectError( + "import file mismatch:\n" + "imported module {!r} has this __file__ attribute:\n" + " {}\n" + "which is not the same as the test file we want to collect:\n" + " {}\n" + "HINT: remove __pycache__ / .pyc files and/or use a " + "unique basename for your test file modules".format(*e.args) + ) from e + except ImportError as e: + exc_info = ExceptionInfo.from_current() + if config.get_verbosity() < 2: + exc_info.traceback = exc_info.traceback.filter(filter_traceback) + exc_repr = ( + exc_info.getrepr(style="short") + if exc_info.traceback + else exc_info.exconly() + ) + formatted_tb = str(exc_repr) + raise nodes.Collector.CollectError( + f"ImportError while importing test module '{path}'.\n" + "Hint: make sure your test modules/packages have valid Python names.\n" + "Traceback:\n" + f"{formatted_tb}" + ) from e + except skip.Exception as e: + if e.allow_module_level: + raise + raise nodes.Collector.CollectError( + "Using pytest.skip outside of a test will skip the entire module. " + "If that's your intention, pass `allow_module_level=True`. " + "If you want to skip a specific test or an entire class, " + "use the @pytest.mark.skip or @pytest.mark.skipif decorators." + ) from e + config.pluginmanager.consider_module(mod) + return mod + + +class Module(nodes.File, PyCollector): + """Collector for test classes and functions in a Python module.""" + + def _getobj(self): + return importtestmodule(self.path, self.config) + + def collect(self) -> Iterable[nodes.Item | nodes.Collector]: + self._register_setup_module_fixture() + self._register_setup_function_fixture() + self.session._fixturemanager.parsefactories(self) + return super().collect() + + def _register_setup_module_fixture(self) -> None: + """Register an autouse, module-scoped fixture for the collected module object + that invokes setUpModule/tearDownModule if either or both are available. + + Using a fixture to invoke this methods ensures we play nicely and unsurprisingly with + other fixtures (#517). + """ + setup_module = _get_first_non_fixture_func( + self.obj, ("setUpModule", "setup_module") + ) + teardown_module = _get_first_non_fixture_func( + self.obj, ("tearDownModule", "teardown_module") + ) + + if setup_module is None and teardown_module is None: + return + + def xunit_setup_module_fixture(request) -> Generator[None]: + module = request.module + if setup_module is not None: + _call_with_optional_argument(setup_module, module) + yield + if teardown_module is not None: + _call_with_optional_argument(teardown_module, module) + + self.session._fixturemanager._register_fixture( + # Use a unique name to speed up lookup. + name=f"_xunit_setup_module_fixture_{self.obj.__name__}", + func=xunit_setup_module_fixture, + nodeid=self.nodeid, + scope="module", + autouse=True, + ) + + def _register_setup_function_fixture(self) -> None: + """Register an autouse, function-scoped fixture for the collected module object + that invokes setup_function/teardown_function if either or both are available. + + Using a fixture to invoke this methods ensures we play nicely and unsurprisingly with + other fixtures (#517). + """ + setup_function = _get_first_non_fixture_func(self.obj, ("setup_function",)) + teardown_function = _get_first_non_fixture_func( + self.obj, ("teardown_function",) + ) + if setup_function is None and teardown_function is None: + return + + def xunit_setup_function_fixture(request) -> Generator[None]: + if request.instance is not None: + # in this case we are bound to an instance, so we need to let + # setup_method handle this + yield + return + function = request.function + if setup_function is not None: + _call_with_optional_argument(setup_function, function) + yield + if teardown_function is not None: + _call_with_optional_argument(teardown_function, function) + + self.session._fixturemanager._register_fixture( + # Use a unique name to speed up lookup. + name=f"_xunit_setup_function_fixture_{self.obj.__name__}", + func=xunit_setup_function_fixture, + nodeid=self.nodeid, + scope="function", + autouse=True, + ) + + +class Package(nodes.Directory): + """Collector for files and directories in a Python packages -- directories + with an `__init__.py` file. + + .. note:: + + Directories without an `__init__.py` file are instead collected by + :class:`~pytest.Dir` by default. Both are :class:`~pytest.Directory` + collectors. + + .. versionchanged:: 8.0 + + Now inherits from :class:`~pytest.Directory`. + """ + + def __init__( + self, + fspath: LEGACY_PATH | None, + parent: nodes.Collector, + # NOTE: following args are unused: + config=None, + session=None, + nodeid=None, + path: Path | None = None, + ) -> None: + # NOTE: Could be just the following, but kept as-is for compat. + # super().__init__(self, fspath, parent=parent) + session = parent.session + super().__init__( + fspath=fspath, + path=path, + parent=parent, + config=config, + session=session, + nodeid=nodeid, + ) + + def setup(self) -> None: + init_mod = importtestmodule(self.path / "__init__.py", self.config) + + # Not using fixtures to call setup_module here because autouse fixtures + # from packages are not called automatically (#4085). + setup_module = _get_first_non_fixture_func( + init_mod, ("setUpModule", "setup_module") + ) + if setup_module is not None: + _call_with_optional_argument(setup_module, init_mod) + + teardown_module = _get_first_non_fixture_func( + init_mod, ("tearDownModule", "teardown_module") + ) + if teardown_module is not None: + func = partial(_call_with_optional_argument, teardown_module, init_mod) + self.addfinalizer(func) + + def collect(self) -> Iterable[nodes.Item | nodes.Collector]: + # Always collect __init__.py first. + def sort_key(entry: os.DirEntry[str]) -> object: + return (entry.name != "__init__.py", entry.name) + + config = self.config + col: nodes.Collector | None + cols: Sequence[nodes.Collector] + ihook = self.ihook + for direntry in scandir(self.path, sort_key): + if direntry.is_dir(): + path = Path(direntry.path) + if not self.session.isinitpath(path, with_parents=True): + if ihook.pytest_ignore_collect(collection_path=path, config=config): + continue + col = ihook.pytest_collect_directory(path=path, parent=self) + if col is not None: + yield col + + elif direntry.is_file(): + path = Path(direntry.path) + if not self.session.isinitpath(path): + if ihook.pytest_ignore_collect(collection_path=path, config=config): + continue + cols = ihook.pytest_collect_file(file_path=path, parent=self) + yield from cols + + +def _call_with_optional_argument(func, arg) -> None: + """Call the given function with the given argument if func accepts one argument, otherwise + calls func without arguments.""" + arg_count = func.__code__.co_argcount + if inspect.ismethod(func): + arg_count -= 1 + if arg_count: + func(arg) + else: + func() + + +def _get_first_non_fixture_func(obj: object, names: Iterable[str]) -> object | None: + """Return the attribute from the given object to be used as a setup/teardown + xunit-style function, but only if not marked as a fixture to avoid calling it twice. + """ + for name in names: + meth: object | None = getattr(obj, name, None) + if meth is not None and fixtures.getfixturemarker(meth) is None: + return meth + return None + + +class Class(PyCollector): + """Collector for test methods (and nested classes) in a Python class.""" + + @classmethod + def from_parent(cls, parent, *, name, obj=None, **kw) -> Self: # type: ignore[override] + """The public constructor.""" + return super().from_parent(name=name, parent=parent, **kw) + + def newinstance(self): + return self.obj() + + def collect(self) -> Iterable[nodes.Item | nodes.Collector]: + if not safe_getattr(self.obj, "__test__", True): + return [] + if hasinit(self.obj): + assert self.parent is not None + self.warn( + PytestCollectionWarning( + f"cannot collect test class {self.obj.__name__!r} because it has a " + f"__init__ constructor (from: {self.parent.nodeid})" + ) + ) + return [] + elif hasnew(self.obj): + assert self.parent is not None + self.warn( + PytestCollectionWarning( + f"cannot collect test class {self.obj.__name__!r} because it has a " + f"__new__ constructor (from: {self.parent.nodeid})" + ) + ) + return [] + + self._register_setup_class_fixture() + self._register_setup_method_fixture() + + self.session._fixturemanager.parsefactories(self.newinstance(), self.nodeid) + + return super().collect() + + def _register_setup_class_fixture(self) -> None: + """Register an autouse, class scoped fixture into the collected class object + that invokes setup_class/teardown_class if either or both are available. + + Using a fixture to invoke this methods ensures we play nicely and unsurprisingly with + other fixtures (#517). + """ + setup_class = _get_first_non_fixture_func(self.obj, ("setup_class",)) + teardown_class = _get_first_non_fixture_func(self.obj, ("teardown_class",)) + if setup_class is None and teardown_class is None: + return + + def xunit_setup_class_fixture(request) -> Generator[None]: + cls = request.cls + if setup_class is not None: + func = getimfunc(setup_class) + _call_with_optional_argument(func, cls) + yield + if teardown_class is not None: + func = getimfunc(teardown_class) + _call_with_optional_argument(func, cls) + + self.session._fixturemanager._register_fixture( + # Use a unique name to speed up lookup. + name=f"_xunit_setup_class_fixture_{self.obj.__qualname__}", + func=xunit_setup_class_fixture, + nodeid=self.nodeid, + scope="class", + autouse=True, + ) + + def _register_setup_method_fixture(self) -> None: + """Register an autouse, function scoped fixture into the collected class object + that invokes setup_method/teardown_method if either or both are available. + + Using a fixture to invoke these methods ensures we play nicely and unsurprisingly with + other fixtures (#517). + """ + setup_name = "setup_method" + setup_method = _get_first_non_fixture_func(self.obj, (setup_name,)) + teardown_name = "teardown_method" + teardown_method = _get_first_non_fixture_func(self.obj, (teardown_name,)) + if setup_method is None and teardown_method is None: + return + + def xunit_setup_method_fixture(request) -> Generator[None]: + instance = request.instance + method = request.function + if setup_method is not None: + func = getattr(instance, setup_name) + _call_with_optional_argument(func, method) + yield + if teardown_method is not None: + func = getattr(instance, teardown_name) + _call_with_optional_argument(func, method) + + self.session._fixturemanager._register_fixture( + # Use a unique name to speed up lookup. + name=f"_xunit_setup_method_fixture_{self.obj.__qualname__}", + func=xunit_setup_method_fixture, + nodeid=self.nodeid, + scope="function", + autouse=True, + ) + + +def hasinit(obj: object) -> bool: + init: object = getattr(obj, "__init__", None) + if init: + return init != object.__init__ + return False + + +def hasnew(obj: object) -> bool: + new: object = getattr(obj, "__new__", None) + if new: + return new != object.__new__ + return False + + +@final +@dataclasses.dataclass(frozen=True) +class IdMaker: + """Make IDs for a parametrization.""" + + __slots__ = ( + "argnames", + "parametersets", + "idfn", + "ids", + "config", + "nodeid", + "func_name", + ) + + # The argnames of the parametrization. + argnames: Sequence[str] + # The ParameterSets of the parametrization. + parametersets: Sequence[ParameterSet] + # Optionally, a user-provided callable to make IDs for parameters in a + # ParameterSet. + idfn: Callable[[Any], object | None] | None + # Optionally, explicit IDs for ParameterSets by index. + ids: Sequence[object | None] | None + # Optionally, the pytest config. + # Used for controlling ASCII escaping, and for calling the + # :hook:`pytest_make_parametrize_id` hook. + config: Config | None + # Optionally, the ID of the node being parametrized. + # Used only for clearer error messages. + nodeid: str | None + # Optionally, the ID of the function being parametrized. + # Used only for clearer error messages. + func_name: str | None + + def make_unique_parameterset_ids(self) -> list[str]: + """Make a unique identifier for each ParameterSet, that may be used to + identify the parametrization in a node ID. + + Format is -...-[counter], where prm_x_token is + - user-provided id, if given + - else an id derived from the value, applicable for certain types + - else + The counter suffix is appended only in case a string wouldn't be unique + otherwise. + """ + resolved_ids = list(self._resolve_ids()) + # All IDs must be unique! + if len(resolved_ids) != len(set(resolved_ids)): + # Record the number of occurrences of each ID. + id_counts = Counter(resolved_ids) + # Map the ID to its next suffix. + id_suffixes: dict[str, int] = defaultdict(int) + # Suffix non-unique IDs to make them unique. + for index, id in enumerate(resolved_ids): + if id_counts[id] > 1: + suffix = "" + if id and id[-1].isdigit(): + suffix = "_" + new_id = f"{id}{suffix}{id_suffixes[id]}" + while new_id in set(resolved_ids): + id_suffixes[id] += 1 + new_id = f"{id}{suffix}{id_suffixes[id]}" + resolved_ids[index] = new_id + id_suffixes[id] += 1 + assert len(resolved_ids) == len( + set(resolved_ids) + ), f"Internal error: {resolved_ids=}" + return resolved_ids + + def _resolve_ids(self) -> Iterable[str]: + """Resolve IDs for all ParameterSets (may contain duplicates).""" + for idx, parameterset in enumerate(self.parametersets): + if parameterset.id is not None: + # ID provided directly - pytest.param(..., id="...") + yield parameterset.id + elif self.ids and idx < len(self.ids) and self.ids[idx] is not None: + # ID provided in the IDs list - parametrize(..., ids=[...]). + yield self._idval_from_value_required(self.ids[idx], idx) + else: + # ID not provided - generate it. + yield "-".join( + self._idval(val, argname, idx) + for val, argname in zip(parameterset.values, self.argnames) + ) + + def _idval(self, val: object, argname: str, idx: int) -> str: + """Make an ID for a parameter in a ParameterSet.""" + idval = self._idval_from_function(val, argname, idx) + if idval is not None: + return idval + idval = self._idval_from_hook(val, argname) + if idval is not None: + return idval + idval = self._idval_from_value(val) + if idval is not None: + return idval + return self._idval_from_argname(argname, idx) + + def _idval_from_function(self, val: object, argname: str, idx: int) -> str | None: + """Try to make an ID for a parameter in a ParameterSet using the + user-provided id callable, if given.""" + if self.idfn is None: + return None + try: + id = self.idfn(val) + except Exception as e: + prefix = f"{self.nodeid}: " if self.nodeid is not None else "" + msg = "error raised while trying to determine id of parameter '{}' at position {}" + msg = prefix + msg.format(argname, idx) + raise ValueError(msg) from e + if id is None: + return None + return self._idval_from_value(id) + + def _idval_from_hook(self, val: object, argname: str) -> str | None: + """Try to make an ID for a parameter in a ParameterSet by calling the + :hook:`pytest_make_parametrize_id` hook.""" + if self.config: + id: str | None = self.config.hook.pytest_make_parametrize_id( + config=self.config, val=val, argname=argname + ) + return id + return None + + def _idval_from_value(self, val: object) -> str | None: + """Try to make an ID for a parameter in a ParameterSet from its value, + if the value type is supported.""" + if isinstance(val, (str, bytes)): + return _ascii_escaped_by_config(val, self.config) + elif val is None or isinstance(val, (float, int, bool, complex)): + return str(val) + elif isinstance(val, Pattern): + return ascii_escaped(val.pattern) + elif val is NOTSET: + # Fallback to default. Note that NOTSET is an enum.Enum. + pass + elif isinstance(val, enum.Enum): + return str(val) + elif isinstance(getattr(val, "__name__", None), str): + # Name of a class, function, module, etc. + name: str = getattr(val, "__name__") + return name + return None + + def _idval_from_value_required(self, val: object, idx: int) -> str: + """Like _idval_from_value(), but fails if the type is not supported.""" + id = self._idval_from_value(val) + if id is not None: + return id + + # Fail. + if self.func_name is not None: + prefix = f"In {self.func_name}: " + elif self.nodeid is not None: + prefix = f"In {self.nodeid}: " + else: + prefix = "" + msg = ( + f"{prefix}ids contains unsupported value {saferepr(val)} (type: {type(val)!r}) at index {idx}. " + "Supported types are: str, bytes, int, float, complex, bool, enum, regex or anything with a __name__." + ) + fail(msg, pytrace=False) + + @staticmethod + def _idval_from_argname(argname: str, idx: int) -> str: + """Make an ID for a parameter in a ParameterSet from the argument name + and the index of the ParameterSet.""" + return str(argname) + str(idx) + + +@final +@dataclasses.dataclass(frozen=True) +class CallSpec2: + """A planned parameterized invocation of a test function. + + Calculated during collection for a given test function's Metafunc. + Once collection is over, each callspec is turned into a single Item + and stored in item.callspec. + """ + + # arg name -> arg value which will be passed to a fixture or pseudo-fixture + # of the same name. (indirect or direct parametrization respectively) + params: dict[str, object] = dataclasses.field(default_factory=dict) + # arg name -> arg index. + indices: dict[str, int] = dataclasses.field(default_factory=dict) + # Used for sorting parametrized resources. + _arg2scope: Mapping[str, Scope] = dataclasses.field(default_factory=dict) + # Parts which will be added to the item's name in `[..]` separated by "-". + _idlist: Sequence[str] = dataclasses.field(default_factory=tuple) + # Marks which will be applied to the item. + marks: list[Mark] = dataclasses.field(default_factory=list) + + def setmulti( + self, + *, + argnames: Iterable[str], + valset: Iterable[object], + id: str, + marks: Iterable[Mark | MarkDecorator], + scope: Scope, + param_index: int, + ) -> CallSpec2: + params = self.params.copy() + indices = self.indices.copy() + arg2scope = dict(self._arg2scope) + for arg, val in zip(argnames, valset): + if arg in params: + raise ValueError(f"duplicate parametrization of {arg!r}") + params[arg] = val + indices[arg] = param_index + arg2scope[arg] = scope + return CallSpec2( + params=params, + indices=indices, + _arg2scope=arg2scope, + _idlist=[*self._idlist, id], + marks=[*self.marks, *normalize_mark_list(marks)], + ) + + def getparam(self, name: str) -> object: + try: + return self.params[name] + except KeyError as e: + raise ValueError(name) from e + + @property + def id(self) -> str: + return "-".join(self._idlist) + + +def get_direct_param_fixture_func(request: FixtureRequest) -> Any: + return request.param + + +# Used for storing pseudo fixturedefs for direct parametrization. +name2pseudofixturedef_key = StashKey[Dict[str, FixtureDef[Any]]]() + + +@final +class Metafunc: + """Objects passed to the :hook:`pytest_generate_tests` hook. + + They help to inspect a test function and to generate tests according to + test configuration or values specified in the class or module where a + test function is defined. + """ + + def __init__( + self, + definition: FunctionDefinition, + fixtureinfo: fixtures.FuncFixtureInfo, + config: Config, + cls=None, + module=None, + *, + _ispytest: bool = False, + ) -> None: + check_ispytest(_ispytest) + + #: Access to the underlying :class:`_pytest.python.FunctionDefinition`. + self.definition = definition + + #: Access to the :class:`pytest.Config` object for the test session. + self.config = config + + #: The module object where the test function is defined in. + self.module = module + + #: Underlying Python test function. + self.function = definition.obj + + #: Set of fixture names required by the test function. + self.fixturenames = fixtureinfo.names_closure + + #: Class object where the test function is defined in or ``None``. + self.cls = cls + + self._arg2fixturedefs = fixtureinfo.name2fixturedefs + + # Result of parametrize(). + self._calls: list[CallSpec2] = [] + + def parametrize( + self, + argnames: str | Sequence[str], + argvalues: Iterable[ParameterSet | Sequence[object] | object], + indirect: bool | Sequence[str] = False, + ids: Iterable[object | None] | Callable[[Any], object | None] | None = None, + scope: _ScopeName | None = None, + *, + _param_mark: Mark | None = None, + ) -> None: + """Add new invocations to the underlying test function using the list + of argvalues for the given argnames. Parametrization is performed + during the collection phase. If you need to setup expensive resources + see about setting indirect to do it rather than at test setup time. + + Can be called multiple times per test function (but only on different + argument names), in which case each call parametrizes all previous + parametrizations, e.g. + + :: + + unparametrized: t + parametrize ["x", "y"]: t[x], t[y] + parametrize [1, 2]: t[x-1], t[x-2], t[y-1], t[y-2] + + :param argnames: + A comma-separated string denoting one or more argument names, or + a list/tuple of argument strings. + + :param argvalues: + The list of argvalues determines how often a test is invoked with + different argument values. + + If only one argname was specified argvalues is a list of values. + If N argnames were specified, argvalues must be a list of + N-tuples, where each tuple-element specifies a value for its + respective argname. + :type argvalues: Iterable[_pytest.mark.structures.ParameterSet | Sequence[object] | object] + :param indirect: + A list of arguments' names (subset of argnames) or a boolean. + If True the list contains all names from the argnames. Each + argvalue corresponding to an argname in this list will + be passed as request.param to its respective argname fixture + function so that it can perform more expensive setups during the + setup phase of a test rather than at collection time. + + :param ids: + Sequence of (or generator for) ids for ``argvalues``, + or a callable to return part of the id for each argvalue. + + With sequences (and generators like ``itertools.count()``) the + returned ids should be of type ``string``, ``int``, ``float``, + ``bool``, or ``None``. + They are mapped to the corresponding index in ``argvalues``. + ``None`` means to use the auto-generated id. + + If it is a callable it will be called for each entry in + ``argvalues``, and the return value is used as part of the + auto-generated id for the whole set (where parts are joined with + dashes ("-")). + This is useful to provide more specific ids for certain items, e.g. + dates. Returning ``None`` will use an auto-generated id. + + If no ids are provided they will be generated automatically from + the argvalues. + + :param scope: + If specified it denotes the scope of the parameters. + The scope is used for grouping tests by parameter instances. + It will also override any fixture-function defined scope, allowing + to set a dynamic scope using test context or configuration. + """ + argnames, parametersets = ParameterSet._for_parametrize( + argnames, + argvalues, + self.function, + self.config, + nodeid=self.definition.nodeid, + ) + del argvalues + + if "request" in argnames: + fail( + "'request' is a reserved name and cannot be used in @pytest.mark.parametrize", + pytrace=False, + ) + + if scope is not None: + scope_ = Scope.from_user( + scope, descr=f"parametrize() call in {self.function.__name__}" + ) + else: + scope_ = _find_parametrized_scope(argnames, self._arg2fixturedefs, indirect) + + self._validate_if_using_arg_names(argnames, indirect) + + # Use any already (possibly) generated ids with parametrize Marks. + if _param_mark and _param_mark._param_ids_from: + generated_ids = _param_mark._param_ids_from._param_ids_generated + if generated_ids is not None: + ids = generated_ids + + ids = self._resolve_parameter_set_ids( + argnames, ids, parametersets, nodeid=self.definition.nodeid + ) + + # Store used (possibly generated) ids with parametrize Marks. + if _param_mark and _param_mark._param_ids_from and generated_ids is None: + object.__setattr__(_param_mark._param_ids_from, "_param_ids_generated", ids) + + # Add funcargs as fixturedefs to fixtureinfo.arg2fixturedefs by registering + # artificial "pseudo" FixtureDef's so that later at test execution time we can + # rely on a proper FixtureDef to exist for fixture setup. + node = None + # If we have a scope that is higher than function, we need + # to make sure we only ever create an according fixturedef on + # a per-scope basis. We thus store and cache the fixturedef on the + # node related to the scope. + if scope_ is not Scope.Function: + collector = self.definition.parent + assert collector is not None + node = get_scope_node(collector, scope_) + if node is None: + # If used class scope and there is no class, use module-level + # collector (for now). + if scope_ is Scope.Class: + assert isinstance(collector, Module) + node = collector + # If used package scope and there is no package, use session + # (for now). + elif scope_ is Scope.Package: + node = collector.session + else: + assert False, f"Unhandled missing scope: {scope}" + if node is None: + name2pseudofixturedef = None + else: + default: dict[str, FixtureDef[Any]] = {} + name2pseudofixturedef = node.stash.setdefault( + name2pseudofixturedef_key, default + ) + arg_directness = self._resolve_args_directness(argnames, indirect) + for argname in argnames: + if arg_directness[argname] == "indirect": + continue + if name2pseudofixturedef is not None and argname in name2pseudofixturedef: + fixturedef = name2pseudofixturedef[argname] + else: + fixturedef = FixtureDef( + config=self.config, + baseid="", + argname=argname, + func=get_direct_param_fixture_func, + scope=scope_, + params=None, + ids=None, + _ispytest=True, + ) + if name2pseudofixturedef is not None: + name2pseudofixturedef[argname] = fixturedef + self._arg2fixturedefs[argname] = [fixturedef] + + # Create the new calls: if we are parametrize() multiple times (by applying the decorator + # more than once) then we accumulate those calls generating the cartesian product + # of all calls. + newcalls = [] + for callspec in self._calls or [CallSpec2()]: + for param_index, (param_id, param_set) in enumerate( + zip(ids, parametersets) + ): + newcallspec = callspec.setmulti( + argnames=argnames, + valset=param_set.values, + id=param_id, + marks=param_set.marks, + scope=scope_, + param_index=param_index, + ) + newcalls.append(newcallspec) + self._calls = newcalls + + def _resolve_parameter_set_ids( + self, + argnames: Sequence[str], + ids: Iterable[object | None] | Callable[[Any], object | None] | None, + parametersets: Sequence[ParameterSet], + nodeid: str, + ) -> list[str]: + """Resolve the actual ids for the given parameter sets. + + :param argnames: + Argument names passed to ``parametrize()``. + :param ids: + The `ids` parameter of the ``parametrize()`` call (see docs). + :param parametersets: + The parameter sets, each containing a set of values corresponding + to ``argnames``. + :param nodeid str: + The nodeid of the definition item that generated this + parametrization. + :returns: + List with ids for each parameter set given. + """ + if ids is None: + idfn = None + ids_ = None + elif callable(ids): + idfn = ids + ids_ = None + else: + idfn = None + ids_ = self._validate_ids(ids, parametersets, self.function.__name__) + id_maker = IdMaker( + argnames, + parametersets, + idfn, + ids_, + self.config, + nodeid=nodeid, + func_name=self.function.__name__, + ) + return id_maker.make_unique_parameterset_ids() + + def _validate_ids( + self, + ids: Iterable[object | None], + parametersets: Sequence[ParameterSet], + func_name: str, + ) -> list[object | None]: + try: + num_ids = len(ids) # type: ignore[arg-type] + except TypeError: + try: + iter(ids) + except TypeError as e: + raise TypeError("ids must be a callable or an iterable") from e + num_ids = len(parametersets) + + # num_ids == 0 is a special case: https://github.com/pytest-dev/pytest/issues/1849 + if num_ids != len(parametersets) and num_ids != 0: + msg = "In {}: {} parameter sets specified, with different number of ids: {}" + fail(msg.format(func_name, len(parametersets), num_ids), pytrace=False) + + return list(itertools.islice(ids, num_ids)) + + def _resolve_args_directness( + self, + argnames: Sequence[str], + indirect: bool | Sequence[str], + ) -> dict[str, Literal["indirect", "direct"]]: + """Resolve if each parametrized argument must be considered an indirect + parameter to a fixture of the same name, or a direct parameter to the + parametrized function, based on the ``indirect`` parameter of the + parametrized() call. + + :param argnames: + List of argument names passed to ``parametrize()``. + :param indirect: + Same as the ``indirect`` parameter of ``parametrize()``. + :returns + A dict mapping each arg name to either "indirect" or "direct". + """ + arg_directness: dict[str, Literal["indirect", "direct"]] + if isinstance(indirect, bool): + arg_directness = dict.fromkeys( + argnames, "indirect" if indirect else "direct" + ) + elif isinstance(indirect, Sequence): + arg_directness = dict.fromkeys(argnames, "direct") + for arg in indirect: + if arg not in argnames: + fail( + f"In {self.function.__name__}: indirect fixture '{arg}' doesn't exist", + pytrace=False, + ) + arg_directness[arg] = "indirect" + else: + fail( + f"In {self.function.__name__}: expected Sequence or boolean" + f" for indirect, got {type(indirect).__name__}", + pytrace=False, + ) + return arg_directness + + def _validate_if_using_arg_names( + self, + argnames: Sequence[str], + indirect: bool | Sequence[str], + ) -> None: + """Check if all argnames are being used, by default values, or directly/indirectly. + + :param List[str] argnames: List of argument names passed to ``parametrize()``. + :param indirect: Same as the ``indirect`` parameter of ``parametrize()``. + :raises ValueError: If validation fails. + """ + default_arg_names = set(get_default_arg_names(self.function)) + func_name = self.function.__name__ + for arg in argnames: + if arg not in self.fixturenames: + if arg in default_arg_names: + fail( + f"In {func_name}: function already takes an argument '{arg}' with a default value", + pytrace=False, + ) + else: + if isinstance(indirect, Sequence): + name = "fixture" if arg in indirect else "argument" + else: + name = "fixture" if indirect else "argument" + fail( + f"In {func_name}: function uses no {name} '{arg}'", + pytrace=False, + ) + + +def _find_parametrized_scope( + argnames: Sequence[str], + arg2fixturedefs: Mapping[str, Sequence[fixtures.FixtureDef[object]]], + indirect: bool | Sequence[str], +) -> Scope: + """Find the most appropriate scope for a parametrized call based on its arguments. + + When there's at least one direct argument, always use "function" scope. + + When a test function is parametrized and all its arguments are indirect + (e.g. fixtures), return the most narrow scope based on the fixtures used. + + Related to issue #1832, based on code posted by @Kingdread. + """ + if isinstance(indirect, Sequence): + all_arguments_are_fixtures = len(indirect) == len(argnames) + else: + all_arguments_are_fixtures = bool(indirect) + + if all_arguments_are_fixtures: + fixturedefs = arg2fixturedefs or {} + used_scopes = [ + fixturedef[-1]._scope + for name, fixturedef in fixturedefs.items() + if name in argnames + ] + # Takes the most narrow scope from used fixtures. + return min(used_scopes, default=Scope.Function) + + return Scope.Function + + +def _ascii_escaped_by_config(val: str | bytes, config: Config | None) -> str: + if config is None: + escape_option = False + else: + escape_option = config.getini( + "disable_test_id_escaping_and_forfeit_all_rights_to_community_support" + ) + # TODO: If escaping is turned off and the user passes bytes, + # will return a bytes. For now we ignore this but the + # code *probably* doesn't handle this case. + return val if escape_option else ascii_escaped(val) # type: ignore + + +class Function(PyobjMixin, nodes.Item): + """Item responsible for setting up and executing a Python test function. + + :param name: + The full function name, including any decorations like those + added by parametrization (``my_func[my_param]``). + :param parent: + The parent Node. + :param config: + The pytest Config object. + :param callspec: + If given, this function has been parametrized and the callspec contains + meta information about the parametrization. + :param callobj: + If given, the object which will be called when the Function is invoked, + otherwise the callobj will be obtained from ``parent`` using ``originalname``. + :param keywords: + Keywords bound to the function object for "-k" matching. + :param session: + The pytest Session object. + :param fixtureinfo: + Fixture information already resolved at this fixture node.. + :param originalname: + The attribute name to use for accessing the underlying function object. + Defaults to ``name``. Set this if name is different from the original name, + for example when it contains decorations like those added by parametrization + (``my_func[my_param]``). + """ + + # Disable since functions handle it themselves. + _ALLOW_MARKERS = False + + def __init__( + self, + name: str, + parent, + config: Config | None = None, + callspec: CallSpec2 | None = None, + callobj=NOTSET, + keywords: Mapping[str, Any] | None = None, + session: Session | None = None, + fixtureinfo: FuncFixtureInfo | None = None, + originalname: str | None = None, + ) -> None: + super().__init__(name, parent, config=config, session=session) + + if callobj is not NOTSET: + self._obj = callobj + self._instance = getattr(callobj, "__self__", None) + + #: Original function name, without any decorations (for example + #: parametrization adds a ``"[...]"`` suffix to function names), used to access + #: the underlying function object from ``parent`` (in case ``callobj`` is not given + #: explicitly). + #: + #: .. versionadded:: 3.0 + self.originalname = originalname or name + + # Note: when FunctionDefinition is introduced, we should change ``originalname`` + # to a readonly property that returns FunctionDefinition.name. + + self.own_markers.extend(get_unpacked_marks(self.obj)) + if callspec: + self.callspec = callspec + self.own_markers.extend(callspec.marks) + + # todo: this is a hell of a hack + # https://github.com/pytest-dev/pytest/issues/4569 + # Note: the order of the updates is important here; indicates what + # takes priority (ctor argument over function attributes over markers). + # Take own_markers only; NodeKeywords handles parent traversal on its own. + self.keywords.update((mark.name, mark) for mark in self.own_markers) + self.keywords.update(self.obj.__dict__) + if keywords: + self.keywords.update(keywords) + + if fixtureinfo is None: + fm = self.session._fixturemanager + fixtureinfo = fm.getfixtureinfo(self, self.obj, self.cls) + self._fixtureinfo: FuncFixtureInfo = fixtureinfo + self.fixturenames = fixtureinfo.names_closure + self._initrequest() + + # todo: determine sound type limitations + @classmethod + def from_parent(cls, parent, **kw) -> Self: + """The public constructor.""" + return super().from_parent(parent=parent, **kw) + + def _initrequest(self) -> None: + self.funcargs: dict[str, object] = {} + self._request = fixtures.TopRequest(self, _ispytest=True) + + @property + def function(self): + """Underlying python 'function' object.""" + return getimfunc(self.obj) + + @property + def instance(self): + try: + return self._instance + except AttributeError: + if isinstance(self.parent, Class): + # Each Function gets a fresh class instance. + self._instance = self._getinstance() + else: + self._instance = None + return self._instance + + def _getinstance(self): + if isinstance(self.parent, Class): + # Each Function gets a fresh class instance. + return self.parent.newinstance() + else: + return None + + def _getobj(self): + instance = self.instance + if instance is not None: + parent_obj = instance + else: + assert self.parent is not None + parent_obj = self.parent.obj # type: ignore[attr-defined] + return getattr(parent_obj, self.originalname) + + @property + def _pyfuncitem(self): + """(compatonly) for code expecting pytest-2.2 style request objects.""" + return self + + def runtest(self) -> None: + """Execute the underlying test function.""" + self.ihook.pytest_pyfunc_call(pyfuncitem=self) + + def setup(self) -> None: + self._request._fillfixtures() + + def _traceback_filter(self, excinfo: ExceptionInfo[BaseException]) -> Traceback: + if hasattr(self, "_obj") and not self.config.getoption("fulltrace", False): + code = _pytest._code.Code.from_function(get_real_func(self.obj)) + path, firstlineno = code.path, code.firstlineno + traceback = excinfo.traceback + ntraceback = traceback.cut(path=path, firstlineno=firstlineno) + if ntraceback == traceback: + ntraceback = ntraceback.cut(path=path) + if ntraceback == traceback: + ntraceback = ntraceback.filter(filter_traceback) + if not ntraceback: + ntraceback = traceback + ntraceback = ntraceback.filter(excinfo) + + # issue364: mark all but first and last frames to + # only show a single-line message for each frame. + if self.config.getoption("tbstyle", "auto") == "auto": + if len(ntraceback) > 2: + ntraceback = Traceback( + ( + ntraceback[0], + *(t.with_repr_style("short") for t in ntraceback[1:-1]), + ntraceback[-1], + ) + ) + + return ntraceback + return excinfo.traceback + + # TODO: Type ignored -- breaks Liskov Substitution. + def repr_failure( # type: ignore[override] + self, + excinfo: ExceptionInfo[BaseException], + ) -> str | TerminalRepr: + style = self.config.getoption("tbstyle", "auto") + if style == "auto": + style = "long" + return self._repr_failure_py(excinfo, style=style) + + +class FunctionDefinition(Function): + """This class is a stop gap solution until we evolve to have actual function + definition nodes and manage to get rid of ``metafunc``.""" + + def runtest(self) -> None: + raise RuntimeError("function definitions are not supposed to be run as tests") + + setup = runtest diff --git a/.venv/Lib/site-packages/_pytest/python_api.py b/.venv/Lib/site-packages/_pytest/python_api.py new file mode 100644 index 00000000..4174a55b --- /dev/null +++ b/.venv/Lib/site-packages/_pytest/python_api.py @@ -0,0 +1,1020 @@ +# mypy: allow-untyped-defs +from __future__ import annotations + +from collections.abc import Collection +from collections.abc import Sized +from decimal import Decimal +import math +from numbers import Complex +import pprint +import re +from types import TracebackType +from typing import Any +from typing import Callable +from typing import cast +from typing import ContextManager +from typing import final +from typing import Mapping +from typing import overload +from typing import Pattern +from typing import Sequence +from typing import Tuple +from typing import Type +from typing import TYPE_CHECKING +from typing import TypeVar + +import _pytest._code +from _pytest.outcomes import fail + + +if TYPE_CHECKING: + from numpy import ndarray + + +def _compare_approx( + full_object: object, + message_data: Sequence[tuple[str, str, str]], + number_of_elements: int, + different_ids: Sequence[object], + max_abs_diff: float, + max_rel_diff: float, +) -> list[str]: + message_list = list(message_data) + message_list.insert(0, ("Index", "Obtained", "Expected")) + max_sizes = [0, 0, 0] + for index, obtained, expected in message_list: + max_sizes[0] = max(max_sizes[0], len(index)) + max_sizes[1] = max(max_sizes[1], len(obtained)) + max_sizes[2] = max(max_sizes[2], len(expected)) + explanation = [ + f"comparison failed. Mismatched elements: {len(different_ids)} / {number_of_elements}:", + f"Max absolute difference: {max_abs_diff}", + f"Max relative difference: {max_rel_diff}", + ] + [ + f"{indexes:<{max_sizes[0]}} | {obtained:<{max_sizes[1]}} | {expected:<{max_sizes[2]}}" + for indexes, obtained, expected in message_list + ] + return explanation + + +# builtin pytest.approx helper + + +class ApproxBase: + """Provide shared utilities for making approximate comparisons between + numbers or sequences of numbers.""" + + # Tell numpy to use our `__eq__` operator instead of its. + __array_ufunc__ = None + __array_priority__ = 100 + + def __init__(self, expected, rel=None, abs=None, nan_ok: bool = False) -> None: + __tracebackhide__ = True + self.expected = expected + self.abs = abs + self.rel = rel + self.nan_ok = nan_ok + self._check_type() + + def __repr__(self) -> str: + raise NotImplementedError + + def _repr_compare(self, other_side: Any) -> list[str]: + return [ + "comparison failed", + f"Obtained: {other_side}", + f"Expected: {self}", + ] + + def __eq__(self, actual) -> bool: + return all( + a == self._approx_scalar(x) for a, x in self._yield_comparisons(actual) + ) + + def __bool__(self): + __tracebackhide__ = True + raise AssertionError( + "approx() is not supported in a boolean context.\nDid you mean: `assert a == approx(b)`?" + ) + + # Ignore type because of https://github.com/python/mypy/issues/4266. + __hash__ = None # type: ignore + + def __ne__(self, actual) -> bool: + return not (actual == self) + + def _approx_scalar(self, x) -> ApproxScalar: + if isinstance(x, Decimal): + return ApproxDecimal(x, rel=self.rel, abs=self.abs, nan_ok=self.nan_ok) + return ApproxScalar(x, rel=self.rel, abs=self.abs, nan_ok=self.nan_ok) + + def _yield_comparisons(self, actual): + """Yield all the pairs of numbers to be compared. + + This is used to implement the `__eq__` method. + """ + raise NotImplementedError + + def _check_type(self) -> None: + """Raise a TypeError if the expected value is not a valid type.""" + # This is only a concern if the expected value is a sequence. In every + # other case, the approx() function ensures that the expected value has + # a numeric type. For this reason, the default is to do nothing. The + # classes that deal with sequences should reimplement this method to + # raise if there are any non-numeric elements in the sequence. + + +def _recursive_sequence_map(f, x): + """Recursively map a function over a sequence of arbitrary depth""" + if isinstance(x, (list, tuple)): + seq_type = type(x) + return seq_type(_recursive_sequence_map(f, xi) for xi in x) + elif _is_sequence_like(x): + return [_recursive_sequence_map(f, xi) for xi in x] + else: + return f(x) + + +class ApproxNumpy(ApproxBase): + """Perform approximate comparisons where the expected value is numpy array.""" + + def __repr__(self) -> str: + list_scalars = _recursive_sequence_map( + self._approx_scalar, self.expected.tolist() + ) + return f"approx({list_scalars!r})" + + def _repr_compare(self, other_side: ndarray | list[Any]) -> list[str]: + import itertools + import math + + def get_value_from_nested_list( + nested_list: list[Any], nd_index: tuple[Any, ...] + ) -> Any: + """ + Helper function to get the value out of a nested list, given an n-dimensional index. + This mimics numpy's indexing, but for raw nested python lists. + """ + value: Any = nested_list + for i in nd_index: + value = value[i] + return value + + np_array_shape = self.expected.shape + approx_side_as_seq = _recursive_sequence_map( + self._approx_scalar, self.expected.tolist() + ) + + # convert other_side to numpy array to ensure shape attribute is available + other_side_as_array = _as_numpy_array(other_side) + assert other_side_as_array is not None + + if np_array_shape != other_side_as_array.shape: + return [ + "Impossible to compare arrays with different shapes.", + f"Shapes: {np_array_shape} and {other_side_as_array.shape}", + ] + + number_of_elements = self.expected.size + max_abs_diff = -math.inf + max_rel_diff = -math.inf + different_ids = [] + for index in itertools.product(*(range(i) for i in np_array_shape)): + approx_value = get_value_from_nested_list(approx_side_as_seq, index) + other_value = get_value_from_nested_list(other_side_as_array, index) + if approx_value != other_value: + abs_diff = abs(approx_value.expected - other_value) + max_abs_diff = max(max_abs_diff, abs_diff) + if other_value == 0.0: + max_rel_diff = math.inf + else: + max_rel_diff = max(max_rel_diff, abs_diff / abs(other_value)) + different_ids.append(index) + + message_data = [ + ( + str(index), + str(get_value_from_nested_list(other_side_as_array, index)), + str(get_value_from_nested_list(approx_side_as_seq, index)), + ) + for index in different_ids + ] + return _compare_approx( + self.expected, + message_data, + number_of_elements, + different_ids, + max_abs_diff, + max_rel_diff, + ) + + def __eq__(self, actual) -> bool: + import numpy as np + + # self.expected is supposed to always be an array here. + + if not np.isscalar(actual): + try: + actual = np.asarray(actual) + except Exception as e: + raise TypeError(f"cannot compare '{actual}' to numpy.ndarray") from e + + if not np.isscalar(actual) and actual.shape != self.expected.shape: + return False + + return super().__eq__(actual) + + def _yield_comparisons(self, actual): + import numpy as np + + # `actual` can either be a numpy array or a scalar, it is treated in + # `__eq__` before being passed to `ApproxBase.__eq__`, which is the + # only method that calls this one. + + if np.isscalar(actual): + for i in np.ndindex(self.expected.shape): + yield actual, self.expected[i].item() + else: + for i in np.ndindex(self.expected.shape): + yield actual[i].item(), self.expected[i].item() + + +class ApproxMapping(ApproxBase): + """Perform approximate comparisons where the expected value is a mapping + with numeric values (the keys can be anything).""" + + def __repr__(self) -> str: + return f"approx({({k: self._approx_scalar(v) for k, v in self.expected.items()})!r})" + + def _repr_compare(self, other_side: Mapping[object, float]) -> list[str]: + import math + + approx_side_as_map = { + k: self._approx_scalar(v) for k, v in self.expected.items() + } + + number_of_elements = len(approx_side_as_map) + max_abs_diff = -math.inf + max_rel_diff = -math.inf + different_ids = [] + for (approx_key, approx_value), other_value in zip( + approx_side_as_map.items(), other_side.values() + ): + if approx_value != other_value: + if approx_value.expected is not None and other_value is not None: + max_abs_diff = max( + max_abs_diff, abs(approx_value.expected - other_value) + ) + if approx_value.expected == 0.0: + max_rel_diff = math.inf + else: + max_rel_diff = max( + max_rel_diff, + abs( + (approx_value.expected - other_value) + / approx_value.expected + ), + ) + different_ids.append(approx_key) + + message_data = [ + (str(key), str(other_side[key]), str(approx_side_as_map[key])) + for key in different_ids + ] + + return _compare_approx( + self.expected, + message_data, + number_of_elements, + different_ids, + max_abs_diff, + max_rel_diff, + ) + + def __eq__(self, actual) -> bool: + try: + if set(actual.keys()) != set(self.expected.keys()): + return False + except AttributeError: + return False + + return super().__eq__(actual) + + def _yield_comparisons(self, actual): + for k in self.expected.keys(): + yield actual[k], self.expected[k] + + def _check_type(self) -> None: + __tracebackhide__ = True + for key, value in self.expected.items(): + if isinstance(value, type(self.expected)): + msg = "pytest.approx() does not support nested dictionaries: key={!r} value={!r}\n full mapping={}" + raise TypeError(msg.format(key, value, pprint.pformat(self.expected))) + + +class ApproxSequenceLike(ApproxBase): + """Perform approximate comparisons where the expected value is a sequence of numbers.""" + + def __repr__(self) -> str: + seq_type = type(self.expected) + if seq_type not in (tuple, list): + seq_type = list + return f"approx({seq_type(self._approx_scalar(x) for x in self.expected)!r})" + + def _repr_compare(self, other_side: Sequence[float]) -> list[str]: + import math + + if len(self.expected) != len(other_side): + return [ + "Impossible to compare lists with different sizes.", + f"Lengths: {len(self.expected)} and {len(other_side)}", + ] + + approx_side_as_map = _recursive_sequence_map(self._approx_scalar, self.expected) + + number_of_elements = len(approx_side_as_map) + max_abs_diff = -math.inf + max_rel_diff = -math.inf + different_ids = [] + for i, (approx_value, other_value) in enumerate( + zip(approx_side_as_map, other_side) + ): + if approx_value != other_value: + abs_diff = abs(approx_value.expected - other_value) + max_abs_diff = max(max_abs_diff, abs_diff) + if other_value == 0.0: + max_rel_diff = math.inf + else: + max_rel_diff = max(max_rel_diff, abs_diff / abs(other_value)) + different_ids.append(i) + + message_data = [ + (str(i), str(other_side[i]), str(approx_side_as_map[i])) + for i in different_ids + ] + + return _compare_approx( + self.expected, + message_data, + number_of_elements, + different_ids, + max_abs_diff, + max_rel_diff, + ) + + def __eq__(self, actual) -> bool: + try: + if len(actual) != len(self.expected): + return False + except TypeError: + return False + return super().__eq__(actual) + + def _yield_comparisons(self, actual): + return zip(actual, self.expected) + + def _check_type(self) -> None: + __tracebackhide__ = True + for index, x in enumerate(self.expected): + if isinstance(x, type(self.expected)): + msg = "pytest.approx() does not support nested data structures: {!r} at index {}\n full sequence: {}" + raise TypeError(msg.format(x, index, pprint.pformat(self.expected))) + + +class ApproxScalar(ApproxBase): + """Perform approximate comparisons where the expected value is a single number.""" + + # Using Real should be better than this Union, but not possible yet: + # https://github.com/python/typeshed/pull/3108 + DEFAULT_ABSOLUTE_TOLERANCE: float | Decimal = 1e-12 + DEFAULT_RELATIVE_TOLERANCE: float | Decimal = 1e-6 + + def __repr__(self) -> str: + """Return a string communicating both the expected value and the + tolerance for the comparison being made. + + For example, ``1.0 ± 1e-6``, ``(3+4j) ± 5e-6 ∠ ±180°``. + """ + # Don't show a tolerance for values that aren't compared using + # tolerances, i.e. non-numerics and infinities. Need to call abs to + # handle complex numbers, e.g. (inf + 1j). + if (not isinstance(self.expected, (Complex, Decimal))) or math.isinf( + abs(self.expected) + ): + return str(self.expected) + + # If a sensible tolerance can't be calculated, self.tolerance will + # raise a ValueError. In this case, display '???'. + try: + vetted_tolerance = f"{self.tolerance:.1e}" + if ( + isinstance(self.expected, Complex) + and self.expected.imag + and not math.isinf(self.tolerance) + ): + vetted_tolerance += " ∠ ±180°" + except ValueError: + vetted_tolerance = "???" + + return f"{self.expected} ± {vetted_tolerance}" + + def __eq__(self, actual) -> bool: + """Return whether the given value is equal to the expected value + within the pre-specified tolerance.""" + asarray = _as_numpy_array(actual) + if asarray is not None: + # Call ``__eq__()`` manually to prevent infinite-recursion with + # numpy<1.13. See #3748. + return all(self.__eq__(a) for a in asarray.flat) + + # Short-circuit exact equality. + if actual == self.expected: + return True + + # If either type is non-numeric, fall back to strict equality. + # NB: we need Complex, rather than just Number, to ensure that __abs__, + # __sub__, and __float__ are defined. + if not ( + isinstance(self.expected, (Complex, Decimal)) + and isinstance(actual, (Complex, Decimal)) + ): + return False + + # Allow the user to control whether NaNs are considered equal to each + # other or not. The abs() calls are for compatibility with complex + # numbers. + if math.isnan(abs(self.expected)): + return self.nan_ok and math.isnan(abs(actual)) + + # Infinity shouldn't be approximately equal to anything but itself, but + # if there's a relative tolerance, it will be infinite and infinity + # will seem approximately equal to everything. The equal-to-itself + # case would have been short circuited above, so here we can just + # return false if the expected value is infinite. The abs() call is + # for compatibility with complex numbers. + if math.isinf(abs(self.expected)): + return False + + # Return true if the two numbers are within the tolerance. + result: bool = abs(self.expected - actual) <= self.tolerance + return result + + # Ignore type because of https://github.com/python/mypy/issues/4266. + __hash__ = None # type: ignore + + @property + def tolerance(self): + """Return the tolerance for the comparison. + + This could be either an absolute tolerance or a relative tolerance, + depending on what the user specified or which would be larger. + """ + + def set_default(x, default): + return x if x is not None else default + + # Figure out what the absolute tolerance should be. ``self.abs`` is + # either None or a value specified by the user. + absolute_tolerance = set_default(self.abs, self.DEFAULT_ABSOLUTE_TOLERANCE) + + if absolute_tolerance < 0: + raise ValueError( + f"absolute tolerance can't be negative: {absolute_tolerance}" + ) + if math.isnan(absolute_tolerance): + raise ValueError("absolute tolerance can't be NaN.") + + # If the user specified an absolute tolerance but not a relative one, + # just return the absolute tolerance. + if self.rel is None: + if self.abs is not None: + return absolute_tolerance + + # Figure out what the relative tolerance should be. ``self.rel`` is + # either None or a value specified by the user. This is done after + # we've made sure the user didn't ask for an absolute tolerance only, + # because we don't want to raise errors about the relative tolerance if + # we aren't even going to use it. + relative_tolerance = set_default( + self.rel, self.DEFAULT_RELATIVE_TOLERANCE + ) * abs(self.expected) + + if relative_tolerance < 0: + raise ValueError( + f"relative tolerance can't be negative: {relative_tolerance}" + ) + if math.isnan(relative_tolerance): + raise ValueError("relative tolerance can't be NaN.") + + # Return the larger of the relative and absolute tolerances. + return max(relative_tolerance, absolute_tolerance) + + +class ApproxDecimal(ApproxScalar): + """Perform approximate comparisons where the expected value is a Decimal.""" + + DEFAULT_ABSOLUTE_TOLERANCE = Decimal("1e-12") + DEFAULT_RELATIVE_TOLERANCE = Decimal("1e-6") + + +def approx(expected, rel=None, abs=None, nan_ok: bool = False) -> ApproxBase: + """Assert that two numbers (or two ordered sequences of numbers) are equal to each other + within some tolerance. + + Due to the :doc:`python:tutorial/floatingpoint`, numbers that we + would intuitively expect to be equal are not always so:: + + >>> 0.1 + 0.2 == 0.3 + False + + This problem is commonly encountered when writing tests, e.g. when making + sure that floating-point values are what you expect them to be. One way to + deal with this problem is to assert that two floating-point numbers are + equal to within some appropriate tolerance:: + + >>> abs((0.1 + 0.2) - 0.3) < 1e-6 + True + + However, comparisons like this are tedious to write and difficult to + understand. Furthermore, absolute comparisons like the one above are + usually discouraged because there's no tolerance that works well for all + situations. ``1e-6`` is good for numbers around ``1``, but too small for + very big numbers and too big for very small ones. It's better to express + the tolerance as a fraction of the expected value, but relative comparisons + like that are even more difficult to write correctly and concisely. + + The ``approx`` class performs floating-point comparisons using a syntax + that's as intuitive as possible:: + + >>> from pytest import approx + >>> 0.1 + 0.2 == approx(0.3) + True + + The same syntax also works for ordered sequences of numbers:: + + >>> (0.1 + 0.2, 0.2 + 0.4) == approx((0.3, 0.6)) + True + + ``numpy`` arrays:: + + >>> import numpy as np # doctest: +SKIP + >>> np.array([0.1, 0.2]) + np.array([0.2, 0.4]) == approx(np.array([0.3, 0.6])) # doctest: +SKIP + True + + And for a ``numpy`` array against a scalar:: + + >>> import numpy as np # doctest: +SKIP + >>> np.array([0.1, 0.2]) + np.array([0.2, 0.1]) == approx(0.3) # doctest: +SKIP + True + + Only ordered sequences are supported, because ``approx`` needs + to infer the relative position of the sequences without ambiguity. This means + ``sets`` and other unordered sequences are not supported. + + Finally, dictionary *values* can also be compared:: + + >>> {'a': 0.1 + 0.2, 'b': 0.2 + 0.4} == approx({'a': 0.3, 'b': 0.6}) + True + + The comparison will be true if both mappings have the same keys and their + respective values match the expected tolerances. + + **Tolerances** + + By default, ``approx`` considers numbers within a relative tolerance of + ``1e-6`` (i.e. one part in a million) of its expected value to be equal. + This treatment would lead to surprising results if the expected value was + ``0.0``, because nothing but ``0.0`` itself is relatively close to ``0.0``. + To handle this case less surprisingly, ``approx`` also considers numbers + within an absolute tolerance of ``1e-12`` of its expected value to be + equal. Infinity and NaN are special cases. Infinity is only considered + equal to itself, regardless of the relative tolerance. NaN is not + considered equal to anything by default, but you can make it be equal to + itself by setting the ``nan_ok`` argument to True. (This is meant to + facilitate comparing arrays that use NaN to mean "no data".) + + Both the relative and absolute tolerances can be changed by passing + arguments to the ``approx`` constructor:: + + >>> 1.0001 == approx(1) + False + >>> 1.0001 == approx(1, rel=1e-3) + True + >>> 1.0001 == approx(1, abs=1e-3) + True + + If you specify ``abs`` but not ``rel``, the comparison will not consider + the relative tolerance at all. In other words, two numbers that are within + the default relative tolerance of ``1e-6`` will still be considered unequal + if they exceed the specified absolute tolerance. If you specify both + ``abs`` and ``rel``, the numbers will be considered equal if either + tolerance is met:: + + >>> 1 + 1e-8 == approx(1) + True + >>> 1 + 1e-8 == approx(1, abs=1e-12) + False + >>> 1 + 1e-8 == approx(1, rel=1e-6, abs=1e-12) + True + + You can also use ``approx`` to compare nonnumeric types, or dicts and + sequences containing nonnumeric types, in which case it falls back to + strict equality. This can be useful for comparing dicts and sequences that + can contain optional values:: + + >>> {"required": 1.0000005, "optional": None} == approx({"required": 1, "optional": None}) + True + >>> [None, 1.0000005] == approx([None,1]) + True + >>> ["foo", 1.0000005] == approx([None,1]) + False + + If you're thinking about using ``approx``, then you might want to know how + it compares to other good ways of comparing floating-point numbers. All of + these algorithms are based on relative and absolute tolerances and should + agree for the most part, but they do have meaningful differences: + + - ``math.isclose(a, b, rel_tol=1e-9, abs_tol=0.0)``: True if the relative + tolerance is met w.r.t. either ``a`` or ``b`` or if the absolute + tolerance is met. Because the relative tolerance is calculated w.r.t. + both ``a`` and ``b``, this test is symmetric (i.e. neither ``a`` nor + ``b`` is a "reference value"). You have to specify an absolute tolerance + if you want to compare to ``0.0`` because there is no tolerance by + default. More information: :py:func:`math.isclose`. + + - ``numpy.isclose(a, b, rtol=1e-5, atol=1e-8)``: True if the difference + between ``a`` and ``b`` is less that the sum of the relative tolerance + w.r.t. ``b`` and the absolute tolerance. Because the relative tolerance + is only calculated w.r.t. ``b``, this test is asymmetric and you can + think of ``b`` as the reference value. Support for comparing sequences + is provided by :py:func:`numpy.allclose`. More information: + :std:doc:`numpy:reference/generated/numpy.isclose`. + + - ``unittest.TestCase.assertAlmostEqual(a, b)``: True if ``a`` and ``b`` + are within an absolute tolerance of ``1e-7``. No relative tolerance is + considered , so this function is not appropriate for very large or very + small numbers. Also, it's only available in subclasses of ``unittest.TestCase`` + and it's ugly because it doesn't follow PEP8. More information: + :py:meth:`unittest.TestCase.assertAlmostEqual`. + + - ``a == pytest.approx(b, rel=1e-6, abs=1e-12)``: True if the relative + tolerance is met w.r.t. ``b`` or if the absolute tolerance is met. + Because the relative tolerance is only calculated w.r.t. ``b``, this test + is asymmetric and you can think of ``b`` as the reference value. In the + special case that you explicitly specify an absolute tolerance but not a + relative tolerance, only the absolute tolerance is considered. + + .. note:: + + ``approx`` can handle numpy arrays, but we recommend the + specialised test helpers in :std:doc:`numpy:reference/routines.testing` + if you need support for comparisons, NaNs, or ULP-based tolerances. + + To match strings using regex, you can use + `Matches `_ + from the + `re_assert package `_. + + .. warning:: + + .. versionchanged:: 3.2 + + In order to avoid inconsistent behavior, :py:exc:`TypeError` is + raised for ``>``, ``>=``, ``<`` and ``<=`` comparisons. + The example below illustrates the problem:: + + assert approx(0.1) > 0.1 + 1e-10 # calls approx(0.1).__gt__(0.1 + 1e-10) + assert 0.1 + 1e-10 > approx(0.1) # calls approx(0.1).__lt__(0.1 + 1e-10) + + In the second example one expects ``approx(0.1).__le__(0.1 + 1e-10)`` + to be called. But instead, ``approx(0.1).__lt__(0.1 + 1e-10)`` is used to + comparison. This is because the call hierarchy of rich comparisons + follows a fixed behavior. More information: :py:meth:`object.__ge__` + + .. versionchanged:: 3.7.1 + ``approx`` raises ``TypeError`` when it encounters a dict value or + sequence element of nonnumeric type. + + .. versionchanged:: 6.1.0 + ``approx`` falls back to strict equality for nonnumeric types instead + of raising ``TypeError``. + """ + # Delegate the comparison to a class that knows how to deal with the type + # of the expected value (e.g. int, float, list, dict, numpy.array, etc). + # + # The primary responsibility of these classes is to implement ``__eq__()`` + # and ``__repr__()``. The former is used to actually check if some + # "actual" value is equivalent to the given expected value within the + # allowed tolerance. The latter is used to show the user the expected + # value and tolerance, in the case that a test failed. + # + # The actual logic for making approximate comparisons can be found in + # ApproxScalar, which is used to compare individual numbers. All of the + # other Approx classes eventually delegate to this class. The ApproxBase + # class provides some convenient methods and overloads, but isn't really + # essential. + + __tracebackhide__ = True + + if isinstance(expected, Decimal): + cls: type[ApproxBase] = ApproxDecimal + elif isinstance(expected, Mapping): + cls = ApproxMapping + elif _is_numpy_array(expected): + expected = _as_numpy_array(expected) + cls = ApproxNumpy + elif _is_sequence_like(expected): + cls = ApproxSequenceLike + elif isinstance(expected, Collection) and not isinstance(expected, (str, bytes)): + msg = f"pytest.approx() only supports ordered sequences, but got: {expected!r}" + raise TypeError(msg) + else: + cls = ApproxScalar + + return cls(expected, rel, abs, nan_ok) + + +def _is_sequence_like(expected: object) -> bool: + return ( + hasattr(expected, "__getitem__") + and isinstance(expected, Sized) + and not isinstance(expected, (str, bytes)) + ) + + +def _is_numpy_array(obj: object) -> bool: + """ + Return true if the given object is implicitly convertible to ndarray, + and numpy is already imported. + """ + return _as_numpy_array(obj) is not None + + +def _as_numpy_array(obj: object) -> ndarray | None: + """ + Return an ndarray if the given object is implicitly convertible to ndarray, + and numpy is already imported, otherwise None. + """ + import sys + + np: Any = sys.modules.get("numpy") + if np is not None: + # avoid infinite recursion on numpy scalars, which have __array__ + if np.isscalar(obj): + return None + elif isinstance(obj, np.ndarray): + return obj + elif hasattr(obj, "__array__") or hasattr("obj", "__array_interface__"): + return np.asarray(obj) + return None + + +# builtin pytest.raises helper + +E = TypeVar("E", bound=BaseException) + + +@overload +def raises( + expected_exception: type[E] | tuple[type[E], ...], + *, + match: str | Pattern[str] | None = ..., +) -> RaisesContext[E]: ... + + +@overload +def raises( + expected_exception: type[E] | tuple[type[E], ...], + func: Callable[..., Any], + *args: Any, + **kwargs: Any, +) -> _pytest._code.ExceptionInfo[E]: ... + + +def raises( + expected_exception: type[E] | tuple[type[E], ...], *args: Any, **kwargs: Any +) -> RaisesContext[E] | _pytest._code.ExceptionInfo[E]: + r"""Assert that a code block/function call raises an exception type, or one of its subclasses. + + :param expected_exception: + The expected exception type, or a tuple if one of multiple possible + exception types are expected. Note that subclasses of the passed exceptions + will also match. + + :kwparam str | re.Pattern[str] | None match: + If specified, a string containing a regular expression, + or a regular expression object, that is tested against the string + representation of the exception and its :pep:`678` `__notes__` + using :func:`re.search`. + + To match a literal string that may contain :ref:`special characters + `, the pattern can first be escaped with :func:`re.escape`. + + (This is only used when ``pytest.raises`` is used as a context manager, + and passed through to the function otherwise. + When using ``pytest.raises`` as a function, you can use: + ``pytest.raises(Exc, func, match="passed on").match("my pattern")``.) + + Use ``pytest.raises`` as a context manager, which will capture the exception of the given + type, or any of its subclasses:: + + >>> import pytest + >>> with pytest.raises(ZeroDivisionError): + ... 1/0 + + If the code block does not raise the expected exception (:class:`ZeroDivisionError` in the example + above), or no exception at all, the check will fail instead. + + You can also use the keyword argument ``match`` to assert that the + exception matches a text or regex:: + + >>> with pytest.raises(ValueError, match='must be 0 or None'): + ... raise ValueError("value must be 0 or None") + + >>> with pytest.raises(ValueError, match=r'must be \d+$'): + ... raise ValueError("value must be 42") + + The ``match`` argument searches the formatted exception string, which includes any + `PEP-678 `__ ``__notes__``: + + >>> with pytest.raises(ValueError, match=r"had a note added"): # doctest: +SKIP + ... e = ValueError("value must be 42") + ... e.add_note("had a note added") + ... raise e + + The context manager produces an :class:`ExceptionInfo` object which can be used to inspect the + details of the captured exception:: + + >>> with pytest.raises(ValueError) as exc_info: + ... raise ValueError("value must be 42") + >>> assert exc_info.type is ValueError + >>> assert exc_info.value.args[0] == "value must be 42" + + .. warning:: + + Given that ``pytest.raises`` matches subclasses, be wary of using it to match :class:`Exception` like this:: + + with pytest.raises(Exception): # Careful, this will catch ANY exception raised. + some_function() + + Because :class:`Exception` is the base class of almost all exceptions, it is easy for this to hide + real bugs, where the user wrote this expecting a specific exception, but some other exception is being + raised due to a bug introduced during a refactoring. + + Avoid using ``pytest.raises`` to catch :class:`Exception` unless certain that you really want to catch + **any** exception raised. + + .. note:: + + When using ``pytest.raises`` as a context manager, it's worthwhile to + note that normal context manager rules apply and that the exception + raised *must* be the final line in the scope of the context manager. + Lines of code after that, within the scope of the context manager will + not be executed. For example:: + + >>> value = 15 + >>> with pytest.raises(ValueError) as exc_info: + ... if value > 10: + ... raise ValueError("value must be <= 10") + ... assert exc_info.type is ValueError # This will not execute. + + Instead, the following approach must be taken (note the difference in + scope):: + + >>> with pytest.raises(ValueError) as exc_info: + ... if value > 10: + ... raise ValueError("value must be <= 10") + ... + >>> assert exc_info.type is ValueError + + **Using with** ``pytest.mark.parametrize`` + + When using :ref:`pytest.mark.parametrize ref` + it is possible to parametrize tests such that + some runs raise an exception and others do not. + + See :ref:`parametrizing_conditional_raising` for an example. + + .. seealso:: + + :ref:`assertraises` for more examples and detailed discussion. + + **Legacy form** + + It is possible to specify a callable by passing a to-be-called lambda:: + + >>> raises(ZeroDivisionError, lambda: 1/0) + + + or you can specify an arbitrary callable with arguments:: + + >>> def f(x): return 1/x + ... + >>> raises(ZeroDivisionError, f, 0) + + >>> raises(ZeroDivisionError, f, x=0) + + + The form above is fully supported but discouraged for new code because the + context manager form is regarded as more readable and less error-prone. + + .. note:: + Similar to caught exception objects in Python, explicitly clearing + local references to returned ``ExceptionInfo`` objects can + help the Python interpreter speed up its garbage collection. + + Clearing those references breaks a reference cycle + (``ExceptionInfo`` --> caught exception --> frame stack raising + the exception --> current frame stack --> local variables --> + ``ExceptionInfo``) which makes Python keep all objects referenced + from that cycle (including all local variables in the current + frame) alive until the next cyclic garbage collection run. + More detailed information can be found in the official Python + documentation for :ref:`the try statement `. + """ + __tracebackhide__ = True + + if not expected_exception: + raise ValueError( + f"Expected an exception type or a tuple of exception types, but got `{expected_exception!r}`. " + f"Raising exceptions is already understood as failing the test, so you don't need " + f"any special code to say 'this should never raise an exception'." + ) + if isinstance(expected_exception, type): + expected_exceptions: tuple[type[E], ...] = (expected_exception,) + else: + expected_exceptions = expected_exception + for exc in expected_exceptions: + if not isinstance(exc, type) or not issubclass(exc, BaseException): + msg = "expected exception must be a BaseException type, not {}" # type: ignore[unreachable] + not_a = exc.__name__ if isinstance(exc, type) else type(exc).__name__ + raise TypeError(msg.format(not_a)) + + message = f"DID NOT RAISE {expected_exception}" + + if not args: + match: str | Pattern[str] | None = kwargs.pop("match", None) + if kwargs: + msg = "Unexpected keyword arguments passed to pytest.raises: " + msg += ", ".join(sorted(kwargs)) + msg += "\nUse context-manager form instead?" + raise TypeError(msg) + return RaisesContext(expected_exception, message, match) + else: + func = args[0] + if not callable(func): + raise TypeError(f"{func!r} object (type: {type(func)}) must be callable") + try: + func(*args[1:], **kwargs) + except expected_exception as e: + return _pytest._code.ExceptionInfo.from_exception(e) + fail(message) + + +# This doesn't work with mypy for now. Use fail.Exception instead. +raises.Exception = fail.Exception # type: ignore + + +@final +class RaisesContext(ContextManager[_pytest._code.ExceptionInfo[E]]): + def __init__( + self, + expected_exception: type[E] | tuple[type[E], ...], + message: str, + match_expr: str | Pattern[str] | None = None, + ) -> None: + self.expected_exception = expected_exception + self.message = message + self.match_expr = match_expr + self.excinfo: _pytest._code.ExceptionInfo[E] | None = None + if self.match_expr is not None: + re_error = None + try: + re.compile(self.match_expr) + except re.error as e: + re_error = e + if re_error is not None: + fail(f"Invalid regex pattern provided to 'match': {re_error}") + + def __enter__(self) -> _pytest._code.ExceptionInfo[E]: + self.excinfo = _pytest._code.ExceptionInfo.for_later() + return self.excinfo + + def __exit__( + self, + exc_type: type[BaseException] | None, + exc_val: BaseException | None, + exc_tb: TracebackType | None, + ) -> bool: + __tracebackhide__ = True + if exc_type is None: + fail(self.message) + assert self.excinfo is not None + if not issubclass(exc_type, self.expected_exception): + return False + # Cast to narrow the exception type now that it's verified. + exc_info = cast(Tuple[Type[E], E, TracebackType], (exc_type, exc_val, exc_tb)) + self.excinfo.fill_unfilled(exc_info) + if self.match_expr is not None: + self.excinfo.match(self.match_expr) + return True diff --git a/.venv/Lib/site-packages/_pytest/python_path.py b/.venv/Lib/site-packages/_pytest/python_path.py new file mode 100644 index 00000000..6e33c8a3 --- /dev/null +++ b/.venv/Lib/site-packages/_pytest/python_path.py @@ -0,0 +1,26 @@ +from __future__ import annotations + +import sys + +import pytest +from pytest import Config +from pytest import Parser + + +def pytest_addoption(parser: Parser) -> None: + parser.addini("pythonpath", type="paths", help="Add paths to sys.path", default=[]) + + +@pytest.hookimpl(tryfirst=True) +def pytest_load_initial_conftests(early_config: Config) -> None: + # `pythonpath = a b` will set `sys.path` to `[a, b, x, y, z, ...]` + for path in reversed(early_config.getini("pythonpath")): + sys.path.insert(0, str(path)) + + +@pytest.hookimpl(trylast=True) +def pytest_unconfigure(config: Config) -> None: + for path in config.getini("pythonpath"): + path_str = str(path) + if path_str in sys.path: + sys.path.remove(path_str) diff --git a/.venv/Lib/site-packages/_pytest/recwarn.py b/.venv/Lib/site-packages/_pytest/recwarn.py new file mode 100644 index 00000000..85d8de84 --- /dev/null +++ b/.venv/Lib/site-packages/_pytest/recwarn.py @@ -0,0 +1,365 @@ +# mypy: allow-untyped-defs +"""Record warnings during test function execution.""" + +from __future__ import annotations + +from pprint import pformat +import re +from types import TracebackType +from typing import Any +from typing import Callable +from typing import final +from typing import Generator +from typing import Iterator +from typing import overload +from typing import Pattern +from typing import TYPE_CHECKING +from typing import TypeVar + + +if TYPE_CHECKING: + from typing_extensions import Self + +import warnings + +from _pytest.deprecated import check_ispytest +from _pytest.fixtures import fixture +from _pytest.outcomes import Exit +from _pytest.outcomes import fail + + +T = TypeVar("T") + + +@fixture +def recwarn() -> Generator[WarningsRecorder]: + """Return a :class:`WarningsRecorder` instance that records all warnings emitted by test functions. + + See https://docs.pytest.org/en/latest/how-to/capture-warnings.html for information + on warning categories. + """ + wrec = WarningsRecorder(_ispytest=True) + with wrec: + warnings.simplefilter("default") + yield wrec + + +@overload +def deprecated_call(*, match: str | Pattern[str] | None = ...) -> WarningsRecorder: ... + + +@overload +def deprecated_call(func: Callable[..., T], *args: Any, **kwargs: Any) -> T: ... + + +def deprecated_call( + func: Callable[..., Any] | None = None, *args: Any, **kwargs: Any +) -> WarningsRecorder | Any: + """Assert that code produces a ``DeprecationWarning`` or ``PendingDeprecationWarning`` or ``FutureWarning``. + + This function can be used as a context manager:: + + >>> import warnings + >>> def api_call_v2(): + ... warnings.warn('use v3 of this api', DeprecationWarning) + ... return 200 + + >>> import pytest + >>> with pytest.deprecated_call(): + ... assert api_call_v2() == 200 + + It can also be used by passing a function and ``*args`` and ``**kwargs``, + in which case it will ensure calling ``func(*args, **kwargs)`` produces one of + the warnings types above. The return value is the return value of the function. + + In the context manager form you may use the keyword argument ``match`` to assert + that the warning matches a text or regex. + + The context manager produces a list of :class:`warnings.WarningMessage` objects, + one for each warning raised. + """ + __tracebackhide__ = True + if func is not None: + args = (func, *args) + return warns( + (DeprecationWarning, PendingDeprecationWarning, FutureWarning), *args, **kwargs + ) + + +@overload +def warns( + expected_warning: type[Warning] | tuple[type[Warning], ...] = ..., + *, + match: str | Pattern[str] | None = ..., +) -> WarningsChecker: ... + + +@overload +def warns( + expected_warning: type[Warning] | tuple[type[Warning], ...], + func: Callable[..., T], + *args: Any, + **kwargs: Any, +) -> T: ... + + +def warns( + expected_warning: type[Warning] | tuple[type[Warning], ...] = Warning, + *args: Any, + match: str | Pattern[str] | None = None, + **kwargs: Any, +) -> WarningsChecker | Any: + r"""Assert that code raises a particular class of warning. + + Specifically, the parameter ``expected_warning`` can be a warning class or tuple + of warning classes, and the code inside the ``with`` block must issue at least one + warning of that class or classes. + + This helper produces a list of :class:`warnings.WarningMessage` objects, one for + each warning emitted (regardless of whether it is an ``expected_warning`` or not). + Since pytest 8.0, unmatched warnings are also re-emitted when the context closes. + + This function can be used as a context manager:: + + >>> import pytest + >>> with pytest.warns(RuntimeWarning): + ... warnings.warn("my warning", RuntimeWarning) + + In the context manager form you may use the keyword argument ``match`` to assert + that the warning matches a text or regex:: + + >>> with pytest.warns(UserWarning, match='must be 0 or None'): + ... warnings.warn("value must be 0 or None", UserWarning) + + >>> with pytest.warns(UserWarning, match=r'must be \d+$'): + ... warnings.warn("value must be 42", UserWarning) + + >>> with pytest.warns(UserWarning): # catch re-emitted warning + ... with pytest.warns(UserWarning, match=r'must be \d+$'): + ... warnings.warn("this is not here", UserWarning) + Traceback (most recent call last): + ... + Failed: DID NOT WARN. No warnings of type ...UserWarning... were emitted... + + **Using with** ``pytest.mark.parametrize`` + + When using :ref:`pytest.mark.parametrize ref` it is possible to parametrize tests + such that some runs raise a warning and others do not. + + This could be achieved in the same way as with exceptions, see + :ref:`parametrizing_conditional_raising` for an example. + + """ + __tracebackhide__ = True + if not args: + if kwargs: + argnames = ", ".join(sorted(kwargs)) + raise TypeError( + f"Unexpected keyword arguments passed to pytest.warns: {argnames}" + "\nUse context-manager form instead?" + ) + return WarningsChecker(expected_warning, match_expr=match, _ispytest=True) + else: + func = args[0] + if not callable(func): + raise TypeError(f"{func!r} object (type: {type(func)}) must be callable") + with WarningsChecker(expected_warning, _ispytest=True): + return func(*args[1:], **kwargs) + + +class WarningsRecorder(warnings.catch_warnings): # type:ignore[type-arg] + """A context manager to record raised warnings. + + Each recorded warning is an instance of :class:`warnings.WarningMessage`. + + Adapted from `warnings.catch_warnings`. + + .. note:: + ``DeprecationWarning`` and ``PendingDeprecationWarning`` are treated + differently; see :ref:`ensuring_function_triggers`. + + """ + + def __init__(self, *, _ispytest: bool = False) -> None: + check_ispytest(_ispytest) + super().__init__(record=True) + self._entered = False + self._list: list[warnings.WarningMessage] = [] + + @property + def list(self) -> list[warnings.WarningMessage]: + """The list of recorded warnings.""" + return self._list + + def __getitem__(self, i: int) -> warnings.WarningMessage: + """Get a recorded warning by index.""" + return self._list[i] + + def __iter__(self) -> Iterator[warnings.WarningMessage]: + """Iterate through the recorded warnings.""" + return iter(self._list) + + def __len__(self) -> int: + """The number of recorded warnings.""" + return len(self._list) + + def pop(self, cls: type[Warning] = Warning) -> warnings.WarningMessage: + """Pop the first recorded warning which is an instance of ``cls``, + but not an instance of a child class of any other match. + Raises ``AssertionError`` if there is no match. + """ + best_idx: int | None = None + for i, w in enumerate(self._list): + if w.category == cls: + return self._list.pop(i) # exact match, stop looking + if issubclass(w.category, cls) and ( + best_idx is None + or not issubclass(w.category, self._list[best_idx].category) + ): + best_idx = i + if best_idx is not None: + return self._list.pop(best_idx) + __tracebackhide__ = True + raise AssertionError(f"{cls!r} not found in warning list") + + def clear(self) -> None: + """Clear the list of recorded warnings.""" + self._list[:] = [] + + def __enter__(self) -> Self: + if self._entered: + __tracebackhide__ = True + raise RuntimeError(f"Cannot enter {self!r} twice") + _list = super().__enter__() + # record=True means it's None. + assert _list is not None + self._list = _list + warnings.simplefilter("always") + return self + + def __exit__( + self, + exc_type: type[BaseException] | None, + exc_val: BaseException | None, + exc_tb: TracebackType | None, + ) -> None: + if not self._entered: + __tracebackhide__ = True + raise RuntimeError(f"Cannot exit {self!r} without entering first") + + super().__exit__(exc_type, exc_val, exc_tb) + + # Built-in catch_warnings does not reset entered state so we do it + # manually here for this context manager to become reusable. + self._entered = False + + +@final +class WarningsChecker(WarningsRecorder): + def __init__( + self, + expected_warning: type[Warning] | tuple[type[Warning], ...] = Warning, + match_expr: str | Pattern[str] | None = None, + *, + _ispytest: bool = False, + ) -> None: + check_ispytest(_ispytest) + super().__init__(_ispytest=True) + + msg = "exceptions must be derived from Warning, not %s" + if isinstance(expected_warning, tuple): + for exc in expected_warning: + if not issubclass(exc, Warning): + raise TypeError(msg % type(exc)) + expected_warning_tup = expected_warning + elif isinstance(expected_warning, type) and issubclass( + expected_warning, Warning + ): + expected_warning_tup = (expected_warning,) + else: + raise TypeError(msg % type(expected_warning)) + + self.expected_warning = expected_warning_tup + self.match_expr = match_expr + + def matches(self, warning: warnings.WarningMessage) -> bool: + assert self.expected_warning is not None + return issubclass(warning.category, self.expected_warning) and bool( + self.match_expr is None or re.search(self.match_expr, str(warning.message)) + ) + + def __exit__( + self, + exc_type: type[BaseException] | None, + exc_val: BaseException | None, + exc_tb: TracebackType | None, + ) -> None: + super().__exit__(exc_type, exc_val, exc_tb) + + __tracebackhide__ = True + + # BaseExceptions like pytest.{skip,fail,xfail,exit} or Ctrl-C within + # pytest.warns should *not* trigger "DID NOT WARN" and get suppressed + # when the warning doesn't happen. Control-flow exceptions should always + # propagate. + if exc_val is not None and ( + not isinstance(exc_val, Exception) + # Exit is an Exception, not a BaseException, for some reason. + or isinstance(exc_val, Exit) + ): + return + + def found_str() -> str: + return pformat([record.message for record in self], indent=2) + + try: + if not any(issubclass(w.category, self.expected_warning) for w in self): + fail( + f"DID NOT WARN. No warnings of type {self.expected_warning} were emitted.\n" + f" Emitted warnings: {found_str()}." + ) + elif not any(self.matches(w) for w in self): + fail( + f"DID NOT WARN. No warnings of type {self.expected_warning} matching the regex were emitted.\n" + f" Regex: {self.match_expr}\n" + f" Emitted warnings: {found_str()}." + ) + finally: + # Whether or not any warnings matched, we want to re-emit all unmatched warnings. + for w in self: + if not self.matches(w): + warnings.warn_explicit( + message=w.message, + category=w.category, + filename=w.filename, + lineno=w.lineno, + module=w.__module__, + source=w.source, + ) + + # Currently in Python it is possible to pass other types than an + # `str` message when creating `Warning` instances, however this + # causes an exception when :func:`warnings.filterwarnings` is used + # to filter those warnings. See + # https://github.com/python/cpython/issues/103577 for a discussion. + # While this can be considered a bug in CPython, we put guards in + # pytest as the error message produced without this check in place + # is confusing (#10865). + for w in self: + if type(w.message) is not UserWarning: + # If the warning was of an incorrect type then `warnings.warn()` + # creates a UserWarning. Any other warning must have been specified + # explicitly. + continue + if not w.message.args: + # UserWarning() without arguments must have been specified explicitly. + continue + msg = w.message.args[0] + if isinstance(msg, str): + continue + # It's possible that UserWarning was explicitly specified, and + # its first argument was not a string. But that case can't be + # distinguished from an invalid type. + raise TypeError( + f"Warning must be str or Warning, got {msg!r} (type {type(msg).__name__})" + ) diff --git a/.venv/Lib/site-packages/_pytest/reports.py b/.venv/Lib/site-packages/_pytest/reports.py new file mode 100644 index 00000000..77cbf773 --- /dev/null +++ b/.venv/Lib/site-packages/_pytest/reports.py @@ -0,0 +1,636 @@ +# mypy: allow-untyped-defs +from __future__ import annotations + +import dataclasses +from io import StringIO +import os +from pprint import pprint +from typing import Any +from typing import cast +from typing import final +from typing import Iterable +from typing import Iterator +from typing import Literal +from typing import Mapping +from typing import NoReturn +from typing import Sequence +from typing import TYPE_CHECKING + +from _pytest._code.code import ExceptionChainRepr +from _pytest._code.code import ExceptionInfo +from _pytest._code.code import ExceptionRepr +from _pytest._code.code import ReprEntry +from _pytest._code.code import ReprEntryNative +from _pytest._code.code import ReprExceptionInfo +from _pytest._code.code import ReprFileLocation +from _pytest._code.code import ReprFuncArgs +from _pytest._code.code import ReprLocals +from _pytest._code.code import ReprTraceback +from _pytest._code.code import TerminalRepr +from _pytest._io import TerminalWriter +from _pytest.config import Config +from _pytest.nodes import Collector +from _pytest.nodes import Item +from _pytest.outcomes import fail +from _pytest.outcomes import skip + + +if TYPE_CHECKING: + from typing_extensions import Self + + from _pytest.runner import CallInfo + + +def getworkerinfoline(node): + try: + return node._workerinfocache + except AttributeError: + d = node.workerinfo + ver = "{}.{}.{}".format(*d["version_info"][:3]) + node._workerinfocache = s = "[{}] {} -- Python {} {}".format( + d["id"], d["sysplatform"], ver, d["executable"] + ) + return s + + +class BaseReport: + when: str | None + location: tuple[str, int | None, str] | None + longrepr: ( + None | ExceptionInfo[BaseException] | tuple[str, int, str] | str | TerminalRepr + ) + sections: list[tuple[str, str]] + nodeid: str + outcome: Literal["passed", "failed", "skipped"] + + def __init__(self, **kw: Any) -> None: + self.__dict__.update(kw) + + if TYPE_CHECKING: + # Can have arbitrary fields given to __init__(). + def __getattr__(self, key: str) -> Any: ... + + def toterminal(self, out: TerminalWriter) -> None: + if hasattr(self, "node"): + worker_info = getworkerinfoline(self.node) + if worker_info: + out.line(worker_info) + + longrepr = self.longrepr + if longrepr is None: + return + + if hasattr(longrepr, "toterminal"): + longrepr_terminal = cast(TerminalRepr, longrepr) + longrepr_terminal.toterminal(out) + else: + try: + s = str(longrepr) + except UnicodeEncodeError: + s = "" + out.line(s) + + def get_sections(self, prefix: str) -> Iterator[tuple[str, str]]: + for name, content in self.sections: + if name.startswith(prefix): + yield prefix, content + + @property + def longreprtext(self) -> str: + """Read-only property that returns the full string representation of + ``longrepr``. + + .. versionadded:: 3.0 + """ + file = StringIO() + tw = TerminalWriter(file) + tw.hasmarkup = False + self.toterminal(tw) + exc = file.getvalue() + return exc.strip() + + @property + def caplog(self) -> str: + """Return captured log lines, if log capturing is enabled. + + .. versionadded:: 3.5 + """ + return "\n".join( + content for (prefix, content) in self.get_sections("Captured log") + ) + + @property + def capstdout(self) -> str: + """Return captured text from stdout, if capturing is enabled. + + .. versionadded:: 3.0 + """ + return "".join( + content for (prefix, content) in self.get_sections("Captured stdout") + ) + + @property + def capstderr(self) -> str: + """Return captured text from stderr, if capturing is enabled. + + .. versionadded:: 3.0 + """ + return "".join( + content for (prefix, content) in self.get_sections("Captured stderr") + ) + + @property + def passed(self) -> bool: + """Whether the outcome is passed.""" + return self.outcome == "passed" + + @property + def failed(self) -> bool: + """Whether the outcome is failed.""" + return self.outcome == "failed" + + @property + def skipped(self) -> bool: + """Whether the outcome is skipped.""" + return self.outcome == "skipped" + + @property + def fspath(self) -> str: + """The path portion of the reported node, as a string.""" + return self.nodeid.split("::")[0] + + @property + def count_towards_summary(self) -> bool: + """**Experimental** Whether this report should be counted towards the + totals shown at the end of the test session: "1 passed, 1 failure, etc". + + .. note:: + + This function is considered **experimental**, so beware that it is subject to changes + even in patch releases. + """ + return True + + @property + def head_line(self) -> str | None: + """**Experimental** The head line shown with longrepr output for this + report, more commonly during traceback representation during + failures:: + + ________ Test.foo ________ + + + In the example above, the head_line is "Test.foo". + + .. note:: + + This function is considered **experimental**, so beware that it is subject to changes + even in patch releases. + """ + if self.location is not None: + fspath, lineno, domain = self.location + return domain + return None + + def _get_verbose_word_with_markup( + self, config: Config, default_markup: Mapping[str, bool] + ) -> tuple[str, Mapping[str, bool]]: + _category, _short, verbose = config.hook.pytest_report_teststatus( + report=self, config=config + ) + + if isinstance(verbose, str): + return verbose, default_markup + + if isinstance(verbose, Sequence) and len(verbose) == 2: + word, markup = verbose + if isinstance(word, str) and isinstance(markup, Mapping): + return word, markup + + fail( # pragma: no cover + "pytest_report_teststatus() hook (from a plugin) returned " + f"an invalid verbose value: {verbose!r}.\nExpected either a string " + "or a tuple of (word, markup)." + ) + + def _to_json(self) -> dict[str, Any]: + """Return the contents of this report as a dict of builtin entries, + suitable for serialization. + + This was originally the serialize_report() function from xdist (ca03269). + + Experimental method. + """ + return _report_to_json(self) + + @classmethod + def _from_json(cls, reportdict: dict[str, object]) -> Self: + """Create either a TestReport or CollectReport, depending on the calling class. + + It is the callers responsibility to know which class to pass here. + + This was originally the serialize_report() function from xdist (ca03269). + + Experimental method. + """ + kwargs = _report_kwargs_from_json(reportdict) + return cls(**kwargs) + + +def _report_unserialization_failure( + type_name: str, report_class: type[BaseReport], reportdict +) -> NoReturn: + url = "https://github.com/pytest-dev/pytest/issues" + stream = StringIO() + pprint("-" * 100, stream=stream) + pprint(f"INTERNALERROR: Unknown entry type returned: {type_name}", stream=stream) + pprint(f"report_name: {report_class}", stream=stream) + pprint(reportdict, stream=stream) + pprint(f"Please report this bug at {url}", stream=stream) + pprint("-" * 100, stream=stream) + raise RuntimeError(stream.getvalue()) + + +@final +class TestReport(BaseReport): + """Basic test report object (also used for setup and teardown calls if + they fail). + + Reports can contain arbitrary extra attributes. + """ + + __test__ = False + # Defined by skipping plugin. + # xfail reason if xfailed, otherwise not defined. Use hasattr to distinguish. + wasxfail: str + + def __init__( + self, + nodeid: str, + location: tuple[str, int | None, str], + keywords: Mapping[str, Any], + outcome: Literal["passed", "failed", "skipped"], + longrepr: None + | ExceptionInfo[BaseException] + | tuple[str, int, str] + | str + | TerminalRepr, + when: Literal["setup", "call", "teardown"], + sections: Iterable[tuple[str, str]] = (), + duration: float = 0, + start: float = 0, + stop: float = 0, + user_properties: Iterable[tuple[str, object]] | None = None, + **extra, + ) -> None: + #: Normalized collection nodeid. + self.nodeid = nodeid + + #: A (filesystempath, lineno, domaininfo) tuple indicating the + #: actual location of a test item - it might be different from the + #: collected one e.g. if a method is inherited from a different module. + #: The filesystempath may be relative to ``config.rootdir``. + #: The line number is 0-based. + self.location: tuple[str, int | None, str] = location + + #: A name -> value dictionary containing all keywords and + #: markers associated with a test invocation. + self.keywords: Mapping[str, Any] = keywords + + #: Test outcome, always one of "passed", "failed", "skipped". + self.outcome = outcome + + #: None or a failure representation. + self.longrepr = longrepr + + #: One of 'setup', 'call', 'teardown' to indicate runtest phase. + self.when = when + + #: User properties is a list of tuples (name, value) that holds user + #: defined properties of the test. + self.user_properties = list(user_properties or []) + + #: Tuples of str ``(heading, content)`` with extra information + #: for the test report. Used by pytest to add text captured + #: from ``stdout``, ``stderr``, and intercepted logging events. May + #: be used by other plugins to add arbitrary information to reports. + self.sections = list(sections) + + #: Time it took to run just the test. + self.duration: float = duration + + #: The system time when the call started, in seconds since the epoch. + self.start: float = start + #: The system time when the call ended, in seconds since the epoch. + self.stop: float = stop + + self.__dict__.update(extra) + + def __repr__(self) -> str: + return f"<{self.__class__.__name__} {self.nodeid!r} when={self.when!r} outcome={self.outcome!r}>" + + @classmethod + def from_item_and_call(cls, item: Item, call: CallInfo[None]) -> TestReport: + """Create and fill a TestReport with standard item and call info. + + :param item: The item. + :param call: The call info. + """ + when = call.when + # Remove "collect" from the Literal type -- only for collection calls. + assert when != "collect" + duration = call.duration + start = call.start + stop = call.stop + keywords = {x: 1 for x in item.keywords} + excinfo = call.excinfo + sections = [] + if not call.excinfo: + outcome: Literal["passed", "failed", "skipped"] = "passed" + longrepr: ( + None + | ExceptionInfo[BaseException] + | tuple[str, int, str] + | str + | TerminalRepr + ) = None + else: + if not isinstance(excinfo, ExceptionInfo): + outcome = "failed" + longrepr = excinfo + elif isinstance(excinfo.value, skip.Exception): + outcome = "skipped" + r = excinfo._getreprcrash() + assert ( + r is not None + ), "There should always be a traceback entry for skipping a test." + if excinfo.value._use_item_location: + path, line = item.reportinfo()[:2] + assert line is not None + longrepr = os.fspath(path), line + 1, r.message + else: + longrepr = (str(r.path), r.lineno, r.message) + else: + outcome = "failed" + if call.when == "call": + longrepr = item.repr_failure(excinfo) + else: # exception in setup or teardown + longrepr = item._repr_failure_py( + excinfo, style=item.config.getoption("tbstyle", "auto") + ) + for rwhen, key, content in item._report_sections: + sections.append((f"Captured {key} {rwhen}", content)) + return cls( + item.nodeid, + item.location, + keywords, + outcome, + longrepr, + when, + sections, + duration, + start, + stop, + user_properties=item.user_properties, + ) + + +@final +class CollectReport(BaseReport): + """Collection report object. + + Reports can contain arbitrary extra attributes. + """ + + when = "collect" + + def __init__( + self, + nodeid: str, + outcome: Literal["passed", "failed", "skipped"], + longrepr: None + | ExceptionInfo[BaseException] + | tuple[str, int, str] + | str + | TerminalRepr, + result: list[Item | Collector] | None, + sections: Iterable[tuple[str, str]] = (), + **extra, + ) -> None: + #: Normalized collection nodeid. + self.nodeid = nodeid + + #: Test outcome, always one of "passed", "failed", "skipped". + self.outcome = outcome + + #: None or a failure representation. + self.longrepr = longrepr + + #: The collected items and collection nodes. + self.result = result or [] + + #: Tuples of str ``(heading, content)`` with extra information + #: for the test report. Used by pytest to add text captured + #: from ``stdout``, ``stderr``, and intercepted logging events. May + #: be used by other plugins to add arbitrary information to reports. + self.sections = list(sections) + + self.__dict__.update(extra) + + @property + def location( # type:ignore[override] + self, + ) -> tuple[str, int | None, str] | None: + return (self.fspath, None, self.fspath) + + def __repr__(self) -> str: + return f"" + + +class CollectErrorRepr(TerminalRepr): + def __init__(self, msg: str) -> None: + self.longrepr = msg + + def toterminal(self, out: TerminalWriter) -> None: + out.line(self.longrepr, red=True) + + +def pytest_report_to_serializable( + report: CollectReport | TestReport, +) -> dict[str, Any] | None: + if isinstance(report, (TestReport, CollectReport)): + data = report._to_json() + data["$report_type"] = report.__class__.__name__ + return data + # TODO: Check if this is actually reachable. + return None # type: ignore[unreachable] + + +def pytest_report_from_serializable( + data: dict[str, Any], +) -> CollectReport | TestReport | None: + if "$report_type" in data: + if data["$report_type"] == "TestReport": + return TestReport._from_json(data) + elif data["$report_type"] == "CollectReport": + return CollectReport._from_json(data) + assert False, "Unknown report_type unserialize data: {}".format( + data["$report_type"] + ) + return None + + +def _report_to_json(report: BaseReport) -> dict[str, Any]: + """Return the contents of this report as a dict of builtin entries, + suitable for serialization. + + This was originally the serialize_report() function from xdist (ca03269). + """ + + def serialize_repr_entry( + entry: ReprEntry | ReprEntryNative, + ) -> dict[str, Any]: + data = dataclasses.asdict(entry) + for key, value in data.items(): + if hasattr(value, "__dict__"): + data[key] = dataclasses.asdict(value) + entry_data = {"type": type(entry).__name__, "data": data} + return entry_data + + def serialize_repr_traceback(reprtraceback: ReprTraceback) -> dict[str, Any]: + result = dataclasses.asdict(reprtraceback) + result["reprentries"] = [ + serialize_repr_entry(x) for x in reprtraceback.reprentries + ] + return result + + def serialize_repr_crash( + reprcrash: ReprFileLocation | None, + ) -> dict[str, Any] | None: + if reprcrash is not None: + return dataclasses.asdict(reprcrash) + else: + return None + + def serialize_exception_longrepr(rep: BaseReport) -> dict[str, Any]: + assert rep.longrepr is not None + # TODO: Investigate whether the duck typing is really necessary here. + longrepr = cast(ExceptionRepr, rep.longrepr) + result: dict[str, Any] = { + "reprcrash": serialize_repr_crash(longrepr.reprcrash), + "reprtraceback": serialize_repr_traceback(longrepr.reprtraceback), + "sections": longrepr.sections, + } + if isinstance(longrepr, ExceptionChainRepr): + result["chain"] = [] + for repr_traceback, repr_crash, description in longrepr.chain: + result["chain"].append( + ( + serialize_repr_traceback(repr_traceback), + serialize_repr_crash(repr_crash), + description, + ) + ) + else: + result["chain"] = None + return result + + d = report.__dict__.copy() + if hasattr(report.longrepr, "toterminal"): + if hasattr(report.longrepr, "reprtraceback") and hasattr( + report.longrepr, "reprcrash" + ): + d["longrepr"] = serialize_exception_longrepr(report) + else: + d["longrepr"] = str(report.longrepr) + else: + d["longrepr"] = report.longrepr + for name in d: + if isinstance(d[name], os.PathLike): + d[name] = os.fspath(d[name]) + elif name == "result": + d[name] = None # for now + return d + + +def _report_kwargs_from_json(reportdict: dict[str, Any]) -> dict[str, Any]: + """Return **kwargs that can be used to construct a TestReport or + CollectReport instance. + + This was originally the serialize_report() function from xdist (ca03269). + """ + + def deserialize_repr_entry(entry_data): + data = entry_data["data"] + entry_type = entry_data["type"] + if entry_type == "ReprEntry": + reprfuncargs = None + reprfileloc = None + reprlocals = None + if data["reprfuncargs"]: + reprfuncargs = ReprFuncArgs(**data["reprfuncargs"]) + if data["reprfileloc"]: + reprfileloc = ReprFileLocation(**data["reprfileloc"]) + if data["reprlocals"]: + reprlocals = ReprLocals(data["reprlocals"]["lines"]) + + reprentry: ReprEntry | ReprEntryNative = ReprEntry( + lines=data["lines"], + reprfuncargs=reprfuncargs, + reprlocals=reprlocals, + reprfileloc=reprfileloc, + style=data["style"], + ) + elif entry_type == "ReprEntryNative": + reprentry = ReprEntryNative(data["lines"]) + else: + _report_unserialization_failure(entry_type, TestReport, reportdict) + return reprentry + + def deserialize_repr_traceback(repr_traceback_dict): + repr_traceback_dict["reprentries"] = [ + deserialize_repr_entry(x) for x in repr_traceback_dict["reprentries"] + ] + return ReprTraceback(**repr_traceback_dict) + + def deserialize_repr_crash(repr_crash_dict: dict[str, Any] | None): + if repr_crash_dict is not None: + return ReprFileLocation(**repr_crash_dict) + else: + return None + + if ( + reportdict["longrepr"] + and "reprcrash" in reportdict["longrepr"] + and "reprtraceback" in reportdict["longrepr"] + ): + reprtraceback = deserialize_repr_traceback( + reportdict["longrepr"]["reprtraceback"] + ) + reprcrash = deserialize_repr_crash(reportdict["longrepr"]["reprcrash"]) + if reportdict["longrepr"]["chain"]: + chain = [] + for repr_traceback_data, repr_crash_data, description in reportdict[ + "longrepr" + ]["chain"]: + chain.append( + ( + deserialize_repr_traceback(repr_traceback_data), + deserialize_repr_crash(repr_crash_data), + description, + ) + ) + exception_info: ExceptionChainRepr | ReprExceptionInfo = ExceptionChainRepr( + chain + ) + else: + exception_info = ReprExceptionInfo( + reprtraceback=reprtraceback, + reprcrash=reprcrash, + ) + + for section in reportdict["longrepr"]["sections"]: + exception_info.addsection(*section) + reportdict["longrepr"] = exception_info + + return reportdict diff --git a/.venv/Lib/site-packages/_pytest/runner.py b/.venv/Lib/site-packages/_pytest/runner.py new file mode 100644 index 00000000..0b60301b --- /dev/null +++ b/.venv/Lib/site-packages/_pytest/runner.py @@ -0,0 +1,571 @@ +# mypy: allow-untyped-defs +"""Basic collect and runtest protocol implementations.""" + +from __future__ import annotations + +import bdb +import dataclasses +import os +import sys +import types +from typing import Callable +from typing import cast +from typing import final +from typing import Generic +from typing import Literal +from typing import TYPE_CHECKING +from typing import TypeVar + +from .reports import BaseReport +from .reports import CollectErrorRepr +from .reports import CollectReport +from .reports import TestReport +from _pytest import timing +from _pytest._code.code import ExceptionChainRepr +from _pytest._code.code import ExceptionInfo +from _pytest._code.code import TerminalRepr +from _pytest.config.argparsing import Parser +from _pytest.deprecated import check_ispytest +from _pytest.nodes import Collector +from _pytest.nodes import Directory +from _pytest.nodes import Item +from _pytest.nodes import Node +from _pytest.outcomes import Exit +from _pytest.outcomes import OutcomeException +from _pytest.outcomes import Skipped +from _pytest.outcomes import TEST_OUTCOME + + +if sys.version_info < (3, 11): + from exceptiongroup import BaseExceptionGroup + +if TYPE_CHECKING: + from _pytest.main import Session + from _pytest.terminal import TerminalReporter + +# +# pytest plugin hooks. + + +def pytest_addoption(parser: Parser) -> None: + group = parser.getgroup("terminal reporting", "Reporting", after="general") + group.addoption( + "--durations", + action="store", + type=int, + default=None, + metavar="N", + help="Show N slowest setup/test durations (N=0 for all)", + ) + group.addoption( + "--durations-min", + action="store", + type=float, + default=0.005, + metavar="N", + help="Minimal duration in seconds for inclusion in slowest list. " + "Default: 0.005.", + ) + + +def pytest_terminal_summary(terminalreporter: TerminalReporter) -> None: + durations = terminalreporter.config.option.durations + durations_min = terminalreporter.config.option.durations_min + verbose = terminalreporter.config.get_verbosity() + if durations is None: + return + tr = terminalreporter + dlist = [] + for replist in tr.stats.values(): + for rep in replist: + if hasattr(rep, "duration"): + dlist.append(rep) + if not dlist: + return + dlist.sort(key=lambda x: x.duration, reverse=True) + if not durations: + tr.write_sep("=", "slowest durations") + else: + tr.write_sep("=", f"slowest {durations} durations") + dlist = dlist[:durations] + + for i, rep in enumerate(dlist): + if verbose < 2 and rep.duration < durations_min: + tr.write_line("") + tr.write_line( + f"({len(dlist) - i} durations < {durations_min:g}s hidden. Use -vv to show these durations.)" + ) + break + tr.write_line(f"{rep.duration:02.2f}s {rep.when:<8} {rep.nodeid}") + + +def pytest_sessionstart(session: Session) -> None: + session._setupstate = SetupState() + + +def pytest_sessionfinish(session: Session) -> None: + session._setupstate.teardown_exact(None) + + +def pytest_runtest_protocol(item: Item, nextitem: Item | None) -> bool: + ihook = item.ihook + ihook.pytest_runtest_logstart(nodeid=item.nodeid, location=item.location) + runtestprotocol(item, nextitem=nextitem) + ihook.pytest_runtest_logfinish(nodeid=item.nodeid, location=item.location) + return True + + +def runtestprotocol( + item: Item, log: bool = True, nextitem: Item | None = None +) -> list[TestReport]: + hasrequest = hasattr(item, "_request") + if hasrequest and not item._request: # type: ignore[attr-defined] + # This only happens if the item is re-run, as is done by + # pytest-rerunfailures. + item._initrequest() # type: ignore[attr-defined] + rep = call_and_report(item, "setup", log) + reports = [rep] + if rep.passed: + if item.config.getoption("setupshow", False): + show_test_item(item) + if not item.config.getoption("setuponly", False): + reports.append(call_and_report(item, "call", log)) + # If the session is about to fail or stop, teardown everything - this is + # necessary to correctly report fixture teardown errors (see #11706) + if item.session.shouldfail or item.session.shouldstop: + nextitem = None + reports.append(call_and_report(item, "teardown", log, nextitem=nextitem)) + # After all teardown hooks have been called + # want funcargs and request info to go away. + if hasrequest: + item._request = False # type: ignore[attr-defined] + item.funcargs = None # type: ignore[attr-defined] + return reports + + +def show_test_item(item: Item) -> None: + """Show test function, parameters and the fixtures of the test item.""" + tw = item.config.get_terminal_writer() + tw.line() + tw.write(" " * 8) + tw.write(item.nodeid) + used_fixtures = sorted(getattr(item, "fixturenames", [])) + if used_fixtures: + tw.write(" (fixtures used: {})".format(", ".join(used_fixtures))) + tw.flush() + + +def pytest_runtest_setup(item: Item) -> None: + _update_current_test_var(item, "setup") + item.session._setupstate.setup(item) + + +def pytest_runtest_call(item: Item) -> None: + _update_current_test_var(item, "call") + try: + del sys.last_type + del sys.last_value + del sys.last_traceback + if sys.version_info >= (3, 12, 0): + del sys.last_exc # type:ignore[attr-defined] + except AttributeError: + pass + try: + item.runtest() + except Exception as e: + # Store trace info to allow postmortem debugging + sys.last_type = type(e) + sys.last_value = e + if sys.version_info >= (3, 12, 0): + sys.last_exc = e # type:ignore[attr-defined] + assert e.__traceback__ is not None + # Skip *this* frame + sys.last_traceback = e.__traceback__.tb_next + raise + + +def pytest_runtest_teardown(item: Item, nextitem: Item | None) -> None: + _update_current_test_var(item, "teardown") + item.session._setupstate.teardown_exact(nextitem) + _update_current_test_var(item, None) + + +def _update_current_test_var( + item: Item, when: Literal["setup", "call", "teardown"] | None +) -> None: + """Update :envvar:`PYTEST_CURRENT_TEST` to reflect the current item and stage. + + If ``when`` is None, delete ``PYTEST_CURRENT_TEST`` from the environment. + """ + var_name = "PYTEST_CURRENT_TEST" + if when: + value = f"{item.nodeid} ({when})" + # don't allow null bytes on environment variables (see #2644, #2957) + value = value.replace("\x00", "(null)") + os.environ[var_name] = value + else: + os.environ.pop(var_name) + + +def pytest_report_teststatus(report: BaseReport) -> tuple[str, str, str] | None: + if report.when in ("setup", "teardown"): + if report.failed: + # category, shortletter, verbose-word + return "error", "E", "ERROR" + elif report.skipped: + return "skipped", "s", "SKIPPED" + else: + return "", "", "" + return None + + +# +# Implementation + + +def call_and_report( + item: Item, when: Literal["setup", "call", "teardown"], log: bool = True, **kwds +) -> TestReport: + ihook = item.ihook + if when == "setup": + runtest_hook: Callable[..., None] = ihook.pytest_runtest_setup + elif when == "call": + runtest_hook = ihook.pytest_runtest_call + elif when == "teardown": + runtest_hook = ihook.pytest_runtest_teardown + else: + assert False, f"Unhandled runtest hook case: {when}" + reraise: tuple[type[BaseException], ...] = (Exit,) + if not item.config.getoption("usepdb", False): + reraise += (KeyboardInterrupt,) + call = CallInfo.from_call( + lambda: runtest_hook(item=item, **kwds), when=when, reraise=reraise + ) + report: TestReport = ihook.pytest_runtest_makereport(item=item, call=call) + if log: + ihook.pytest_runtest_logreport(report=report) + if check_interactive_exception(call, report): + ihook.pytest_exception_interact(node=item, call=call, report=report) + return report + + +def check_interactive_exception(call: CallInfo[object], report: BaseReport) -> bool: + """Check whether the call raised an exception that should be reported as + interactive.""" + if call.excinfo is None: + # Didn't raise. + return False + if hasattr(report, "wasxfail"): + # Exception was expected. + return False + if isinstance(call.excinfo.value, (Skipped, bdb.BdbQuit)): + # Special control flow exception. + return False + return True + + +TResult = TypeVar("TResult", covariant=True) + + +@final +@dataclasses.dataclass +class CallInfo(Generic[TResult]): + """Result/Exception info of a function invocation.""" + + _result: TResult | None + #: The captured exception of the call, if it raised. + excinfo: ExceptionInfo[BaseException] | None + #: The system time when the call started, in seconds since the epoch. + start: float + #: The system time when the call ended, in seconds since the epoch. + stop: float + #: The call duration, in seconds. + duration: float + #: The context of invocation: "collect", "setup", "call" or "teardown". + when: Literal["collect", "setup", "call", "teardown"] + + def __init__( + self, + result: TResult | None, + excinfo: ExceptionInfo[BaseException] | None, + start: float, + stop: float, + duration: float, + when: Literal["collect", "setup", "call", "teardown"], + *, + _ispytest: bool = False, + ) -> None: + check_ispytest(_ispytest) + self._result = result + self.excinfo = excinfo + self.start = start + self.stop = stop + self.duration = duration + self.when = when + + @property + def result(self) -> TResult: + """The return value of the call, if it didn't raise. + + Can only be accessed if excinfo is None. + """ + if self.excinfo is not None: + raise AttributeError(f"{self!r} has no valid result") + # The cast is safe because an exception wasn't raised, hence + # _result has the expected function return type (which may be + # None, that's why a cast and not an assert). + return cast(TResult, self._result) + + @classmethod + def from_call( + cls, + func: Callable[[], TResult], + when: Literal["collect", "setup", "call", "teardown"], + reraise: type[BaseException] | tuple[type[BaseException], ...] | None = None, + ) -> CallInfo[TResult]: + """Call func, wrapping the result in a CallInfo. + + :param func: + The function to call. Called without arguments. + :type func: Callable[[], _pytest.runner.TResult] + :param when: + The phase in which the function is called. + :param reraise: + Exception or exceptions that shall propagate if raised by the + function, instead of being wrapped in the CallInfo. + """ + excinfo = None + start = timing.time() + precise_start = timing.perf_counter() + try: + result: TResult | None = func() + except BaseException: + excinfo = ExceptionInfo.from_current() + if reraise is not None and isinstance(excinfo.value, reraise): + raise + result = None + # use the perf counter + precise_stop = timing.perf_counter() + duration = precise_stop - precise_start + stop = timing.time() + return cls( + start=start, + stop=stop, + duration=duration, + when=when, + result=result, + excinfo=excinfo, + _ispytest=True, + ) + + def __repr__(self) -> str: + if self.excinfo is None: + return f"" + return f"" + + +def pytest_runtest_makereport(item: Item, call: CallInfo[None]) -> TestReport: + return TestReport.from_item_and_call(item, call) + + +def pytest_make_collect_report(collector: Collector) -> CollectReport: + def collect() -> list[Item | Collector]: + # Before collecting, if this is a Directory, load the conftests. + # If a conftest import fails to load, it is considered a collection + # error of the Directory collector. This is why it's done inside of the + # CallInfo wrapper. + # + # Note: initial conftests are loaded early, not here. + if isinstance(collector, Directory): + collector.config.pluginmanager._loadconftestmodules( + collector.path, + collector.config.getoption("importmode"), + rootpath=collector.config.rootpath, + consider_namespace_packages=collector.config.getini( + "consider_namespace_packages" + ), + ) + + return list(collector.collect()) + + call = CallInfo.from_call( + collect, "collect", reraise=(KeyboardInterrupt, SystemExit) + ) + longrepr: None | tuple[str, int, str] | str | TerminalRepr = None + if not call.excinfo: + outcome: Literal["passed", "skipped", "failed"] = "passed" + else: + skip_exceptions = [Skipped] + unittest = sys.modules.get("unittest") + if unittest is not None: + skip_exceptions.append(unittest.SkipTest) + if isinstance(call.excinfo.value, tuple(skip_exceptions)): + outcome = "skipped" + r_ = collector._repr_failure_py(call.excinfo, "line") + assert isinstance(r_, ExceptionChainRepr), repr(r_) + r = r_.reprcrash + assert r + longrepr = (str(r.path), r.lineno, r.message) + else: + outcome = "failed" + errorinfo = collector.repr_failure(call.excinfo) + if not hasattr(errorinfo, "toterminal"): + assert isinstance(errorinfo, str) + errorinfo = CollectErrorRepr(errorinfo) + longrepr = errorinfo + result = call.result if not call.excinfo else None + rep = CollectReport(collector.nodeid, outcome, longrepr, result) + rep.call = call # type: ignore # see collect_one_node + return rep + + +class SetupState: + """Shared state for setting up/tearing down test items or collectors + in a session. + + Suppose we have a collection tree as follows: + + + + + + + + The SetupState maintains a stack. The stack starts out empty: + + [] + + During the setup phase of item1, setup(item1) is called. What it does + is: + + push session to stack, run session.setup() + push mod1 to stack, run mod1.setup() + push item1 to stack, run item1.setup() + + The stack is: + + [session, mod1, item1] + + While the stack is in this shape, it is allowed to add finalizers to + each of session, mod1, item1 using addfinalizer(). + + During the teardown phase of item1, teardown_exact(item2) is called, + where item2 is the next item to item1. What it does is: + + pop item1 from stack, run its teardowns + pop mod1 from stack, run its teardowns + + mod1 was popped because it ended its purpose with item1. The stack is: + + [session] + + During the setup phase of item2, setup(item2) is called. What it does + is: + + push mod2 to stack, run mod2.setup() + push item2 to stack, run item2.setup() + + Stack: + + [session, mod2, item2] + + During the teardown phase of item2, teardown_exact(None) is called, + because item2 is the last item. What it does is: + + pop item2 from stack, run its teardowns + pop mod2 from stack, run its teardowns + pop session from stack, run its teardowns + + Stack: + + [] + + The end! + """ + + def __init__(self) -> None: + # The stack is in the dict insertion order. + self.stack: dict[ + Node, + tuple[ + # Node's finalizers. + list[Callable[[], object]], + # Node's exception and original traceback, if its setup raised. + tuple[OutcomeException | Exception, types.TracebackType | None] | None, + ], + ] = {} + + def setup(self, item: Item) -> None: + """Setup objects along the collector chain to the item.""" + needed_collectors = item.listchain() + + # If a collector fails its setup, fail its entire subtree of items. + # The setup is not retried for each item - the same exception is used. + for col, (finalizers, exc) in self.stack.items(): + assert col in needed_collectors, "previous item was not torn down properly" + if exc: + raise exc[0].with_traceback(exc[1]) + + for col in needed_collectors[len(self.stack) :]: + assert col not in self.stack + # Push onto the stack. + self.stack[col] = ([col.teardown], None) + try: + col.setup() + except TEST_OUTCOME as exc: + self.stack[col] = (self.stack[col][0], (exc, exc.__traceback__)) + raise + + def addfinalizer(self, finalizer: Callable[[], object], node: Node) -> None: + """Attach a finalizer to the given node. + + The node must be currently active in the stack. + """ + assert node and not isinstance(node, tuple) + assert callable(finalizer) + assert node in self.stack, (node, self.stack) + self.stack[node][0].append(finalizer) + + def teardown_exact(self, nextitem: Item | None) -> None: + """Teardown the current stack up until reaching nodes that nextitem + also descends from. + + When nextitem is None (meaning we're at the last item), the entire + stack is torn down. + """ + needed_collectors = nextitem and nextitem.listchain() or [] + exceptions: list[BaseException] = [] + while self.stack: + if list(self.stack.keys()) == needed_collectors[: len(self.stack)]: + break + node, (finalizers, _) = self.stack.popitem() + these_exceptions = [] + while finalizers: + fin = finalizers.pop() + try: + fin() + except TEST_OUTCOME as e: + these_exceptions.append(e) + + if len(these_exceptions) == 1: + exceptions.extend(these_exceptions) + elif these_exceptions: + msg = f"errors while tearing down {node!r}" + exceptions.append(BaseExceptionGroup(msg, these_exceptions[::-1])) + + if len(exceptions) == 1: + raise exceptions[0] + elif exceptions: + raise BaseExceptionGroup("errors during test teardown", exceptions[::-1]) + if nextitem is None: + assert not self.stack + + +def collect_one_node(collector: Collector) -> CollectReport: + ihook = collector.ihook + ihook.pytest_collectstart(collector=collector) + rep: CollectReport = ihook.pytest_make_collect_report(collector=collector) + call = rep.__dict__.pop("call", None) + if call and check_interactive_exception(call, rep): + ihook.pytest_exception_interact(node=collector, call=call, report=rep) + return rep diff --git a/.venv/Lib/site-packages/_pytest/scope.py b/.venv/Lib/site-packages/_pytest/scope.py new file mode 100644 index 00000000..976a3ba2 --- /dev/null +++ b/.venv/Lib/site-packages/_pytest/scope.py @@ -0,0 +1,91 @@ +""" +Scope definition and related utilities. + +Those are defined here, instead of in the 'fixtures' module because +their use is spread across many other pytest modules, and centralizing it in 'fixtures' +would cause circular references. + +Also this makes the module light to import, as it should. +""" + +from __future__ import annotations + +from enum import Enum +from functools import total_ordering +from typing import Literal + + +_ScopeName = Literal["session", "package", "module", "class", "function"] + + +@total_ordering +class Scope(Enum): + """ + Represents one of the possible fixture scopes in pytest. + + Scopes are ordered from lower to higher, that is: + + ->>> higher ->>> + + Function < Class < Module < Package < Session + + <<<- lower <<<- + """ + + # Scopes need to be listed from lower to higher. + Function: _ScopeName = "function" + Class: _ScopeName = "class" + Module: _ScopeName = "module" + Package: _ScopeName = "package" + Session: _ScopeName = "session" + + def next_lower(self) -> Scope: + """Return the next lower scope.""" + index = _SCOPE_INDICES[self] + if index == 0: + raise ValueError(f"{self} is the lower-most scope") + return _ALL_SCOPES[index - 1] + + def next_higher(self) -> Scope: + """Return the next higher scope.""" + index = _SCOPE_INDICES[self] + if index == len(_SCOPE_INDICES) - 1: + raise ValueError(f"{self} is the upper-most scope") + return _ALL_SCOPES[index + 1] + + def __lt__(self, other: Scope) -> bool: + self_index = _SCOPE_INDICES[self] + other_index = _SCOPE_INDICES[other] + return self_index < other_index + + @classmethod + def from_user( + cls, scope_name: _ScopeName, descr: str, where: str | None = None + ) -> Scope: + """ + Given a scope name from the user, return the equivalent Scope enum. Should be used + whenever we want to convert a user provided scope name to its enum object. + + If the scope name is invalid, construct a user friendly message and call pytest.fail. + """ + from _pytest.outcomes import fail + + try: + # Holding this reference is necessary for mypy at the moment. + scope = Scope(scope_name) + except ValueError: + fail( + "{} {}got an unexpected scope value '{}'".format( + descr, f"from {where} " if where else "", scope_name + ), + pytrace=False, + ) + return scope + + +_ALL_SCOPES = list(Scope) +_SCOPE_INDICES = {scope: index for index, scope in enumerate(_ALL_SCOPES)} + + +# Ordered list of scopes which can contain many tests (in practice all except Function). +HIGH_SCOPES = [x for x in Scope if x is not Scope.Function] diff --git a/.venv/Lib/site-packages/_pytest/setuponly.py b/.venv/Lib/site-packages/_pytest/setuponly.py new file mode 100644 index 00000000..de297f40 --- /dev/null +++ b/.venv/Lib/site-packages/_pytest/setuponly.py @@ -0,0 +1,102 @@ +from __future__ import annotations + +from typing import Generator + +from _pytest._io.saferepr import saferepr +from _pytest.config import Config +from _pytest.config import ExitCode +from _pytest.config.argparsing import Parser +from _pytest.fixtures import FixtureDef +from _pytest.fixtures import SubRequest +from _pytest.scope import Scope +import pytest + + +def pytest_addoption(parser: Parser) -> None: + group = parser.getgroup("debugconfig") + group.addoption( + "--setuponly", + "--setup-only", + action="store_true", + help="Only setup fixtures, do not execute tests", + ) + group.addoption( + "--setupshow", + "--setup-show", + action="store_true", + help="Show setup of fixtures while executing tests", + ) + + +@pytest.hookimpl(wrapper=True) +def pytest_fixture_setup( + fixturedef: FixtureDef[object], request: SubRequest +) -> Generator[None, object, object]: + try: + return (yield) + finally: + if request.config.option.setupshow: + if hasattr(request, "param"): + # Save the fixture parameter so ._show_fixture_action() can + # display it now and during the teardown (in .finish()). + if fixturedef.ids: + if callable(fixturedef.ids): + param = fixturedef.ids(request.param) + else: + param = fixturedef.ids[request.param_index] + else: + param = request.param + fixturedef.cached_param = param # type: ignore[attr-defined] + _show_fixture_action(fixturedef, request.config, "SETUP") + + +def pytest_fixture_post_finalizer( + fixturedef: FixtureDef[object], request: SubRequest +) -> None: + if fixturedef.cached_result is not None: + config = request.config + if config.option.setupshow: + _show_fixture_action(fixturedef, request.config, "TEARDOWN") + if hasattr(fixturedef, "cached_param"): + del fixturedef.cached_param + + +def _show_fixture_action( + fixturedef: FixtureDef[object], config: Config, msg: str +) -> None: + capman = config.pluginmanager.getplugin("capturemanager") + if capman: + capman.suspend_global_capture() + + tw = config.get_terminal_writer() + tw.line() + # Use smaller indentation the higher the scope: Session = 0, Package = 1, etc. + scope_indent = list(reversed(Scope)).index(fixturedef._scope) + tw.write(" " * 2 * scope_indent) + tw.write( + "{step} {scope} {fixture}".format( # noqa: UP032 (Readability) + step=msg.ljust(8), # align the output to TEARDOWN + scope=fixturedef.scope[0].upper(), + fixture=fixturedef.argname, + ) + ) + + if msg == "SETUP": + deps = sorted(arg for arg in fixturedef.argnames if arg != "request") + if deps: + tw.write(" (fixtures used: {})".format(", ".join(deps))) + + if hasattr(fixturedef, "cached_param"): + tw.write(f"[{saferepr(fixturedef.cached_param, maxsize=42)}]") + + tw.flush() + + if capman: + capman.resume_global_capture() + + +@pytest.hookimpl(tryfirst=True) +def pytest_cmdline_main(config: Config) -> int | ExitCode | None: + if config.option.setuponly: + config.option.setupshow = True + return None diff --git a/.venv/Lib/site-packages/_pytest/setupplan.py b/.venv/Lib/site-packages/_pytest/setupplan.py new file mode 100644 index 00000000..4e124cce --- /dev/null +++ b/.venv/Lib/site-packages/_pytest/setupplan.py @@ -0,0 +1,39 @@ +from __future__ import annotations + +from _pytest.config import Config +from _pytest.config import ExitCode +from _pytest.config.argparsing import Parser +from _pytest.fixtures import FixtureDef +from _pytest.fixtures import SubRequest +import pytest + + +def pytest_addoption(parser: Parser) -> None: + group = parser.getgroup("debugconfig") + group.addoption( + "--setupplan", + "--setup-plan", + action="store_true", + help="Show what fixtures and tests would be executed but " + "don't execute anything", + ) + + +@pytest.hookimpl(tryfirst=True) +def pytest_fixture_setup( + fixturedef: FixtureDef[object], request: SubRequest +) -> object | None: + # Will return a dummy fixture if the setuponly option is provided. + if request.config.option.setupplan: + my_cache_key = fixturedef.cache_key(request) + fixturedef.cached_result = (None, my_cache_key, None) + return fixturedef.cached_result + return None + + +@pytest.hookimpl(tryfirst=True) +def pytest_cmdline_main(config: Config) -> int | ExitCode | None: + if config.option.setupplan: + config.option.setuponly = True + config.option.setupshow = True + return None diff --git a/.venv/Lib/site-packages/_pytest/skipping.py b/.venv/Lib/site-packages/_pytest/skipping.py new file mode 100644 index 00000000..9818be2a --- /dev/null +++ b/.venv/Lib/site-packages/_pytest/skipping.py @@ -0,0 +1,301 @@ +# mypy: allow-untyped-defs +"""Support for skip/xfail functions and markers.""" + +from __future__ import annotations + +from collections.abc import Mapping +import dataclasses +import os +import platform +import sys +import traceback +from typing import Generator +from typing import Optional + +from _pytest.config import Config +from _pytest.config import hookimpl +from _pytest.config.argparsing import Parser +from _pytest.mark.structures import Mark +from _pytest.nodes import Item +from _pytest.outcomes import fail +from _pytest.outcomes import skip +from _pytest.outcomes import xfail +from _pytest.reports import BaseReport +from _pytest.reports import TestReport +from _pytest.runner import CallInfo +from _pytest.stash import StashKey + + +def pytest_addoption(parser: Parser) -> None: + group = parser.getgroup("general") + group.addoption( + "--runxfail", + action="store_true", + dest="runxfail", + default=False, + help="Report the results of xfail tests as if they were not marked", + ) + + parser.addini( + "xfail_strict", + "Default for the strict parameter of xfail " + "markers when not given explicitly (default: False)", + default=False, + type="bool", + ) + + +def pytest_configure(config: Config) -> None: + if config.option.runxfail: + # yay a hack + import pytest + + old = pytest.xfail + config.add_cleanup(lambda: setattr(pytest, "xfail", old)) + + def nop(*args, **kwargs): + pass + + nop.Exception = xfail.Exception # type: ignore[attr-defined] + setattr(pytest, "xfail", nop) + + config.addinivalue_line( + "markers", + "skip(reason=None): skip the given test function with an optional reason. " + 'Example: skip(reason="no way of currently testing this") skips the ' + "test.", + ) + config.addinivalue_line( + "markers", + "skipif(condition, ..., *, reason=...): " + "skip the given test function if any of the conditions evaluate to True. " + "Example: skipif(sys.platform == 'win32') skips the test if we are on the win32 platform. " + "See https://docs.pytest.org/en/stable/reference/reference.html#pytest-mark-skipif", + ) + config.addinivalue_line( + "markers", + "xfail(condition, ..., *, reason=..., run=True, raises=None, strict=xfail_strict): " + "mark the test function as an expected failure if any of the conditions " + "evaluate to True. Optionally specify a reason for better reporting " + "and run=False if you don't even want to execute the test function. " + "If only specific exception(s) are expected, you can list them in " + "raises, and if the test fails in other ways, it will be reported as " + "a true failure. See https://docs.pytest.org/en/stable/reference/reference.html#pytest-mark-xfail", + ) + + +def evaluate_condition(item: Item, mark: Mark, condition: object) -> tuple[bool, str]: + """Evaluate a single skipif/xfail condition. + + If an old-style string condition is given, it is eval()'d, otherwise the + condition is bool()'d. If this fails, an appropriately formatted pytest.fail + is raised. + + Returns (result, reason). The reason is only relevant if the result is True. + """ + # String condition. + if isinstance(condition, str): + globals_ = { + "os": os, + "sys": sys, + "platform": platform, + "config": item.config, + } + for dictionary in reversed( + item.ihook.pytest_markeval_namespace(config=item.config) + ): + if not isinstance(dictionary, Mapping): + raise ValueError( + f"pytest_markeval_namespace() needs to return a dict, got {dictionary!r}" + ) + globals_.update(dictionary) + if hasattr(item, "obj"): + globals_.update(item.obj.__globals__) + try: + filename = f"<{mark.name} condition>" + condition_code = compile(condition, filename, "eval") + result = eval(condition_code, globals_) + except SyntaxError as exc: + msglines = [ + f"Error evaluating {mark.name!r} condition", + " " + condition, + " " + " " * (exc.offset or 0) + "^", + "SyntaxError: invalid syntax", + ] + fail("\n".join(msglines), pytrace=False) + except Exception as exc: + msglines = [ + f"Error evaluating {mark.name!r} condition", + " " + condition, + *traceback.format_exception_only(type(exc), exc), + ] + fail("\n".join(msglines), pytrace=False) + + # Boolean condition. + else: + try: + result = bool(condition) + except Exception as exc: + msglines = [ + f"Error evaluating {mark.name!r} condition as a boolean", + *traceback.format_exception_only(type(exc), exc), + ] + fail("\n".join(msglines), pytrace=False) + + reason = mark.kwargs.get("reason", None) + if reason is None: + if isinstance(condition, str): + reason = "condition: " + condition + else: + # XXX better be checked at collection time + msg = ( + f"Error evaluating {mark.name!r}: " + + "you need to specify reason=STRING when using booleans as conditions." + ) + fail(msg, pytrace=False) + + return result, reason + + +@dataclasses.dataclass(frozen=True) +class Skip: + """The result of evaluate_skip_marks().""" + + reason: str = "unconditional skip" + + +def evaluate_skip_marks(item: Item) -> Skip | None: + """Evaluate skip and skipif marks on item, returning Skip if triggered.""" + for mark in item.iter_markers(name="skipif"): + if "condition" not in mark.kwargs: + conditions = mark.args + else: + conditions = (mark.kwargs["condition"],) + + # Unconditional. + if not conditions: + reason = mark.kwargs.get("reason", "") + return Skip(reason) + + # If any of the conditions are true. + for condition in conditions: + result, reason = evaluate_condition(item, mark, condition) + if result: + return Skip(reason) + + for mark in item.iter_markers(name="skip"): + try: + return Skip(*mark.args, **mark.kwargs) + except TypeError as e: + raise TypeError(str(e) + " - maybe you meant pytest.mark.skipif?") from None + + return None + + +@dataclasses.dataclass(frozen=True) +class Xfail: + """The result of evaluate_xfail_marks().""" + + __slots__ = ("reason", "run", "strict", "raises") + + reason: str + run: bool + strict: bool + raises: tuple[type[BaseException], ...] | None + + +def evaluate_xfail_marks(item: Item) -> Xfail | None: + """Evaluate xfail marks on item, returning Xfail if triggered.""" + for mark in item.iter_markers(name="xfail"): + run = mark.kwargs.get("run", True) + strict = mark.kwargs.get("strict", item.config.getini("xfail_strict")) + raises = mark.kwargs.get("raises", None) + if "condition" not in mark.kwargs: + conditions = mark.args + else: + conditions = (mark.kwargs["condition"],) + + # Unconditional. + if not conditions: + reason = mark.kwargs.get("reason", "") + return Xfail(reason, run, strict, raises) + + # If any of the conditions are true. + for condition in conditions: + result, reason = evaluate_condition(item, mark, condition) + if result: + return Xfail(reason, run, strict, raises) + + return None + + +# Saves the xfail mark evaluation. Can be refreshed during call if None. +xfailed_key = StashKey[Optional[Xfail]]() + + +@hookimpl(tryfirst=True) +def pytest_runtest_setup(item: Item) -> None: + skipped = evaluate_skip_marks(item) + if skipped: + raise skip.Exception(skipped.reason, _use_item_location=True) + + item.stash[xfailed_key] = xfailed = evaluate_xfail_marks(item) + if xfailed and not item.config.option.runxfail and not xfailed.run: + xfail("[NOTRUN] " + xfailed.reason) + + +@hookimpl(wrapper=True) +def pytest_runtest_call(item: Item) -> Generator[None]: + xfailed = item.stash.get(xfailed_key, None) + if xfailed is None: + item.stash[xfailed_key] = xfailed = evaluate_xfail_marks(item) + + if xfailed and not item.config.option.runxfail and not xfailed.run: + xfail("[NOTRUN] " + xfailed.reason) + + try: + return (yield) + finally: + # The test run may have added an xfail mark dynamically. + xfailed = item.stash.get(xfailed_key, None) + if xfailed is None: + item.stash[xfailed_key] = xfailed = evaluate_xfail_marks(item) + + +@hookimpl(wrapper=True) +def pytest_runtest_makereport( + item: Item, call: CallInfo[None] +) -> Generator[None, TestReport, TestReport]: + rep = yield + xfailed = item.stash.get(xfailed_key, None) + if item.config.option.runxfail: + pass # don't interfere + elif call.excinfo and isinstance(call.excinfo.value, xfail.Exception): + assert call.excinfo.value.msg is not None + rep.wasxfail = "reason: " + call.excinfo.value.msg + rep.outcome = "skipped" + elif not rep.skipped and xfailed: + if call.excinfo: + raises = xfailed.raises + if raises is not None and not isinstance(call.excinfo.value, raises): + rep.outcome = "failed" + else: + rep.outcome = "skipped" + rep.wasxfail = xfailed.reason + elif call.when == "call": + if xfailed.strict: + rep.outcome = "failed" + rep.longrepr = "[XPASS(strict)] " + xfailed.reason + else: + rep.outcome = "passed" + rep.wasxfail = xfailed.reason + return rep + + +def pytest_report_teststatus(report: BaseReport) -> tuple[str, str, str] | None: + if hasattr(report, "wasxfail"): + if report.skipped: + return "xfailed", "x", "XFAIL" + elif report.passed: + return "xpassed", "X", "XPASS" + return None diff --git a/.venv/Lib/site-packages/_pytest/stash.py b/.venv/Lib/site-packages/_pytest/stash.py new file mode 100644 index 00000000..6a9ff884 --- /dev/null +++ b/.venv/Lib/site-packages/_pytest/stash.py @@ -0,0 +1,116 @@ +from __future__ import annotations + +from typing import Any +from typing import cast +from typing import Generic +from typing import TypeVar + + +__all__ = ["Stash", "StashKey"] + + +T = TypeVar("T") +D = TypeVar("D") + + +class StashKey(Generic[T]): + """``StashKey`` is an object used as a key to a :class:`Stash`. + + A ``StashKey`` is associated with the type ``T`` of the value of the key. + + A ``StashKey`` is unique and cannot conflict with another key. + + .. versionadded:: 7.0 + """ + + __slots__ = () + + +class Stash: + r"""``Stash`` is a type-safe heterogeneous mutable mapping that + allows keys and value types to be defined separately from + where it (the ``Stash``) is created. + + Usually you will be given an object which has a ``Stash``, for example + :class:`~pytest.Config` or a :class:`~_pytest.nodes.Node`: + + .. code-block:: python + + stash: Stash = some_object.stash + + If a module or plugin wants to store data in this ``Stash``, it creates + :class:`StashKey`\s for its keys (at the module level): + + .. code-block:: python + + # At the top-level of the module + some_str_key = StashKey[str]() + some_bool_key = StashKey[bool]() + + To store information: + + .. code-block:: python + + # Value type must match the key. + stash[some_str_key] = "value" + stash[some_bool_key] = True + + To retrieve the information: + + .. code-block:: python + + # The static type of some_str is str. + some_str = stash[some_str_key] + # The static type of some_bool is bool. + some_bool = stash[some_bool_key] + + .. versionadded:: 7.0 + """ + + __slots__ = ("_storage",) + + def __init__(self) -> None: + self._storage: dict[StashKey[Any], object] = {} + + def __setitem__(self, key: StashKey[T], value: T) -> None: + """Set a value for key.""" + self._storage[key] = value + + def __getitem__(self, key: StashKey[T]) -> T: + """Get the value for key. + + Raises ``KeyError`` if the key wasn't set before. + """ + return cast(T, self._storage[key]) + + def get(self, key: StashKey[T], default: D) -> T | D: + """Get the value for key, or return default if the key wasn't set + before.""" + try: + return self[key] + except KeyError: + return default + + def setdefault(self, key: StashKey[T], default: T) -> T: + """Return the value of key if already set, otherwise set the value + of key to default and return default.""" + try: + return self[key] + except KeyError: + self[key] = default + return default + + def __delitem__(self, key: StashKey[T]) -> None: + """Delete the value for key. + + Raises ``KeyError`` if the key wasn't set before. + """ + del self._storage[key] + + def __contains__(self, key: StashKey[T]) -> bool: + """Return whether key was set.""" + return key in self._storage + + def __len__(self) -> int: + """Return how many items exist in the stash.""" + return len(self._storage) diff --git a/.venv/Lib/site-packages/_pytest/stepwise.py b/.venv/Lib/site-packages/_pytest/stepwise.py new file mode 100644 index 00000000..c7860808 --- /dev/null +++ b/.venv/Lib/site-packages/_pytest/stepwise.py @@ -0,0 +1,125 @@ +from __future__ import annotations + +from _pytest import nodes +from _pytest.cacheprovider import Cache +from _pytest.config import Config +from _pytest.config.argparsing import Parser +from _pytest.main import Session +from _pytest.reports import TestReport + + +STEPWISE_CACHE_DIR = "cache/stepwise" + + +def pytest_addoption(parser: Parser) -> None: + group = parser.getgroup("general") + group.addoption( + "--sw", + "--stepwise", + action="store_true", + default=False, + dest="stepwise", + help="Exit on test failure and continue from last failing test next time", + ) + group.addoption( + "--sw-skip", + "--stepwise-skip", + action="store_true", + default=False, + dest="stepwise_skip", + help="Ignore the first failing test but stop on the next failing test. " + "Implicitly enables --stepwise.", + ) + + +def pytest_configure(config: Config) -> None: + if config.option.stepwise_skip: + # allow --stepwise-skip to work on its own merits. + config.option.stepwise = True + if config.getoption("stepwise"): + config.pluginmanager.register(StepwisePlugin(config), "stepwiseplugin") + + +def pytest_sessionfinish(session: Session) -> None: + if not session.config.getoption("stepwise"): + assert session.config.cache is not None + if hasattr(session.config, "workerinput"): + # Do not update cache if this process is a xdist worker to prevent + # race conditions (#10641). + return + # Clear the list of failing tests if the plugin is not active. + session.config.cache.set(STEPWISE_CACHE_DIR, []) + + +class StepwisePlugin: + def __init__(self, config: Config) -> None: + self.config = config + self.session: Session | None = None + self.report_status = "" + assert config.cache is not None + self.cache: Cache = config.cache + self.lastfailed: str | None = self.cache.get(STEPWISE_CACHE_DIR, None) + self.skip: bool = config.getoption("stepwise_skip") + + def pytest_sessionstart(self, session: Session) -> None: + self.session = session + + def pytest_collection_modifyitems( + self, config: Config, items: list[nodes.Item] + ) -> None: + if not self.lastfailed: + self.report_status = "no previously failed tests, not skipping." + return + + # check all item nodes until we find a match on last failed + failed_index = None + for index, item in enumerate(items): + if item.nodeid == self.lastfailed: + failed_index = index + break + + # If the previously failed test was not found among the test items, + # do not skip any tests. + if failed_index is None: + self.report_status = "previously failed test not found, not skipping." + else: + self.report_status = f"skipping {failed_index} already passed items." + deselected = items[:failed_index] + del items[:failed_index] + config.hook.pytest_deselected(items=deselected) + + def pytest_runtest_logreport(self, report: TestReport) -> None: + if report.failed: + if self.skip: + # Remove test from the failed ones (if it exists) and unset the skip option + # to make sure the following tests will not be skipped. + if report.nodeid == self.lastfailed: + self.lastfailed = None + + self.skip = False + else: + # Mark test as the last failing and interrupt the test session. + self.lastfailed = report.nodeid + assert self.session is not None + self.session.shouldstop = ( + "Test failed, continuing from this test next run." + ) + + else: + # If the test was actually run and did pass. + if report.when == "call": + # Remove test from the failed ones, if exists. + if report.nodeid == self.lastfailed: + self.lastfailed = None + + def pytest_report_collectionfinish(self) -> str | None: + if self.config.get_verbosity() >= 0 and self.report_status: + return f"stepwise: {self.report_status}" + return None + + def pytest_sessionfinish(self) -> None: + if hasattr(self.config, "workerinput"): + # Do not update cache if this process is a xdist worker to prevent + # race conditions (#10641). + return + self.cache.set(STEPWISE_CACHE_DIR, self.lastfailed) diff --git a/.venv/Lib/site-packages/_pytest/terminal.py b/.venv/Lib/site-packages/_pytest/terminal.py new file mode 100644 index 00000000..ed267bf5 --- /dev/null +++ b/.venv/Lib/site-packages/_pytest/terminal.py @@ -0,0 +1,1577 @@ +# mypy: allow-untyped-defs +"""Terminal reporting of the full testing process. + +This is a good source for looking at the various reporting hooks. +""" + +from __future__ import annotations + +import argparse +from collections import Counter +import dataclasses +import datetime +from functools import partial +import inspect +from pathlib import Path +import platform +import sys +import textwrap +from typing import Any +from typing import Callable +from typing import ClassVar +from typing import final +from typing import Generator +from typing import Literal +from typing import Mapping +from typing import NamedTuple +from typing import Sequence +from typing import TextIO +from typing import TYPE_CHECKING +import warnings + +import pluggy + +from _pytest import nodes +from _pytest import timing +from _pytest._code import ExceptionInfo +from _pytest._code.code import ExceptionRepr +from _pytest._io import TerminalWriter +from _pytest._io.wcwidth import wcswidth +import _pytest._version +from _pytest.assertion.util import running_on_ci +from _pytest.config import _PluggyPlugin +from _pytest.config import Config +from _pytest.config import ExitCode +from _pytest.config import hookimpl +from _pytest.config.argparsing import Parser +from _pytest.nodes import Item +from _pytest.nodes import Node +from _pytest.pathlib import absolutepath +from _pytest.pathlib import bestrelpath +from _pytest.reports import BaseReport +from _pytest.reports import CollectReport +from _pytest.reports import TestReport + + +if TYPE_CHECKING: + from _pytest.main import Session + + +REPORT_COLLECTING_RESOLUTION = 0.5 + +KNOWN_TYPES = ( + "failed", + "passed", + "skipped", + "deselected", + "xfailed", + "xpassed", + "warnings", + "error", +) + +_REPORTCHARS_DEFAULT = "fE" + + +class MoreQuietAction(argparse.Action): + """A modified copy of the argparse count action which counts down and updates + the legacy quiet attribute at the same time. + + Used to unify verbosity handling. + """ + + def __init__( + self, + option_strings: Sequence[str], + dest: str, + default: object = None, + required: bool = False, + help: str | None = None, + ) -> None: + super().__init__( + option_strings=option_strings, + dest=dest, + nargs=0, + default=default, + required=required, + help=help, + ) + + def __call__( + self, + parser: argparse.ArgumentParser, + namespace: argparse.Namespace, + values: str | Sequence[object] | None, + option_string: str | None = None, + ) -> None: + new_count = getattr(namespace, self.dest, 0) - 1 + setattr(namespace, self.dest, new_count) + # todo Deprecate config.quiet + namespace.quiet = getattr(namespace, "quiet", 0) + 1 + + +class TestShortLogReport(NamedTuple): + """Used to store the test status result category, shortletter and verbose word. + For example ``"rerun", "R", ("RERUN", {"yellow": True})``. + + :ivar category: + The class of result, for example ``“passed”``, ``“skipped”``, ``“error”``, or the empty string. + + :ivar letter: + The short letter shown as testing progresses, for example ``"."``, ``"s"``, ``"E"``, or the empty string. + + :ivar word: + Verbose word is shown as testing progresses in verbose mode, for example ``"PASSED"``, ``"SKIPPED"``, + ``"ERROR"``, or the empty string. + """ + + category: str + letter: str + word: str | tuple[str, Mapping[str, bool]] + + +def pytest_addoption(parser: Parser) -> None: + group = parser.getgroup("terminal reporting", "Reporting", after="general") + group._addoption( + "-v", + "--verbose", + action="count", + default=0, + dest="verbose", + help="Increase verbosity", + ) + group._addoption( + "--no-header", + action="store_true", + default=False, + dest="no_header", + help="Disable header", + ) + group._addoption( + "--no-summary", + action="store_true", + default=False, + dest="no_summary", + help="Disable summary", + ) + group._addoption( + "--no-fold-skipped", + action="store_false", + dest="fold_skipped", + default=True, + help="Do not fold skipped tests in short summary.", + ) + group._addoption( + "-q", + "--quiet", + action=MoreQuietAction, + default=0, + dest="verbose", + help="Decrease verbosity", + ) + group._addoption( + "--verbosity", + dest="verbose", + type=int, + default=0, + help="Set verbosity. Default: 0.", + ) + group._addoption( + "-r", + action="store", + dest="reportchars", + default=_REPORTCHARS_DEFAULT, + metavar="chars", + help="Show extra test summary info as specified by chars: (f)ailed, " + "(E)rror, (s)kipped, (x)failed, (X)passed, " + "(p)assed, (P)assed with output, (a)ll except passed (p/P), or (A)ll. " + "(w)arnings are enabled by default (see --disable-warnings), " + "'N' can be used to reset the list. (default: 'fE').", + ) + group._addoption( + "--disable-warnings", + "--disable-pytest-warnings", + default=False, + dest="disable_warnings", + action="store_true", + help="Disable warnings summary", + ) + group._addoption( + "-l", + "--showlocals", + action="store_true", + dest="showlocals", + default=False, + help="Show locals in tracebacks (disabled by default)", + ) + group._addoption( + "--no-showlocals", + action="store_false", + dest="showlocals", + help="Hide locals in tracebacks (negate --showlocals passed through addopts)", + ) + group._addoption( + "--tb", + metavar="style", + action="store", + dest="tbstyle", + default="auto", + choices=["auto", "long", "short", "no", "line", "native"], + help="Traceback print mode (auto/long/short/line/native/no)", + ) + group._addoption( + "--xfail-tb", + action="store_true", + dest="xfail_tb", + default=False, + help="Show tracebacks for xfail (as long as --tb != no)", + ) + group._addoption( + "--show-capture", + action="store", + dest="showcapture", + choices=["no", "stdout", "stderr", "log", "all"], + default="all", + help="Controls how captured stdout/stderr/log is shown on failed tests. " + "Default: all.", + ) + group._addoption( + "--fulltrace", + "--full-trace", + action="store_true", + default=False, + help="Don't cut any tracebacks (default is to cut)", + ) + group._addoption( + "--color", + metavar="color", + action="store", + dest="color", + default="auto", + choices=["yes", "no", "auto"], + help="Color terminal output (yes/no/auto)", + ) + group._addoption( + "--code-highlight", + default="yes", + choices=["yes", "no"], + help="Whether code should be highlighted (only if --color is also enabled). " + "Default: yes.", + ) + + parser.addini( + "console_output_style", + help='Console output: "classic", or with additional progress information ' + '("progress" (percentage) | "count" | "progress-even-when-capture-no" (forces ' + "progress even when capture=no)", + default="progress", + ) + Config._add_verbosity_ini( + parser, + Config.VERBOSITY_TEST_CASES, + help=( + "Specify a verbosity level for test case execution, overriding the main level. " + "Higher levels will provide more detailed information about each test case executed." + ), + ) + + +def pytest_configure(config: Config) -> None: + reporter = TerminalReporter(config, sys.stdout) + config.pluginmanager.register(reporter, "terminalreporter") + if config.option.debug or config.option.traceconfig: + + def mywriter(tags, args): + msg = " ".join(map(str, args)) + reporter.write_line("[traceconfig] " + msg) + + config.trace.root.setprocessor("pytest:config", mywriter) + + +def getreportopt(config: Config) -> str: + reportchars: str = config.option.reportchars + + old_aliases = {"F", "S"} + reportopts = "" + for char in reportchars: + if char in old_aliases: + char = char.lower() + if char == "a": + reportopts = "sxXEf" + elif char == "A": + reportopts = "PpsxXEf" + elif char == "N": + reportopts = "" + elif char not in reportopts: + reportopts += char + + if not config.option.disable_warnings and "w" not in reportopts: + reportopts = "w" + reportopts + elif config.option.disable_warnings and "w" in reportopts: + reportopts = reportopts.replace("w", "") + + return reportopts + + +@hookimpl(trylast=True) # after _pytest.runner +def pytest_report_teststatus(report: BaseReport) -> tuple[str, str, str]: + letter = "F" + if report.passed: + letter = "." + elif report.skipped: + letter = "s" + + outcome: str = report.outcome + if report.when in ("collect", "setup", "teardown") and outcome == "failed": + outcome = "error" + letter = "E" + + return outcome, letter, outcome.upper() + + +@dataclasses.dataclass +class WarningReport: + """Simple structure to hold warnings information captured by ``pytest_warning_recorded``. + + :ivar str message: + User friendly message about the warning. + :ivar str|None nodeid: + nodeid that generated the warning (see ``get_location``). + :ivar tuple fslocation: + File system location of the source of the warning (see ``get_location``). + """ + + message: str + nodeid: str | None = None + fslocation: tuple[str, int] | None = None + + count_towards_summary: ClassVar = True + + def get_location(self, config: Config) -> str | None: + """Return the more user-friendly information about the location of a warning, or None.""" + if self.nodeid: + return self.nodeid + if self.fslocation: + filename, linenum = self.fslocation + relpath = bestrelpath(config.invocation_params.dir, absolutepath(filename)) + return f"{relpath}:{linenum}" + return None + + +@final +class TerminalReporter: + def __init__(self, config: Config, file: TextIO | None = None) -> None: + import _pytest.config + + self.config = config + self._numcollected = 0 + self._session: Session | None = None + self._showfspath: bool | None = None + + self.stats: dict[str, list[Any]] = {} + self._main_color: str | None = None + self._known_types: list[str] | None = None + self.startpath = config.invocation_params.dir + if file is None: + file = sys.stdout + self._tw = _pytest.config.create_terminal_writer(config, file) + self._screen_width = self._tw.fullwidth + self.currentfspath: None | Path | str | int = None + self.reportchars = getreportopt(config) + self.foldskipped = config.option.fold_skipped + self.hasmarkup = self._tw.hasmarkup + self.isatty = file.isatty() + self._progress_nodeids_reported: set[str] = set() + self._show_progress_info = self._determine_show_progress_info() + self._collect_report_last_write: float | None = None + self._already_displayed_warnings: int | None = None + self._keyboardinterrupt_memo: ExceptionRepr | None = None + + def _determine_show_progress_info(self) -> Literal["progress", "count", False]: + """Return whether we should display progress information based on the current config.""" + # do not show progress if we are not capturing output (#3038) unless explicitly + # overridden by progress-even-when-capture-no + if ( + self.config.getoption("capture", "no") == "no" + and self.config.getini("console_output_style") + != "progress-even-when-capture-no" + ): + return False + # do not show progress if we are showing fixture setup/teardown + if self.config.getoption("setupshow", False): + return False + cfg: str = self.config.getini("console_output_style") + if cfg in {"progress", "progress-even-when-capture-no"}: + return "progress" + elif cfg == "count": + return "count" + else: + return False + + @property + def verbosity(self) -> int: + verbosity: int = self.config.option.verbose + return verbosity + + @property + def showheader(self) -> bool: + return self.verbosity >= 0 + + @property + def no_header(self) -> bool: + return bool(self.config.option.no_header) + + @property + def no_summary(self) -> bool: + return bool(self.config.option.no_summary) + + @property + def showfspath(self) -> bool: + if self._showfspath is None: + return self.config.get_verbosity(Config.VERBOSITY_TEST_CASES) >= 0 + return self._showfspath + + @showfspath.setter + def showfspath(self, value: bool | None) -> None: + self._showfspath = value + + @property + def showlongtestinfo(self) -> bool: + return self.config.get_verbosity(Config.VERBOSITY_TEST_CASES) > 0 + + def hasopt(self, char: str) -> bool: + char = {"xfailed": "x", "skipped": "s"}.get(char, char) + return char in self.reportchars + + def write_fspath_result(self, nodeid: str, res: str, **markup: bool) -> None: + fspath = self.config.rootpath / nodeid.split("::")[0] + if self.currentfspath is None or fspath != self.currentfspath: + if self.currentfspath is not None and self._show_progress_info: + self._write_progress_information_filling_space() + self.currentfspath = fspath + relfspath = bestrelpath(self.startpath, fspath) + self._tw.line() + self._tw.write(relfspath + " ") + self._tw.write(res, flush=True, **markup) + + def write_ensure_prefix(self, prefix: str, extra: str = "", **kwargs) -> None: + if self.currentfspath != prefix: + self._tw.line() + self.currentfspath = prefix + self._tw.write(prefix) + if extra: + self._tw.write(extra, **kwargs) + self.currentfspath = -2 + + def ensure_newline(self) -> None: + if self.currentfspath: + self._tw.line() + self.currentfspath = None + + def wrap_write( + self, + content: str, + *, + flush: bool = False, + margin: int = 8, + line_sep: str = "\n", + **markup: bool, + ) -> None: + """Wrap message with margin for progress info.""" + width_of_current_line = self._tw.width_of_current_line + wrapped = line_sep.join( + textwrap.wrap( + " " * width_of_current_line + content, + width=self._screen_width - margin, + drop_whitespace=True, + replace_whitespace=False, + ), + ) + wrapped = wrapped[width_of_current_line:] + self._tw.write(wrapped, flush=flush, **markup) + + def write(self, content: str, *, flush: bool = False, **markup: bool) -> None: + self._tw.write(content, flush=flush, **markup) + + def flush(self) -> None: + self._tw.flush() + + def write_line(self, line: str | bytes, **markup: bool) -> None: + if not isinstance(line, str): + line = str(line, errors="replace") + self.ensure_newline() + self._tw.line(line, **markup) + + def rewrite(self, line: str, **markup: bool) -> None: + """Rewinds the terminal cursor to the beginning and writes the given line. + + :param erase: + If True, will also add spaces until the full terminal width to ensure + previous lines are properly erased. + + The rest of the keyword arguments are markup instructions. + """ + erase = markup.pop("erase", False) + if erase: + fill_count = self._tw.fullwidth - len(line) - 1 + fill = " " * fill_count + else: + fill = "" + line = str(line) + self._tw.write("\r" + line + fill, **markup) + + def write_sep( + self, + sep: str, + title: str | None = None, + fullwidth: int | None = None, + **markup: bool, + ) -> None: + self.ensure_newline() + self._tw.sep(sep, title, fullwidth, **markup) + + def section(self, title: str, sep: str = "=", **kw: bool) -> None: + self._tw.sep(sep, title, **kw) + + def line(self, msg: str, **kw: bool) -> None: + self._tw.line(msg, **kw) + + def _add_stats(self, category: str, items: Sequence[Any]) -> None: + set_main_color = category not in self.stats + self.stats.setdefault(category, []).extend(items) + if set_main_color: + self._set_main_color() + + def pytest_internalerror(self, excrepr: ExceptionRepr) -> bool: + for line in str(excrepr).split("\n"): + self.write_line("INTERNALERROR> " + line) + return True + + def pytest_warning_recorded( + self, + warning_message: warnings.WarningMessage, + nodeid: str, + ) -> None: + from _pytest.warnings import warning_record_to_str + + fslocation = warning_message.filename, warning_message.lineno + message = warning_record_to_str(warning_message) + + warning_report = WarningReport( + fslocation=fslocation, message=message, nodeid=nodeid + ) + self._add_stats("warnings", [warning_report]) + + def pytest_plugin_registered(self, plugin: _PluggyPlugin) -> None: + if self.config.option.traceconfig: + msg = f"PLUGIN registered: {plugin}" + # XXX This event may happen during setup/teardown time + # which unfortunately captures our output here + # which garbles our output if we use self.write_line. + self.write_line(msg) + + def pytest_deselected(self, items: Sequence[Item]) -> None: + self._add_stats("deselected", items) + + def pytest_runtest_logstart( + self, nodeid: str, location: tuple[str, int | None, str] + ) -> None: + fspath, lineno, domain = location + # Ensure that the path is printed before the + # 1st test of a module starts running. + if self.showlongtestinfo: + line = self._locationline(nodeid, fspath, lineno, domain) + self.write_ensure_prefix(line, "") + self.flush() + elif self.showfspath: + self.write_fspath_result(nodeid, "") + self.flush() + + def pytest_runtest_logreport(self, report: TestReport) -> None: + self._tests_ran = True + rep = report + + res = TestShortLogReport( + *self.config.hook.pytest_report_teststatus(report=rep, config=self.config) + ) + category, letter, word = res.category, res.letter, res.word + if not isinstance(word, tuple): + markup = None + else: + word, markup = word + self._add_stats(category, [rep]) + if not letter and not word: + # Probably passed setup/teardown. + return + if markup is None: + was_xfail = hasattr(report, "wasxfail") + if rep.passed and not was_xfail: + markup = {"green": True} + elif rep.passed and was_xfail: + markup = {"yellow": True} + elif rep.failed: + markup = {"red": True} + elif rep.skipped: + markup = {"yellow": True} + else: + markup = {} + self._progress_nodeids_reported.add(rep.nodeid) + if self.config.get_verbosity(Config.VERBOSITY_TEST_CASES) <= 0: + self._tw.write(letter, **markup) + # When running in xdist, the logreport and logfinish of multiple + # items are interspersed, e.g. `logreport`, `logreport`, + # `logfinish`, `logfinish`. To avoid the "past edge" calculation + # from getting confused and overflowing (#7166), do the past edge + # printing here and not in logfinish, except for the 100% which + # should only be printed after all teardowns are finished. + if self._show_progress_info and not self._is_last_item: + self._write_progress_information_if_past_edge() + else: + line = self._locationline(rep.nodeid, *rep.location) + running_xdist = hasattr(rep, "node") + if not running_xdist: + self.write_ensure_prefix(line, word, **markup) + if rep.skipped or hasattr(report, "wasxfail"): + reason = _get_raw_skip_reason(rep) + if self.config.get_verbosity(Config.VERBOSITY_TEST_CASES) < 2: + available_width = ( + (self._tw.fullwidth - self._tw.width_of_current_line) + - len(" [100%]") + - 1 + ) + formatted_reason = _format_trimmed( + " ({})", reason, available_width + ) + else: + formatted_reason = f" ({reason})" + + if reason and formatted_reason is not None: + self.wrap_write(formatted_reason) + if self._show_progress_info: + self._write_progress_information_filling_space() + else: + self.ensure_newline() + self._tw.write(f"[{rep.node.gateway.id}]") + if self._show_progress_info: + self._tw.write( + self._get_progress_information_message() + " ", cyan=True + ) + else: + self._tw.write(" ") + self._tw.write(word, **markup) + self._tw.write(" " + line) + self.currentfspath = -2 + self.flush() + + @property + def _is_last_item(self) -> bool: + assert self._session is not None + return len(self._progress_nodeids_reported) == self._session.testscollected + + @hookimpl(wrapper=True) + def pytest_runtestloop(self) -> Generator[None, object, object]: + result = yield + + # Write the final/100% progress -- deferred until the loop is complete. + if ( + self.config.get_verbosity(Config.VERBOSITY_TEST_CASES) <= 0 + and self._show_progress_info + and self._progress_nodeids_reported + ): + self._write_progress_information_filling_space() + + return result + + def _get_progress_information_message(self) -> str: + assert self._session + collected = self._session.testscollected + if self._show_progress_info == "count": + if collected: + progress = len(self._progress_nodeids_reported) + counter_format = f"{{:{len(str(collected))}d}}" + format_string = f" [{counter_format}/{{}}]" + return format_string.format(progress, collected) + return f" [ {collected} / {collected} ]" + else: + if collected: + return ( + f" [{len(self._progress_nodeids_reported) * 100 // collected:3d}%]" + ) + return " [100%]" + + def _write_progress_information_if_past_edge(self) -> None: + w = self._width_of_current_line + if self._show_progress_info == "count": + assert self._session + num_tests = self._session.testscollected + progress_length = len(f" [{num_tests}/{num_tests}]") + else: + progress_length = len(" [100%]") + past_edge = w + progress_length + 1 >= self._screen_width + if past_edge: + main_color, _ = self._get_main_color() + msg = self._get_progress_information_message() + self._tw.write(msg + "\n", **{main_color: True}) + + def _write_progress_information_filling_space(self) -> None: + color, _ = self._get_main_color() + msg = self._get_progress_information_message() + w = self._width_of_current_line + fill = self._tw.fullwidth - w - 1 + self.write(msg.rjust(fill), flush=True, **{color: True}) + + @property + def _width_of_current_line(self) -> int: + """Return the width of the current line.""" + return self._tw.width_of_current_line + + def pytest_collection(self) -> None: + if self.isatty: + if self.config.option.verbose >= 0: + self.write("collecting ... ", flush=True, bold=True) + self._collect_report_last_write = timing.time() + elif self.config.option.verbose >= 1: + self.write("collecting ... ", flush=True, bold=True) + + def pytest_collectreport(self, report: CollectReport) -> None: + if report.failed: + self._add_stats("error", [report]) + elif report.skipped: + self._add_stats("skipped", [report]) + items = [x for x in report.result if isinstance(x, Item)] + self._numcollected += len(items) + if self.isatty: + self.report_collect() + + def report_collect(self, final: bool = False) -> None: + if self.config.option.verbose < 0: + return + + if not final: + # Only write "collecting" report every 0.5s. + t = timing.time() + if ( + self._collect_report_last_write is not None + and self._collect_report_last_write > t - REPORT_COLLECTING_RESOLUTION + ): + return + self._collect_report_last_write = t + + errors = len(self.stats.get("error", [])) + skipped = len(self.stats.get("skipped", [])) + deselected = len(self.stats.get("deselected", [])) + selected = self._numcollected - deselected + line = "collected " if final else "collecting " + line += ( + str(self._numcollected) + " item" + ("" if self._numcollected == 1 else "s") + ) + if errors: + line += " / %d error%s" % (errors, "s" if errors != 1 else "") + if deselected: + line += " / %d deselected" % deselected + if skipped: + line += " / %d skipped" % skipped + if self._numcollected > selected: + line += " / %d selected" % selected + if self.isatty: + self.rewrite(line, bold=True, erase=True) + if final: + self.write("\n") + else: + self.write_line(line) + + @hookimpl(trylast=True) + def pytest_sessionstart(self, session: Session) -> None: + self._session = session + self._sessionstarttime = timing.time() + if not self.showheader: + return + self.write_sep("=", "test session starts", bold=True) + verinfo = platform.python_version() + if not self.no_header: + msg = f"platform {sys.platform} -- Python {verinfo}" + pypy_version_info = getattr(sys, "pypy_version_info", None) + if pypy_version_info: + verinfo = ".".join(map(str, pypy_version_info[:3])) + msg += f"[pypy-{verinfo}-{pypy_version_info[3]}]" + msg += f", pytest-{_pytest._version.version}, pluggy-{pluggy.__version__}" + if ( + self.verbosity > 0 + or self.config.option.debug + or getattr(self.config.option, "pastebin", None) + ): + msg += " -- " + str(sys.executable) + self.write_line(msg) + lines = self.config.hook.pytest_report_header( + config=self.config, start_path=self.startpath + ) + self._write_report_lines_from_hooks(lines) + + def _write_report_lines_from_hooks( + self, lines: Sequence[str | Sequence[str]] + ) -> None: + for line_or_lines in reversed(lines): + if isinstance(line_or_lines, str): + self.write_line(line_or_lines) + else: + for line in line_or_lines: + self.write_line(line) + + def pytest_report_header(self, config: Config) -> list[str]: + result = [f"rootdir: {config.rootpath}"] + + if config.inipath: + result.append("configfile: " + bestrelpath(config.rootpath, config.inipath)) + + if config.args_source == Config.ArgsSource.TESTPATHS: + testpaths: list[str] = config.getini("testpaths") + result.append("testpaths: {}".format(", ".join(testpaths))) + + plugininfo = config.pluginmanager.list_plugin_distinfo() + if plugininfo: + result.append( + "plugins: {}".format(", ".join(_plugin_nameversions(plugininfo))) + ) + return result + + def pytest_collection_finish(self, session: Session) -> None: + self.report_collect(True) + + lines = self.config.hook.pytest_report_collectionfinish( + config=self.config, + start_path=self.startpath, + items=session.items, + ) + self._write_report_lines_from_hooks(lines) + + if self.config.getoption("collectonly"): + if session.items: + if self.config.option.verbose > -1: + self._tw.line("") + self._printcollecteditems(session.items) + + failed = self.stats.get("failed") + if failed: + self._tw.sep("!", "collection failures") + for rep in failed: + rep.toterminal(self._tw) + + def _printcollecteditems(self, items: Sequence[Item]) -> None: + test_cases_verbosity = self.config.get_verbosity(Config.VERBOSITY_TEST_CASES) + if test_cases_verbosity < 0: + if test_cases_verbosity < -1: + counts = Counter(item.nodeid.split("::", 1)[0] for item in items) + for name, count in sorted(counts.items()): + self._tw.line("%s: %d" % (name, count)) + else: + for item in items: + self._tw.line(item.nodeid) + return + stack: list[Node] = [] + indent = "" + for item in items: + needed_collectors = item.listchain()[1:] # strip root node + while stack: + if stack == needed_collectors[: len(stack)]: + break + stack.pop() + for col in needed_collectors[len(stack) :]: + stack.append(col) + indent = (len(stack) - 1) * " " + self._tw.line(f"{indent}{col}") + if test_cases_verbosity >= 1: + obj = getattr(col, "obj", None) + doc = inspect.getdoc(obj) if obj else None + if doc: + for line in doc.splitlines(): + self._tw.line("{}{}".format(indent + " ", line)) + + @hookimpl(wrapper=True) + def pytest_sessionfinish( + self, session: Session, exitstatus: int | ExitCode + ) -> Generator[None]: + result = yield + self._tw.line("") + summary_exit_codes = ( + ExitCode.OK, + ExitCode.TESTS_FAILED, + ExitCode.INTERRUPTED, + ExitCode.USAGE_ERROR, + ExitCode.NO_TESTS_COLLECTED, + ) + if exitstatus in summary_exit_codes and not self.no_summary: + self.config.hook.pytest_terminal_summary( + terminalreporter=self, exitstatus=exitstatus, config=self.config + ) + if session.shouldfail: + self.write_sep("!", str(session.shouldfail), red=True) + if exitstatus == ExitCode.INTERRUPTED: + self._report_keyboardinterrupt() + self._keyboardinterrupt_memo = None + elif session.shouldstop: + self.write_sep("!", str(session.shouldstop), red=True) + self.summary_stats() + return result + + @hookimpl(wrapper=True) + def pytest_terminal_summary(self) -> Generator[None]: + self.summary_errors() + self.summary_failures() + self.summary_xfailures() + self.summary_warnings() + self.summary_passes() + self.summary_xpasses() + try: + return (yield) + finally: + self.short_test_summary() + # Display any extra warnings from teardown here (if any). + self.summary_warnings() + + def pytest_keyboard_interrupt(self, excinfo: ExceptionInfo[BaseException]) -> None: + self._keyboardinterrupt_memo = excinfo.getrepr(funcargs=True) + + def pytest_unconfigure(self) -> None: + if self._keyboardinterrupt_memo is not None: + self._report_keyboardinterrupt() + + def _report_keyboardinterrupt(self) -> None: + excrepr = self._keyboardinterrupt_memo + assert excrepr is not None + assert excrepr.reprcrash is not None + msg = excrepr.reprcrash.message + self.write_sep("!", msg) + if "KeyboardInterrupt" in msg: + if self.config.option.fulltrace: + excrepr.toterminal(self._tw) + else: + excrepr.reprcrash.toterminal(self._tw) + self._tw.line( + "(to show a full traceback on KeyboardInterrupt use --full-trace)", + yellow=True, + ) + + def _locationline( + self, nodeid: str, fspath: str, lineno: int | None, domain: str + ) -> str: + def mkrel(nodeid: str) -> str: + line = self.config.cwd_relative_nodeid(nodeid) + if domain and line.endswith(domain): + line = line[: -len(domain)] + values = domain.split("[") + values[0] = values[0].replace(".", "::") # don't replace '.' in params + line += "[".join(values) + return line + + # fspath comes from testid which has a "/"-normalized path. + if fspath: + res = mkrel(nodeid) + if self.verbosity >= 2 and nodeid.split("::")[0] != fspath.replace( + "\\", nodes.SEP + ): + res += " <- " + bestrelpath(self.startpath, Path(fspath)) + else: + res = "[location]" + return res + " " + + def _getfailureheadline(self, rep): + head_line = rep.head_line + if head_line: + return head_line + return "test session" # XXX? + + def _getcrashline(self, rep): + try: + return str(rep.longrepr.reprcrash) + except AttributeError: + try: + return str(rep.longrepr)[:50] + except AttributeError: + return "" + + # + # Summaries for sessionfinish. + # + def getreports(self, name: str): + return [x for x in self.stats.get(name, ()) if not hasattr(x, "_pdbshown")] + + def summary_warnings(self) -> None: + if self.hasopt("w"): + all_warnings: list[WarningReport] | None = self.stats.get("warnings") + if not all_warnings: + return + + final = self._already_displayed_warnings is not None + if final: + warning_reports = all_warnings[self._already_displayed_warnings :] + else: + warning_reports = all_warnings + self._already_displayed_warnings = len(warning_reports) + if not warning_reports: + return + + reports_grouped_by_message: dict[str, list[WarningReport]] = {} + for wr in warning_reports: + reports_grouped_by_message.setdefault(wr.message, []).append(wr) + + def collapsed_location_report(reports: list[WarningReport]) -> str: + locations = [] + for w in reports: + location = w.get_location(self.config) + if location: + locations.append(location) + + if len(locations) < 10: + return "\n".join(map(str, locations)) + + counts_by_filename = Counter( + str(loc).split("::", 1)[0] for loc in locations + ) + return "\n".join( + "{}: {} warning{}".format(k, v, "s" if v > 1 else "") + for k, v in counts_by_filename.items() + ) + + title = "warnings summary (final)" if final else "warnings summary" + self.write_sep("=", title, yellow=True, bold=False) + for message, message_reports in reports_grouped_by_message.items(): + maybe_location = collapsed_location_report(message_reports) + if maybe_location: + self._tw.line(maybe_location) + lines = message.splitlines() + indented = "\n".join(" " + x for x in lines) + message = indented.rstrip() + else: + message = message.rstrip() + self._tw.line(message) + self._tw.line() + self._tw.line( + "-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html" + ) + + def summary_passes(self) -> None: + self.summary_passes_combined("passed", "PASSES", "P") + + def summary_xpasses(self) -> None: + self.summary_passes_combined("xpassed", "XPASSES", "X") + + def summary_passes_combined( + self, which_reports: str, sep_title: str, needed_opt: str + ) -> None: + if self.config.option.tbstyle != "no": + if self.hasopt(needed_opt): + reports: list[TestReport] = self.getreports(which_reports) + if not reports: + return + self.write_sep("=", sep_title) + for rep in reports: + if rep.sections: + msg = self._getfailureheadline(rep) + self.write_sep("_", msg, green=True, bold=True) + self._outrep_summary(rep) + self._handle_teardown_sections(rep.nodeid) + + def _get_teardown_reports(self, nodeid: str) -> list[TestReport]: + reports = self.getreports("") + return [ + report + for report in reports + if report.when == "teardown" and report.nodeid == nodeid + ] + + def _handle_teardown_sections(self, nodeid: str) -> None: + for report in self._get_teardown_reports(nodeid): + self.print_teardown_sections(report) + + def print_teardown_sections(self, rep: TestReport) -> None: + showcapture = self.config.option.showcapture + if showcapture == "no": + return + for secname, content in rep.sections: + if showcapture != "all" and showcapture not in secname: + continue + if "teardown" in secname: + self._tw.sep("-", secname) + if content[-1:] == "\n": + content = content[:-1] + self._tw.line(content) + + def summary_failures(self) -> None: + style = self.config.option.tbstyle + self.summary_failures_combined("failed", "FAILURES", style=style) + + def summary_xfailures(self) -> None: + show_tb = self.config.option.xfail_tb + style = self.config.option.tbstyle if show_tb else "no" + self.summary_failures_combined("xfailed", "XFAILURES", style=style) + + def summary_failures_combined( + self, + which_reports: str, + sep_title: str, + *, + style: str, + needed_opt: str | None = None, + ) -> None: + if style != "no": + if not needed_opt or self.hasopt(needed_opt): + reports: list[BaseReport] = self.getreports(which_reports) + if not reports: + return + self.write_sep("=", sep_title) + if style == "line": + for rep in reports: + line = self._getcrashline(rep) + self.write_line(line) + else: + for rep in reports: + msg = self._getfailureheadline(rep) + self.write_sep("_", msg, red=True, bold=True) + self._outrep_summary(rep) + self._handle_teardown_sections(rep.nodeid) + + def summary_errors(self) -> None: + if self.config.option.tbstyle != "no": + reports: list[BaseReport] = self.getreports("error") + if not reports: + return + self.write_sep("=", "ERRORS") + for rep in self.stats["error"]: + msg = self._getfailureheadline(rep) + if rep.when == "collect": + msg = "ERROR collecting " + msg + else: + msg = f"ERROR at {rep.when} of {msg}" + self.write_sep("_", msg, red=True, bold=True) + self._outrep_summary(rep) + + def _outrep_summary(self, rep: BaseReport) -> None: + rep.toterminal(self._tw) + showcapture = self.config.option.showcapture + if showcapture == "no": + return + for secname, content in rep.sections: + if showcapture != "all" and showcapture not in secname: + continue + self._tw.sep("-", secname) + if content[-1:] == "\n": + content = content[:-1] + self._tw.line(content) + + def summary_stats(self) -> None: + if self.verbosity < -1: + return + + session_duration = timing.time() - self._sessionstarttime + (parts, main_color) = self.build_summary_stats_line() + line_parts = [] + + display_sep = self.verbosity >= 0 + if display_sep: + fullwidth = self._tw.fullwidth + for text, markup in parts: + with_markup = self._tw.markup(text, **markup) + if display_sep: + fullwidth += len(with_markup) - len(text) + line_parts.append(with_markup) + msg = ", ".join(line_parts) + + main_markup = {main_color: True} + duration = f" in {format_session_duration(session_duration)}" + duration_with_markup = self._tw.markup(duration, **main_markup) + if display_sep: + fullwidth += len(duration_with_markup) - len(duration) + msg += duration_with_markup + + if display_sep: + markup_for_end_sep = self._tw.markup("", **main_markup) + if markup_for_end_sep.endswith("\x1b[0m"): + markup_for_end_sep = markup_for_end_sep[:-4] + fullwidth += len(markup_for_end_sep) + msg += markup_for_end_sep + + if display_sep: + self.write_sep("=", msg, fullwidth=fullwidth, **main_markup) + else: + self.write_line(msg, **main_markup) + + def short_test_summary(self) -> None: + if not self.reportchars: + return + + def show_simple(lines: list[str], *, stat: str) -> None: + failed = self.stats.get(stat, []) + if not failed: + return + config = self.config + for rep in failed: + color = _color_for_type.get(stat, _color_for_type_default) + line = _get_line_with_reprcrash_message( + config, rep, self._tw, {color: True} + ) + lines.append(line) + + def show_xfailed(lines: list[str]) -> None: + xfailed = self.stats.get("xfailed", []) + for rep in xfailed: + verbose_word, verbose_markup = rep._get_verbose_word_with_markup( + self.config, {_color_for_type["warnings"]: True} + ) + markup_word = self._tw.markup(verbose_word, **verbose_markup) + nodeid = _get_node_id_with_markup(self._tw, self.config, rep) + line = f"{markup_word} {nodeid}" + reason = rep.wasxfail + if reason: + line += " - " + str(reason) + + lines.append(line) + + def show_xpassed(lines: list[str]) -> None: + xpassed = self.stats.get("xpassed", []) + for rep in xpassed: + verbose_word, verbose_markup = rep._get_verbose_word_with_markup( + self.config, {_color_for_type["warnings"]: True} + ) + markup_word = self._tw.markup(verbose_word, **verbose_markup) + nodeid = _get_node_id_with_markup(self._tw, self.config, rep) + line = f"{markup_word} {nodeid}" + reason = rep.wasxfail + if reason: + line += " - " + str(reason) + lines.append(line) + + def show_skipped_folded(lines: list[str]) -> None: + skipped: list[CollectReport] = self.stats.get("skipped", []) + fskips = _folded_skips(self.startpath, skipped) if skipped else [] + if not fskips: + return + verbose_word, verbose_markup = skipped[0]._get_verbose_word_with_markup( + self.config, {_color_for_type["warnings"]: True} + ) + markup_word = self._tw.markup(verbose_word, **verbose_markup) + prefix = "Skipped: " + for num, fspath, lineno, reason in fskips: + if reason.startswith(prefix): + reason = reason[len(prefix) :] + if lineno is not None: + lines.append( + "%s [%d] %s:%d: %s" % (markup_word, num, fspath, lineno, reason) + ) + else: + lines.append("%s [%d] %s: %s" % (markup_word, num, fspath, reason)) + + def show_skipped_unfolded(lines: list[str]) -> None: + skipped: list[CollectReport] = self.stats.get("skipped", []) + + for rep in skipped: + assert rep.longrepr is not None + assert isinstance(rep.longrepr, tuple), (rep, rep.longrepr) + assert len(rep.longrepr) == 3, (rep, rep.longrepr) + + verbose_word, verbose_markup = rep._get_verbose_word_with_markup( + self.config, {_color_for_type["warnings"]: True} + ) + markup_word = self._tw.markup(verbose_word, **verbose_markup) + nodeid = _get_node_id_with_markup(self._tw, self.config, rep) + line = f"{markup_word} {nodeid}" + reason = rep.longrepr[2] + if reason: + line += " - " + str(reason) + lines.append(line) + + def show_skipped(lines: list[str]) -> None: + if self.foldskipped: + show_skipped_folded(lines) + else: + show_skipped_unfolded(lines) + + REPORTCHAR_ACTIONS: Mapping[str, Callable[[list[str]], None]] = { + "x": show_xfailed, + "X": show_xpassed, + "f": partial(show_simple, stat="failed"), + "s": show_skipped, + "p": partial(show_simple, stat="passed"), + "E": partial(show_simple, stat="error"), + } + + lines: list[str] = [] + for char in self.reportchars: + action = REPORTCHAR_ACTIONS.get(char) + if action: # skipping e.g. "P" (passed with output) here. + action(lines) + + if lines: + self.write_sep("=", "short test summary info", cyan=True, bold=True) + for line in lines: + self.write_line(line) + + def _get_main_color(self) -> tuple[str, list[str]]: + if self._main_color is None or self._known_types is None or self._is_last_item: + self._set_main_color() + assert self._main_color + assert self._known_types + return self._main_color, self._known_types + + def _determine_main_color(self, unknown_type_seen: bool) -> str: + stats = self.stats + if "failed" in stats or "error" in stats: + main_color = "red" + elif "warnings" in stats or "xpassed" in stats or unknown_type_seen: + main_color = "yellow" + elif "passed" in stats or not self._is_last_item: + main_color = "green" + else: + main_color = "yellow" + return main_color + + def _set_main_color(self) -> None: + unknown_types: list[str] = [] + for found_type in self.stats: + if found_type: # setup/teardown reports have an empty key, ignore them + if found_type not in KNOWN_TYPES and found_type not in unknown_types: + unknown_types.append(found_type) + self._known_types = list(KNOWN_TYPES) + unknown_types + self._main_color = self._determine_main_color(bool(unknown_types)) + + def build_summary_stats_line(self) -> tuple[list[tuple[str, dict[str, bool]]], str]: + """ + Build the parts used in the last summary stats line. + + The summary stats line is the line shown at the end, "=== 12 passed, 2 errors in Xs===". + + This function builds a list of the "parts" that make up for the text in that line, in + the example above it would be: + + [ + ("12 passed", {"green": True}), + ("2 errors", {"red": True} + ] + + That last dict for each line is a "markup dictionary", used by TerminalWriter to + color output. + + The final color of the line is also determined by this function, and is the second + element of the returned tuple. + """ + if self.config.getoption("collectonly"): + return self._build_collect_only_summary_stats_line() + else: + return self._build_normal_summary_stats_line() + + def _get_reports_to_display(self, key: str) -> list[Any]: + """Get test/collection reports for the given status key, such as `passed` or `error`.""" + reports = self.stats.get(key, []) + return [x for x in reports if getattr(x, "count_towards_summary", True)] + + def _build_normal_summary_stats_line( + self, + ) -> tuple[list[tuple[str, dict[str, bool]]], str]: + main_color, known_types = self._get_main_color() + parts = [] + + for key in known_types: + reports = self._get_reports_to_display(key) + if reports: + count = len(reports) + color = _color_for_type.get(key, _color_for_type_default) + markup = {color: True, "bold": color == main_color} + parts.append(("%d %s" % pluralize(count, key), markup)) + + if not parts: + parts = [("no tests ran", {_color_for_type_default: True})] + + return parts, main_color + + def _build_collect_only_summary_stats_line( + self, + ) -> tuple[list[tuple[str, dict[str, bool]]], str]: + deselected = len(self._get_reports_to_display("deselected")) + errors = len(self._get_reports_to_display("error")) + + if self._numcollected == 0: + parts = [("no tests collected", {"yellow": True})] + main_color = "yellow" + + elif deselected == 0: + main_color = "green" + collected_output = "%d %s collected" % pluralize(self._numcollected, "test") + parts = [(collected_output, {main_color: True})] + else: + all_tests_were_deselected = self._numcollected == deselected + if all_tests_were_deselected: + main_color = "yellow" + collected_output = f"no tests collected ({deselected} deselected)" + else: + main_color = "green" + selected = self._numcollected - deselected + collected_output = f"{selected}/{self._numcollected} tests collected ({deselected} deselected)" + + parts = [(collected_output, {main_color: True})] + + if errors: + main_color = _color_for_type["error"] + parts += [("%d %s" % pluralize(errors, "error"), {main_color: True})] + + return parts, main_color + + +def _get_node_id_with_markup(tw: TerminalWriter, config: Config, rep: BaseReport): + nodeid = config.cwd_relative_nodeid(rep.nodeid) + path, *parts = nodeid.split("::") + if parts: + parts_markup = tw.markup("::".join(parts), bold=True) + return path + "::" + parts_markup + else: + return path + + +def _format_trimmed(format: str, msg: str, available_width: int) -> str | None: + """Format msg into format, ellipsizing it if doesn't fit in available_width. + + Returns None if even the ellipsis can't fit. + """ + # Only use the first line. + i = msg.find("\n") + if i != -1: + msg = msg[:i] + + ellipsis = "..." + format_width = wcswidth(format.format("")) + if format_width + len(ellipsis) > available_width: + return None + + if format_width + wcswidth(msg) > available_width: + available_width -= len(ellipsis) + msg = msg[:available_width] + while format_width + wcswidth(msg) > available_width: + msg = msg[:-1] + msg += ellipsis + + return format.format(msg) + + +def _get_line_with_reprcrash_message( + config: Config, rep: BaseReport, tw: TerminalWriter, word_markup: dict[str, bool] +) -> str: + """Get summary line for a report, trying to add reprcrash message.""" + verbose_word, verbose_markup = rep._get_verbose_word_with_markup( + config, word_markup + ) + word = tw.markup(verbose_word, **verbose_markup) + node = _get_node_id_with_markup(tw, config, rep) + + line = f"{word} {node}" + line_width = wcswidth(line) + + try: + # Type ignored intentionally -- possible AttributeError expected. + msg = rep.longrepr.reprcrash.message # type: ignore[union-attr] + except AttributeError: + pass + else: + if running_on_ci() or config.option.verbose >= 2: + msg = f" - {msg}" + else: + available_width = tw.fullwidth - line_width + msg = _format_trimmed(" - {}", msg, available_width) + if msg is not None: + line += msg + + return line + + +def _folded_skips( + startpath: Path, + skipped: Sequence[CollectReport], +) -> list[tuple[int, str, int | None, str]]: + d: dict[tuple[str, int | None, str], list[CollectReport]] = {} + for event in skipped: + assert event.longrepr is not None + assert isinstance(event.longrepr, tuple), (event, event.longrepr) + assert len(event.longrepr) == 3, (event, event.longrepr) + fspath, lineno, reason = event.longrepr + # For consistency, report all fspaths in relative form. + fspath = bestrelpath(startpath, Path(fspath)) + keywords = getattr(event, "keywords", {}) + # Folding reports with global pytestmark variable. + # This is a workaround, because for now we cannot identify the scope of a skip marker + # TODO: Revisit after marks scope would be fixed. + if ( + event.when == "setup" + and "skip" in keywords + and "pytestmark" not in keywords + ): + key: tuple[str, int | None, str] = (fspath, None, reason) + else: + key = (fspath, lineno, reason) + d.setdefault(key, []).append(event) + values: list[tuple[int, str, int | None, str]] = [] + for key, events in d.items(): + values.append((len(events), *key)) + return values + + +_color_for_type = { + "failed": "red", + "error": "red", + "warnings": "yellow", + "passed": "green", +} +_color_for_type_default = "yellow" + + +def pluralize(count: int, noun: str) -> tuple[int, str]: + # No need to pluralize words such as `failed` or `passed`. + if noun not in ["error", "warnings", "test"]: + return count, noun + + # The `warnings` key is plural. To avoid API breakage, we keep it that way but + # set it to singular here so we can determine plurality in the same way as we do + # for `error`. + noun = noun.replace("warnings", "warning") + + return count, noun + "s" if count != 1 else noun + + +def _plugin_nameversions(plugininfo) -> list[str]: + values: list[str] = [] + for plugin, dist in plugininfo: + # Gets us name and version! + name = f"{dist.project_name}-{dist.version}" + # Questionable convenience, but it keeps things short. + if name.startswith("pytest-"): + name = name[7:] + # We decided to print python package names they can have more than one plugin. + if name not in values: + values.append(name) + return values + + +def format_session_duration(seconds: float) -> str: + """Format the given seconds in a human readable manner to show in the final summary.""" + if seconds < 60: + return f"{seconds:.2f}s" + else: + dt = datetime.timedelta(seconds=int(seconds)) + return f"{seconds:.2f}s ({dt})" + + +def _get_raw_skip_reason(report: TestReport) -> str: + """Get the reason string of a skip/xfail/xpass test report. + + The string is just the part given by the user. + """ + if hasattr(report, "wasxfail"): + reason = report.wasxfail + if reason.startswith("reason: "): + reason = reason[len("reason: ") :] + return reason + else: + assert report.skipped + assert isinstance(report.longrepr, tuple) + _, _, reason = report.longrepr + if reason.startswith("Skipped: "): + reason = reason[len("Skipped: ") :] + elif reason == "Skipped": + reason = "" + return reason diff --git a/.venv/Lib/site-packages/_pytest/threadexception.py b/.venv/Lib/site-packages/_pytest/threadexception.py new file mode 100644 index 00000000..c1ed8038 --- /dev/null +++ b/.venv/Lib/site-packages/_pytest/threadexception.py @@ -0,0 +1,97 @@ +from __future__ import annotations + +import threading +import traceback +from types import TracebackType +from typing import Any +from typing import Callable +from typing import Generator +from typing import TYPE_CHECKING +import warnings + +import pytest + + +if TYPE_CHECKING: + from typing_extensions import Self + + +# Copied from cpython/Lib/test/support/threading_helper.py, with modifications. +class catch_threading_exception: + """Context manager catching threading.Thread exception using + threading.excepthook. + + Storing exc_value using a custom hook can create a reference cycle. The + reference cycle is broken explicitly when the context manager exits. + + Storing thread using a custom hook can resurrect it if it is set to an + object which is being finalized. Exiting the context manager clears the + stored object. + + Usage: + with threading_helper.catch_threading_exception() as cm: + # code spawning a thread which raises an exception + ... + # check the thread exception: use cm.args + ... + # cm.args attribute no longer exists at this point + # (to break a reference cycle) + """ + + def __init__(self) -> None: + self.args: threading.ExceptHookArgs | None = None + self._old_hook: Callable[[threading.ExceptHookArgs], Any] | None = None + + def _hook(self, args: threading.ExceptHookArgs) -> None: + self.args = args + + def __enter__(self) -> Self: + self._old_hook = threading.excepthook + threading.excepthook = self._hook + return self + + def __exit__( + self, + exc_type: type[BaseException] | None, + exc_val: BaseException | None, + exc_tb: TracebackType | None, + ) -> None: + assert self._old_hook is not None + threading.excepthook = self._old_hook + self._old_hook = None + del self.args + + +def thread_exception_runtest_hook() -> Generator[None]: + with catch_threading_exception() as cm: + try: + yield + finally: + if cm.args: + thread_name = ( + "" if cm.args.thread is None else cm.args.thread.name + ) + msg = f"Exception in thread {thread_name}\n\n" + msg += "".join( + traceback.format_exception( + cm.args.exc_type, + cm.args.exc_value, + cm.args.exc_traceback, + ) + ) + warnings.warn(pytest.PytestUnhandledThreadExceptionWarning(msg)) + + +@pytest.hookimpl(wrapper=True, trylast=True) +def pytest_runtest_setup() -> Generator[None]: + yield from thread_exception_runtest_hook() + + +@pytest.hookimpl(wrapper=True, tryfirst=True) +def pytest_runtest_call() -> Generator[None]: + yield from thread_exception_runtest_hook() + + +@pytest.hookimpl(wrapper=True, tryfirst=True) +def pytest_runtest_teardown() -> Generator[None]: + yield from thread_exception_runtest_hook() diff --git a/.venv/Lib/site-packages/_pytest/timing.py b/.venv/Lib/site-packages/_pytest/timing.py new file mode 100644 index 00000000..b23c7f69 --- /dev/null +++ b/.venv/Lib/site-packages/_pytest/timing.py @@ -0,0 +1,16 @@ +"""Indirection for time functions. + +We intentionally grab some "time" functions internally to avoid tests mocking "time" to affect +pytest runtime information (issue #185). + +Fixture "mock_timing" also interacts with this module for pytest's own tests. +""" + +from __future__ import annotations + +from time import perf_counter +from time import sleep +from time import time + + +__all__ = ["perf_counter", "sleep", "time"] diff --git a/.venv/Lib/site-packages/_pytest/tmpdir.py b/.venv/Lib/site-packages/_pytest/tmpdir.py new file mode 100644 index 00000000..de0cbcfe --- /dev/null +++ b/.venv/Lib/site-packages/_pytest/tmpdir.py @@ -0,0 +1,322 @@ +# mypy: allow-untyped-defs +"""Support for providing temporary directories to test functions.""" + +from __future__ import annotations + +import dataclasses +import os +from pathlib import Path +import re +from shutil import rmtree +import tempfile +from typing import Any +from typing import Dict +from typing import final +from typing import Generator +from typing import Literal + +from .pathlib import cleanup_dead_symlinks +from .pathlib import LOCK_TIMEOUT +from .pathlib import make_numbered_dir +from .pathlib import make_numbered_dir_with_cleanup +from .pathlib import rm_rf +from _pytest.compat import get_user_id +from _pytest.config import Config +from _pytest.config import ExitCode +from _pytest.config import hookimpl +from _pytest.config.argparsing import Parser +from _pytest.deprecated import check_ispytest +from _pytest.fixtures import fixture +from _pytest.fixtures import FixtureRequest +from _pytest.monkeypatch import MonkeyPatch +from _pytest.nodes import Item +from _pytest.reports import TestReport +from _pytest.stash import StashKey + + +tmppath_result_key = StashKey[Dict[str, bool]]() +RetentionType = Literal["all", "failed", "none"] + + +@final +@dataclasses.dataclass +class TempPathFactory: + """Factory for temporary directories under the common base temp directory. + + The base directory can be configured using the ``--basetemp`` option. + """ + + _given_basetemp: Path | None + # pluggy TagTracerSub, not currently exposed, so Any. + _trace: Any + _basetemp: Path | None + _retention_count: int + _retention_policy: RetentionType + + def __init__( + self, + given_basetemp: Path | None, + retention_count: int, + retention_policy: RetentionType, + trace, + basetemp: Path | None = None, + *, + _ispytest: bool = False, + ) -> None: + check_ispytest(_ispytest) + if given_basetemp is None: + self._given_basetemp = None + else: + # Use os.path.abspath() to get absolute path instead of resolve() as it + # does not work the same in all platforms (see #4427). + # Path.absolute() exists, but it is not public (see https://bugs.python.org/issue25012). + self._given_basetemp = Path(os.path.abspath(str(given_basetemp))) + self._trace = trace + self._retention_count = retention_count + self._retention_policy = retention_policy + self._basetemp = basetemp + + @classmethod + def from_config( + cls, + config: Config, + *, + _ispytest: bool = False, + ) -> TempPathFactory: + """Create a factory according to pytest configuration. + + :meta private: + """ + check_ispytest(_ispytest) + count = int(config.getini("tmp_path_retention_count")) + if count < 0: + raise ValueError( + f"tmp_path_retention_count must be >= 0. Current input: {count}." + ) + + policy = config.getini("tmp_path_retention_policy") + if policy not in ("all", "failed", "none"): + raise ValueError( + f"tmp_path_retention_policy must be either all, failed, none. Current input: {policy}." + ) + + return cls( + given_basetemp=config.option.basetemp, + trace=config.trace.get("tmpdir"), + retention_count=count, + retention_policy=policy, + _ispytest=True, + ) + + def _ensure_relative_to_basetemp(self, basename: str) -> str: + basename = os.path.normpath(basename) + if (self.getbasetemp() / basename).resolve().parent != self.getbasetemp(): + raise ValueError(f"{basename} is not a normalized and relative path") + return basename + + def mktemp(self, basename: str, numbered: bool = True) -> Path: + """Create a new temporary directory managed by the factory. + + :param basename: + Directory base name, must be a relative path. + + :param numbered: + If ``True``, ensure the directory is unique by adding a numbered + suffix greater than any existing one: ``basename="foo-"`` and ``numbered=True`` + means that this function will create directories named ``"foo-0"``, + ``"foo-1"``, ``"foo-2"`` and so on. + + :returns: + The path to the new directory. + """ + basename = self._ensure_relative_to_basetemp(basename) + if not numbered: + p = self.getbasetemp().joinpath(basename) + p.mkdir(mode=0o700) + else: + p = make_numbered_dir(root=self.getbasetemp(), prefix=basename, mode=0o700) + self._trace("mktemp", p) + return p + + def getbasetemp(self) -> Path: + """Return the base temporary directory, creating it if needed. + + :returns: + The base temporary directory. + """ + if self._basetemp is not None: + return self._basetemp + + if self._given_basetemp is not None: + basetemp = self._given_basetemp + if basetemp.exists(): + rm_rf(basetemp) + basetemp.mkdir(mode=0o700) + basetemp = basetemp.resolve() + else: + from_env = os.environ.get("PYTEST_DEBUG_TEMPROOT") + temproot = Path(from_env or tempfile.gettempdir()).resolve() + user = get_user() or "unknown" + # use a sub-directory in the temproot to speed-up + # make_numbered_dir() call + rootdir = temproot.joinpath(f"pytest-of-{user}") + try: + rootdir.mkdir(mode=0o700, exist_ok=True) + except OSError: + # getuser() likely returned illegal characters for the platform, use unknown back off mechanism + rootdir = temproot.joinpath("pytest-of-unknown") + rootdir.mkdir(mode=0o700, exist_ok=True) + # Because we use exist_ok=True with a predictable name, make sure + # we are the owners, to prevent any funny business (on unix, where + # temproot is usually shared). + # Also, to keep things private, fixup any world-readable temp + # rootdir's permissions. Historically 0o755 was used, so we can't + # just error out on this, at least for a while. + uid = get_user_id() + if uid is not None: + rootdir_stat = rootdir.stat() + if rootdir_stat.st_uid != uid: + raise OSError( + f"The temporary directory {rootdir} is not owned by the current user. " + "Fix this and try again." + ) + if (rootdir_stat.st_mode & 0o077) != 0: + os.chmod(rootdir, rootdir_stat.st_mode & ~0o077) + keep = self._retention_count + if self._retention_policy == "none": + keep = 0 + basetemp = make_numbered_dir_with_cleanup( + prefix="pytest-", + root=rootdir, + keep=keep, + lock_timeout=LOCK_TIMEOUT, + mode=0o700, + ) + assert basetemp is not None, basetemp + self._basetemp = basetemp + self._trace("new basetemp", basetemp) + return basetemp + + +def get_user() -> str | None: + """Return the current user name, or None if getuser() does not work + in the current environment (see #1010).""" + try: + # In some exotic environments, getpass may not be importable. + import getpass + + return getpass.getuser() + except (ImportError, OSError, KeyError): + return None + + +def pytest_configure(config: Config) -> None: + """Create a TempPathFactory and attach it to the config object. + + This is to comply with existing plugins which expect the handler to be + available at pytest_configure time, but ideally should be moved entirely + to the tmp_path_factory session fixture. + """ + mp = MonkeyPatch() + config.add_cleanup(mp.undo) + _tmp_path_factory = TempPathFactory.from_config(config, _ispytest=True) + mp.setattr(config, "_tmp_path_factory", _tmp_path_factory, raising=False) + + +def pytest_addoption(parser: Parser) -> None: + parser.addini( + "tmp_path_retention_count", + help="How many sessions should we keep the `tmp_path` directories, according to `tmp_path_retention_policy`.", + default=3, + ) + + parser.addini( + "tmp_path_retention_policy", + help="Controls which directories created by the `tmp_path` fixture are kept around, based on test outcome. " + "(all/failed/none)", + default="all", + ) + + +@fixture(scope="session") +def tmp_path_factory(request: FixtureRequest) -> TempPathFactory: + """Return a :class:`pytest.TempPathFactory` instance for the test session.""" + # Set dynamically by pytest_configure() above. + return request.config._tmp_path_factory # type: ignore + + +def _mk_tmp(request: FixtureRequest, factory: TempPathFactory) -> Path: + name = request.node.name + name = re.sub(r"[\W]", "_", name) + MAXVAL = 30 + name = name[:MAXVAL] + return factory.mktemp(name, numbered=True) + + +@fixture +def tmp_path( + request: FixtureRequest, tmp_path_factory: TempPathFactory +) -> Generator[Path]: + """Return a temporary directory path object which is unique to each test + function invocation, created as a sub directory of the base temporary + directory. + + By default, a new base temporary directory is created each test session, + and old bases are removed after 3 sessions, to aid in debugging. + This behavior can be configured with :confval:`tmp_path_retention_count` and + :confval:`tmp_path_retention_policy`. + If ``--basetemp`` is used then it is cleared each session. See + :ref:`temporary directory location and retention`. + + The returned object is a :class:`pathlib.Path` object. + """ + path = _mk_tmp(request, tmp_path_factory) + yield path + + # Remove the tmpdir if the policy is "failed" and the test passed. + tmp_path_factory: TempPathFactory = request.session.config._tmp_path_factory # type: ignore + policy = tmp_path_factory._retention_policy + result_dict = request.node.stash[tmppath_result_key] + + if policy == "failed" and result_dict.get("call", True): + # We do a "best effort" to remove files, but it might not be possible due to some leaked resource, + # permissions, etc, in which case we ignore it. + rmtree(path, ignore_errors=True) + + del request.node.stash[tmppath_result_key] + + +def pytest_sessionfinish(session, exitstatus: int | ExitCode): + """After each session, remove base directory if all the tests passed, + the policy is "failed", and the basetemp is not specified by a user. + """ + tmp_path_factory: TempPathFactory = session.config._tmp_path_factory + basetemp = tmp_path_factory._basetemp + if basetemp is None: + return + + policy = tmp_path_factory._retention_policy + if ( + exitstatus == 0 + and policy == "failed" + and tmp_path_factory._given_basetemp is None + ): + if basetemp.is_dir(): + # We do a "best effort" to remove files, but it might not be possible due to some leaked resource, + # permissions, etc, in which case we ignore it. + rmtree(basetemp, ignore_errors=True) + + # Remove dead symlinks. + if basetemp.is_dir(): + cleanup_dead_symlinks(basetemp) + + +@hookimpl(wrapper=True, tryfirst=True) +def pytest_runtest_makereport( + item: Item, call +) -> Generator[None, TestReport, TestReport]: + rep = yield + assert rep.when is not None + empty: dict[str, bool] = {} + item.stash.setdefault(tmppath_result_key, empty)[rep.when] = rep.passed + return rep diff --git a/.venv/Lib/site-packages/_pytest/unittest.py b/.venv/Lib/site-packages/_pytest/unittest.py new file mode 100644 index 00000000..8cecd4f9 --- /dev/null +++ b/.venv/Lib/site-packages/_pytest/unittest.py @@ -0,0 +1,435 @@ +# mypy: allow-untyped-defs +"""Discover and run std-library "unittest" style tests.""" + +from __future__ import annotations + +import inspect +import sys +import traceback +import types +from typing import Any +from typing import Callable +from typing import Generator +from typing import Iterable +from typing import Tuple +from typing import Type +from typing import TYPE_CHECKING +from typing import Union + +import _pytest._code +from _pytest.compat import is_async_function +from _pytest.config import hookimpl +from _pytest.fixtures import FixtureRequest +from _pytest.nodes import Collector +from _pytest.nodes import Item +from _pytest.outcomes import exit +from _pytest.outcomes import fail +from _pytest.outcomes import skip +from _pytest.outcomes import xfail +from _pytest.python import Class +from _pytest.python import Function +from _pytest.python import Module +from _pytest.runner import CallInfo +import pytest + + +if sys.version_info[:2] < (3, 11): + from exceptiongroup import ExceptionGroup + +if TYPE_CHECKING: + import unittest + + import twisted.trial.unittest + + +_SysExcInfoType = Union[ + Tuple[Type[BaseException], BaseException, types.TracebackType], + Tuple[None, None, None], +] + + +def pytest_pycollect_makeitem( + collector: Module | Class, name: str, obj: object +) -> UnitTestCase | None: + try: + # Has unittest been imported? + ut = sys.modules["unittest"] + # Is obj a subclass of unittest.TestCase? + # Type ignored because `ut` is an opaque module. + if not issubclass(obj, ut.TestCase): # type: ignore + return None + except Exception: + return None + # Is obj a concrete class? + # Abstract classes can't be instantiated so no point collecting them. + if inspect.isabstract(obj): + return None + # Yes, so let's collect it. + return UnitTestCase.from_parent(collector, name=name, obj=obj) + + +class UnitTestCase(Class): + # Marker for fixturemanger.getfixtureinfo() + # to declare that our children do not support funcargs. + nofuncargs = True + + def newinstance(self): + # TestCase __init__ takes the method (test) name. The TestCase + # constructor treats the name "runTest" as a special no-op, so it can be + # used when a dummy instance is needed. While unittest.TestCase has a + # default, some subclasses omit the default (#9610), so always supply + # it. + return self.obj("runTest") + + def collect(self) -> Iterable[Item | Collector]: + from unittest import TestLoader + + cls = self.obj + if not getattr(cls, "__test__", True): + return + + skipped = _is_skipped(cls) + if not skipped: + self._register_unittest_setup_method_fixture(cls) + self._register_unittest_setup_class_fixture(cls) + self._register_setup_class_fixture() + + self.session._fixturemanager.parsefactories(self.newinstance(), self.nodeid) + + loader = TestLoader() + foundsomething = False + for name in loader.getTestCaseNames(self.obj): + x = getattr(self.obj, name) + if not getattr(x, "__test__", True): + continue + yield TestCaseFunction.from_parent(self, name=name) + foundsomething = True + + if not foundsomething: + runtest = getattr(self.obj, "runTest", None) + if runtest is not None: + ut = sys.modules.get("twisted.trial.unittest", None) + if ut is None or runtest != ut.TestCase.runTest: + yield TestCaseFunction.from_parent(self, name="runTest") + + def _register_unittest_setup_class_fixture(self, cls: type) -> None: + """Register an auto-use fixture to invoke setUpClass and + tearDownClass (#517).""" + setup = getattr(cls, "setUpClass", None) + teardown = getattr(cls, "tearDownClass", None) + if setup is None and teardown is None: + return None + cleanup = getattr(cls, "doClassCleanups", lambda: None) + + def process_teardown_exceptions() -> None: + # tearDown_exceptions is a list set in the class containing exc_infos for errors during + # teardown for the class. + exc_infos = getattr(cls, "tearDown_exceptions", None) + if not exc_infos: + return + exceptions = [exc for (_, exc, _) in exc_infos] + # If a single exception, raise it directly as this provides a more readable + # error (hopefully this will improve in #12255). + if len(exceptions) == 1: + raise exceptions[0] + else: + raise ExceptionGroup("Unittest class cleanup errors", exceptions) + + def unittest_setup_class_fixture( + request: FixtureRequest, + ) -> Generator[None]: + cls = request.cls + if _is_skipped(cls): + reason = cls.__unittest_skip_why__ + raise pytest.skip.Exception(reason, _use_item_location=True) + if setup is not None: + try: + setup() + # unittest does not call the cleanup function for every BaseException, so we + # follow this here. + except Exception: + cleanup() + process_teardown_exceptions() + raise + yield + try: + if teardown is not None: + teardown() + finally: + cleanup() + process_teardown_exceptions() + + self.session._fixturemanager._register_fixture( + # Use a unique name to speed up lookup. + name=f"_unittest_setUpClass_fixture_{cls.__qualname__}", + func=unittest_setup_class_fixture, + nodeid=self.nodeid, + scope="class", + autouse=True, + ) + + def _register_unittest_setup_method_fixture(self, cls: type) -> None: + """Register an auto-use fixture to invoke setup_method and + teardown_method (#517).""" + setup = getattr(cls, "setup_method", None) + teardown = getattr(cls, "teardown_method", None) + if setup is None and teardown is None: + return None + + def unittest_setup_method_fixture( + request: FixtureRequest, + ) -> Generator[None]: + self = request.instance + if _is_skipped(self): + reason = self.__unittest_skip_why__ + raise pytest.skip.Exception(reason, _use_item_location=True) + if setup is not None: + setup(self, request.function) + yield + if teardown is not None: + teardown(self, request.function) + + self.session._fixturemanager._register_fixture( + # Use a unique name to speed up lookup. + name=f"_unittest_setup_method_fixture_{cls.__qualname__}", + func=unittest_setup_method_fixture, + nodeid=self.nodeid, + scope="function", + autouse=True, + ) + + +class TestCaseFunction(Function): + nofuncargs = True + _excinfo: list[_pytest._code.ExceptionInfo[BaseException]] | None = None + + def _getinstance(self): + assert isinstance(self.parent, UnitTestCase) + return self.parent.obj(self.name) + + # Backward compat for pytest-django; can be removed after pytest-django + # updates + some slack. + @property + def _testcase(self): + return self.instance + + def setup(self) -> None: + # A bound method to be called during teardown() if set (see 'runtest()'). + self._explicit_tearDown: Callable[[], None] | None = None + super().setup() + + def teardown(self) -> None: + if self._explicit_tearDown is not None: + self._explicit_tearDown() + self._explicit_tearDown = None + self._obj = None + del self._instance + super().teardown() + + def startTest(self, testcase: unittest.TestCase) -> None: + pass + + def _addexcinfo(self, rawexcinfo: _SysExcInfoType) -> None: + # Unwrap potential exception info (see twisted trial support below). + rawexcinfo = getattr(rawexcinfo, "_rawexcinfo", rawexcinfo) + try: + excinfo = _pytest._code.ExceptionInfo[BaseException].from_exc_info( + rawexcinfo # type: ignore[arg-type] + ) + # Invoke the attributes to trigger storing the traceback + # trial causes some issue there. + _ = excinfo.value + _ = excinfo.traceback + except TypeError: + try: + try: + values = traceback.format_exception(*rawexcinfo) + values.insert( + 0, + "NOTE: Incompatible Exception Representation, " + "displaying natively:\n\n", + ) + fail("".join(values), pytrace=False) + except (fail.Exception, KeyboardInterrupt): + raise + except BaseException: + fail( + "ERROR: Unknown Incompatible Exception " + f"representation:\n{rawexcinfo!r}", + pytrace=False, + ) + except KeyboardInterrupt: + raise + except fail.Exception: + excinfo = _pytest._code.ExceptionInfo.from_current() + self.__dict__.setdefault("_excinfo", []).append(excinfo) + + def addError( + self, testcase: unittest.TestCase, rawexcinfo: _SysExcInfoType + ) -> None: + try: + if isinstance(rawexcinfo[1], exit.Exception): + exit(rawexcinfo[1].msg) + except TypeError: + pass + self._addexcinfo(rawexcinfo) + + def addFailure( + self, testcase: unittest.TestCase, rawexcinfo: _SysExcInfoType + ) -> None: + self._addexcinfo(rawexcinfo) + + def addSkip(self, testcase: unittest.TestCase, reason: str) -> None: + try: + raise pytest.skip.Exception(reason, _use_item_location=True) + except skip.Exception: + self._addexcinfo(sys.exc_info()) + + def addExpectedFailure( + self, + testcase: unittest.TestCase, + rawexcinfo: _SysExcInfoType, + reason: str = "", + ) -> None: + try: + xfail(str(reason)) + except xfail.Exception: + self._addexcinfo(sys.exc_info()) + + def addUnexpectedSuccess( + self, + testcase: unittest.TestCase, + reason: twisted.trial.unittest.Todo | None = None, + ) -> None: + msg = "Unexpected success" + if reason: + msg += f": {reason.reason}" + # Preserve unittest behaviour - fail the test. Explicitly not an XPASS. + try: + fail(msg, pytrace=False) + except fail.Exception: + self._addexcinfo(sys.exc_info()) + + def addSuccess(self, testcase: unittest.TestCase) -> None: + pass + + def stopTest(self, testcase: unittest.TestCase) -> None: + pass + + def addDuration(self, testcase: unittest.TestCase, elapsed: float) -> None: + pass + + def runtest(self) -> None: + from _pytest.debugging import maybe_wrap_pytest_function_for_tracing + + testcase = self.instance + assert testcase is not None + + maybe_wrap_pytest_function_for_tracing(self) + + # Let the unittest framework handle async functions. + if is_async_function(self.obj): + testcase(result=self) + else: + # When --pdb is given, we want to postpone calling tearDown() otherwise + # when entering the pdb prompt, tearDown() would have probably cleaned up + # instance variables, which makes it difficult to debug. + # Arguably we could always postpone tearDown(), but this changes the moment where the + # TestCase instance interacts with the results object, so better to only do it + # when absolutely needed. + # We need to consider if the test itself is skipped, or the whole class. + assert isinstance(self.parent, UnitTestCase) + skipped = _is_skipped(self.obj) or _is_skipped(self.parent.obj) + if self.config.getoption("usepdb") and not skipped: + self._explicit_tearDown = testcase.tearDown + setattr(testcase, "tearDown", lambda *args: None) + + # We need to update the actual bound method with self.obj, because + # wrap_pytest_function_for_tracing replaces self.obj by a wrapper. + setattr(testcase, self.name, self.obj) + try: + testcase(result=self) + finally: + delattr(testcase, self.name) + + def _traceback_filter( + self, excinfo: _pytest._code.ExceptionInfo[BaseException] + ) -> _pytest._code.Traceback: + traceback = super()._traceback_filter(excinfo) + ntraceback = traceback.filter( + lambda x: not x.frame.f_globals.get("__unittest"), + ) + if not ntraceback: + ntraceback = traceback + return ntraceback + + +@hookimpl(tryfirst=True) +def pytest_runtest_makereport(item: Item, call: CallInfo[None]) -> None: + if isinstance(item, TestCaseFunction): + if item._excinfo: + call.excinfo = item._excinfo.pop(0) + try: + del call.result + except AttributeError: + pass + + # Convert unittest.SkipTest to pytest.skip. + # This is actually only needed for nose, which reuses unittest.SkipTest for + # its own nose.SkipTest. For unittest TestCases, SkipTest is already + # handled internally, and doesn't reach here. + unittest = sys.modules.get("unittest") + if unittest and call.excinfo and isinstance(call.excinfo.value, unittest.SkipTest): + excinfo = call.excinfo + call2 = CallInfo[None].from_call( + lambda: pytest.skip(str(excinfo.value)), call.when + ) + call.excinfo = call2.excinfo + + +# Twisted trial support. +classImplements_has_run = False + + +@hookimpl(wrapper=True) +def pytest_runtest_protocol(item: Item) -> Generator[None, object, object]: + if isinstance(item, TestCaseFunction) and "twisted.trial.unittest" in sys.modules: + ut: Any = sys.modules["twisted.python.failure"] + global classImplements_has_run + Failure__init__ = ut.Failure.__init__ + if not classImplements_has_run: + from twisted.trial.itrial import IReporter + from zope.interface import classImplements + + classImplements(TestCaseFunction, IReporter) + classImplements_has_run = True + + def excstore( + self, exc_value=None, exc_type=None, exc_tb=None, captureVars=None + ): + if exc_value is None: + self._rawexcinfo = sys.exc_info() + else: + if exc_type is None: + exc_type = type(exc_value) + self._rawexcinfo = (exc_type, exc_value, exc_tb) + try: + Failure__init__( + self, exc_value, exc_type, exc_tb, captureVars=captureVars + ) + except TypeError: + Failure__init__(self, exc_value, exc_type, exc_tb) + + ut.Failure.__init__ = excstore + try: + res = yield + finally: + ut.Failure.__init__ = Failure__init__ + else: + res = yield + return res + + +def _is_skipped(obj) -> bool: + """Return True if the given object has been marked with @unittest.skip.""" + return bool(getattr(obj, "__unittest_skip__", False)) diff --git a/.venv/Lib/site-packages/_pytest/unraisableexception.py b/.venv/Lib/site-packages/_pytest/unraisableexception.py new file mode 100644 index 00000000..77a2de20 --- /dev/null +++ b/.venv/Lib/site-packages/_pytest/unraisableexception.py @@ -0,0 +1,100 @@ +from __future__ import annotations + +import sys +import traceback +from types import TracebackType +from typing import Any +from typing import Callable +from typing import Generator +from typing import TYPE_CHECKING +import warnings + +import pytest + + +if TYPE_CHECKING: + from typing_extensions import Self + + +# Copied from cpython/Lib/test/support/__init__.py, with modifications. +class catch_unraisable_exception: + """Context manager catching unraisable exception using sys.unraisablehook. + + Storing the exception value (cm.unraisable.exc_value) creates a reference + cycle. The reference cycle is broken explicitly when the context manager + exits. + + Storing the object (cm.unraisable.object) can resurrect it if it is set to + an object which is being finalized. Exiting the context manager clears the + stored object. + + Usage: + with catch_unraisable_exception() as cm: + # code creating an "unraisable exception" + ... + # check the unraisable exception: use cm.unraisable + ... + # cm.unraisable attribute no longer exists at this point + # (to break a reference cycle) + """ + + def __init__(self) -> None: + self.unraisable: sys.UnraisableHookArgs | None = None + self._old_hook: Callable[[sys.UnraisableHookArgs], Any] | None = None + + def _hook(self, unraisable: sys.UnraisableHookArgs) -> None: + # Storing unraisable.object can resurrect an object which is being + # finalized. Storing unraisable.exc_value creates a reference cycle. + self.unraisable = unraisable + + def __enter__(self) -> Self: + self._old_hook = sys.unraisablehook + sys.unraisablehook = self._hook + return self + + def __exit__( + self, + exc_type: type[BaseException] | None, + exc_val: BaseException | None, + exc_tb: TracebackType | None, + ) -> None: + assert self._old_hook is not None + sys.unraisablehook = self._old_hook + self._old_hook = None + del self.unraisable + + +def unraisable_exception_runtest_hook() -> Generator[None]: + with catch_unraisable_exception() as cm: + try: + yield + finally: + if cm.unraisable: + if cm.unraisable.err_msg is not None: + err_msg = cm.unraisable.err_msg + else: + err_msg = "Exception ignored in" + msg = f"{err_msg}: {cm.unraisable.object!r}\n\n" + msg += "".join( + traceback.format_exception( + cm.unraisable.exc_type, + cm.unraisable.exc_value, + cm.unraisable.exc_traceback, + ) + ) + warnings.warn(pytest.PytestUnraisableExceptionWarning(msg)) + + +@pytest.hookimpl(wrapper=True, tryfirst=True) +def pytest_runtest_setup() -> Generator[None]: + yield from unraisable_exception_runtest_hook() + + +@pytest.hookimpl(wrapper=True, tryfirst=True) +def pytest_runtest_call() -> Generator[None]: + yield from unraisable_exception_runtest_hook() + + +@pytest.hookimpl(wrapper=True, tryfirst=True) +def pytest_runtest_teardown() -> Generator[None]: + yield from unraisable_exception_runtest_hook() diff --git a/.venv/Lib/site-packages/_pytest/warning_types.py b/.venv/Lib/site-packages/_pytest/warning_types.py new file mode 100644 index 00000000..4ab14e48 --- /dev/null +++ b/.venv/Lib/site-packages/_pytest/warning_types.py @@ -0,0 +1,166 @@ +from __future__ import annotations + +import dataclasses +import inspect +from types import FunctionType +from typing import Any +from typing import final +from typing import Generic +from typing import TypeVar +import warnings + + +class PytestWarning(UserWarning): + """Base class for all warnings emitted by pytest.""" + + __module__ = "pytest" + + +@final +class PytestAssertRewriteWarning(PytestWarning): + """Warning emitted by the pytest assert rewrite module.""" + + __module__ = "pytest" + + +@final +class PytestCacheWarning(PytestWarning): + """Warning emitted by the cache plugin in various situations.""" + + __module__ = "pytest" + + +@final +class PytestConfigWarning(PytestWarning): + """Warning emitted for configuration issues.""" + + __module__ = "pytest" + + +@final +class PytestCollectionWarning(PytestWarning): + """Warning emitted when pytest is not able to collect a file or symbol in a module.""" + + __module__ = "pytest" + + +class PytestDeprecationWarning(PytestWarning, DeprecationWarning): + """Warning class for features that will be removed in a future version.""" + + __module__ = "pytest" + + +class PytestRemovedIn9Warning(PytestDeprecationWarning): + """Warning class for features that will be removed in pytest 9.""" + + __module__ = "pytest" + + +class PytestReturnNotNoneWarning(PytestWarning): + """Warning emitted when a test function is returning value other than None.""" + + __module__ = "pytest" + + +@final +class PytestExperimentalApiWarning(PytestWarning, FutureWarning): + """Warning category used to denote experiments in pytest. + + Use sparingly as the API might change or even be removed completely in a + future version. + """ + + __module__ = "pytest" + + @classmethod + def simple(cls, apiname: str) -> PytestExperimentalApiWarning: + return cls(f"{apiname} is an experimental api that may change over time") + + +@final +class PytestUnhandledCoroutineWarning(PytestReturnNotNoneWarning): + """Warning emitted for an unhandled coroutine. + + A coroutine was encountered when collecting test functions, but was not + handled by any async-aware plugin. + Coroutine test functions are not natively supported. + """ + + __module__ = "pytest" + + +@final +class PytestUnknownMarkWarning(PytestWarning): + """Warning emitted on use of unknown markers. + + See :ref:`mark` for details. + """ + + __module__ = "pytest" + + +@final +class PytestUnraisableExceptionWarning(PytestWarning): + """An unraisable exception was reported. + + Unraisable exceptions are exceptions raised in :meth:`__del__ ` + implementations and similar situations when the exception cannot be raised + as normal. + """ + + __module__ = "pytest" + + +@final +class PytestUnhandledThreadExceptionWarning(PytestWarning): + """An unhandled exception occurred in a :class:`~threading.Thread`. + + Such exceptions don't propagate normally. + """ + + __module__ = "pytest" + + +_W = TypeVar("_W", bound=PytestWarning) + + +@final +@dataclasses.dataclass +class UnformattedWarning(Generic[_W]): + """A warning meant to be formatted during runtime. + + This is used to hold warnings that need to format their message at runtime, + as opposed to a direct message. + """ + + category: type[_W] + template: str + + def format(self, **kwargs: Any) -> _W: + """Return an instance of the warning category, formatted with given kwargs.""" + return self.category(self.template.format(**kwargs)) + + +def warn_explicit_for(method: FunctionType, message: PytestWarning) -> None: + """ + Issue the warning :param:`message` for the definition of the given :param:`method` + + this helps to log warnings for functions defined prior to finding an issue with them + (like hook wrappers being marked in a legacy mechanism) + """ + lineno = method.__code__.co_firstlineno + filename = inspect.getfile(method) + module = method.__module__ + mod_globals = method.__globals__ + try: + warnings.warn_explicit( + message, + type(message), + filename=filename, + module=module, + registry=mod_globals.setdefault("__warningregistry__", {}), + lineno=lineno, + ) + except Warning as w: + # If warnings are errors (e.g. -Werror), location information gets lost, so we add it to the message. + raise type(w)(f"{w}\n at {filename}:{lineno}") from None diff --git a/.venv/Lib/site-packages/_pytest/warnings.py b/.venv/Lib/site-packages/_pytest/warnings.py new file mode 100644 index 00000000..eeb47726 --- /dev/null +++ b/.venv/Lib/site-packages/_pytest/warnings.py @@ -0,0 +1,151 @@ +# mypy: allow-untyped-defs +from __future__ import annotations + +from contextlib import contextmanager +import sys +from typing import Generator +from typing import Literal +import warnings + +from _pytest.config import apply_warning_filters +from _pytest.config import Config +from _pytest.config import parse_warning_filter +from _pytest.main import Session +from _pytest.nodes import Item +from _pytest.terminal import TerminalReporter +import pytest + + +def pytest_configure(config: Config) -> None: + config.addinivalue_line( + "markers", + "filterwarnings(warning): add a warning filter to the given test. " + "see https://docs.pytest.org/en/stable/how-to/capture-warnings.html#pytest-mark-filterwarnings ", + ) + + +@contextmanager +def catch_warnings_for_item( + config: Config, + ihook, + when: Literal["config", "collect", "runtest"], + item: Item | None, +) -> Generator[None]: + """Context manager that catches warnings generated in the contained execution block. + + ``item`` can be None if we are not in the context of an item execution. + + Each warning captured triggers the ``pytest_warning_recorded`` hook. + """ + config_filters = config.getini("filterwarnings") + cmdline_filters = config.known_args_namespace.pythonwarnings or [] + with warnings.catch_warnings(record=True) as log: + # mypy can't infer that record=True means log is not None; help it. + assert log is not None + + if not sys.warnoptions: + # If user is not explicitly configuring warning filters, show deprecation warnings by default (#2908). + warnings.filterwarnings("always", category=DeprecationWarning) + warnings.filterwarnings("always", category=PendingDeprecationWarning) + + # To be enabled in pytest 9.0.0. + # warnings.filterwarnings("error", category=pytest.PytestRemovedIn9Warning) + + apply_warning_filters(config_filters, cmdline_filters) + + # apply filters from "filterwarnings" marks + nodeid = "" if item is None else item.nodeid + if item is not None: + for mark in item.iter_markers(name="filterwarnings"): + for arg in mark.args: + warnings.filterwarnings(*parse_warning_filter(arg, escape=False)) + + try: + yield + finally: + for warning_message in log: + ihook.pytest_warning_recorded.call_historic( + kwargs=dict( + warning_message=warning_message, + nodeid=nodeid, + when=when, + location=None, + ) + ) + + +def warning_record_to_str(warning_message: warnings.WarningMessage) -> str: + """Convert a warnings.WarningMessage to a string.""" + warn_msg = warning_message.message + msg = warnings.formatwarning( + str(warn_msg), + warning_message.category, + warning_message.filename, + warning_message.lineno, + warning_message.line, + ) + if warning_message.source is not None: + try: + import tracemalloc + except ImportError: + pass + else: + tb = tracemalloc.get_object_traceback(warning_message.source) + if tb is not None: + formatted_tb = "\n".join(tb.format()) + # Use a leading new line to better separate the (large) output + # from the traceback to the previous warning text. + msg += f"\nObject allocated at:\n{formatted_tb}" + else: + # No need for a leading new line. + url = "https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings" + msg += "Enable tracemalloc to get traceback where the object was allocated.\n" + msg += f"See {url} for more info." + return msg + + +@pytest.hookimpl(wrapper=True, tryfirst=True) +def pytest_runtest_protocol(item: Item) -> Generator[None, object, object]: + with catch_warnings_for_item( + config=item.config, ihook=item.ihook, when="runtest", item=item + ): + return (yield) + + +@pytest.hookimpl(wrapper=True, tryfirst=True) +def pytest_collection(session: Session) -> Generator[None, object, object]: + config = session.config + with catch_warnings_for_item( + config=config, ihook=config.hook, when="collect", item=None + ): + return (yield) + + +@pytest.hookimpl(wrapper=True) +def pytest_terminal_summary( + terminalreporter: TerminalReporter, +) -> Generator[None]: + config = terminalreporter.config + with catch_warnings_for_item( + config=config, ihook=config.hook, when="config", item=None + ): + return (yield) + + +@pytest.hookimpl(wrapper=True) +def pytest_sessionfinish(session: Session) -> Generator[None]: + config = session.config + with catch_warnings_for_item( + config=config, ihook=config.hook, when="config", item=None + ): + return (yield) + + +@pytest.hookimpl(wrapper=True) +def pytest_load_initial_conftests( + early_config: Config, +) -> Generator[None]: + with catch_warnings_for_item( + config=early_config, ihook=early_config.hook, when="config", item=None + ): + return (yield) diff --git a/.venv/Lib/site-packages/asgiref-3.8.1.dist-info/INSTALLER b/.venv/Lib/site-packages/asgiref-3.8.1.dist-info/INSTALLER new file mode 100644 index 00000000..a1b589e3 --- /dev/null +++ b/.venv/Lib/site-packages/asgiref-3.8.1.dist-info/INSTALLER @@ -0,0 +1 @@ +pip diff --git a/.venv/Lib/site-packages/asgiref-3.8.1.dist-info/LICENSE b/.venv/Lib/site-packages/asgiref-3.8.1.dist-info/LICENSE new file mode 100644 index 00000000..5f4f225d --- /dev/null +++ b/.venv/Lib/site-packages/asgiref-3.8.1.dist-info/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) Django Software Foundation and individual contributors. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + 3. Neither the name of Django nor the names of its contributors may be used + to endorse or promote products derived from this software without + specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/.venv/Lib/site-packages/asgiref-3.8.1.dist-info/METADATA b/.venv/Lib/site-packages/asgiref-3.8.1.dist-info/METADATA new file mode 100644 index 00000000..a9ffa932 --- /dev/null +++ b/.venv/Lib/site-packages/asgiref-3.8.1.dist-info/METADATA @@ -0,0 +1,246 @@ +Metadata-Version: 2.1 +Name: asgiref +Version: 3.8.1 +Summary: ASGI specs, helper code, and adapters +Home-page: https://github.com/django/asgiref/ +Author: Django Software Foundation +Author-email: foundation@djangoproject.com +License: BSD-3-Clause +Project-URL: Documentation, https://asgi.readthedocs.io/ +Project-URL: Further Documentation, https://docs.djangoproject.com/en/stable/topics/async/#async-adapter-functions +Project-URL: Changelog, https://github.com/django/asgiref/blob/master/CHANGELOG.txt +Classifier: Development Status :: 5 - Production/Stable +Classifier: Environment :: Web Environment +Classifier: Intended Audience :: Developers +Classifier: License :: OSI Approved :: BSD License +Classifier: Operating System :: OS Independent +Classifier: Programming Language :: Python +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: 3 :: Only +Classifier: Programming Language :: Python :: 3.8 +Classifier: Programming Language :: Python :: 3.9 +Classifier: Programming Language :: Python :: 3.10 +Classifier: Programming Language :: Python :: 3.11 +Classifier: Programming Language :: Python :: 3.12 +Classifier: Topic :: Internet :: WWW/HTTP +Requires-Python: >=3.8 +License-File: LICENSE +Requires-Dist: typing-extensions >=4 ; python_version < "3.11" +Provides-Extra: tests +Requires-Dist: pytest ; extra == 'tests' +Requires-Dist: pytest-asyncio ; extra == 'tests' +Requires-Dist: mypy >=0.800 ; extra == 'tests' + +asgiref +======= + +.. image:: https://github.com/django/asgiref/actions/workflows/tests.yml/badge.svg + :target: https://github.com/django/asgiref/actions/workflows/tests.yml + +.. image:: https://img.shields.io/pypi/v/asgiref.svg + :target: https://pypi.python.org/pypi/asgiref + +ASGI is a standard for Python asynchronous web apps and servers to communicate +with each other, and positioned as an asynchronous successor to WSGI. You can +read more at https://asgi.readthedocs.io/en/latest/ + +This package includes ASGI base libraries, such as: + +* Sync-to-async and async-to-sync function wrappers, ``asgiref.sync`` +* Server base classes, ``asgiref.server`` +* A WSGI-to-ASGI adapter, in ``asgiref.wsgi`` + + +Function wrappers +----------------- + +These allow you to wrap or decorate async or sync functions to call them from +the other style (so you can call async functions from a synchronous thread, +or vice-versa). + +In particular: + +* AsyncToSync lets a synchronous subthread stop and wait while the async + function is called on the main thread's event loop, and then control is + returned to the thread when the async function is finished. + +* SyncToAsync lets async code call a synchronous function, which is run in + a threadpool and control returned to the async coroutine when the synchronous + function completes. + +The idea is to make it easier to call synchronous APIs from async code and +asynchronous APIs from synchronous code so it's easier to transition code from +one style to the other. In the case of Channels, we wrap the (synchronous) +Django view system with SyncToAsync to allow it to run inside the (asynchronous) +ASGI server. + +Note that exactly what threads things run in is very specific, and aimed to +keep maximum compatibility with old synchronous code. See +"Synchronous code & Threads" below for a full explanation. By default, +``sync_to_async`` will run all synchronous code in the program in the same +thread for safety reasons; you can disable this for more performance with +``@sync_to_async(thread_sensitive=False)``, but make sure that your code does +not rely on anything bound to threads (like database connections) when you do. + + +Threadlocal replacement +----------------------- + +This is a drop-in replacement for ``threading.local`` that works with both +threads and asyncio Tasks. Even better, it will proxy values through from a +task-local context to a thread-local context when you use ``sync_to_async`` +to run things in a threadpool, and vice-versa for ``async_to_sync``. + +If you instead want true thread- and task-safety, you can set +``thread_critical`` on the Local object to ensure this instead. + + +Server base classes +------------------- + +Includes a ``StatelessServer`` class which provides all the hard work of +writing a stateless server (as in, does not handle direct incoming sockets +but instead consumes external streams or sockets to work out what is happening). + +An example of such a server would be a chatbot server that connects out to +a central chat server and provides a "connection scope" per user chatting to +it. There's only one actual connection, but the server has to separate things +into several scopes for easier writing of the code. + +You can see an example of this being used in `frequensgi `_. + + +WSGI-to-ASGI adapter +-------------------- + +Allows you to wrap a WSGI application so it appears as a valid ASGI application. + +Simply wrap it around your WSGI application like so:: + + asgi_application = WsgiToAsgi(wsgi_application) + +The WSGI application will be run in a synchronous threadpool, and the wrapped +ASGI application will be one that accepts ``http`` class messages. + +Please note that not all extended features of WSGI may be supported (such as +file handles for incoming POST bodies). + + +Dependencies +------------ + +``asgiref`` requires Python 3.8 or higher. + + +Contributing +------------ + +Please refer to the +`main Channels contributing docs `_. + + +Testing +''''''' + +To run tests, make sure you have installed the ``tests`` extra with the package:: + + cd asgiref/ + pip install -e .[tests] + pytest + + +Building the documentation +'''''''''''''''''''''''''' + +The documentation uses `Sphinx `_:: + + cd asgiref/docs/ + pip install sphinx + +To build the docs, you can use the default tools:: + + sphinx-build -b html . _build/html # or `make html`, if you've got make set up + cd _build/html + python -m http.server + +...or you can use ``sphinx-autobuild`` to run a server and rebuild/reload +your documentation changes automatically:: + + pip install sphinx-autobuild + sphinx-autobuild . _build/html + + +Releasing +''''''''' + +To release, first add details to CHANGELOG.txt and update the version number in ``asgiref/__init__.py``. + +Then, build and push the packages:: + + python -m build + twine upload dist/* + rm -r build/ dist/ + + +Implementation Details +---------------------- + +Synchronous code & threads +'''''''''''''''''''''''''' + +The ``asgiref.sync`` module provides two wrappers that let you go between +asynchronous and synchronous code at will, while taking care of the rough edges +for you. + +Unfortunately, the rough edges are numerous, and the code has to work especially +hard to keep things in the same thread as much as possible. Notably, the +restrictions we are working with are: + +* All synchronous code called through ``SyncToAsync`` and marked with + ``thread_sensitive`` should run in the same thread as each other (and if the + outer layer of the program is synchronous, the main thread) + +* If a thread already has a running async loop, ``AsyncToSync`` can't run things + on that loop if it's blocked on synchronous code that is above you in the + call stack. + +The first compromise you get to might be that ``thread_sensitive`` code should +just run in the same thread and not spawn in a sub-thread, fulfilling the first +restriction, but that immediately runs you into the second restriction. + +The only real solution is to essentially have a variant of ThreadPoolExecutor +that executes any ``thread_sensitive`` code on the outermost synchronous +thread - either the main thread, or a single spawned subthread. + +This means you now have two basic states: + +* If the outermost layer of your program is synchronous, then all async code + run through ``AsyncToSync`` will run in a per-call event loop in arbitrary + sub-threads, while all ``thread_sensitive`` code will run in the main thread. + +* If the outermost layer of your program is asynchronous, then all async code + runs on the main thread's event loop, and all ``thread_sensitive`` synchronous + code will run in a single shared sub-thread. + +Crucially, this means that in both cases there is a thread which is a shared +resource that all ``thread_sensitive`` code must run on, and there is a chance +that this thread is currently blocked on its own ``AsyncToSync`` call. Thus, +``AsyncToSync`` needs to act as an executor for thread code while it's blocking. + +The ``CurrentThreadExecutor`` class provides this functionality; rather than +simply waiting on a Future, you can call its ``run_until_future`` method and +it will run submitted code until that Future is done. This means that code +inside the call can then run code on your thread. + + +Maintenance and Security +------------------------ + +To report security issues, please contact security@djangoproject.com. For GPG +signatures and more security process information, see +https://docs.djangoproject.com/en/dev/internals/security/. + +To report bugs or request new features, please open a new GitHub issue. + +This repository is part of the Channels project. For the shepherd and maintenance team, please see the +`main Channels readme `_. diff --git a/.venv/Lib/site-packages/asgiref-3.8.1.dist-info/RECORD b/.venv/Lib/site-packages/asgiref-3.8.1.dist-info/RECORD new file mode 100644 index 00000000..1770b426 --- /dev/null +++ b/.venv/Lib/site-packages/asgiref-3.8.1.dist-info/RECORD @@ -0,0 +1,27 @@ +asgiref-3.8.1.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +asgiref-3.8.1.dist-info/LICENSE,sha256=uEZBXRtRTpwd_xSiLeuQbXlLxUbKYSn5UKGM0JHipmk,1552 +asgiref-3.8.1.dist-info/METADATA,sha256=Cbu67XPstSkMxAdA4puvY-FAzN9OrT_AasH7IuK6DaM,9259 +asgiref-3.8.1.dist-info/RECORD,, +asgiref-3.8.1.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92 +asgiref-3.8.1.dist-info/top_level.txt,sha256=bokQjCzwwERhdBiPdvYEZa4cHxT4NCeAffQNUqJ8ssg,8 +asgiref/__init__.py,sha256=kZzGpxWKY4rWDQrrrlM7bN7YKRAjy17Wv4w__djvVYU,22 +asgiref/__pycache__/__init__.cpython-312.pyc,, +asgiref/__pycache__/compatibility.cpython-312.pyc,, +asgiref/__pycache__/current_thread_executor.cpython-312.pyc,, +asgiref/__pycache__/local.cpython-312.pyc,, +asgiref/__pycache__/server.cpython-312.pyc,, +asgiref/__pycache__/sync.cpython-312.pyc,, +asgiref/__pycache__/testing.cpython-312.pyc,, +asgiref/__pycache__/timeout.cpython-312.pyc,, +asgiref/__pycache__/typing.cpython-312.pyc,, +asgiref/__pycache__/wsgi.cpython-312.pyc,, +asgiref/compatibility.py,sha256=DhY1SOpOvOw0Y1lSEjCqg-znRUQKecG3LTaV48MZi68,1606 +asgiref/current_thread_executor.py,sha256=EuowbT0oL_P4Fq8KTXNUyEgk3-k4Yh4E8F_anEVdeBI,3977 +asgiref/local.py,sha256=bNeER_QIfw2-PAPYanqAZq6yAAEJ-aio7e9o8Up-mgI,4808 +asgiref/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +asgiref/server.py,sha256=egTQhZo1k4G0F7SSBQNp_VOekpGcjBJZU2kkCoiGC_M,6005 +asgiref/sync.py,sha256=Why0YQV84vSp7IBBr-JDbxYCua-InLgBjuiCMlj9WgI,21444 +asgiref/testing.py,sha256=QgZgXKrwdq5xzhZqynr1msWOiTS3Kpastj7wHU2ePRY,3481 +asgiref/timeout.py,sha256=LtGL-xQpG8JHprdsEUCMErJ0kNWj4qwWZhEHJ3iKu4s,3627 +asgiref/typing.py,sha256=rLF3y_9OgvlQMaDm8yMw8QTgsO9Mv9YAc6Cj8xjvWo0,6264 +asgiref/wsgi.py,sha256=fxBLgUE_0PEVgcp13ticz6GHf3q-aKWcB5eFPhd6yxo,6753 diff --git a/.venv/Lib/site-packages/asgiref-3.8.1.dist-info/WHEEL b/.venv/Lib/site-packages/asgiref-3.8.1.dist-info/WHEEL new file mode 100644 index 00000000..bab98d67 --- /dev/null +++ b/.venv/Lib/site-packages/asgiref-3.8.1.dist-info/WHEEL @@ -0,0 +1,5 @@ +Wheel-Version: 1.0 +Generator: bdist_wheel (0.43.0) +Root-Is-Purelib: true +Tag: py3-none-any + diff --git a/.venv/Lib/site-packages/asgiref-3.8.1.dist-info/top_level.txt b/.venv/Lib/site-packages/asgiref-3.8.1.dist-info/top_level.txt new file mode 100644 index 00000000..ddf99d3d --- /dev/null +++ b/.venv/Lib/site-packages/asgiref-3.8.1.dist-info/top_level.txt @@ -0,0 +1 @@ +asgiref diff --git a/.venv/Lib/site-packages/asgiref/__init__.py b/.venv/Lib/site-packages/asgiref/__init__.py new file mode 100644 index 00000000..e4e78c0b --- /dev/null +++ b/.venv/Lib/site-packages/asgiref/__init__.py @@ -0,0 +1 @@ +__version__ = "3.8.1" diff --git a/.venv/Lib/site-packages/asgiref/compatibility.py b/.venv/Lib/site-packages/asgiref/compatibility.py new file mode 100644 index 00000000..3a2a63e6 --- /dev/null +++ b/.venv/Lib/site-packages/asgiref/compatibility.py @@ -0,0 +1,48 @@ +import inspect + +from .sync import iscoroutinefunction + + +def is_double_callable(application): + """ + Tests to see if an application is a legacy-style (double-callable) application. + """ + # Look for a hint on the object first + if getattr(application, "_asgi_single_callable", False): + return False + if getattr(application, "_asgi_double_callable", False): + return True + # Uninstanted classes are double-callable + if inspect.isclass(application): + return True + # Instanted classes depend on their __call__ + if hasattr(application, "__call__"): + # We only check to see if its __call__ is a coroutine function - + # if it's not, it still might be a coroutine function itself. + if iscoroutinefunction(application.__call__): + return False + # Non-classes we just check directly + return not iscoroutinefunction(application) + + +def double_to_single_callable(application): + """ + Transforms a double-callable ASGI application into a single-callable one. + """ + + async def new_application(scope, receive, send): + instance = application(scope) + return await instance(receive, send) + + return new_application + + +def guarantee_single_callable(application): + """ + Takes either a single- or double-callable application and always returns it + in single-callable style. Use this to add backwards compatibility for ASGI + 2.0 applications to your server/test harness/etc. + """ + if is_double_callable(application): + application = double_to_single_callable(application) + return application diff --git a/.venv/Lib/site-packages/asgiref/current_thread_executor.py b/.venv/Lib/site-packages/asgiref/current_thread_executor.py new file mode 100644 index 00000000..67a7926f --- /dev/null +++ b/.venv/Lib/site-packages/asgiref/current_thread_executor.py @@ -0,0 +1,115 @@ +import queue +import sys +import threading +from concurrent.futures import Executor, Future +from typing import TYPE_CHECKING, Any, Callable, TypeVar, Union + +if sys.version_info >= (3, 10): + from typing import ParamSpec +else: + from typing_extensions import ParamSpec + +_T = TypeVar("_T") +_P = ParamSpec("_P") +_R = TypeVar("_R") + + +class _WorkItem: + """ + Represents an item needing to be run in the executor. + Copied from ThreadPoolExecutor (but it's private, so we're not going to rely on importing it) + """ + + def __init__( + self, + future: "Future[_R]", + fn: Callable[_P, _R], + *args: _P.args, + **kwargs: _P.kwargs, + ): + self.future = future + self.fn = fn + self.args = args + self.kwargs = kwargs + + def run(self) -> None: + __traceback_hide__ = True # noqa: F841 + if not self.future.set_running_or_notify_cancel(): + return + try: + result = self.fn(*self.args, **self.kwargs) + except BaseException as exc: + self.future.set_exception(exc) + # Break a reference cycle with the exception 'exc' + self = None # type: ignore[assignment] + else: + self.future.set_result(result) + + +class CurrentThreadExecutor(Executor): + """ + An Executor that actually runs code in the thread it is instantiated in. + Passed to other threads running async code, so they can run sync code in + the thread they came from. + """ + + def __init__(self) -> None: + self._work_thread = threading.current_thread() + self._work_queue: queue.Queue[Union[_WorkItem, "Future[Any]"]] = queue.Queue() + self._broken = False + + def run_until_future(self, future: "Future[Any]") -> None: + """ + Runs the code in the work queue until a result is available from the future. + Should be run from the thread the executor is initialised in. + """ + # Check we're in the right thread + if threading.current_thread() != self._work_thread: + raise RuntimeError( + "You cannot run CurrentThreadExecutor from a different thread" + ) + future.add_done_callback(self._work_queue.put) + # Keep getting and running work items until we get the future we're waiting for + # back via the future's done callback. + try: + while True: + # Get a work item and run it + work_item = self._work_queue.get() + if work_item is future: + return + assert isinstance(work_item, _WorkItem) + work_item.run() + del work_item + finally: + self._broken = True + + def _submit( + self, + fn: Callable[_P, _R], + *args: _P.args, + **kwargs: _P.kwargs, + ) -> "Future[_R]": + # Check they're not submitting from the same thread + if threading.current_thread() == self._work_thread: + raise RuntimeError( + "You cannot submit onto CurrentThreadExecutor from its own thread" + ) + # Check they're not too late or the executor errored + if self._broken: + raise RuntimeError("CurrentThreadExecutor already quit or is broken") + # Add to work queue + f: "Future[_R]" = Future() + work_item = _WorkItem(f, fn, *args, **kwargs) + self._work_queue.put(work_item) + # Return the future + return f + + # Python 3.9+ has a new signature for submit with a "/" after `fn`, to enforce + # it to be a positional argument. If we ignore[override] mypy on 3.9+ will be + # happy but 3.8 will say that the ignore comment is unused, even when + # defining them differently based on sys.version_info. + # We should be able to remove this when we drop support for 3.8. + if not TYPE_CHECKING: + + def submit(self, fn, *args, **kwargs): + return self._submit(fn, *args, **kwargs) diff --git a/.venv/Lib/site-packages/asgiref/local.py b/.venv/Lib/site-packages/asgiref/local.py new file mode 100644 index 00000000..a8b9459b --- /dev/null +++ b/.venv/Lib/site-packages/asgiref/local.py @@ -0,0 +1,128 @@ +import asyncio +import contextlib +import contextvars +import threading +from typing import Any, Dict, Union + + +class _CVar: + """Storage utility for Local.""" + + def __init__(self) -> None: + self._data: "contextvars.ContextVar[Dict[str, Any]]" = contextvars.ContextVar( + "asgiref.local" + ) + + def __getattr__(self, key): + storage_object = self._data.get({}) + try: + return storage_object[key] + except KeyError: + raise AttributeError(f"{self!r} object has no attribute {key!r}") + + def __setattr__(self, key: str, value: Any) -> None: + if key == "_data": + return super().__setattr__(key, value) + + storage_object = self._data.get({}) + storage_object[key] = value + self._data.set(storage_object) + + def __delattr__(self, key: str) -> None: + storage_object = self._data.get({}) + if key in storage_object: + del storage_object[key] + self._data.set(storage_object) + else: + raise AttributeError(f"{self!r} object has no attribute {key!r}") + + +class Local: + """Local storage for async tasks. + + This is a namespace object (similar to `threading.local`) where data is + also local to the current async task (if there is one). + + In async threads, local means in the same sense as the `contextvars` + module - i.e. a value set in an async frame will be visible: + + - to other async code `await`-ed from this frame. + - to tasks spawned using `asyncio` utilities (`create_task`, `wait_for`, + `gather` and probably others). + - to code scheduled in a sync thread using `sync_to_async` + + In "sync" threads (a thread with no async event loop running), the + data is thread-local, but additionally shared with async code executed + via the `async_to_sync` utility, which schedules async code in a new thread + and copies context across to that thread. + + If `thread_critical` is True, then the local will only be visible per-thread, + behaving exactly like `threading.local` if the thread is sync, and as + `contextvars` if the thread is async. This allows genuinely thread-sensitive + code (such as DB handles) to be kept stricly to their initial thread and + disable the sharing across `sync_to_async` and `async_to_sync` wrapped calls. + + Unlike plain `contextvars` objects, this utility is threadsafe. + """ + + def __init__(self, thread_critical: bool = False) -> None: + self._thread_critical = thread_critical + self._thread_lock = threading.RLock() + + self._storage: "Union[threading.local, _CVar]" + + if thread_critical: + # Thread-local storage + self._storage = threading.local() + else: + # Contextvar storage + self._storage = _CVar() + + @contextlib.contextmanager + def _lock_storage(self): + # Thread safe access to storage + if self._thread_critical: + try: + # this is a test for are we in a async or sync + # thread - will raise RuntimeError if there is + # no current loop + asyncio.get_running_loop() + except RuntimeError: + # We are in a sync thread, the storage is + # just the plain thread local (i.e, "global within + # this thread" - it doesn't matter where you are + # in a call stack you see the same storage) + yield self._storage + else: + # We are in an async thread - storage is still + # local to this thread, but additionally should + # behave like a context var (is only visible with + # the same async call stack) + + # Ensure context exists in the current thread + if not hasattr(self._storage, "cvar"): + self._storage.cvar = _CVar() + + # self._storage is a thread local, so the members + # can't be accessed in another thread (we don't + # need any locks) + yield self._storage.cvar + else: + # Lock for thread_critical=False as other threads + # can access the exact same storage object + with self._thread_lock: + yield self._storage + + def __getattr__(self, key): + with self._lock_storage() as storage: + return getattr(storage, key) + + def __setattr__(self, key, value): + if key in ("_local", "_storage", "_thread_critical", "_thread_lock"): + return super().__setattr__(key, value) + with self._lock_storage() as storage: + setattr(storage, key, value) + + def __delattr__(self, key): + with self._lock_storage() as storage: + delattr(storage, key) diff --git a/.venv/Lib/site-packages/asgiref/py.typed b/.venv/Lib/site-packages/asgiref/py.typed new file mode 100644 index 00000000..e69de29b diff --git a/.venv/Lib/site-packages/asgiref/server.py b/.venv/Lib/site-packages/asgiref/server.py new file mode 100644 index 00000000..43c28c6c --- /dev/null +++ b/.venv/Lib/site-packages/asgiref/server.py @@ -0,0 +1,157 @@ +import asyncio +import logging +import time +import traceback + +from .compatibility import guarantee_single_callable + +logger = logging.getLogger(__name__) + + +class StatelessServer: + """ + Base server class that handles basic concepts like application instance + creation/pooling, exception handling, and similar, for stateless protocols + (i.e. ones without actual incoming connections to the process) + + Your code should override the handle() method, doing whatever it needs to, + and calling get_or_create_application_instance with a unique `scope_id` + and `scope` for the scope it wants to get. + + If an application instance is found with the same `scope_id`, you are + given its input queue, otherwise one is made for you with the scope provided + and you are given that fresh new input queue. Either way, you should do + something like: + + input_queue = self.get_or_create_application_instance( + "user-123456", + {"type": "testprotocol", "user_id": "123456", "username": "andrew"}, + ) + input_queue.put_nowait(message) + + If you try and create an application instance and there are already + `max_application` instances, the oldest/least recently used one will be + reclaimed and shut down to make space. + + Application coroutines that error will be found periodically (every 100ms + by default) and have their exceptions printed to the console. Override + application_exception() if you want to do more when this happens. + + If you override run(), make sure you handle things like launching the + application checker. + """ + + application_checker_interval = 0.1 + + def __init__(self, application, max_applications=1000): + # Parameters + self.application = application + self.max_applications = max_applications + # Initialisation + self.application_instances = {} + + ### Mainloop and handling + + def run(self): + """ + Runs the asyncio event loop with our handler loop. + """ + event_loop = asyncio.get_event_loop() + asyncio.ensure_future(self.application_checker()) + try: + event_loop.run_until_complete(self.handle()) + except KeyboardInterrupt: + logger.info("Exiting due to Ctrl-C/interrupt") + + async def handle(self): + raise NotImplementedError("You must implement handle()") + + async def application_send(self, scope, message): + """ + Receives outbound sends from applications and handles them. + """ + raise NotImplementedError("You must implement application_send()") + + ### Application instance management + + def get_or_create_application_instance(self, scope_id, scope): + """ + Creates an application instance and returns its queue. + """ + if scope_id in self.application_instances: + self.application_instances[scope_id]["last_used"] = time.time() + return self.application_instances[scope_id]["input_queue"] + # See if we need to delete an old one + while len(self.application_instances) > self.max_applications: + self.delete_oldest_application_instance() + # Make an instance of the application + input_queue = asyncio.Queue() + application_instance = guarantee_single_callable(self.application) + # Run it, and stash the future for later checking + future = asyncio.ensure_future( + application_instance( + scope=scope, + receive=input_queue.get, + send=lambda message: self.application_send(scope, message), + ), + ) + self.application_instances[scope_id] = { + "input_queue": input_queue, + "future": future, + "scope": scope, + "last_used": time.time(), + } + return input_queue + + def delete_oldest_application_instance(self): + """ + Finds and deletes the oldest application instance + """ + oldest_time = min( + details["last_used"] for details in self.application_instances.values() + ) + for scope_id, details in self.application_instances.items(): + if details["last_used"] == oldest_time: + self.delete_application_instance(scope_id) + # Return to make sure we only delete one in case two have + # the same oldest time + return + + def delete_application_instance(self, scope_id): + """ + Removes an application instance (makes sure its task is stopped, + then removes it from the current set) + """ + details = self.application_instances[scope_id] + del self.application_instances[scope_id] + if not details["future"].done(): + details["future"].cancel() + + async def application_checker(self): + """ + Goes through the set of current application instance Futures and cleans up + any that are done/prints exceptions for any that errored. + """ + while True: + await asyncio.sleep(self.application_checker_interval) + for scope_id, details in list(self.application_instances.items()): + if details["future"].done(): + exception = details["future"].exception() + if exception: + await self.application_exception(exception, details) + try: + del self.application_instances[scope_id] + except KeyError: + # Exception handling might have already got here before us. That's fine. + pass + + async def application_exception(self, exception, application_details): + """ + Called whenever an application coroutine has an exception. + """ + logging.error( + "Exception inside application: %s\n%s%s", + exception, + "".join(traceback.format_tb(exception.__traceback__)), + f" {exception}", + ) diff --git a/.venv/Lib/site-packages/asgiref/sync.py b/.venv/Lib/site-packages/asgiref/sync.py new file mode 100644 index 00000000..4427fc2a --- /dev/null +++ b/.venv/Lib/site-packages/asgiref/sync.py @@ -0,0 +1,613 @@ +import asyncio +import asyncio.coroutines +import contextvars +import functools +import inspect +import os +import sys +import threading +import warnings +import weakref +from concurrent.futures import Future, ThreadPoolExecutor +from typing import ( + TYPE_CHECKING, + Any, + Awaitable, + Callable, + Coroutine, + Dict, + Generic, + List, + Optional, + TypeVar, + Union, + overload, +) + +from .current_thread_executor import CurrentThreadExecutor +from .local import Local + +if sys.version_info >= (3, 10): + from typing import ParamSpec +else: + from typing_extensions import ParamSpec + +if TYPE_CHECKING: + # This is not available to import at runtime + from _typeshed import OptExcInfo + +_F = TypeVar("_F", bound=Callable[..., Any]) +_P = ParamSpec("_P") +_R = TypeVar("_R") + + +def _restore_context(context: contextvars.Context) -> None: + # Check for changes in contextvars, and set them to the current + # context for downstream consumers + for cvar in context: + cvalue = context.get(cvar) + try: + if cvar.get() != cvalue: + cvar.set(cvalue) + except LookupError: + cvar.set(cvalue) + + +# Python 3.12 deprecates asyncio.iscoroutinefunction() as an alias for +# inspect.iscoroutinefunction(), whilst also removing the _is_coroutine marker. +# The latter is replaced with the inspect.markcoroutinefunction decorator. +# Until 3.12 is the minimum supported Python version, provide a shim. + +if hasattr(inspect, "markcoroutinefunction"): + iscoroutinefunction = inspect.iscoroutinefunction + markcoroutinefunction: Callable[[_F], _F] = inspect.markcoroutinefunction +else: + iscoroutinefunction = asyncio.iscoroutinefunction # type: ignore[assignment] + + def markcoroutinefunction(func: _F) -> _F: + func._is_coroutine = asyncio.coroutines._is_coroutine # type: ignore + return func + + +class ThreadSensitiveContext: + """Async context manager to manage context for thread sensitive mode + + This context manager controls which thread pool executor is used when in + thread sensitive mode. By default, a single thread pool executor is shared + within a process. + + The ThreadSensitiveContext() context manager may be used to specify a + thread pool per context. + + This context manager is re-entrant, so only the outer-most call to + ThreadSensitiveContext will set the context. + + Usage: + + >>> import time + >>> async with ThreadSensitiveContext(): + ... await sync_to_async(time.sleep, 1)() + """ + + def __init__(self): + self.token = None + + async def __aenter__(self): + try: + SyncToAsync.thread_sensitive_context.get() + except LookupError: + self.token = SyncToAsync.thread_sensitive_context.set(self) + + return self + + async def __aexit__(self, exc, value, tb): + if not self.token: + return + + executor = SyncToAsync.context_to_thread_executor.pop(self, None) + if executor: + executor.shutdown() + SyncToAsync.thread_sensitive_context.reset(self.token) + + +class AsyncToSync(Generic[_P, _R]): + """ + Utility class which turns an awaitable that only works on the thread with + the event loop into a synchronous callable that works in a subthread. + + If the call stack contains an async loop, the code runs there. + Otherwise, the code runs in a new loop in a new thread. + + Either way, this thread then pauses and waits to run any thread_sensitive + code called from further down the call stack using SyncToAsync, before + finally exiting once the async task returns. + """ + + # Keeps a reference to the CurrentThreadExecutor in local context, so that + # any sync_to_async inside the wrapped code can find it. + executors: "Local" = Local() + + # When we can't find a CurrentThreadExecutor from the context, such as + # inside create_task, we'll look it up here from the running event loop. + loop_thread_executors: "Dict[asyncio.AbstractEventLoop, CurrentThreadExecutor]" = {} + + def __init__( + self, + awaitable: Union[ + Callable[_P, Coroutine[Any, Any, _R]], + Callable[_P, Awaitable[_R]], + ], + force_new_loop: bool = False, + ): + if not callable(awaitable) or ( + not iscoroutinefunction(awaitable) + and not iscoroutinefunction(getattr(awaitable, "__call__", awaitable)) + ): + # Python does not have very reliable detection of async functions + # (lots of false negatives) so this is just a warning. + warnings.warn( + "async_to_sync was passed a non-async-marked callable", stacklevel=2 + ) + self.awaitable = awaitable + try: + self.__self__ = self.awaitable.__self__ # type: ignore[union-attr] + except AttributeError: + pass + self.force_new_loop = force_new_loop + self.main_event_loop = None + try: + self.main_event_loop = asyncio.get_running_loop() + except RuntimeError: + # There's no event loop in this thread. + pass + + def __call__(self, *args: _P.args, **kwargs: _P.kwargs) -> _R: + __traceback_hide__ = True # noqa: F841 + + if not self.force_new_loop and not self.main_event_loop: + # There's no event loop in this thread. Look for the threadlocal if + # we're inside SyncToAsync + main_event_loop_pid = getattr( + SyncToAsync.threadlocal, "main_event_loop_pid", None + ) + # We make sure the parent loop is from the same process - if + # they've forked, this is not going to be valid any more (#194) + if main_event_loop_pid and main_event_loop_pid == os.getpid(): + self.main_event_loop = getattr( + SyncToAsync.threadlocal, "main_event_loop", None + ) + + # You can't call AsyncToSync from a thread with a running event loop + try: + event_loop = asyncio.get_running_loop() + except RuntimeError: + pass + else: + if event_loop.is_running(): + raise RuntimeError( + "You cannot use AsyncToSync in the same thread as an async event loop - " + "just await the async function directly." + ) + + # Make a future for the return information + call_result: "Future[_R]" = Future() + + # Make a CurrentThreadExecutor we'll use to idle in this thread - we + # need one for every sync frame, even if there's one above us in the + # same thread. + old_executor = getattr(self.executors, "current", None) + current_executor = CurrentThreadExecutor() + self.executors.current = current_executor + + # Wrapping context in list so it can be reassigned from within + # `main_wrap`. + context = [contextvars.copy_context()] + + # Get task context so that parent task knows which task to propagate + # an asyncio.CancelledError to. + task_context = getattr(SyncToAsync.threadlocal, "task_context", None) + + loop = None + # Use call_soon_threadsafe to schedule a synchronous callback on the + # main event loop's thread if it's there, otherwise make a new loop + # in this thread. + try: + awaitable = self.main_wrap( + call_result, + sys.exc_info(), + task_context, + context, + *args, + **kwargs, + ) + + if not (self.main_event_loop and self.main_event_loop.is_running()): + # Make our own event loop - in a new thread - and run inside that. + loop = asyncio.new_event_loop() + self.loop_thread_executors[loop] = current_executor + loop_executor = ThreadPoolExecutor(max_workers=1) + loop_future = loop_executor.submit( + self._run_event_loop, loop, awaitable + ) + if current_executor: + # Run the CurrentThreadExecutor until the future is done + current_executor.run_until_future(loop_future) + # Wait for future and/or allow for exception propagation + loop_future.result() + else: + # Call it inside the existing loop + self.main_event_loop.call_soon_threadsafe( + self.main_event_loop.create_task, awaitable + ) + if current_executor: + # Run the CurrentThreadExecutor until the future is done + current_executor.run_until_future(call_result) + finally: + # Clean up any executor we were running + if loop is not None: + del self.loop_thread_executors[loop] + _restore_context(context[0]) + # Restore old current thread executor state + self.executors.current = old_executor + + # Wait for results from the future. + return call_result.result() + + def _run_event_loop(self, loop, coro): + """ + Runs the given event loop (designed to be called in a thread). + """ + asyncio.set_event_loop(loop) + try: + loop.run_until_complete(coro) + finally: + try: + # mimic asyncio.run() behavior + # cancel unexhausted async generators + tasks = asyncio.all_tasks(loop) + for task in tasks: + task.cancel() + + async def gather(): + await asyncio.gather(*tasks, return_exceptions=True) + + loop.run_until_complete(gather()) + for task in tasks: + if task.cancelled(): + continue + if task.exception() is not None: + loop.call_exception_handler( + { + "message": "unhandled exception during loop shutdown", + "exception": task.exception(), + "task": task, + } + ) + if hasattr(loop, "shutdown_asyncgens"): + loop.run_until_complete(loop.shutdown_asyncgens()) + finally: + loop.close() + asyncio.set_event_loop(self.main_event_loop) + + def __get__(self, parent: Any, objtype: Any) -> Callable[_P, _R]: + """ + Include self for methods + """ + func = functools.partial(self.__call__, parent) + return functools.update_wrapper(func, self.awaitable) + + async def main_wrap( + self, + call_result: "Future[_R]", + exc_info: "OptExcInfo", + task_context: "Optional[List[asyncio.Task[Any]]]", + context: List[contextvars.Context], + *args: _P.args, + **kwargs: _P.kwargs, + ) -> None: + """ + Wraps the awaitable with something that puts the result into the + result/exception future. + """ + + __traceback_hide__ = True # noqa: F841 + + if context is not None: + _restore_context(context[0]) + + current_task = asyncio.current_task() + if current_task is not None and task_context is not None: + task_context.append(current_task) + + try: + # If we have an exception, run the function inside the except block + # after raising it so exc_info is correctly populated. + if exc_info[1]: + try: + raise exc_info[1] + except BaseException: + result = await self.awaitable(*args, **kwargs) + else: + result = await self.awaitable(*args, **kwargs) + except BaseException as e: + call_result.set_exception(e) + else: + call_result.set_result(result) + finally: + if current_task is not None and task_context is not None: + task_context.remove(current_task) + context[0] = contextvars.copy_context() + + +class SyncToAsync(Generic[_P, _R]): + """ + Utility class which turns a synchronous callable into an awaitable that + runs in a threadpool. It also sets a threadlocal inside the thread so + calls to AsyncToSync can escape it. + + If thread_sensitive is passed, the code will run in the same thread as any + outer code. This is needed for underlying Python code that is not + threadsafe (for example, code which handles SQLite database connections). + + If the outermost program is async (i.e. SyncToAsync is outermost), then + this will be a dedicated single sub-thread that all sync code runs in, + one after the other. If the outermost program is sync (i.e. AsyncToSync is + outermost), this will just be the main thread. This is achieved by idling + with a CurrentThreadExecutor while AsyncToSync is blocking its sync parent, + rather than just blocking. + + If executor is passed in, that will be used instead of the loop's default executor. + In order to pass in an executor, thread_sensitive must be set to False, otherwise + a TypeError will be raised. + """ + + # Storage for main event loop references + threadlocal = threading.local() + + # Single-thread executor for thread-sensitive code + single_thread_executor = ThreadPoolExecutor(max_workers=1) + + # Maintain a contextvar for the current execution context. Optionally used + # for thread sensitive mode. + thread_sensitive_context: "contextvars.ContextVar[ThreadSensitiveContext]" = ( + contextvars.ContextVar("thread_sensitive_context") + ) + + # Contextvar that is used to detect if the single thread executor + # would be awaited on while already being used in the same context + deadlock_context: "contextvars.ContextVar[bool]" = contextvars.ContextVar( + "deadlock_context" + ) + + # Maintaining a weak reference to the context ensures that thread pools are + # erased once the context goes out of scope. This terminates the thread pool. + context_to_thread_executor: "weakref.WeakKeyDictionary[ThreadSensitiveContext, ThreadPoolExecutor]" = ( + weakref.WeakKeyDictionary() + ) + + def __init__( + self, + func: Callable[_P, _R], + thread_sensitive: bool = True, + executor: Optional["ThreadPoolExecutor"] = None, + ) -> None: + if ( + not callable(func) + or iscoroutinefunction(func) + or iscoroutinefunction(getattr(func, "__call__", func)) + ): + raise TypeError("sync_to_async can only be applied to sync functions.") + self.func = func + functools.update_wrapper(self, func) + self._thread_sensitive = thread_sensitive + markcoroutinefunction(self) + if thread_sensitive and executor is not None: + raise TypeError("executor must not be set when thread_sensitive is True") + self._executor = executor + try: + self.__self__ = func.__self__ # type: ignore + except AttributeError: + pass + + async def __call__(self, *args: _P.args, **kwargs: _P.kwargs) -> _R: + __traceback_hide__ = True # noqa: F841 + loop = asyncio.get_running_loop() + + # Work out what thread to run the code in + if self._thread_sensitive: + current_thread_executor = getattr(AsyncToSync.executors, "current", None) + if current_thread_executor: + # If we have a parent sync thread above somewhere, use that + executor = current_thread_executor + elif self.thread_sensitive_context.get(None): + # If we have a way of retrieving the current context, attempt + # to use a per-context thread pool executor + thread_sensitive_context = self.thread_sensitive_context.get() + + if thread_sensitive_context in self.context_to_thread_executor: + # Re-use thread executor in current context + executor = self.context_to_thread_executor[thread_sensitive_context] + else: + # Create new thread executor in current context + executor = ThreadPoolExecutor(max_workers=1) + self.context_to_thread_executor[thread_sensitive_context] = executor + elif loop in AsyncToSync.loop_thread_executors: + # Re-use thread executor for running loop + executor = AsyncToSync.loop_thread_executors[loop] + elif self.deadlock_context.get(False): + raise RuntimeError( + "Single thread executor already being used, would deadlock" + ) + else: + # Otherwise, we run it in a fixed single thread + executor = self.single_thread_executor + self.deadlock_context.set(True) + else: + # Use the passed in executor, or the loop's default if it is None + executor = self._executor + + context = contextvars.copy_context() + child = functools.partial(self.func, *args, **kwargs) + func = context.run + task_context: List[asyncio.Task[Any]] = [] + + # Run the code in the right thread + exec_coro = loop.run_in_executor( + executor, + functools.partial( + self.thread_handler, + loop, + sys.exc_info(), + task_context, + func, + child, + ), + ) + ret: _R + try: + ret = await asyncio.shield(exec_coro) + except asyncio.CancelledError: + cancel_parent = True + try: + task = task_context[0] + task.cancel() + try: + await task + cancel_parent = False + except asyncio.CancelledError: + pass + except IndexError: + pass + if exec_coro.done(): + raise + if cancel_parent: + exec_coro.cancel() + ret = await exec_coro + finally: + _restore_context(context) + self.deadlock_context.set(False) + + return ret + + def __get__( + self, parent: Any, objtype: Any + ) -> Callable[_P, Coroutine[Any, Any, _R]]: + """ + Include self for methods + """ + func = functools.partial(self.__call__, parent) + return functools.update_wrapper(func, self.func) + + def thread_handler(self, loop, exc_info, task_context, func, *args, **kwargs): + """ + Wraps the sync application with exception handling. + """ + + __traceback_hide__ = True # noqa: F841 + + # Set the threadlocal for AsyncToSync + self.threadlocal.main_event_loop = loop + self.threadlocal.main_event_loop_pid = os.getpid() + self.threadlocal.task_context = task_context + + # Run the function + # If we have an exception, run the function inside the except block + # after raising it so exc_info is correctly populated. + if exc_info[1]: + try: + raise exc_info[1] + except BaseException: + return func(*args, **kwargs) + else: + return func(*args, **kwargs) + + +@overload +def async_to_sync( + *, + force_new_loop: bool = False, +) -> Callable[ + [Union[Callable[_P, Coroutine[Any, Any, _R]], Callable[_P, Awaitable[_R]]]], + Callable[_P, _R], +]: + ... + + +@overload +def async_to_sync( + awaitable: Union[ + Callable[_P, Coroutine[Any, Any, _R]], + Callable[_P, Awaitable[_R]], + ], + *, + force_new_loop: bool = False, +) -> Callable[_P, _R]: + ... + + +def async_to_sync( + awaitable: Optional[ + Union[ + Callable[_P, Coroutine[Any, Any, _R]], + Callable[_P, Awaitable[_R]], + ] + ] = None, + *, + force_new_loop: bool = False, +) -> Union[ + Callable[ + [Union[Callable[_P, Coroutine[Any, Any, _R]], Callable[_P, Awaitable[_R]]]], + Callable[_P, _R], + ], + Callable[_P, _R], +]: + if awaitable is None: + return lambda f: AsyncToSync( + f, + force_new_loop=force_new_loop, + ) + return AsyncToSync( + awaitable, + force_new_loop=force_new_loop, + ) + + +@overload +def sync_to_async( + *, + thread_sensitive: bool = True, + executor: Optional["ThreadPoolExecutor"] = None, +) -> Callable[[Callable[_P, _R]], Callable[_P, Coroutine[Any, Any, _R]]]: + ... + + +@overload +def sync_to_async( + func: Callable[_P, _R], + *, + thread_sensitive: bool = True, + executor: Optional["ThreadPoolExecutor"] = None, +) -> Callable[_P, Coroutine[Any, Any, _R]]: + ... + + +def sync_to_async( + func: Optional[Callable[_P, _R]] = None, + *, + thread_sensitive: bool = True, + executor: Optional["ThreadPoolExecutor"] = None, +) -> Union[ + Callable[[Callable[_P, _R]], Callable[_P, Coroutine[Any, Any, _R]]], + Callable[_P, Coroutine[Any, Any, _R]], +]: + if func is None: + return lambda f: SyncToAsync( + f, + thread_sensitive=thread_sensitive, + executor=executor, + ) + return SyncToAsync( + func, + thread_sensitive=thread_sensitive, + executor=executor, + ) diff --git a/.venv/Lib/site-packages/asgiref/testing.py b/.venv/Lib/site-packages/asgiref/testing.py new file mode 100644 index 00000000..aa7cff1c --- /dev/null +++ b/.venv/Lib/site-packages/asgiref/testing.py @@ -0,0 +1,103 @@ +import asyncio +import contextvars +import time + +from .compatibility import guarantee_single_callable +from .timeout import timeout as async_timeout + + +class ApplicationCommunicator: + """ + Runs an ASGI application in a test mode, allowing sending of + messages to it and retrieval of messages it sends. + """ + + def __init__(self, application, scope): + self.application = guarantee_single_callable(application) + self.scope = scope + self.input_queue = asyncio.Queue() + self.output_queue = asyncio.Queue() + # Clear context - this ensures that context vars set in the testing scope + # are not "leaked" into the application which would normally begin with + # an empty context. In Python >= 3.11 this could also be written as: + # asyncio.create_task(..., context=contextvars.Context()) + self.future = contextvars.Context().run( + asyncio.create_task, + self.application(scope, self.input_queue.get, self.output_queue.put), + ) + + async def wait(self, timeout=1): + """ + Waits for the application to stop itself and returns any exceptions. + """ + try: + async with async_timeout(timeout): + try: + await self.future + self.future.result() + except asyncio.CancelledError: + pass + finally: + if not self.future.done(): + self.future.cancel() + try: + await self.future + except asyncio.CancelledError: + pass + + def stop(self, exceptions=True): + if not self.future.done(): + self.future.cancel() + elif exceptions: + # Give a chance to raise any exceptions + self.future.result() + + def __del__(self): + # Clean up on deletion + try: + self.stop(exceptions=False) + except RuntimeError: + # Event loop already stopped + pass + + async def send_input(self, message): + """ + Sends a single message to the application + """ + # Give it the message + await self.input_queue.put(message) + + async def receive_output(self, timeout=1): + """ + Receives a single message from the application, with optional timeout. + """ + # Make sure there's not an exception to raise from the task + if self.future.done(): + self.future.result() + # Wait and receive the message + try: + async with async_timeout(timeout): + return await self.output_queue.get() + except asyncio.TimeoutError as e: + # See if we have another error to raise inside + if self.future.done(): + self.future.result() + else: + self.future.cancel() + try: + await self.future + except asyncio.CancelledError: + pass + raise e + + async def receive_nothing(self, timeout=0.1, interval=0.01): + """ + Checks that there is no message to receive in the given time. + """ + # `interval` has precedence over `timeout` + start = time.monotonic() + while time.monotonic() - start < timeout: + if not self.output_queue.empty(): + return False + await asyncio.sleep(interval) + return self.output_queue.empty() diff --git a/.venv/Lib/site-packages/asgiref/timeout.py b/.venv/Lib/site-packages/asgiref/timeout.py new file mode 100644 index 00000000..fd5381d0 --- /dev/null +++ b/.venv/Lib/site-packages/asgiref/timeout.py @@ -0,0 +1,118 @@ +# This code is originally sourced from the aio-libs project "async_timeout", +# under the Apache 2.0 license. You may see the original project at +# https://github.com/aio-libs/async-timeout + +# It is vendored here to reduce chain-dependencies on this library, and +# modified slightly to remove some features we don't use. + + +import asyncio +import warnings +from types import TracebackType +from typing import Any # noqa +from typing import Optional, Type + + +class timeout: + """timeout context manager. + + Useful in cases when you want to apply timeout logic around block + of code or in cases when asyncio.wait_for is not suitable. For example: + + >>> with timeout(0.001): + ... async with aiohttp.get('https://github.com') as r: + ... await r.text() + + + timeout - value in seconds or None to disable timeout logic + loop - asyncio compatible event loop + """ + + def __init__( + self, + timeout: Optional[float], + *, + loop: Optional[asyncio.AbstractEventLoop] = None, + ) -> None: + self._timeout = timeout + if loop is None: + loop = asyncio.get_running_loop() + else: + warnings.warn( + """The loop argument to timeout() is deprecated.""", DeprecationWarning + ) + self._loop = loop + self._task = None # type: Optional[asyncio.Task[Any]] + self._cancelled = False + self._cancel_handler = None # type: Optional[asyncio.Handle] + self._cancel_at = None # type: Optional[float] + + def __enter__(self) -> "timeout": + return self._do_enter() + + def __exit__( + self, + exc_type: Type[BaseException], + exc_val: BaseException, + exc_tb: TracebackType, + ) -> Optional[bool]: + self._do_exit(exc_type) + return None + + async def __aenter__(self) -> "timeout": + return self._do_enter() + + async def __aexit__( + self, + exc_type: Type[BaseException], + exc_val: BaseException, + exc_tb: TracebackType, + ) -> None: + self._do_exit(exc_type) + + @property + def expired(self) -> bool: + return self._cancelled + + @property + def remaining(self) -> Optional[float]: + if self._cancel_at is not None: + return max(self._cancel_at - self._loop.time(), 0.0) + else: + return None + + def _do_enter(self) -> "timeout": + # Support Tornado 5- without timeout + # Details: https://github.com/python/asyncio/issues/392 + if self._timeout is None: + return self + + self._task = asyncio.current_task(self._loop) + if self._task is None: + raise RuntimeError( + "Timeout context manager should be used " "inside a task" + ) + + if self._timeout <= 0: + self._loop.call_soon(self._cancel_task) + return self + + self._cancel_at = self._loop.time() + self._timeout + self._cancel_handler = self._loop.call_at(self._cancel_at, self._cancel_task) + return self + + def _do_exit(self, exc_type: Type[BaseException]) -> None: + if exc_type is asyncio.CancelledError and self._cancelled: + self._cancel_handler = None + self._task = None + raise asyncio.TimeoutError + if self._timeout is not None and self._cancel_handler is not None: + self._cancel_handler.cancel() + self._cancel_handler = None + self._task = None + return None + + def _cancel_task(self) -> None: + if self._task is not None: + self._task.cancel() + self._cancelled = True diff --git a/.venv/Lib/site-packages/asgiref/typing.py b/.venv/Lib/site-packages/asgiref/typing.py new file mode 100644 index 00000000..71c25ed8 --- /dev/null +++ b/.venv/Lib/site-packages/asgiref/typing.py @@ -0,0 +1,278 @@ +import sys +from typing import ( + Any, + Awaitable, + Callable, + Dict, + Iterable, + Literal, + Optional, + Protocol, + Tuple, + Type, + TypedDict, + Union, +) + +if sys.version_info >= (3, 11): + from typing import NotRequired +else: + from typing_extensions import NotRequired + +__all__ = ( + "ASGIVersions", + "HTTPScope", + "WebSocketScope", + "LifespanScope", + "WWWScope", + "Scope", + "HTTPRequestEvent", + "HTTPResponseStartEvent", + "HTTPResponseBodyEvent", + "HTTPResponseTrailersEvent", + "HTTPResponsePathsendEvent", + "HTTPServerPushEvent", + "HTTPDisconnectEvent", + "WebSocketConnectEvent", + "WebSocketAcceptEvent", + "WebSocketReceiveEvent", + "WebSocketSendEvent", + "WebSocketResponseStartEvent", + "WebSocketResponseBodyEvent", + "WebSocketDisconnectEvent", + "WebSocketCloseEvent", + "LifespanStartupEvent", + "LifespanShutdownEvent", + "LifespanStartupCompleteEvent", + "LifespanStartupFailedEvent", + "LifespanShutdownCompleteEvent", + "LifespanShutdownFailedEvent", + "ASGIReceiveEvent", + "ASGISendEvent", + "ASGIReceiveCallable", + "ASGISendCallable", + "ASGI2Protocol", + "ASGI2Application", + "ASGI3Application", + "ASGIApplication", +) + + +class ASGIVersions(TypedDict): + spec_version: str + version: Union[Literal["2.0"], Literal["3.0"]] + + +class HTTPScope(TypedDict): + type: Literal["http"] + asgi: ASGIVersions + http_version: str + method: str + scheme: str + path: str + raw_path: bytes + query_string: bytes + root_path: str + headers: Iterable[Tuple[bytes, bytes]] + client: Optional[Tuple[str, int]] + server: Optional[Tuple[str, Optional[int]]] + state: NotRequired[Dict[str, Any]] + extensions: Optional[Dict[str, Dict[object, object]]] + + +class WebSocketScope(TypedDict): + type: Literal["websocket"] + asgi: ASGIVersions + http_version: str + scheme: str + path: str + raw_path: bytes + query_string: bytes + root_path: str + headers: Iterable[Tuple[bytes, bytes]] + client: Optional[Tuple[str, int]] + server: Optional[Tuple[str, Optional[int]]] + subprotocols: Iterable[str] + state: NotRequired[Dict[str, Any]] + extensions: Optional[Dict[str, Dict[object, object]]] + + +class LifespanScope(TypedDict): + type: Literal["lifespan"] + asgi: ASGIVersions + state: NotRequired[Dict[str, Any]] + + +WWWScope = Union[HTTPScope, WebSocketScope] +Scope = Union[HTTPScope, WebSocketScope, LifespanScope] + + +class HTTPRequestEvent(TypedDict): + type: Literal["http.request"] + body: bytes + more_body: bool + + +class HTTPResponseDebugEvent(TypedDict): + type: Literal["http.response.debug"] + info: Dict[str, object] + + +class HTTPResponseStartEvent(TypedDict): + type: Literal["http.response.start"] + status: int + headers: Iterable[Tuple[bytes, bytes]] + trailers: bool + + +class HTTPResponseBodyEvent(TypedDict): + type: Literal["http.response.body"] + body: bytes + more_body: bool + + +class HTTPResponseTrailersEvent(TypedDict): + type: Literal["http.response.trailers"] + headers: Iterable[Tuple[bytes, bytes]] + more_trailers: bool + + +class HTTPResponsePathsendEvent(TypedDict): + type: Literal["http.response.pathsend"] + path: str + + +class HTTPServerPushEvent(TypedDict): + type: Literal["http.response.push"] + path: str + headers: Iterable[Tuple[bytes, bytes]] + + +class HTTPDisconnectEvent(TypedDict): + type: Literal["http.disconnect"] + + +class WebSocketConnectEvent(TypedDict): + type: Literal["websocket.connect"] + + +class WebSocketAcceptEvent(TypedDict): + type: Literal["websocket.accept"] + subprotocol: Optional[str] + headers: Iterable[Tuple[bytes, bytes]] + + +class WebSocketReceiveEvent(TypedDict): + type: Literal["websocket.receive"] + bytes: Optional[bytes] + text: Optional[str] + + +class WebSocketSendEvent(TypedDict): + type: Literal["websocket.send"] + bytes: Optional[bytes] + text: Optional[str] + + +class WebSocketResponseStartEvent(TypedDict): + type: Literal["websocket.http.response.start"] + status: int + headers: Iterable[Tuple[bytes, bytes]] + + +class WebSocketResponseBodyEvent(TypedDict): + type: Literal["websocket.http.response.body"] + body: bytes + more_body: bool + + +class WebSocketDisconnectEvent(TypedDict): + type: Literal["websocket.disconnect"] + code: int + + +class WebSocketCloseEvent(TypedDict): + type: Literal["websocket.close"] + code: int + reason: Optional[str] + + +class LifespanStartupEvent(TypedDict): + type: Literal["lifespan.startup"] + + +class LifespanShutdownEvent(TypedDict): + type: Literal["lifespan.shutdown"] + + +class LifespanStartupCompleteEvent(TypedDict): + type: Literal["lifespan.startup.complete"] + + +class LifespanStartupFailedEvent(TypedDict): + type: Literal["lifespan.startup.failed"] + message: str + + +class LifespanShutdownCompleteEvent(TypedDict): + type: Literal["lifespan.shutdown.complete"] + + +class LifespanShutdownFailedEvent(TypedDict): + type: Literal["lifespan.shutdown.failed"] + message: str + + +ASGIReceiveEvent = Union[ + HTTPRequestEvent, + HTTPDisconnectEvent, + WebSocketConnectEvent, + WebSocketReceiveEvent, + WebSocketDisconnectEvent, + LifespanStartupEvent, + LifespanShutdownEvent, +] + + +ASGISendEvent = Union[ + HTTPResponseStartEvent, + HTTPResponseBodyEvent, + HTTPResponseTrailersEvent, + HTTPServerPushEvent, + HTTPDisconnectEvent, + WebSocketAcceptEvent, + WebSocketSendEvent, + WebSocketResponseStartEvent, + WebSocketResponseBodyEvent, + WebSocketCloseEvent, + LifespanStartupCompleteEvent, + LifespanStartupFailedEvent, + LifespanShutdownCompleteEvent, + LifespanShutdownFailedEvent, +] + + +ASGIReceiveCallable = Callable[[], Awaitable[ASGIReceiveEvent]] +ASGISendCallable = Callable[[ASGISendEvent], Awaitable[None]] + + +class ASGI2Protocol(Protocol): + def __init__(self, scope: Scope) -> None: + ... + + async def __call__( + self, receive: ASGIReceiveCallable, send: ASGISendCallable + ) -> None: + ... + + +ASGI2Application = Type[ASGI2Protocol] +ASGI3Application = Callable[ + [ + Scope, + ASGIReceiveCallable, + ASGISendCallable, + ], + Awaitable[None], +] +ASGIApplication = Union[ASGI2Application, ASGI3Application] diff --git a/.venv/Lib/site-packages/asgiref/wsgi.py b/.venv/Lib/site-packages/asgiref/wsgi.py new file mode 100644 index 00000000..65af4279 --- /dev/null +++ b/.venv/Lib/site-packages/asgiref/wsgi.py @@ -0,0 +1,166 @@ +from io import BytesIO +from tempfile import SpooledTemporaryFile + +from asgiref.sync import AsyncToSync, sync_to_async + + +class WsgiToAsgi: + """ + Wraps a WSGI application to make it into an ASGI application. + """ + + def __init__(self, wsgi_application): + self.wsgi_application = wsgi_application + + async def __call__(self, scope, receive, send): + """ + ASGI application instantiation point. + We return a new WsgiToAsgiInstance here with the WSGI app + and the scope, ready to respond when it is __call__ed. + """ + await WsgiToAsgiInstance(self.wsgi_application)(scope, receive, send) + + +class WsgiToAsgiInstance: + """ + Per-socket instance of a wrapped WSGI application + """ + + def __init__(self, wsgi_application): + self.wsgi_application = wsgi_application + self.response_started = False + self.response_content_length = None + + async def __call__(self, scope, receive, send): + if scope["type"] != "http": + raise ValueError("WSGI wrapper received a non-HTTP scope") + self.scope = scope + with SpooledTemporaryFile(max_size=65536) as body: + # Alright, wait for the http.request messages + while True: + message = await receive() + if message["type"] != "http.request": + raise ValueError("WSGI wrapper received a non-HTTP-request message") + body.write(message.get("body", b"")) + if not message.get("more_body"): + break + body.seek(0) + # Wrap send so it can be called from the subthread + self.sync_send = AsyncToSync(send) + # Call the WSGI app + await self.run_wsgi_app(body) + + def build_environ(self, scope, body): + """ + Builds a scope and request body into a WSGI environ object. + """ + script_name = scope.get("root_path", "").encode("utf8").decode("latin1") + path_info = scope["path"].encode("utf8").decode("latin1") + if path_info.startswith(script_name): + path_info = path_info[len(script_name) :] + environ = { + "REQUEST_METHOD": scope["method"], + "SCRIPT_NAME": script_name, + "PATH_INFO": path_info, + "QUERY_STRING": scope["query_string"].decode("ascii"), + "SERVER_PROTOCOL": "HTTP/%s" % scope["http_version"], + "wsgi.version": (1, 0), + "wsgi.url_scheme": scope.get("scheme", "http"), + "wsgi.input": body, + "wsgi.errors": BytesIO(), + "wsgi.multithread": True, + "wsgi.multiprocess": True, + "wsgi.run_once": False, + } + # Get server name and port - required in WSGI, not in ASGI + if "server" in scope: + environ["SERVER_NAME"] = scope["server"][0] + environ["SERVER_PORT"] = str(scope["server"][1]) + else: + environ["SERVER_NAME"] = "localhost" + environ["SERVER_PORT"] = "80" + + if scope.get("client") is not None: + environ["REMOTE_ADDR"] = scope["client"][0] + + # Go through headers and make them into environ entries + for name, value in self.scope.get("headers", []): + name = name.decode("latin1") + if name == "content-length": + corrected_name = "CONTENT_LENGTH" + elif name == "content-type": + corrected_name = "CONTENT_TYPE" + else: + corrected_name = "HTTP_%s" % name.upper().replace("-", "_") + # HTTPbis say only ASCII chars are allowed in headers, but we latin1 just in case + value = value.decode("latin1") + if corrected_name in environ: + value = environ[corrected_name] + "," + value + environ[corrected_name] = value + return environ + + def start_response(self, status, response_headers, exc_info=None): + """ + WSGI start_response callable. + """ + # Don't allow re-calling once response has begun + if self.response_started: + raise exc_info[1].with_traceback(exc_info[2]) + # Don't allow re-calling without exc_info + if hasattr(self, "response_start") and exc_info is None: + raise ValueError( + "You cannot call start_response a second time without exc_info" + ) + # Extract status code + status_code, _ = status.split(" ", 1) + status_code = int(status_code) + # Extract headers + headers = [ + (name.lower().encode("ascii"), value.encode("ascii")) + for name, value in response_headers + ] + # Extract content-length + self.response_content_length = None + for name, value in response_headers: + if name.lower() == "content-length": + self.response_content_length = int(value) + # Build and send response start message. + self.response_start = { + "type": "http.response.start", + "status": status_code, + "headers": headers, + } + + @sync_to_async + def run_wsgi_app(self, body): + """ + Called in a subthread to run the WSGI app. We encapsulate like + this so that the start_response callable is called in the same thread. + """ + # Translate the scope and incoming request body into a WSGI environ + environ = self.build_environ(self.scope, body) + # Run the WSGI app + bytes_sent = 0 + for output in self.wsgi_application(environ, self.start_response): + # If this is the first response, include the response headers + if not self.response_started: + self.response_started = True + self.sync_send(self.response_start) + # If the application supplies a Content-Length header + if self.response_content_length is not None: + # The server should not transmit more bytes to the client than the header allows + bytes_allowed = self.response_content_length - bytes_sent + if len(output) > bytes_allowed: + output = output[:bytes_allowed] + self.sync_send( + {"type": "http.response.body", "body": output, "more_body": True} + ) + bytes_sent += len(output) + # The server should stop iterating over the response when enough data has been sent + if bytes_sent == self.response_content_length: + break + # Close connection + if not self.response_started: + self.response_started = True + self.sync_send(self.response_start) + self.sync_send({"type": "http.response.body"}) diff --git a/.venv/Lib/site-packages/colorama-0.4.6.dist-info/INSTALLER b/.venv/Lib/site-packages/colorama-0.4.6.dist-info/INSTALLER new file mode 100644 index 00000000..a1b589e3 --- /dev/null +++ b/.venv/Lib/site-packages/colorama-0.4.6.dist-info/INSTALLER @@ -0,0 +1 @@ +pip diff --git a/.venv/Lib/site-packages/colorama-0.4.6.dist-info/METADATA b/.venv/Lib/site-packages/colorama-0.4.6.dist-info/METADATA new file mode 100644 index 00000000..a1b5c575 --- /dev/null +++ b/.venv/Lib/site-packages/colorama-0.4.6.dist-info/METADATA @@ -0,0 +1,441 @@ +Metadata-Version: 2.1 +Name: colorama +Version: 0.4.6 +Summary: Cross-platform colored terminal text. +Project-URL: Homepage, https://github.com/tartley/colorama +Author-email: Jonathan Hartley +License-File: LICENSE.txt +Keywords: ansi,color,colour,crossplatform,terminal,text,windows,xplatform +Classifier: Development Status :: 5 - Production/Stable +Classifier: Environment :: Console +Classifier: Intended Audience :: Developers +Classifier: License :: OSI Approved :: BSD License +Classifier: Operating System :: OS Independent +Classifier: Programming Language :: Python +Classifier: Programming Language :: Python :: 2 +Classifier: Programming Language :: Python :: 2.7 +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: 3.7 +Classifier: Programming Language :: Python :: 3.8 +Classifier: Programming Language :: Python :: 3.9 +Classifier: Programming Language :: Python :: 3.10 +Classifier: Programming Language :: Python :: Implementation :: CPython +Classifier: Programming Language :: Python :: Implementation :: PyPy +Classifier: Topic :: Terminals +Requires-Python: !=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7 +Description-Content-Type: text/x-rst + +.. image:: https://img.shields.io/pypi/v/colorama.svg + :target: https://pypi.org/project/colorama/ + :alt: Latest Version + +.. image:: https://img.shields.io/pypi/pyversions/colorama.svg + :target: https://pypi.org/project/colorama/ + :alt: Supported Python versions + +.. image:: https://github.com/tartley/colorama/actions/workflows/test.yml/badge.svg + :target: https://github.com/tartley/colorama/actions/workflows/test.yml + :alt: Build Status + +Colorama +======== + +Makes ANSI escape character sequences (for producing colored terminal text and +cursor positioning) work under MS Windows. + +.. |donate| image:: https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif + :target: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=2MZ9D2GMLYCUJ&item_name=Colorama¤cy_code=USD + :alt: Donate with Paypal + +`PyPI for releases `_ | +`Github for source `_ | +`Colorama for enterprise on Tidelift `_ + +If you find Colorama useful, please |donate| to the authors. Thank you! + +Installation +------------ + +Tested on CPython 2.7, 3.7, 3.8, 3.9 and 3.10 and Pypy 2.7 and 3.8. + +No requirements other than the standard library. + +.. code-block:: bash + + pip install colorama + # or + conda install -c anaconda colorama + +Description +----------- + +ANSI escape character sequences have long been used to produce colored terminal +text and cursor positioning on Unix and Macs. Colorama makes this work on +Windows, too, by wrapping ``stdout``, stripping ANSI sequences it finds (which +would appear as gobbledygook in the output), and converting them into the +appropriate win32 calls to modify the state of the terminal. On other platforms, +Colorama does nothing. + +This has the upshot of providing a simple cross-platform API for printing +colored terminal text from Python, and has the happy side-effect that existing +applications or libraries which use ANSI sequences to produce colored output on +Linux or Macs can now also work on Windows, simply by calling +``colorama.just_fix_windows_console()`` (since v0.4.6) or ``colorama.init()`` +(all versions, but may have other side-effects – see below). + +An alternative approach is to install ``ansi.sys`` on Windows machines, which +provides the same behaviour for all applications running in terminals. Colorama +is intended for situations where that isn't easy (e.g., maybe your app doesn't +have an installer.) + +Demo scripts in the source code repository print some colored text using +ANSI sequences. Compare their output under Gnome-terminal's built in ANSI +handling, versus on Windows Command-Prompt using Colorama: + +.. image:: https://github.com/tartley/colorama/raw/master/screenshots/ubuntu-demo.png + :width: 661 + :height: 357 + :alt: ANSI sequences on Ubuntu under gnome-terminal. + +.. image:: https://github.com/tartley/colorama/raw/master/screenshots/windows-demo.png + :width: 668 + :height: 325 + :alt: Same ANSI sequences on Windows, using Colorama. + +These screenshots show that, on Windows, Colorama does not support ANSI 'dim +text'; it looks the same as 'normal text'. + +Usage +----- + +Initialisation +.............. + +If the only thing you want from Colorama is to get ANSI escapes to work on +Windows, then run: + +.. code-block:: python + + from colorama import just_fix_windows_console + just_fix_windows_console() + +If you're on a recent version of Windows 10 or better, and your stdout/stderr +are pointing to a Windows console, then this will flip the magic configuration +switch to enable Windows' built-in ANSI support. + +If you're on an older version of Windows, and your stdout/stderr are pointing to +a Windows console, then this will wrap ``sys.stdout`` and/or ``sys.stderr`` in a +magic file object that intercepts ANSI escape sequences and issues the +appropriate Win32 calls to emulate them. + +In all other circumstances, it does nothing whatsoever. Basically the idea is +that this makes Windows act like Unix with respect to ANSI escape handling. + +It's safe to call this function multiple times. It's safe to call this function +on non-Windows platforms, but it won't do anything. It's safe to call this +function when one or both of your stdout/stderr are redirected to a file – it +won't do anything to those streams. + +Alternatively, you can use the older interface with more features (but also more +potential footguns): + +.. code-block:: python + + from colorama import init + init() + +This does the same thing as ``just_fix_windows_console``, except for the +following differences: + +- It's not safe to call ``init`` multiple times; you can end up with multiple + layers of wrapping and broken ANSI support. + +- Colorama will apply a heuristic to guess whether stdout/stderr support ANSI, + and if it thinks they don't, then it will wrap ``sys.stdout`` and + ``sys.stderr`` in a magic file object that strips out ANSI escape sequences + before printing them. This happens on all platforms, and can be convenient if + you want to write your code to emit ANSI escape sequences unconditionally, and + let Colorama decide whether they should actually be output. But note that + Colorama's heuristic is not particularly clever. + +- ``init`` also accepts explicit keyword args to enable/disable various + functionality – see below. + +To stop using Colorama before your program exits, simply call ``deinit()``. +This will restore ``stdout`` and ``stderr`` to their original values, so that +Colorama is disabled. To resume using Colorama again, call ``reinit()``; it is +cheaper than calling ``init()`` again (but does the same thing). + +Most users should depend on ``colorama >= 0.4.6``, and use +``just_fix_windows_console``. The old ``init`` interface will be supported +indefinitely for backwards compatibility, but we don't plan to fix any issues +with it, also for backwards compatibility. + +Colored Output +.............. + +Cross-platform printing of colored text can then be done using Colorama's +constant shorthand for ANSI escape sequences. These are deliberately +rudimentary, see below. + +.. code-block:: python + + from colorama import Fore, Back, Style + print(Fore.RED + 'some red text') + print(Back.GREEN + 'and with a green background') + print(Style.DIM + 'and in dim text') + print(Style.RESET_ALL) + print('back to normal now') + +...or simply by manually printing ANSI sequences from your own code: + +.. code-block:: python + + print('\033[31m' + 'some red text') + print('\033[39m') # and reset to default color + +...or, Colorama can be used in conjunction with existing ANSI libraries +such as the venerable `Termcolor `_ +the fabulous `Blessings `_, +or the incredible `_Rich `_. + +If you wish Colorama's Fore, Back and Style constants were more capable, +then consider using one of the above highly capable libraries to generate +colors, etc, and use Colorama just for its primary purpose: to convert +those ANSI sequences to also work on Windows: + +SIMILARLY, do not send PRs adding the generation of new ANSI types to Colorama. +We are only interested in converting ANSI codes to win32 API calls, not +shortcuts like the above to generate ANSI characters. + +.. code-block:: python + + from colorama import just_fix_windows_console + from termcolor import colored + + # use Colorama to make Termcolor work on Windows too + just_fix_windows_console() + + # then use Termcolor for all colored text output + print(colored('Hello, World!', 'green', 'on_red')) + +Available formatting constants are:: + + Fore: BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE, RESET. + Back: BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE, RESET. + Style: DIM, NORMAL, BRIGHT, RESET_ALL + +``Style.RESET_ALL`` resets foreground, background, and brightness. Colorama will +perform this reset automatically on program exit. + +These are fairly well supported, but not part of the standard:: + + Fore: LIGHTBLACK_EX, LIGHTRED_EX, LIGHTGREEN_EX, LIGHTYELLOW_EX, LIGHTBLUE_EX, LIGHTMAGENTA_EX, LIGHTCYAN_EX, LIGHTWHITE_EX + Back: LIGHTBLACK_EX, LIGHTRED_EX, LIGHTGREEN_EX, LIGHTYELLOW_EX, LIGHTBLUE_EX, LIGHTMAGENTA_EX, LIGHTCYAN_EX, LIGHTWHITE_EX + +Cursor Positioning +.................. + +ANSI codes to reposition the cursor are supported. See ``demos/demo06.py`` for +an example of how to generate them. + +Init Keyword Args +................. + +``init()`` accepts some ``**kwargs`` to override default behaviour. + +init(autoreset=False): + If you find yourself repeatedly sending reset sequences to turn off color + changes at the end of every print, then ``init(autoreset=True)`` will + automate that: + + .. code-block:: python + + from colorama import init + init(autoreset=True) + print(Fore.RED + 'some red text') + print('automatically back to default color again') + +init(strip=None): + Pass ``True`` or ``False`` to override whether ANSI codes should be + stripped from the output. The default behaviour is to strip if on Windows + or if output is redirected (not a tty). + +init(convert=None): + Pass ``True`` or ``False`` to override whether to convert ANSI codes in the + output into win32 calls. The default behaviour is to convert if on Windows + and output is to a tty (terminal). + +init(wrap=True): + On Windows, Colorama works by replacing ``sys.stdout`` and ``sys.stderr`` + with proxy objects, which override the ``.write()`` method to do their work. + If this wrapping causes you problems, then this can be disabled by passing + ``init(wrap=False)``. The default behaviour is to wrap if ``autoreset`` or + ``strip`` or ``convert`` are True. + + When wrapping is disabled, colored printing on non-Windows platforms will + continue to work as normal. To do cross-platform colored output, you can + use Colorama's ``AnsiToWin32`` proxy directly: + + .. code-block:: python + + import sys + from colorama import init, AnsiToWin32 + init(wrap=False) + stream = AnsiToWin32(sys.stderr).stream + + # Python 2 + print >>stream, Fore.BLUE + 'blue text on stderr' + + # Python 3 + print(Fore.BLUE + 'blue text on stderr', file=stream) + +Recognised ANSI Sequences +......................... + +ANSI sequences generally take the form:: + + ESC [ ; ... + +Where ```` is an integer, and ```` is a single letter. Zero or +more params are passed to a ````. If no params are passed, it is +generally synonymous with passing a single zero. No spaces exist in the +sequence; they have been inserted here simply to read more easily. + +The only ANSI sequences that Colorama converts into win32 calls are:: + + ESC [ 0 m # reset all (colors and brightness) + ESC [ 1 m # bright + ESC [ 2 m # dim (looks same as normal brightness) + ESC [ 22 m # normal brightness + + # FOREGROUND: + ESC [ 30 m # black + ESC [ 31 m # red + ESC [ 32 m # green + ESC [ 33 m # yellow + ESC [ 34 m # blue + ESC [ 35 m # magenta + ESC [ 36 m # cyan + ESC [ 37 m # white + ESC [ 39 m # reset + + # BACKGROUND + ESC [ 40 m # black + ESC [ 41 m # red + ESC [ 42 m # green + ESC [ 43 m # yellow + ESC [ 44 m # blue + ESC [ 45 m # magenta + ESC [ 46 m # cyan + ESC [ 47 m # white + ESC [ 49 m # reset + + # cursor positioning + ESC [ y;x H # position cursor at x across, y down + ESC [ y;x f # position cursor at x across, y down + ESC [ n A # move cursor n lines up + ESC [ n B # move cursor n lines down + ESC [ n C # move cursor n characters forward + ESC [ n D # move cursor n characters backward + + # clear the screen + ESC [ mode J # clear the screen + + # clear the line + ESC [ mode K # clear the line + +Multiple numeric params to the ``'m'`` command can be combined into a single +sequence:: + + ESC [ 36 ; 45 ; 1 m # bright cyan text on magenta background + +All other ANSI sequences of the form ``ESC [ ; ... `` +are silently stripped from the output on Windows. + +Any other form of ANSI sequence, such as single-character codes or alternative +initial characters, are not recognised or stripped. It would be cool to add +them though. Let me know if it would be useful for you, via the Issues on +GitHub. + +Status & Known Problems +----------------------- + +I've personally only tested it on Windows XP (CMD, Console2), Ubuntu +(gnome-terminal, xterm), and OS X. + +Some valid ANSI sequences aren't recognised. + +If you're hacking on the code, see `README-hacking.md`_. ESPECIALLY, see the +explanation there of why we do not want PRs that allow Colorama to generate new +types of ANSI codes. + +See outstanding issues and wish-list: +https://github.com/tartley/colorama/issues + +If anything doesn't work for you, or doesn't do what you expected or hoped for, +I'd love to hear about it on that issues list, would be delighted by patches, +and would be happy to grant commit access to anyone who submits a working patch +or two. + +.. _README-hacking.md: README-hacking.md + +License +------- + +Copyright Jonathan Hartley & Arnon Yaari, 2013-2020. BSD 3-Clause license; see +LICENSE file. + +Professional support +-------------------- + +.. |tideliftlogo| image:: https://cdn2.hubspot.net/hubfs/4008838/website/logos/logos_for_download/Tidelift_primary-shorthand-logo.png + :alt: Tidelift + :target: https://tidelift.com/subscription/pkg/pypi-colorama?utm_source=pypi-colorama&utm_medium=referral&utm_campaign=readme + +.. list-table:: + :widths: 10 100 + + * - |tideliftlogo| + - Professional support for colorama is available as part of the + `Tidelift Subscription`_. + Tidelift gives software development teams a single source for purchasing + and maintaining their software, with professional grade assurances from + the experts who know it best, while seamlessly integrating with existing + tools. + +.. _Tidelift Subscription: https://tidelift.com/subscription/pkg/pypi-colorama?utm_source=pypi-colorama&utm_medium=referral&utm_campaign=readme + +Thanks +------ + +See the CHANGELOG for more thanks! + +* Marc Schlaich (schlamar) for a ``setup.py`` fix for Python2.5. +* Marc Abramowitz, reported & fixed a crash on exit with closed ``stdout``, + providing a solution to issue #7's setuptools/distutils debate, + and other fixes. +* User 'eryksun', for guidance on correctly instantiating ``ctypes.windll``. +* Matthew McCormick for politely pointing out a longstanding crash on non-Win. +* Ben Hoyt, for a magnificent fix under 64-bit Windows. +* Jesse at Empty Square for submitting a fix for examples in the README. +* User 'jamessp', an observant documentation fix for cursor positioning. +* User 'vaal1239', Dave Mckee & Lackner Kristof for a tiny but much-needed Win7 + fix. +* Julien Stuyck, for wisely suggesting Python3 compatible updates to README. +* Daniel Griffith for multiple fabulous patches. +* Oscar Lesta for a valuable fix to stop ANSI chars being sent to non-tty + output. +* Roger Binns, for many suggestions, valuable feedback, & bug reports. +* Tim Golden for thought and much appreciated feedback on the initial idea. +* User 'Zearin' for updates to the README file. +* John Szakmeister for adding support for light colors +* Charles Merriam for adding documentation to demos +* Jurko for a fix on 64-bit Windows CPython2.5 w/o ctypes +* Florian Bruhin for a fix when stdout or stderr are None +* Thomas Weininger for fixing ValueError on Windows +* Remi Rampin for better Github integration and fixes to the README file +* Simeon Visser for closing a file handle using 'with' and updating classifiers + to include Python 3.3 and 3.4 +* Andy Neff for fixing RESET of LIGHT_EX colors. +* Jonathan Hartley for the initial idea and implementation. diff --git a/.venv/Lib/site-packages/colorama-0.4.6.dist-info/RECORD b/.venv/Lib/site-packages/colorama-0.4.6.dist-info/RECORD new file mode 100644 index 00000000..cd6b130d --- /dev/null +++ b/.venv/Lib/site-packages/colorama-0.4.6.dist-info/RECORD @@ -0,0 +1,31 @@ +colorama-0.4.6.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +colorama-0.4.6.dist-info/METADATA,sha256=e67SnrUMOym9sz_4TjF3vxvAV4T3aF7NyqRHHH3YEMw,17158 +colorama-0.4.6.dist-info/RECORD,, +colorama-0.4.6.dist-info/WHEEL,sha256=cdcF4Fbd0FPtw2EMIOwH-3rSOTUdTCeOSXRMD1iLUb8,105 +colorama-0.4.6.dist-info/licenses/LICENSE.txt,sha256=ysNcAmhuXQSlpxQL-zs25zrtSWZW6JEQLkKIhteTAxg,1491 +colorama/__init__.py,sha256=wePQA4U20tKgYARySLEC047ucNX-g8pRLpYBuiHlLb8,266 +colorama/__pycache__/__init__.cpython-312.pyc,, +colorama/__pycache__/ansi.cpython-312.pyc,, +colorama/__pycache__/ansitowin32.cpython-312.pyc,, +colorama/__pycache__/initialise.cpython-312.pyc,, +colorama/__pycache__/win32.cpython-312.pyc,, +colorama/__pycache__/winterm.cpython-312.pyc,, +colorama/ansi.py,sha256=Top4EeEuaQdBWdteKMEcGOTeKeF19Q-Wo_6_Cj5kOzQ,2522 +colorama/ansitowin32.py,sha256=vPNYa3OZbxjbuFyaVo0Tmhmy1FZ1lKMWCnT7odXpItk,11128 +colorama/initialise.py,sha256=-hIny86ClXo39ixh5iSCfUIa2f_h_bgKRDW7gqs-KLU,3325 +colorama/tests/__init__.py,sha256=MkgPAEzGQd-Rq0w0PZXSX2LadRWhUECcisJY8lSrm4Q,75 +colorama/tests/__pycache__/__init__.cpython-312.pyc,, +colorama/tests/__pycache__/ansi_test.cpython-312.pyc,, +colorama/tests/__pycache__/ansitowin32_test.cpython-312.pyc,, +colorama/tests/__pycache__/initialise_test.cpython-312.pyc,, +colorama/tests/__pycache__/isatty_test.cpython-312.pyc,, +colorama/tests/__pycache__/utils.cpython-312.pyc,, +colorama/tests/__pycache__/winterm_test.cpython-312.pyc,, +colorama/tests/ansi_test.py,sha256=FeViDrUINIZcr505PAxvU4AjXz1asEiALs9GXMhwRaE,2839 +colorama/tests/ansitowin32_test.py,sha256=RN7AIhMJ5EqDsYaCjVo-o4u8JzDD4ukJbmevWKS70rY,10678 +colorama/tests/initialise_test.py,sha256=BbPy-XfyHwJ6zKozuQOvNvQZzsx9vdb_0bYXn7hsBTc,6741 +colorama/tests/isatty_test.py,sha256=Pg26LRpv0yQDB5Ac-sxgVXG7hsA1NYvapFgApZfYzZg,1866 +colorama/tests/utils.py,sha256=1IIRylG39z5-dzq09R_ngufxyPZxgldNbrxKxUGwGKE,1079 +colorama/tests/winterm_test.py,sha256=qoWFPEjym5gm2RuMwpf3pOis3a5r_PJZFCzK254JL8A,3709 +colorama/win32.py,sha256=YQOKwMTwtGBbsY4dL5HYTvwTeP9wIQra5MvPNddpxZs,6181 +colorama/winterm.py,sha256=XCQFDHjPi6AHYNdZwy0tA02H-Jh48Jp-HvCjeLeLp3U,7134 diff --git a/.venv/Lib/site-packages/colorama-0.4.6.dist-info/WHEEL b/.venv/Lib/site-packages/colorama-0.4.6.dist-info/WHEEL new file mode 100644 index 00000000..d79189fd --- /dev/null +++ b/.venv/Lib/site-packages/colorama-0.4.6.dist-info/WHEEL @@ -0,0 +1,5 @@ +Wheel-Version: 1.0 +Generator: hatchling 1.11.1 +Root-Is-Purelib: true +Tag: py2-none-any +Tag: py3-none-any diff --git a/.venv/Lib/site-packages/colorama-0.4.6.dist-info/licenses/LICENSE.txt b/.venv/Lib/site-packages/colorama-0.4.6.dist-info/licenses/LICENSE.txt new file mode 100644 index 00000000..3105888e --- /dev/null +++ b/.venv/Lib/site-packages/colorama-0.4.6.dist-info/licenses/LICENSE.txt @@ -0,0 +1,27 @@ +Copyright (c) 2010 Jonathan Hartley +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of the copyright holders, nor those of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/.venv/Lib/site-packages/colorama/__init__.py b/.venv/Lib/site-packages/colorama/__init__.py new file mode 100644 index 00000000..383101cd --- /dev/null +++ b/.venv/Lib/site-packages/colorama/__init__.py @@ -0,0 +1,7 @@ +# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. +from .initialise import init, deinit, reinit, colorama_text, just_fix_windows_console +from .ansi import Fore, Back, Style, Cursor +from .ansitowin32 import AnsiToWin32 + +__version__ = '0.4.6' + diff --git a/.venv/Lib/site-packages/colorama/ansi.py b/.venv/Lib/site-packages/colorama/ansi.py new file mode 100644 index 00000000..11ec695f --- /dev/null +++ b/.venv/Lib/site-packages/colorama/ansi.py @@ -0,0 +1,102 @@ +# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. +''' +This module generates ANSI character codes to printing colors to terminals. +See: http://en.wikipedia.org/wiki/ANSI_escape_code +''' + +CSI = '\033[' +OSC = '\033]' +BEL = '\a' + + +def code_to_chars(code): + return CSI + str(code) + 'm' + +def set_title(title): + return OSC + '2;' + title + BEL + +def clear_screen(mode=2): + return CSI + str(mode) + 'J' + +def clear_line(mode=2): + return CSI + str(mode) + 'K' + + +class AnsiCodes(object): + def __init__(self): + # the subclasses declare class attributes which are numbers. + # Upon instantiation we define instance attributes, which are the same + # as the class attributes but wrapped with the ANSI escape sequence + for name in dir(self): + if not name.startswith('_'): + value = getattr(self, name) + setattr(self, name, code_to_chars(value)) + + +class AnsiCursor(object): + def UP(self, n=1): + return CSI + str(n) + 'A' + def DOWN(self, n=1): + return CSI + str(n) + 'B' + def FORWARD(self, n=1): + return CSI + str(n) + 'C' + def BACK(self, n=1): + return CSI + str(n) + 'D' + def POS(self, x=1, y=1): + return CSI + str(y) + ';' + str(x) + 'H' + + +class AnsiFore(AnsiCodes): + BLACK = 30 + RED = 31 + GREEN = 32 + YELLOW = 33 + BLUE = 34 + MAGENTA = 35 + CYAN = 36 + WHITE = 37 + RESET = 39 + + # These are fairly well supported, but not part of the standard. + LIGHTBLACK_EX = 90 + LIGHTRED_EX = 91 + LIGHTGREEN_EX = 92 + LIGHTYELLOW_EX = 93 + LIGHTBLUE_EX = 94 + LIGHTMAGENTA_EX = 95 + LIGHTCYAN_EX = 96 + LIGHTWHITE_EX = 97 + + +class AnsiBack(AnsiCodes): + BLACK = 40 + RED = 41 + GREEN = 42 + YELLOW = 43 + BLUE = 44 + MAGENTA = 45 + CYAN = 46 + WHITE = 47 + RESET = 49 + + # These are fairly well supported, but not part of the standard. + LIGHTBLACK_EX = 100 + LIGHTRED_EX = 101 + LIGHTGREEN_EX = 102 + LIGHTYELLOW_EX = 103 + LIGHTBLUE_EX = 104 + LIGHTMAGENTA_EX = 105 + LIGHTCYAN_EX = 106 + LIGHTWHITE_EX = 107 + + +class AnsiStyle(AnsiCodes): + BRIGHT = 1 + DIM = 2 + NORMAL = 22 + RESET_ALL = 0 + +Fore = AnsiFore() +Back = AnsiBack() +Style = AnsiStyle() +Cursor = AnsiCursor() diff --git a/.venv/Lib/site-packages/colorama/ansitowin32.py b/.venv/Lib/site-packages/colorama/ansitowin32.py new file mode 100644 index 00000000..abf209e6 --- /dev/null +++ b/.venv/Lib/site-packages/colorama/ansitowin32.py @@ -0,0 +1,277 @@ +# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. +import re +import sys +import os + +from .ansi import AnsiFore, AnsiBack, AnsiStyle, Style, BEL +from .winterm import enable_vt_processing, WinTerm, WinColor, WinStyle +from .win32 import windll, winapi_test + + +winterm = None +if windll is not None: + winterm = WinTerm() + + +class StreamWrapper(object): + ''' + Wraps a stream (such as stdout), acting as a transparent proxy for all + attribute access apart from method 'write()', which is delegated to our + Converter instance. + ''' + def __init__(self, wrapped, converter): + # double-underscore everything to prevent clashes with names of + # attributes on the wrapped stream object. + self.__wrapped = wrapped + self.__convertor = converter + + def __getattr__(self, name): + return getattr(self.__wrapped, name) + + def __enter__(self, *args, **kwargs): + # special method lookup bypasses __getattr__/__getattribute__, see + # https://stackoverflow.com/questions/12632894/why-doesnt-getattr-work-with-exit + # thus, contextlib magic methods are not proxied via __getattr__ + return self.__wrapped.__enter__(*args, **kwargs) + + def __exit__(self, *args, **kwargs): + return self.__wrapped.__exit__(*args, **kwargs) + + def __setstate__(self, state): + self.__dict__ = state + + def __getstate__(self): + return self.__dict__ + + def write(self, text): + self.__convertor.write(text) + + def isatty(self): + stream = self.__wrapped + if 'PYCHARM_HOSTED' in os.environ: + if stream is not None and (stream is sys.__stdout__ or stream is sys.__stderr__): + return True + try: + stream_isatty = stream.isatty + except AttributeError: + return False + else: + return stream_isatty() + + @property + def closed(self): + stream = self.__wrapped + try: + return stream.closed + # AttributeError in the case that the stream doesn't support being closed + # ValueError for the case that the stream has already been detached when atexit runs + except (AttributeError, ValueError): + return True + + +class AnsiToWin32(object): + ''' + Implements a 'write()' method which, on Windows, will strip ANSI character + sequences from the text, and if outputting to a tty, will convert them into + win32 function calls. + ''' + ANSI_CSI_RE = re.compile('\001?\033\\[((?:\\d|;)*)([a-zA-Z])\002?') # Control Sequence Introducer + ANSI_OSC_RE = re.compile('\001?\033\\]([^\a]*)(\a)\002?') # Operating System Command + + def __init__(self, wrapped, convert=None, strip=None, autoreset=False): + # The wrapped stream (normally sys.stdout or sys.stderr) + self.wrapped = wrapped + + # should we reset colors to defaults after every .write() + self.autoreset = autoreset + + # create the proxy wrapping our output stream + self.stream = StreamWrapper(wrapped, self) + + on_windows = os.name == 'nt' + # We test if the WinAPI works, because even if we are on Windows + # we may be using a terminal that doesn't support the WinAPI + # (e.g. Cygwin Terminal). In this case it's up to the terminal + # to support the ANSI codes. + conversion_supported = on_windows and winapi_test() + try: + fd = wrapped.fileno() + except Exception: + fd = -1 + system_has_native_ansi = not on_windows or enable_vt_processing(fd) + have_tty = not self.stream.closed and self.stream.isatty() + need_conversion = conversion_supported and not system_has_native_ansi + + # should we strip ANSI sequences from our output? + if strip is None: + strip = need_conversion or not have_tty + self.strip = strip + + # should we should convert ANSI sequences into win32 calls? + if convert is None: + convert = need_conversion and have_tty + self.convert = convert + + # dict of ansi codes to win32 functions and parameters + self.win32_calls = self.get_win32_calls() + + # are we wrapping stderr? + self.on_stderr = self.wrapped is sys.stderr + + def should_wrap(self): + ''' + True if this class is actually needed. If false, then the output + stream will not be affected, nor will win32 calls be issued, so + wrapping stdout is not actually required. This will generally be + False on non-Windows platforms, unless optional functionality like + autoreset has been requested using kwargs to init() + ''' + return self.convert or self.strip or self.autoreset + + def get_win32_calls(self): + if self.convert and winterm: + return { + AnsiStyle.RESET_ALL: (winterm.reset_all, ), + AnsiStyle.BRIGHT: (winterm.style, WinStyle.BRIGHT), + AnsiStyle.DIM: (winterm.style, WinStyle.NORMAL), + AnsiStyle.NORMAL: (winterm.style, WinStyle.NORMAL), + AnsiFore.BLACK: (winterm.fore, WinColor.BLACK), + AnsiFore.RED: (winterm.fore, WinColor.RED), + AnsiFore.GREEN: (winterm.fore, WinColor.GREEN), + AnsiFore.YELLOW: (winterm.fore, WinColor.YELLOW), + AnsiFore.BLUE: (winterm.fore, WinColor.BLUE), + AnsiFore.MAGENTA: (winterm.fore, WinColor.MAGENTA), + AnsiFore.CYAN: (winterm.fore, WinColor.CYAN), + AnsiFore.WHITE: (winterm.fore, WinColor.GREY), + AnsiFore.RESET: (winterm.fore, ), + AnsiFore.LIGHTBLACK_EX: (winterm.fore, WinColor.BLACK, True), + AnsiFore.LIGHTRED_EX: (winterm.fore, WinColor.RED, True), + AnsiFore.LIGHTGREEN_EX: (winterm.fore, WinColor.GREEN, True), + AnsiFore.LIGHTYELLOW_EX: (winterm.fore, WinColor.YELLOW, True), + AnsiFore.LIGHTBLUE_EX: (winterm.fore, WinColor.BLUE, True), + AnsiFore.LIGHTMAGENTA_EX: (winterm.fore, WinColor.MAGENTA, True), + AnsiFore.LIGHTCYAN_EX: (winterm.fore, WinColor.CYAN, True), + AnsiFore.LIGHTWHITE_EX: (winterm.fore, WinColor.GREY, True), + AnsiBack.BLACK: (winterm.back, WinColor.BLACK), + AnsiBack.RED: (winterm.back, WinColor.RED), + AnsiBack.GREEN: (winterm.back, WinColor.GREEN), + AnsiBack.YELLOW: (winterm.back, WinColor.YELLOW), + AnsiBack.BLUE: (winterm.back, WinColor.BLUE), + AnsiBack.MAGENTA: (winterm.back, WinColor.MAGENTA), + AnsiBack.CYAN: (winterm.back, WinColor.CYAN), + AnsiBack.WHITE: (winterm.back, WinColor.GREY), + AnsiBack.RESET: (winterm.back, ), + AnsiBack.LIGHTBLACK_EX: (winterm.back, WinColor.BLACK, True), + AnsiBack.LIGHTRED_EX: (winterm.back, WinColor.RED, True), + AnsiBack.LIGHTGREEN_EX: (winterm.back, WinColor.GREEN, True), + AnsiBack.LIGHTYELLOW_EX: (winterm.back, WinColor.YELLOW, True), + AnsiBack.LIGHTBLUE_EX: (winterm.back, WinColor.BLUE, True), + AnsiBack.LIGHTMAGENTA_EX: (winterm.back, WinColor.MAGENTA, True), + AnsiBack.LIGHTCYAN_EX: (winterm.back, WinColor.CYAN, True), + AnsiBack.LIGHTWHITE_EX: (winterm.back, WinColor.GREY, True), + } + return dict() + + def write(self, text): + if self.strip or self.convert: + self.write_and_convert(text) + else: + self.wrapped.write(text) + self.wrapped.flush() + if self.autoreset: + self.reset_all() + + + def reset_all(self): + if self.convert: + self.call_win32('m', (0,)) + elif not self.strip and not self.stream.closed: + self.wrapped.write(Style.RESET_ALL) + + + def write_and_convert(self, text): + ''' + Write the given text to our wrapped stream, stripping any ANSI + sequences from the text, and optionally converting them into win32 + calls. + ''' + cursor = 0 + text = self.convert_osc(text) + for match in self.ANSI_CSI_RE.finditer(text): + start, end = match.span() + self.write_plain_text(text, cursor, start) + self.convert_ansi(*match.groups()) + cursor = end + self.write_plain_text(text, cursor, len(text)) + + + def write_plain_text(self, text, start, end): + if start < end: + self.wrapped.write(text[start:end]) + self.wrapped.flush() + + + def convert_ansi(self, paramstring, command): + if self.convert: + params = self.extract_params(command, paramstring) + self.call_win32(command, params) + + + def extract_params(self, command, paramstring): + if command in 'Hf': + params = tuple(int(p) if len(p) != 0 else 1 for p in paramstring.split(';')) + while len(params) < 2: + # defaults: + params = params + (1,) + else: + params = tuple(int(p) for p in paramstring.split(';') if len(p) != 0) + if len(params) == 0: + # defaults: + if command in 'JKm': + params = (0,) + elif command in 'ABCD': + params = (1,) + + return params + + + def call_win32(self, command, params): + if command == 'm': + for param in params: + if param in self.win32_calls: + func_args = self.win32_calls[param] + func = func_args[0] + args = func_args[1:] + kwargs = dict(on_stderr=self.on_stderr) + func(*args, **kwargs) + elif command in 'J': + winterm.erase_screen(params[0], on_stderr=self.on_stderr) + elif command in 'K': + winterm.erase_line(params[0], on_stderr=self.on_stderr) + elif command in 'Hf': # cursor position - absolute + winterm.set_cursor_position(params, on_stderr=self.on_stderr) + elif command in 'ABCD': # cursor position - relative + n = params[0] + # A - up, B - down, C - forward, D - back + x, y = {'A': (0, -n), 'B': (0, n), 'C': (n, 0), 'D': (-n, 0)}[command] + winterm.cursor_adjust(x, y, on_stderr=self.on_stderr) + + + def convert_osc(self, text): + for match in self.ANSI_OSC_RE.finditer(text): + start, end = match.span() + text = text[:start] + text[end:] + paramstring, command = match.groups() + if command == BEL: + if paramstring.count(";") == 1: + params = paramstring.split(";") + # 0 - change title and icon (we will only change title) + # 1 - change icon (we don't support this) + # 2 - change title + if params[0] in '02': + winterm.set_title(params[1]) + return text + + + def flush(self): + self.wrapped.flush() diff --git a/.venv/Lib/site-packages/colorama/initialise.py b/.venv/Lib/site-packages/colorama/initialise.py new file mode 100644 index 00000000..d5fd4b71 --- /dev/null +++ b/.venv/Lib/site-packages/colorama/initialise.py @@ -0,0 +1,121 @@ +# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. +import atexit +import contextlib +import sys + +from .ansitowin32 import AnsiToWin32 + + +def _wipe_internal_state_for_tests(): + global orig_stdout, orig_stderr + orig_stdout = None + orig_stderr = None + + global wrapped_stdout, wrapped_stderr + wrapped_stdout = None + wrapped_stderr = None + + global atexit_done + atexit_done = False + + global fixed_windows_console + fixed_windows_console = False + + try: + # no-op if it wasn't registered + atexit.unregister(reset_all) + except AttributeError: + # python 2: no atexit.unregister. Oh well, we did our best. + pass + + +def reset_all(): + if AnsiToWin32 is not None: # Issue #74: objects might become None at exit + AnsiToWin32(orig_stdout).reset_all() + + +def init(autoreset=False, convert=None, strip=None, wrap=True): + + if not wrap and any([autoreset, convert, strip]): + raise ValueError('wrap=False conflicts with any other arg=True') + + global wrapped_stdout, wrapped_stderr + global orig_stdout, orig_stderr + + orig_stdout = sys.stdout + orig_stderr = sys.stderr + + if sys.stdout is None: + wrapped_stdout = None + else: + sys.stdout = wrapped_stdout = \ + wrap_stream(orig_stdout, convert, strip, autoreset, wrap) + if sys.stderr is None: + wrapped_stderr = None + else: + sys.stderr = wrapped_stderr = \ + wrap_stream(orig_stderr, convert, strip, autoreset, wrap) + + global atexit_done + if not atexit_done: + atexit.register(reset_all) + atexit_done = True + + +def deinit(): + if orig_stdout is not None: + sys.stdout = orig_stdout + if orig_stderr is not None: + sys.stderr = orig_stderr + + +def just_fix_windows_console(): + global fixed_windows_console + + if sys.platform != "win32": + return + if fixed_windows_console: + return + if wrapped_stdout is not None or wrapped_stderr is not None: + # Someone already ran init() and it did stuff, so we won't second-guess them + return + + # On newer versions of Windows, AnsiToWin32.__init__ will implicitly enable the + # native ANSI support in the console as a side-effect. We only need to actually + # replace sys.stdout/stderr if we're in the old-style conversion mode. + new_stdout = AnsiToWin32(sys.stdout, convert=None, strip=None, autoreset=False) + if new_stdout.convert: + sys.stdout = new_stdout + new_stderr = AnsiToWin32(sys.stderr, convert=None, strip=None, autoreset=False) + if new_stderr.convert: + sys.stderr = new_stderr + + fixed_windows_console = True + +@contextlib.contextmanager +def colorama_text(*args, **kwargs): + init(*args, **kwargs) + try: + yield + finally: + deinit() + + +def reinit(): + if wrapped_stdout is not None: + sys.stdout = wrapped_stdout + if wrapped_stderr is not None: + sys.stderr = wrapped_stderr + + +def wrap_stream(stream, convert, strip, autoreset, wrap): + if wrap: + wrapper = AnsiToWin32(stream, + convert=convert, strip=strip, autoreset=autoreset) + if wrapper.should_wrap(): + stream = wrapper.stream + return stream + + +# Use this for initial setup as well, to reduce code duplication +_wipe_internal_state_for_tests() diff --git a/.venv/Lib/site-packages/colorama/tests/__init__.py b/.venv/Lib/site-packages/colorama/tests/__init__.py new file mode 100644 index 00000000..8c5661e9 --- /dev/null +++ b/.venv/Lib/site-packages/colorama/tests/__init__.py @@ -0,0 +1 @@ +# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. diff --git a/.venv/Lib/site-packages/colorama/tests/ansi_test.py b/.venv/Lib/site-packages/colorama/tests/ansi_test.py new file mode 100644 index 00000000..0a20c80f --- /dev/null +++ b/.venv/Lib/site-packages/colorama/tests/ansi_test.py @@ -0,0 +1,76 @@ +# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. +import sys +from unittest import TestCase, main + +from ..ansi import Back, Fore, Style +from ..ansitowin32 import AnsiToWin32 + +stdout_orig = sys.stdout +stderr_orig = sys.stderr + + +class AnsiTest(TestCase): + + def setUp(self): + # sanity check: stdout should be a file or StringIO object. + # It will only be AnsiToWin32 if init() has previously wrapped it + self.assertNotEqual(type(sys.stdout), AnsiToWin32) + self.assertNotEqual(type(sys.stderr), AnsiToWin32) + + def tearDown(self): + sys.stdout = stdout_orig + sys.stderr = stderr_orig + + + def testForeAttributes(self): + self.assertEqual(Fore.BLACK, '\033[30m') + self.assertEqual(Fore.RED, '\033[31m') + self.assertEqual(Fore.GREEN, '\033[32m') + self.assertEqual(Fore.YELLOW, '\033[33m') + self.assertEqual(Fore.BLUE, '\033[34m') + self.assertEqual(Fore.MAGENTA, '\033[35m') + self.assertEqual(Fore.CYAN, '\033[36m') + self.assertEqual(Fore.WHITE, '\033[37m') + self.assertEqual(Fore.RESET, '\033[39m') + + # Check the light, extended versions. + self.assertEqual(Fore.LIGHTBLACK_EX, '\033[90m') + self.assertEqual(Fore.LIGHTRED_EX, '\033[91m') + self.assertEqual(Fore.LIGHTGREEN_EX, '\033[92m') + self.assertEqual(Fore.LIGHTYELLOW_EX, '\033[93m') + self.assertEqual(Fore.LIGHTBLUE_EX, '\033[94m') + self.assertEqual(Fore.LIGHTMAGENTA_EX, '\033[95m') + self.assertEqual(Fore.LIGHTCYAN_EX, '\033[96m') + self.assertEqual(Fore.LIGHTWHITE_EX, '\033[97m') + + + def testBackAttributes(self): + self.assertEqual(Back.BLACK, '\033[40m') + self.assertEqual(Back.RED, '\033[41m') + self.assertEqual(Back.GREEN, '\033[42m') + self.assertEqual(Back.YELLOW, '\033[43m') + self.assertEqual(Back.BLUE, '\033[44m') + self.assertEqual(Back.MAGENTA, '\033[45m') + self.assertEqual(Back.CYAN, '\033[46m') + self.assertEqual(Back.WHITE, '\033[47m') + self.assertEqual(Back.RESET, '\033[49m') + + # Check the light, extended versions. + self.assertEqual(Back.LIGHTBLACK_EX, '\033[100m') + self.assertEqual(Back.LIGHTRED_EX, '\033[101m') + self.assertEqual(Back.LIGHTGREEN_EX, '\033[102m') + self.assertEqual(Back.LIGHTYELLOW_EX, '\033[103m') + self.assertEqual(Back.LIGHTBLUE_EX, '\033[104m') + self.assertEqual(Back.LIGHTMAGENTA_EX, '\033[105m') + self.assertEqual(Back.LIGHTCYAN_EX, '\033[106m') + self.assertEqual(Back.LIGHTWHITE_EX, '\033[107m') + + + def testStyleAttributes(self): + self.assertEqual(Style.DIM, '\033[2m') + self.assertEqual(Style.NORMAL, '\033[22m') + self.assertEqual(Style.BRIGHT, '\033[1m') + + +if __name__ == '__main__': + main() diff --git a/.venv/Lib/site-packages/colorama/tests/ansitowin32_test.py b/.venv/Lib/site-packages/colorama/tests/ansitowin32_test.py new file mode 100644 index 00000000..91ca551f --- /dev/null +++ b/.venv/Lib/site-packages/colorama/tests/ansitowin32_test.py @@ -0,0 +1,294 @@ +# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. +from io import StringIO, TextIOWrapper +from unittest import TestCase, main +try: + from contextlib import ExitStack +except ImportError: + # python 2 + from contextlib2 import ExitStack + +try: + from unittest.mock import MagicMock, Mock, patch +except ImportError: + from mock import MagicMock, Mock, patch + +from ..ansitowin32 import AnsiToWin32, StreamWrapper +from ..win32 import ENABLE_VIRTUAL_TERMINAL_PROCESSING +from .utils import osname + + +class StreamWrapperTest(TestCase): + + def testIsAProxy(self): + mockStream = Mock() + wrapper = StreamWrapper(mockStream, None) + self.assertTrue( wrapper.random_attr is mockStream.random_attr ) + + def testDelegatesWrite(self): + mockStream = Mock() + mockConverter = Mock() + wrapper = StreamWrapper(mockStream, mockConverter) + wrapper.write('hello') + self.assertTrue(mockConverter.write.call_args, (('hello',), {})) + + def testDelegatesContext(self): + mockConverter = Mock() + s = StringIO() + with StreamWrapper(s, mockConverter) as fp: + fp.write(u'hello') + self.assertTrue(s.closed) + + def testProxyNoContextManager(self): + mockStream = MagicMock() + mockStream.__enter__.side_effect = AttributeError() + mockConverter = Mock() + with self.assertRaises(AttributeError) as excinfo: + with StreamWrapper(mockStream, mockConverter) as wrapper: + wrapper.write('hello') + + def test_closed_shouldnt_raise_on_closed_stream(self): + stream = StringIO() + stream.close() + wrapper = StreamWrapper(stream, None) + self.assertEqual(wrapper.closed, True) + + def test_closed_shouldnt_raise_on_detached_stream(self): + stream = TextIOWrapper(StringIO()) + stream.detach() + wrapper = StreamWrapper(stream, None) + self.assertEqual(wrapper.closed, True) + +class AnsiToWin32Test(TestCase): + + def testInit(self): + mockStdout = Mock() + auto = Mock() + stream = AnsiToWin32(mockStdout, autoreset=auto) + self.assertEqual(stream.wrapped, mockStdout) + self.assertEqual(stream.autoreset, auto) + + @patch('colorama.ansitowin32.winterm', None) + @patch('colorama.ansitowin32.winapi_test', lambda *_: True) + def testStripIsTrueOnWindows(self): + with osname('nt'): + mockStdout = Mock() + stream = AnsiToWin32(mockStdout) + self.assertTrue(stream.strip) + + def testStripIsFalseOffWindows(self): + with osname('posix'): + mockStdout = Mock(closed=False) + stream = AnsiToWin32(mockStdout) + self.assertFalse(stream.strip) + + def testWriteStripsAnsi(self): + mockStdout = Mock() + stream = AnsiToWin32(mockStdout) + stream.wrapped = Mock() + stream.write_and_convert = Mock() + stream.strip = True + + stream.write('abc') + + self.assertFalse(stream.wrapped.write.called) + self.assertEqual(stream.write_and_convert.call_args, (('abc',), {})) + + def testWriteDoesNotStripAnsi(self): + mockStdout = Mock() + stream = AnsiToWin32(mockStdout) + stream.wrapped = Mock() + stream.write_and_convert = Mock() + stream.strip = False + stream.convert = False + + stream.write('abc') + + self.assertFalse(stream.write_and_convert.called) + self.assertEqual(stream.wrapped.write.call_args, (('abc',), {})) + + def assert_autoresets(self, convert, autoreset=True): + stream = AnsiToWin32(Mock()) + stream.convert = convert + stream.reset_all = Mock() + stream.autoreset = autoreset + stream.winterm = Mock() + + stream.write('abc') + + self.assertEqual(stream.reset_all.called, autoreset) + + def testWriteAutoresets(self): + self.assert_autoresets(convert=True) + self.assert_autoresets(convert=False) + self.assert_autoresets(convert=True, autoreset=False) + self.assert_autoresets(convert=False, autoreset=False) + + def testWriteAndConvertWritesPlainText(self): + stream = AnsiToWin32(Mock()) + stream.write_and_convert( 'abc' ) + self.assertEqual( stream.wrapped.write.call_args, (('abc',), {}) ) + + def testWriteAndConvertStripsAllValidAnsi(self): + stream = AnsiToWin32(Mock()) + stream.call_win32 = Mock() + data = [ + 'abc\033[mdef', + 'abc\033[0mdef', + 'abc\033[2mdef', + 'abc\033[02mdef', + 'abc\033[002mdef', + 'abc\033[40mdef', + 'abc\033[040mdef', + 'abc\033[0;1mdef', + 'abc\033[40;50mdef', + 'abc\033[50;30;40mdef', + 'abc\033[Adef', + 'abc\033[0Gdef', + 'abc\033[1;20;128Hdef', + ] + for datum in data: + stream.wrapped.write.reset_mock() + stream.write_and_convert( datum ) + self.assertEqual( + [args[0] for args in stream.wrapped.write.call_args_list], + [ ('abc',), ('def',) ] + ) + + def testWriteAndConvertSkipsEmptySnippets(self): + stream = AnsiToWin32(Mock()) + stream.call_win32 = Mock() + stream.write_and_convert( '\033[40m\033[41m' ) + self.assertFalse( stream.wrapped.write.called ) + + def testWriteAndConvertCallsWin32WithParamsAndCommand(self): + stream = AnsiToWin32(Mock()) + stream.convert = True + stream.call_win32 = Mock() + stream.extract_params = Mock(return_value='params') + data = { + 'abc\033[adef': ('a', 'params'), + 'abc\033[;;bdef': ('b', 'params'), + 'abc\033[0cdef': ('c', 'params'), + 'abc\033[;;0;;Gdef': ('G', 'params'), + 'abc\033[1;20;128Hdef': ('H', 'params'), + } + for datum, expected in data.items(): + stream.call_win32.reset_mock() + stream.write_and_convert( datum ) + self.assertEqual( stream.call_win32.call_args[0], expected ) + + def test_reset_all_shouldnt_raise_on_closed_orig_stdout(self): + stream = StringIO() + converter = AnsiToWin32(stream) + stream.close() + + converter.reset_all() + + def test_wrap_shouldnt_raise_on_closed_orig_stdout(self): + stream = StringIO() + stream.close() + with \ + patch("colorama.ansitowin32.os.name", "nt"), \ + patch("colorama.ansitowin32.winapi_test", lambda: True): + converter = AnsiToWin32(stream) + self.assertTrue(converter.strip) + self.assertFalse(converter.convert) + + def test_wrap_shouldnt_raise_on_missing_closed_attr(self): + with \ + patch("colorama.ansitowin32.os.name", "nt"), \ + patch("colorama.ansitowin32.winapi_test", lambda: True): + converter = AnsiToWin32(object()) + self.assertTrue(converter.strip) + self.assertFalse(converter.convert) + + def testExtractParams(self): + stream = AnsiToWin32(Mock()) + data = { + '': (0,), + ';;': (0,), + '2': (2,), + ';;002;;': (2,), + '0;1': (0, 1), + ';;003;;456;;': (3, 456), + '11;22;33;44;55': (11, 22, 33, 44, 55), + } + for datum, expected in data.items(): + self.assertEqual(stream.extract_params('m', datum), expected) + + def testCallWin32UsesLookup(self): + listener = Mock() + stream = AnsiToWin32(listener) + stream.win32_calls = { + 1: (lambda *_, **__: listener(11),), + 2: (lambda *_, **__: listener(22),), + 3: (lambda *_, **__: listener(33),), + } + stream.call_win32('m', (3, 1, 99, 2)) + self.assertEqual( + [a[0][0] for a in listener.call_args_list], + [33, 11, 22] ) + + def test_osc_codes(self): + mockStdout = Mock() + stream = AnsiToWin32(mockStdout, convert=True) + with patch('colorama.ansitowin32.winterm') as winterm: + data = [ + '\033]0\x07', # missing arguments + '\033]0;foo\x08', # wrong OSC command + '\033]0;colorama_test_title\x07', # should work + '\033]1;colorama_test_title\x07', # wrong set command + '\033]2;colorama_test_title\x07', # should work + '\033]' + ';' * 64 + '\x08', # see issue #247 + ] + for code in data: + stream.write(code) + self.assertEqual(winterm.set_title.call_count, 2) + + def test_native_windows_ansi(self): + with ExitStack() as stack: + def p(a, b): + stack.enter_context(patch(a, b, create=True)) + # Pretend to be on Windows + p("colorama.ansitowin32.os.name", "nt") + p("colorama.ansitowin32.winapi_test", lambda: True) + p("colorama.win32.winapi_test", lambda: True) + p("colorama.winterm.win32.windll", "non-None") + p("colorama.winterm.get_osfhandle", lambda _: 1234) + + # Pretend that our mock stream has native ANSI support + p( + "colorama.winterm.win32.GetConsoleMode", + lambda _: ENABLE_VIRTUAL_TERMINAL_PROCESSING, + ) + SetConsoleMode = Mock() + p("colorama.winterm.win32.SetConsoleMode", SetConsoleMode) + + stdout = Mock() + stdout.closed = False + stdout.isatty.return_value = True + stdout.fileno.return_value = 1 + + # Our fake console says it has native vt support, so AnsiToWin32 should + # enable that support and do nothing else. + stream = AnsiToWin32(stdout) + SetConsoleMode.assert_called_with(1234, ENABLE_VIRTUAL_TERMINAL_PROCESSING) + self.assertFalse(stream.strip) + self.assertFalse(stream.convert) + self.assertFalse(stream.should_wrap()) + + # Now let's pretend we're on an old Windows console, that doesn't have + # native ANSI support. + p("colorama.winterm.win32.GetConsoleMode", lambda _: 0) + SetConsoleMode = Mock() + p("colorama.winterm.win32.SetConsoleMode", SetConsoleMode) + + stream = AnsiToWin32(stdout) + SetConsoleMode.assert_called_with(1234, ENABLE_VIRTUAL_TERMINAL_PROCESSING) + self.assertTrue(stream.strip) + self.assertTrue(stream.convert) + self.assertTrue(stream.should_wrap()) + + +if __name__ == '__main__': + main() diff --git a/.venv/Lib/site-packages/colorama/tests/initialise_test.py b/.venv/Lib/site-packages/colorama/tests/initialise_test.py new file mode 100644 index 00000000..89f9b075 --- /dev/null +++ b/.venv/Lib/site-packages/colorama/tests/initialise_test.py @@ -0,0 +1,189 @@ +# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. +import sys +from unittest import TestCase, main, skipUnless + +try: + from unittest.mock import patch, Mock +except ImportError: + from mock import patch, Mock + +from ..ansitowin32 import StreamWrapper +from ..initialise import init, just_fix_windows_console, _wipe_internal_state_for_tests +from .utils import osname, replace_by + +orig_stdout = sys.stdout +orig_stderr = sys.stderr + + +class InitTest(TestCase): + + @skipUnless(sys.stdout.isatty(), "sys.stdout is not a tty") + def setUp(self): + # sanity check + self.assertNotWrapped() + + def tearDown(self): + _wipe_internal_state_for_tests() + sys.stdout = orig_stdout + sys.stderr = orig_stderr + + def assertWrapped(self): + self.assertIsNot(sys.stdout, orig_stdout, 'stdout should be wrapped') + self.assertIsNot(sys.stderr, orig_stderr, 'stderr should be wrapped') + self.assertTrue(isinstance(sys.stdout, StreamWrapper), + 'bad stdout wrapper') + self.assertTrue(isinstance(sys.stderr, StreamWrapper), + 'bad stderr wrapper') + + def assertNotWrapped(self): + self.assertIs(sys.stdout, orig_stdout, 'stdout should not be wrapped') + self.assertIs(sys.stderr, orig_stderr, 'stderr should not be wrapped') + + @patch('colorama.initialise.reset_all') + @patch('colorama.ansitowin32.winapi_test', lambda *_: True) + @patch('colorama.ansitowin32.enable_vt_processing', lambda *_: False) + def testInitWrapsOnWindows(self, _): + with osname("nt"): + init() + self.assertWrapped() + + @patch('colorama.initialise.reset_all') + @patch('colorama.ansitowin32.winapi_test', lambda *_: False) + def testInitDoesntWrapOnEmulatedWindows(self, _): + with osname("nt"): + init() + self.assertNotWrapped() + + def testInitDoesntWrapOnNonWindows(self): + with osname("posix"): + init() + self.assertNotWrapped() + + def testInitDoesntWrapIfNone(self): + with replace_by(None): + init() + # We can't use assertNotWrapped here because replace_by(None) + # changes stdout/stderr already. + self.assertIsNone(sys.stdout) + self.assertIsNone(sys.stderr) + + def testInitAutoresetOnWrapsOnAllPlatforms(self): + with osname("posix"): + init(autoreset=True) + self.assertWrapped() + + def testInitWrapOffDoesntWrapOnWindows(self): + with osname("nt"): + init(wrap=False) + self.assertNotWrapped() + + def testInitWrapOffIncompatibleWithAutoresetOn(self): + self.assertRaises(ValueError, lambda: init(autoreset=True, wrap=False)) + + @patch('colorama.win32.SetConsoleTextAttribute') + @patch('colorama.initialise.AnsiToWin32') + def testAutoResetPassedOn(self, mockATW32, _): + with osname("nt"): + init(autoreset=True) + self.assertEqual(len(mockATW32.call_args_list), 2) + self.assertEqual(mockATW32.call_args_list[1][1]['autoreset'], True) + self.assertEqual(mockATW32.call_args_list[0][1]['autoreset'], True) + + @patch('colorama.initialise.AnsiToWin32') + def testAutoResetChangeable(self, mockATW32): + with osname("nt"): + init() + + init(autoreset=True) + self.assertEqual(len(mockATW32.call_args_list), 4) + self.assertEqual(mockATW32.call_args_list[2][1]['autoreset'], True) + self.assertEqual(mockATW32.call_args_list[3][1]['autoreset'], True) + + init() + self.assertEqual(len(mockATW32.call_args_list), 6) + self.assertEqual( + mockATW32.call_args_list[4][1]['autoreset'], False) + self.assertEqual( + mockATW32.call_args_list[5][1]['autoreset'], False) + + + @patch('colorama.initialise.atexit.register') + def testAtexitRegisteredOnlyOnce(self, mockRegister): + init() + self.assertTrue(mockRegister.called) + mockRegister.reset_mock() + init() + self.assertFalse(mockRegister.called) + + +class JustFixWindowsConsoleTest(TestCase): + def _reset(self): + _wipe_internal_state_for_tests() + sys.stdout = orig_stdout + sys.stderr = orig_stderr + + def tearDown(self): + self._reset() + + @patch("colorama.ansitowin32.winapi_test", lambda: True) + def testJustFixWindowsConsole(self): + if sys.platform != "win32": + # just_fix_windows_console should be a no-op + just_fix_windows_console() + self.assertIs(sys.stdout, orig_stdout) + self.assertIs(sys.stderr, orig_stderr) + else: + def fake_std(): + # Emulate stdout=not a tty, stderr=tty + # to check that we handle both cases correctly + stdout = Mock() + stdout.closed = False + stdout.isatty.return_value = False + stdout.fileno.return_value = 1 + sys.stdout = stdout + + stderr = Mock() + stderr.closed = False + stderr.isatty.return_value = True + stderr.fileno.return_value = 2 + sys.stderr = stderr + + for native_ansi in [False, True]: + with patch( + 'colorama.ansitowin32.enable_vt_processing', + lambda *_: native_ansi + ): + self._reset() + fake_std() + + # Regular single-call test + prev_stdout = sys.stdout + prev_stderr = sys.stderr + just_fix_windows_console() + self.assertIs(sys.stdout, prev_stdout) + if native_ansi: + self.assertIs(sys.stderr, prev_stderr) + else: + self.assertIsNot(sys.stderr, prev_stderr) + + # second call without resetting is always a no-op + prev_stdout = sys.stdout + prev_stderr = sys.stderr + just_fix_windows_console() + self.assertIs(sys.stdout, prev_stdout) + self.assertIs(sys.stderr, prev_stderr) + + self._reset() + fake_std() + + # If init() runs first, just_fix_windows_console should be a no-op + init() + prev_stdout = sys.stdout + prev_stderr = sys.stderr + just_fix_windows_console() + self.assertIs(prev_stdout, sys.stdout) + self.assertIs(prev_stderr, sys.stderr) + + +if __name__ == '__main__': + main() diff --git a/.venv/Lib/site-packages/colorama/tests/isatty_test.py b/.venv/Lib/site-packages/colorama/tests/isatty_test.py new file mode 100644 index 00000000..0f84e4be --- /dev/null +++ b/.venv/Lib/site-packages/colorama/tests/isatty_test.py @@ -0,0 +1,57 @@ +# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. +import sys +from unittest import TestCase, main + +from ..ansitowin32 import StreamWrapper, AnsiToWin32 +from .utils import pycharm, replace_by, replace_original_by, StreamTTY, StreamNonTTY + + +def is_a_tty(stream): + return StreamWrapper(stream, None).isatty() + +class IsattyTest(TestCase): + + def test_TTY(self): + tty = StreamTTY() + self.assertTrue(is_a_tty(tty)) + with pycharm(): + self.assertTrue(is_a_tty(tty)) + + def test_nonTTY(self): + non_tty = StreamNonTTY() + self.assertFalse(is_a_tty(non_tty)) + with pycharm(): + self.assertFalse(is_a_tty(non_tty)) + + def test_withPycharm(self): + with pycharm(): + self.assertTrue(is_a_tty(sys.stderr)) + self.assertTrue(is_a_tty(sys.stdout)) + + def test_withPycharmTTYOverride(self): + tty = StreamTTY() + with pycharm(), replace_by(tty): + self.assertTrue(is_a_tty(tty)) + + def test_withPycharmNonTTYOverride(self): + non_tty = StreamNonTTY() + with pycharm(), replace_by(non_tty): + self.assertFalse(is_a_tty(non_tty)) + + def test_withPycharmNoneOverride(self): + with pycharm(): + with replace_by(None), replace_original_by(None): + self.assertFalse(is_a_tty(None)) + self.assertFalse(is_a_tty(StreamNonTTY())) + self.assertTrue(is_a_tty(StreamTTY())) + + def test_withPycharmStreamWrapped(self): + with pycharm(): + self.assertTrue(AnsiToWin32(StreamTTY()).stream.isatty()) + self.assertFalse(AnsiToWin32(StreamNonTTY()).stream.isatty()) + self.assertTrue(AnsiToWin32(sys.stdout).stream.isatty()) + self.assertTrue(AnsiToWin32(sys.stderr).stream.isatty()) + + +if __name__ == '__main__': + main() diff --git a/.venv/Lib/site-packages/colorama/tests/utils.py b/.venv/Lib/site-packages/colorama/tests/utils.py new file mode 100644 index 00000000..472fafb4 --- /dev/null +++ b/.venv/Lib/site-packages/colorama/tests/utils.py @@ -0,0 +1,49 @@ +# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. +from contextlib import contextmanager +from io import StringIO +import sys +import os + + +class StreamTTY(StringIO): + def isatty(self): + return True + +class StreamNonTTY(StringIO): + def isatty(self): + return False + +@contextmanager +def osname(name): + orig = os.name + os.name = name + yield + os.name = orig + +@contextmanager +def replace_by(stream): + orig_stdout = sys.stdout + orig_stderr = sys.stderr + sys.stdout = stream + sys.stderr = stream + yield + sys.stdout = orig_stdout + sys.stderr = orig_stderr + +@contextmanager +def replace_original_by(stream): + orig_stdout = sys.__stdout__ + orig_stderr = sys.__stderr__ + sys.__stdout__ = stream + sys.__stderr__ = stream + yield + sys.__stdout__ = orig_stdout + sys.__stderr__ = orig_stderr + +@contextmanager +def pycharm(): + os.environ["PYCHARM_HOSTED"] = "1" + non_tty = StreamNonTTY() + with replace_by(non_tty), replace_original_by(non_tty): + yield + del os.environ["PYCHARM_HOSTED"] diff --git a/.venv/Lib/site-packages/colorama/tests/winterm_test.py b/.venv/Lib/site-packages/colorama/tests/winterm_test.py new file mode 100644 index 00000000..d0955f9e --- /dev/null +++ b/.venv/Lib/site-packages/colorama/tests/winterm_test.py @@ -0,0 +1,131 @@ +# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. +import sys +from unittest import TestCase, main, skipUnless + +try: + from unittest.mock import Mock, patch +except ImportError: + from mock import Mock, patch + +from ..winterm import WinColor, WinStyle, WinTerm + + +class WinTermTest(TestCase): + + @patch('colorama.winterm.win32') + def testInit(self, mockWin32): + mockAttr = Mock() + mockAttr.wAttributes = 7 + 6 * 16 + 8 + mockWin32.GetConsoleScreenBufferInfo.return_value = mockAttr + term = WinTerm() + self.assertEqual(term._fore, 7) + self.assertEqual(term._back, 6) + self.assertEqual(term._style, 8) + + @skipUnless(sys.platform.startswith("win"), "requires Windows") + def testGetAttrs(self): + term = WinTerm() + + term._fore = 0 + term._back = 0 + term._style = 0 + self.assertEqual(term.get_attrs(), 0) + + term._fore = WinColor.YELLOW + self.assertEqual(term.get_attrs(), WinColor.YELLOW) + + term._back = WinColor.MAGENTA + self.assertEqual( + term.get_attrs(), + WinColor.YELLOW + WinColor.MAGENTA * 16) + + term._style = WinStyle.BRIGHT + self.assertEqual( + term.get_attrs(), + WinColor.YELLOW + WinColor.MAGENTA * 16 + WinStyle.BRIGHT) + + @patch('colorama.winterm.win32') + def testResetAll(self, mockWin32): + mockAttr = Mock() + mockAttr.wAttributes = 1 + 2 * 16 + 8 + mockWin32.GetConsoleScreenBufferInfo.return_value = mockAttr + term = WinTerm() + + term.set_console = Mock() + term._fore = -1 + term._back = -1 + term._style = -1 + + term.reset_all() + + self.assertEqual(term._fore, 1) + self.assertEqual(term._back, 2) + self.assertEqual(term._style, 8) + self.assertEqual(term.set_console.called, True) + + @skipUnless(sys.platform.startswith("win"), "requires Windows") + def testFore(self): + term = WinTerm() + term.set_console = Mock() + term._fore = 0 + + term.fore(5) + + self.assertEqual(term._fore, 5) + self.assertEqual(term.set_console.called, True) + + @skipUnless(sys.platform.startswith("win"), "requires Windows") + def testBack(self): + term = WinTerm() + term.set_console = Mock() + term._back = 0 + + term.back(5) + + self.assertEqual(term._back, 5) + self.assertEqual(term.set_console.called, True) + + @skipUnless(sys.platform.startswith("win"), "requires Windows") + def testStyle(self): + term = WinTerm() + term.set_console = Mock() + term._style = 0 + + term.style(22) + + self.assertEqual(term._style, 22) + self.assertEqual(term.set_console.called, True) + + @patch('colorama.winterm.win32') + def testSetConsole(self, mockWin32): + mockAttr = Mock() + mockAttr.wAttributes = 0 + mockWin32.GetConsoleScreenBufferInfo.return_value = mockAttr + term = WinTerm() + term.windll = Mock() + + term.set_console() + + self.assertEqual( + mockWin32.SetConsoleTextAttribute.call_args, + ((mockWin32.STDOUT, term.get_attrs()), {}) + ) + + @patch('colorama.winterm.win32') + def testSetConsoleOnStderr(self, mockWin32): + mockAttr = Mock() + mockAttr.wAttributes = 0 + mockWin32.GetConsoleScreenBufferInfo.return_value = mockAttr + term = WinTerm() + term.windll = Mock() + + term.set_console(on_stderr=True) + + self.assertEqual( + mockWin32.SetConsoleTextAttribute.call_args, + ((mockWin32.STDERR, term.get_attrs()), {}) + ) + + +if __name__ == '__main__': + main() diff --git a/.venv/Lib/site-packages/colorama/win32.py b/.venv/Lib/site-packages/colorama/win32.py new file mode 100644 index 00000000..841b0e27 --- /dev/null +++ b/.venv/Lib/site-packages/colorama/win32.py @@ -0,0 +1,180 @@ +# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. + +# from winbase.h +STDOUT = -11 +STDERR = -12 + +ENABLE_VIRTUAL_TERMINAL_PROCESSING = 0x0004 + +try: + import ctypes + from ctypes import LibraryLoader + windll = LibraryLoader(ctypes.WinDLL) + from ctypes import wintypes +except (AttributeError, ImportError): + windll = None + SetConsoleTextAttribute = lambda *_: None + winapi_test = lambda *_: None +else: + from ctypes import byref, Structure, c_char, POINTER + + COORD = wintypes._COORD + + class CONSOLE_SCREEN_BUFFER_INFO(Structure): + """struct in wincon.h.""" + _fields_ = [ + ("dwSize", COORD), + ("dwCursorPosition", COORD), + ("wAttributes", wintypes.WORD), + ("srWindow", wintypes.SMALL_RECT), + ("dwMaximumWindowSize", COORD), + ] + def __str__(self): + return '(%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d)' % ( + self.dwSize.Y, self.dwSize.X + , self.dwCursorPosition.Y, self.dwCursorPosition.X + , self.wAttributes + , self.srWindow.Top, self.srWindow.Left, self.srWindow.Bottom, self.srWindow.Right + , self.dwMaximumWindowSize.Y, self.dwMaximumWindowSize.X + ) + + _GetStdHandle = windll.kernel32.GetStdHandle + _GetStdHandle.argtypes = [ + wintypes.DWORD, + ] + _GetStdHandle.restype = wintypes.HANDLE + + _GetConsoleScreenBufferInfo = windll.kernel32.GetConsoleScreenBufferInfo + _GetConsoleScreenBufferInfo.argtypes = [ + wintypes.HANDLE, + POINTER(CONSOLE_SCREEN_BUFFER_INFO), + ] + _GetConsoleScreenBufferInfo.restype = wintypes.BOOL + + _SetConsoleTextAttribute = windll.kernel32.SetConsoleTextAttribute + _SetConsoleTextAttribute.argtypes = [ + wintypes.HANDLE, + wintypes.WORD, + ] + _SetConsoleTextAttribute.restype = wintypes.BOOL + + _SetConsoleCursorPosition = windll.kernel32.SetConsoleCursorPosition + _SetConsoleCursorPosition.argtypes = [ + wintypes.HANDLE, + COORD, + ] + _SetConsoleCursorPosition.restype = wintypes.BOOL + + _FillConsoleOutputCharacterA = windll.kernel32.FillConsoleOutputCharacterA + _FillConsoleOutputCharacterA.argtypes = [ + wintypes.HANDLE, + c_char, + wintypes.DWORD, + COORD, + POINTER(wintypes.DWORD), + ] + _FillConsoleOutputCharacterA.restype = wintypes.BOOL + + _FillConsoleOutputAttribute = windll.kernel32.FillConsoleOutputAttribute + _FillConsoleOutputAttribute.argtypes = [ + wintypes.HANDLE, + wintypes.WORD, + wintypes.DWORD, + COORD, + POINTER(wintypes.DWORD), + ] + _FillConsoleOutputAttribute.restype = wintypes.BOOL + + _SetConsoleTitleW = windll.kernel32.SetConsoleTitleW + _SetConsoleTitleW.argtypes = [ + wintypes.LPCWSTR + ] + _SetConsoleTitleW.restype = wintypes.BOOL + + _GetConsoleMode = windll.kernel32.GetConsoleMode + _GetConsoleMode.argtypes = [ + wintypes.HANDLE, + POINTER(wintypes.DWORD) + ] + _GetConsoleMode.restype = wintypes.BOOL + + _SetConsoleMode = windll.kernel32.SetConsoleMode + _SetConsoleMode.argtypes = [ + wintypes.HANDLE, + wintypes.DWORD + ] + _SetConsoleMode.restype = wintypes.BOOL + + def _winapi_test(handle): + csbi = CONSOLE_SCREEN_BUFFER_INFO() + success = _GetConsoleScreenBufferInfo( + handle, byref(csbi)) + return bool(success) + + def winapi_test(): + return any(_winapi_test(h) for h in + (_GetStdHandle(STDOUT), _GetStdHandle(STDERR))) + + def GetConsoleScreenBufferInfo(stream_id=STDOUT): + handle = _GetStdHandle(stream_id) + csbi = CONSOLE_SCREEN_BUFFER_INFO() + success = _GetConsoleScreenBufferInfo( + handle, byref(csbi)) + return csbi + + def SetConsoleTextAttribute(stream_id, attrs): + handle = _GetStdHandle(stream_id) + return _SetConsoleTextAttribute(handle, attrs) + + def SetConsoleCursorPosition(stream_id, position, adjust=True): + position = COORD(*position) + # If the position is out of range, do nothing. + if position.Y <= 0 or position.X <= 0: + return + # Adjust for Windows' SetConsoleCursorPosition: + # 1. being 0-based, while ANSI is 1-based. + # 2. expecting (x,y), while ANSI uses (y,x). + adjusted_position = COORD(position.Y - 1, position.X - 1) + if adjust: + # Adjust for viewport's scroll position + sr = GetConsoleScreenBufferInfo(STDOUT).srWindow + adjusted_position.Y += sr.Top + adjusted_position.X += sr.Left + # Resume normal processing + handle = _GetStdHandle(stream_id) + return _SetConsoleCursorPosition(handle, adjusted_position) + + def FillConsoleOutputCharacter(stream_id, char, length, start): + handle = _GetStdHandle(stream_id) + char = c_char(char.encode()) + length = wintypes.DWORD(length) + num_written = wintypes.DWORD(0) + # Note that this is hard-coded for ANSI (vs wide) bytes. + success = _FillConsoleOutputCharacterA( + handle, char, length, start, byref(num_written)) + return num_written.value + + def FillConsoleOutputAttribute(stream_id, attr, length, start): + ''' FillConsoleOutputAttribute( hConsole, csbi.wAttributes, dwConSize, coordScreen, &cCharsWritten )''' + handle = _GetStdHandle(stream_id) + attribute = wintypes.WORD(attr) + length = wintypes.DWORD(length) + num_written = wintypes.DWORD(0) + # Note that this is hard-coded for ANSI (vs wide) bytes. + return _FillConsoleOutputAttribute( + handle, attribute, length, start, byref(num_written)) + + def SetConsoleTitle(title): + return _SetConsoleTitleW(title) + + def GetConsoleMode(handle): + mode = wintypes.DWORD() + success = _GetConsoleMode(handle, byref(mode)) + if not success: + raise ctypes.WinError() + return mode.value + + def SetConsoleMode(handle, mode): + success = _SetConsoleMode(handle, mode) + if not success: + raise ctypes.WinError() diff --git a/.venv/Lib/site-packages/colorama/winterm.py b/.venv/Lib/site-packages/colorama/winterm.py new file mode 100644 index 00000000..aad867e8 --- /dev/null +++ b/.venv/Lib/site-packages/colorama/winterm.py @@ -0,0 +1,195 @@ +# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. +try: + from msvcrt import get_osfhandle +except ImportError: + def get_osfhandle(_): + raise OSError("This isn't windows!") + + +from . import win32 + +# from wincon.h +class WinColor(object): + BLACK = 0 + BLUE = 1 + GREEN = 2 + CYAN = 3 + RED = 4 + MAGENTA = 5 + YELLOW = 6 + GREY = 7 + +# from wincon.h +class WinStyle(object): + NORMAL = 0x00 # dim text, dim background + BRIGHT = 0x08 # bright text, dim background + BRIGHT_BACKGROUND = 0x80 # dim text, bright background + +class WinTerm(object): + + def __init__(self): + self._default = win32.GetConsoleScreenBufferInfo(win32.STDOUT).wAttributes + self.set_attrs(self._default) + self._default_fore = self._fore + self._default_back = self._back + self._default_style = self._style + # In order to emulate LIGHT_EX in windows, we borrow the BRIGHT style. + # So that LIGHT_EX colors and BRIGHT style do not clobber each other, + # we track them separately, since LIGHT_EX is overwritten by Fore/Back + # and BRIGHT is overwritten by Style codes. + self._light = 0 + + def get_attrs(self): + return self._fore + self._back * 16 + (self._style | self._light) + + def set_attrs(self, value): + self._fore = value & 7 + self._back = (value >> 4) & 7 + self._style = value & (WinStyle.BRIGHT | WinStyle.BRIGHT_BACKGROUND) + + def reset_all(self, on_stderr=None): + self.set_attrs(self._default) + self.set_console(attrs=self._default) + self._light = 0 + + def fore(self, fore=None, light=False, on_stderr=False): + if fore is None: + fore = self._default_fore + self._fore = fore + # Emulate LIGHT_EX with BRIGHT Style + if light: + self._light |= WinStyle.BRIGHT + else: + self._light &= ~WinStyle.BRIGHT + self.set_console(on_stderr=on_stderr) + + def back(self, back=None, light=False, on_stderr=False): + if back is None: + back = self._default_back + self._back = back + # Emulate LIGHT_EX with BRIGHT_BACKGROUND Style + if light: + self._light |= WinStyle.BRIGHT_BACKGROUND + else: + self._light &= ~WinStyle.BRIGHT_BACKGROUND + self.set_console(on_stderr=on_stderr) + + def style(self, style=None, on_stderr=False): + if style is None: + style = self._default_style + self._style = style + self.set_console(on_stderr=on_stderr) + + def set_console(self, attrs=None, on_stderr=False): + if attrs is None: + attrs = self.get_attrs() + handle = win32.STDOUT + if on_stderr: + handle = win32.STDERR + win32.SetConsoleTextAttribute(handle, attrs) + + def get_position(self, handle): + position = win32.GetConsoleScreenBufferInfo(handle).dwCursorPosition + # Because Windows coordinates are 0-based, + # and win32.SetConsoleCursorPosition expects 1-based. + position.X += 1 + position.Y += 1 + return position + + def set_cursor_position(self, position=None, on_stderr=False): + if position is None: + # I'm not currently tracking the position, so there is no default. + # position = self.get_position() + return + handle = win32.STDOUT + if on_stderr: + handle = win32.STDERR + win32.SetConsoleCursorPosition(handle, position) + + def cursor_adjust(self, x, y, on_stderr=False): + handle = win32.STDOUT + if on_stderr: + handle = win32.STDERR + position = self.get_position(handle) + adjusted_position = (position.Y + y, position.X + x) + win32.SetConsoleCursorPosition(handle, adjusted_position, adjust=False) + + def erase_screen(self, mode=0, on_stderr=False): + # 0 should clear from the cursor to the end of the screen. + # 1 should clear from the cursor to the beginning of the screen. + # 2 should clear the entire screen, and move cursor to (1,1) + handle = win32.STDOUT + if on_stderr: + handle = win32.STDERR + csbi = win32.GetConsoleScreenBufferInfo(handle) + # get the number of character cells in the current buffer + cells_in_screen = csbi.dwSize.X * csbi.dwSize.Y + # get number of character cells before current cursor position + cells_before_cursor = csbi.dwSize.X * csbi.dwCursorPosition.Y + csbi.dwCursorPosition.X + if mode == 0: + from_coord = csbi.dwCursorPosition + cells_to_erase = cells_in_screen - cells_before_cursor + elif mode == 1: + from_coord = win32.COORD(0, 0) + cells_to_erase = cells_before_cursor + elif mode == 2: + from_coord = win32.COORD(0, 0) + cells_to_erase = cells_in_screen + else: + # invalid mode + return + # fill the entire screen with blanks + win32.FillConsoleOutputCharacter(handle, ' ', cells_to_erase, from_coord) + # now set the buffer's attributes accordingly + win32.FillConsoleOutputAttribute(handle, self.get_attrs(), cells_to_erase, from_coord) + if mode == 2: + # put the cursor where needed + win32.SetConsoleCursorPosition(handle, (1, 1)) + + def erase_line(self, mode=0, on_stderr=False): + # 0 should clear from the cursor to the end of the line. + # 1 should clear from the cursor to the beginning of the line. + # 2 should clear the entire line. + handle = win32.STDOUT + if on_stderr: + handle = win32.STDERR + csbi = win32.GetConsoleScreenBufferInfo(handle) + if mode == 0: + from_coord = csbi.dwCursorPosition + cells_to_erase = csbi.dwSize.X - csbi.dwCursorPosition.X + elif mode == 1: + from_coord = win32.COORD(0, csbi.dwCursorPosition.Y) + cells_to_erase = csbi.dwCursorPosition.X + elif mode == 2: + from_coord = win32.COORD(0, csbi.dwCursorPosition.Y) + cells_to_erase = csbi.dwSize.X + else: + # invalid mode + return + # fill the entire screen with blanks + win32.FillConsoleOutputCharacter(handle, ' ', cells_to_erase, from_coord) + # now set the buffer's attributes accordingly + win32.FillConsoleOutputAttribute(handle, self.get_attrs(), cells_to_erase, from_coord) + + def set_title(self, title): + win32.SetConsoleTitle(title) + + +def enable_vt_processing(fd): + if win32.windll is None or not win32.winapi_test(): + return False + + try: + handle = get_osfhandle(fd) + mode = win32.GetConsoleMode(handle) + win32.SetConsoleMode( + handle, + mode | win32.ENABLE_VIRTUAL_TERMINAL_PROCESSING, + ) + + mode = win32.GetConsoleMode(handle) + if mode & win32.ENABLE_VIRTUAL_TERMINAL_PROCESSING: + return True + # Can get TypeError in testsuite where 'fd' is a Mock() + except (OSError, TypeError): + return False diff --git a/.venv/Lib/site-packages/coverage-7.6.4.dist-info/INSTALLER b/.venv/Lib/site-packages/coverage-7.6.4.dist-info/INSTALLER new file mode 100644 index 00000000..a1b589e3 --- /dev/null +++ b/.venv/Lib/site-packages/coverage-7.6.4.dist-info/INSTALLER @@ -0,0 +1 @@ +pip diff --git a/.venv/Lib/site-packages/coverage-7.6.4.dist-info/LICENSE.txt b/.venv/Lib/site-packages/coverage-7.6.4.dist-info/LICENSE.txt new file mode 100644 index 00000000..f433b1a5 --- /dev/null +++ b/.venv/Lib/site-packages/coverage-7.6.4.dist-info/LICENSE.txt @@ -0,0 +1,177 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS diff --git a/.venv/Lib/site-packages/coverage-7.6.4.dist-info/METADATA b/.venv/Lib/site-packages/coverage-7.6.4.dist-info/METADATA new file mode 100644 index 00000000..f1a44cde --- /dev/null +++ b/.venv/Lib/site-packages/coverage-7.6.4.dist-info/METADATA @@ -0,0 +1,199 @@ +Metadata-Version: 2.1 +Name: coverage +Version: 7.6.4 +Summary: Code coverage measurement for Python +Home-page: https://github.com/nedbat/coveragepy +Author: Ned Batchelder and 239 others +Author-email: ned@nedbatchelder.com +License: Apache-2.0 +Project-URL: Documentation, https://coverage.readthedocs.io/en/7.6.4 +Project-URL: Funding, https://tidelift.com/subscription/pkg/pypi-coverage?utm_source=pypi-coverage&utm_medium=referral&utm_campaign=pypi +Project-URL: Issues, https://github.com/nedbat/coveragepy/issues +Project-URL: Mastodon, https://hachyderm.io/@coveragepy +Project-URL: Mastodon (nedbat), https://hachyderm.io/@nedbat +Keywords: code coverage testing +Classifier: Environment :: Console +Classifier: Intended Audience :: Developers +Classifier: License :: OSI Approved :: Apache Software License +Classifier: Operating System :: OS Independent +Classifier: Programming Language :: Python +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: 3.9 +Classifier: Programming Language :: Python :: 3.10 +Classifier: Programming Language :: Python :: 3.11 +Classifier: Programming Language :: Python :: 3.12 +Classifier: Programming Language :: Python :: 3.13 +Classifier: Programming Language :: Python :: 3.14 +Classifier: Programming Language :: Python :: Implementation :: CPython +Classifier: Programming Language :: Python :: Implementation :: PyPy +Classifier: Topic :: Software Development :: Quality Assurance +Classifier: Topic :: Software Development :: Testing +Classifier: Development Status :: 5 - Production/Stable +Requires-Python: >=3.9 +Description-Content-Type: text/x-rst +License-File: LICENSE.txt +Provides-Extra: toml +Requires-Dist: tomli ; (python_full_version <= "3.11.0a6") and extra == 'toml' + +.. Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 +.. For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt + +=========== +Coverage.py +=========== + +Code coverage measurement for Python. + +.. image:: https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/banner2-direct.svg + :target: https://vshymanskyy.github.io/StandWithUkraine + :alt: Stand with Ukraine + +------------- + +| |kit| |license| |versions| +| |test-status| |quality-status| |docs| |metacov| +| |tidelift| |sponsor| |stars| |mastodon-coveragepy| |mastodon-nedbat| + +Coverage.py measures code coverage, typically during test execution. It uses +the code analysis tools and tracing hooks provided in the Python standard +library to determine which lines are executable, and which have been executed. + +Coverage.py runs on these versions of Python: + +.. PYVERSIONS + +* Python 3.9 through 3.14 alpha 1, including free-threading. +* PyPy3 versions 3.9 and 3.10. + +Documentation is on `Read the Docs`_. Code repository and issue tracker are on +`GitHub`_. + +.. _Read the Docs: https://coverage.readthedocs.io/en/7.6.4/ +.. _GitHub: https://github.com/nedbat/coveragepy + +**New in 7.x:** +multi-line exclusion patterns; +function/class reporting; +experimental support for sys.monitoring; +dropped support for Python 3.7 and 3.8; +added ``Coverage.collect()`` context manager; +improved data combining; +``[run] exclude_also`` setting; +``report --format=``; +type annotations. + +**New in 6.x:** +dropped support for Python 2.7, 3.5, and 3.6; +write data on SIGTERM; +added support for 3.10 match/case statements. + + +For Enterprise +-------------- + +.. |tideliftlogo| image:: https://nedbatchelder.com/pix/Tidelift_Logo_small.png + :alt: Tidelift + :target: https://tidelift.com/subscription/pkg/pypi-coverage?utm_source=pypi-coverage&utm_medium=referral&utm_campaign=readme + +.. list-table:: + :widths: 10 100 + + * - |tideliftlogo| + - `Available as part of the Tidelift Subscription. `_ + Coverage and thousands of other packages are working with + Tidelift to deliver one enterprise subscription that covers all of the open + source you use. If you want the flexibility of open source and the confidence + of commercial-grade software, this is for you. + `Learn more. `_ + + +Getting Started +--------------- + +Looking to run ``coverage`` on your test suite? See the `Quick Start section`_ +of the docs. + +.. _Quick Start section: https://coverage.readthedocs.io/en/7.6.4/#quick-start + + +Change history +-------------- + +The complete history of changes is on the `change history page`_. + +.. _change history page: https://coverage.readthedocs.io/en/7.6.4/changes.html + + +Code of Conduct +--------------- + +Everyone participating in the coverage.py project is expected to treat other +people with respect and to follow the guidelines articulated in the `Python +Community Code of Conduct`_. + +.. _Python Community Code of Conduct: https://www.python.org/psf/codeofconduct/ + + +Contributing +------------ + +Found a bug? Want to help improve the code or documentation? See the +`Contributing section`_ of the docs. + +.. _Contributing section: https://coverage.readthedocs.io/en/7.6.4/contributing.html + + +Security +-------- + +To report a security vulnerability, please use the `Tidelift security +contact`_. Tidelift will coordinate the fix and disclosure. + +.. _Tidelift security contact: https://tidelift.com/security + + +License +------- + +Licensed under the `Apache 2.0 License`_. For details, see `NOTICE.txt`_. + +.. _Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 +.. _NOTICE.txt: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt + + +.. |test-status| image:: https://github.com/nedbat/coveragepy/actions/workflows/testsuite.yml/badge.svg?branch=master&event=push + :target: https://github.com/nedbat/coveragepy/actions/workflows/testsuite.yml + :alt: Test suite status +.. |quality-status| image:: https://github.com/nedbat/coveragepy/actions/workflows/quality.yml/badge.svg?branch=master&event=push + :target: https://github.com/nedbat/coveragepy/actions/workflows/quality.yml + :alt: Quality check status +.. |docs| image:: https://readthedocs.org/projects/coverage/badge/?version=latest&style=flat + :target: https://coverage.readthedocs.io/en/7.6.4/ + :alt: Documentation +.. |kit| image:: https://img.shields.io/pypi/v/coverage + :target: https://pypi.org/project/coverage/ + :alt: PyPI status +.. |versions| image:: https://img.shields.io/pypi/pyversions/coverage.svg?logo=python&logoColor=FBE072 + :target: https://pypi.org/project/coverage/ + :alt: Python versions supported +.. |license| image:: https://img.shields.io/pypi/l/coverage.svg + :target: https://pypi.org/project/coverage/ + :alt: License +.. |metacov| image:: https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/nedbat/8c6980f77988a327348f9b02bbaf67f5/raw/metacov.json + :target: https://nedbat.github.io/coverage-reports/latest.html + :alt: Coverage reports +.. |tidelift| image:: https://tidelift.com/badges/package/pypi/coverage + :target: https://tidelift.com/subscription/pkg/pypi-coverage?utm_source=pypi-coverage&utm_medium=referral&utm_campaign=readme + :alt: Tidelift +.. |stars| image:: https://img.shields.io/github/stars/nedbat/coveragepy.svg?logo=github + :target: https://github.com/nedbat/coveragepy/stargazers + :alt: GitHub stars +.. |mastodon-nedbat| image:: https://img.shields.io/badge/dynamic/json?style=flat&labelColor=450657&logo=mastodon&logoColor=ffffff&label=@nedbat&query=followers_count&url=https%3A%2F%2Fhachyderm.io%2Fapi%2Fv1%2Faccounts%2Flookup%3Facct=nedbat + :target: https://hachyderm.io/@nedbat + :alt: nedbat on Mastodon +.. |mastodon-coveragepy| image:: https://img.shields.io/badge/dynamic/json?style=flat&labelColor=450657&logo=mastodon&logoColor=ffffff&label=@coveragepy&query=followers_count&url=https%3A%2F%2Fhachyderm.io%2Fapi%2Fv1%2Faccounts%2Flookup%3Facct=coveragepy + :target: https://hachyderm.io/@coveragepy + :alt: coveragepy on Mastodon +.. |sponsor| image:: https://img.shields.io/badge/%E2%9D%A4-Sponsor%20me-brightgreen?style=flat&logo=GitHub + :target: https://github.com/sponsors/nedbat + :alt: Sponsor me on GitHub diff --git a/.venv/Lib/site-packages/coverage-7.6.4.dist-info/RECORD b/.venv/Lib/site-packages/coverage-7.6.4.dist-info/RECORD new file mode 100644 index 00000000..0d759579 --- /dev/null +++ b/.venv/Lib/site-packages/coverage-7.6.4.dist-info/RECORD @@ -0,0 +1,104 @@ +../../Scripts/coverage-3.12.exe,sha256=CxGbiS_SJniVJdBsS-u-xNIL8AbrCT9sAliJL3ttbRg,108427 +../../Scripts/coverage.exe,sha256=CxGbiS_SJniVJdBsS-u-xNIL8AbrCT9sAliJL3ttbRg,108427 +../../Scripts/coverage3.exe,sha256=CxGbiS_SJniVJdBsS-u-xNIL8AbrCT9sAliJL3ttbRg,108427 +coverage-7.6.4.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +coverage-7.6.4.dist-info/LICENSE.txt,sha256=6z17VIVGasvYHytJb1latjfSeS4mggayfZnnk722dUk,10351 +coverage-7.6.4.dist-info/METADATA,sha256=PHuR-BG7Gh5L-TkHQTvA6y-1qQHEfIFZpCyByVP52P0,8404 +coverage-7.6.4.dist-info/RECORD,, +coverage-7.6.4.dist-info/WHEEL,sha256=62QJgqtUFevqILau0n0UncooEMoOyVCKVQitJpcuCig,101 +coverage-7.6.4.dist-info/entry_points.txt,sha256=s7x_4Bg6sI_AjEov0yLrWDOVR__vCWpFoIGw-MZk2qA,123 +coverage-7.6.4.dist-info/top_level.txt,sha256=BjhyiIvusb5OJkqCXjRncTF3soKF-mDOby-hxkWwwv0,9 +coverage/__init__.py,sha256=f3KZIgjkIaxJ4WZJAtfWwAHO6G1czoeyvuCOb09vRIs,1081 +coverage/__main__.py,sha256=LzQl-dAzS04IRHO8f2hyW79ck5g68kO13-9Ez-nHKGQ,303 +coverage/__pycache__/__init__.cpython-312.pyc,, +coverage/__pycache__/__main__.cpython-312.pyc,, +coverage/__pycache__/annotate.cpython-312.pyc,, +coverage/__pycache__/bytecode.cpython-312.pyc,, +coverage/__pycache__/cmdline.cpython-312.pyc,, +coverage/__pycache__/collector.cpython-312.pyc,, +coverage/__pycache__/config.cpython-312.pyc,, +coverage/__pycache__/context.cpython-312.pyc,, +coverage/__pycache__/control.cpython-312.pyc,, +coverage/__pycache__/core.cpython-312.pyc,, +coverage/__pycache__/data.cpython-312.pyc,, +coverage/__pycache__/debug.cpython-312.pyc,, +coverage/__pycache__/disposition.cpython-312.pyc,, +coverage/__pycache__/env.cpython-312.pyc,, +coverage/__pycache__/exceptions.cpython-312.pyc,, +coverage/__pycache__/execfile.cpython-312.pyc,, +coverage/__pycache__/files.cpython-312.pyc,, +coverage/__pycache__/html.cpython-312.pyc,, +coverage/__pycache__/inorout.cpython-312.pyc,, +coverage/__pycache__/jsonreport.cpython-312.pyc,, +coverage/__pycache__/lcovreport.cpython-312.pyc,, +coverage/__pycache__/misc.cpython-312.pyc,, +coverage/__pycache__/multiproc.cpython-312.pyc,, +coverage/__pycache__/numbits.cpython-312.pyc,, +coverage/__pycache__/parser.cpython-312.pyc,, +coverage/__pycache__/phystokens.cpython-312.pyc,, +coverage/__pycache__/plugin.cpython-312.pyc,, +coverage/__pycache__/plugin_support.cpython-312.pyc,, +coverage/__pycache__/python.cpython-312.pyc,, +coverage/__pycache__/pytracer.cpython-312.pyc,, +coverage/__pycache__/regions.cpython-312.pyc,, +coverage/__pycache__/report.cpython-312.pyc,, +coverage/__pycache__/report_core.cpython-312.pyc,, +coverage/__pycache__/results.cpython-312.pyc,, +coverage/__pycache__/sqldata.cpython-312.pyc,, +coverage/__pycache__/sqlitedb.cpython-312.pyc,, +coverage/__pycache__/sysmon.cpython-312.pyc,, +coverage/__pycache__/templite.cpython-312.pyc,, +coverage/__pycache__/tomlconfig.cpython-312.pyc,, +coverage/__pycache__/types.cpython-312.pyc,, +coverage/__pycache__/version.cpython-312.pyc,, +coverage/__pycache__/xmlreport.cpython-312.pyc,, +coverage/annotate.py,sha256=9vMpWp83DsQScDTWDT6pL8vIC7iUSSTRs4zCOac0TNk,3881 +coverage/bytecode.py,sha256=DInUGd7brsv5mdmGdQmAR79yHAN3H14ccitcPIzV7Qc,744 +coverage/cmdline.py,sha256=8OoJ_sEjXF4zdz8VgIlXA-o6atsdXQI8Cbdum_7An_A,35254 +coverage/collector.py,sha256=UfezPlmAPjOpNhgE6PbdYUr4gK9Zi2mPoEJ38XMPZEA,19972 +coverage/config.py,sha256=wazyeHPbB14ahCNXHIzhtxaVfJc-gw4RDhH2B5rQSLQ,22926 +coverage/context.py,sha256=lb8B-58yW8du56inutIeiZuTxdNr7TfJi1JddvRwQhg,2573 +coverage/control.py,sha256=K8-_8eBY0QfKqd_Hq3T-5IPeCHu0XlTdLWX1_ub10XM,53355 +coverage/core.py,sha256=rpwLpoGnOUeAWfgjRETjmApuB2SeMCj7C5xFDLdnZtQ,3554 +coverage/data.py,sha256=TNWtGx3noa_FBYFB0QUt3a8YDTkJyij3ux9Rt_nWgGA,8297 +coverage/debug.py,sha256=5n1QX0ytnfQFk76j3q6o4lV_E7Ys7iwi_7OiVNGDHzU,21310 +coverage/disposition.py,sha256=xb-zvwp_42zbePVis4Y_m_xjOyHcM6zmTGM1dn7TMv0,1952 +coverage/env.py,sha256=Gx_jWawfU_aZTWgnzGpGhxZEWW-lv8zcgCH7vuxMQc4,4590 +coverage/exceptions.py,sha256=QeimYAr2NgdcvWceOX8ull-66maTv2zz7UZ7ZFQUh9A,1460 +coverage/execfile.py,sha256=zkZJId_n4PEGuuWqQK8PXoBvYlzqS57titVcbbVJMKI,12214 +coverage/files.py,sha256=0qz-Jfiw6pYNFeKG9sIu42D3nq9HRLzzzutFSPSH5Qc,19942 +coverage/html.py,sha256=bKIe8ojFHvZDyYT6EFrSU3zcA3KfDgmytqj3J4on7dE,30147 +coverage/htmlfiles/coverage_html.js,sha256=PqDTAlVdIaB9gIjEf6JHHysMm_D7HyRe4BzQFfpf3OM,26207 +coverage/htmlfiles/favicon_32.png,sha256=vIEA-odDwRvSQ-syWfSwEnWGUWEv2b-Tv4tzTRfwJWE,1732 +coverage/htmlfiles/index.html,sha256=eciDXoye0zDRlWUY5q4HHlE1FPVG4_y0NZ9_OIwaQ0E,7005 +coverage/htmlfiles/keybd_closed.png,sha256=fZv4rmY3DkNJtPQjrFJ5UBOE5DdNof3mdeCZWC7TOoo,9004 +coverage/htmlfiles/pyfile.html,sha256=dJV8bc3mMQz6J_N2KxVMXNKVge6vnMiQiqqe1QYuZmw,6643 +coverage/htmlfiles/style.css,sha256=hEsJogNnNUUQOvNJRwR2OqJhmcsn03tRhuNWoc2g3VQ,14414 +coverage/htmlfiles/style.scss,sha256=VtMzE1jNJhiN0Ih6mhJ0niyxr9UIYyYtirIe-QVq_vs,19217 +coverage/inorout.py,sha256=0JkiC3qqeQX-h38W4EdYu49C2RN9IuJaiEfVns8vSyc,24382 +coverage/jsonreport.py,sha256=bkl2DggQRaxL5p2geBt0Vd1ffgiI-vjj1HUTY5QMklw,6919 +coverage/lcovreport.py,sha256=5vgS_HkT_Rq5gCxLKUyv79h-hTdk7qoTPUS0dE621rg,8127 +coverage/misc.py,sha256=zQUXYuWhfi5W5PIx2OU9Lxj2NgPEyy5j7IZUY6lBspQ,11591 +coverage/multiproc.py,sha256=qAxRi2Jc19a7DVp1hgUZP6JyNF5l3nLmjGcBD-aiZ08,4310 +coverage/numbits.py,sha256=YWRSkT-8872C-XtEzxTl1Uk9aoFKUjFbdKkNtYPKGEc,4819 +coverage/parser.py,sha256=6cf8nVciZcAyVmDgIN6a31ZsnAauFC46THCSttILBog,51915 +coverage/phystokens.py,sha256=R989TrsFcuZx7x2kBOZmOyQc7z_7QrA3d1cWcRBEGas,7735 +coverage/plugin.py,sha256=V1h7GiWKYGpZYISOHfr69lPK4K2f5XYa0o60XtrvVSk,22214 +coverage/plugin_support.py,sha256=T9B3CF6OdI07ICQoq18AaCRj-h3xBkOxz8FEuSlsbtc,10609 +coverage/py.typed,sha256=QhKiyYY18iX2PTjtgwSYebGpYvH_m0bYEyU_kMST7EU,73 +coverage/python.py,sha256=02kieGCrvS_DQhE3xIHZkJX9__ItYR5K9mm55eQ7-xU,8745 +coverage/pytracer.py,sha256=I-11n12PEO4OHv4vVUn7CmZixmU_HtN-P87edbL2b3I,15448 +coverage/regions.py,sha256=5ls28y7vlhby3m-Vs6vuvT3u61b23ivL1x6zrf_LYAY,4623 +coverage/report.py,sha256=C-Gp3GBBUQ-NUEwCTzEjj_j-JwdHceNkjdUJMnSU5QE,10876 +coverage/report_core.py,sha256=Ar6U6I3hf8Pu8jIfYmW-MXmlrlcfTzt2r8FeVW9oBvA,4196 +coverage/results.py,sha256=-0bkb0tc-CSCvLvuMMOwOa_hewtSn8N7iVCdZoFCEeI,14120 +coverage/sqldata.py,sha256=XvLEju-FpfFoy-EZffWQLaCgLlw23w5beM3J4xWU1Vk,44615 +coverage/sqlitedb.py,sha256=SVQ0qLHKWTZgxgw59LvZOpxAiNN7MZXn4Vy3RBki3n4,9931 +coverage/sysmon.py,sha256=YtfeO_RdLL14YElF53DP8onD_xNgh03xhFjj8idfUfA,16236 +coverage/templite.py,sha256=CrVt52hhVQxkEY7R9-LV5MBrHnDAoe8xBG1XYIwUPlc,11114 +coverage/tomlconfig.py,sha256=eqhqyA2qgYBsq5Xr7R4EPcXNnc477KnTY6hIRta-9Sk,7760 +coverage/tracer.cp312-win_amd64.pyd,sha256=5hn0M4ud0JJ5vLpWD9vsF4i8U_Dfr_iaQw7nbguV5nY,22528 +coverage/tracer.pyi,sha256=A_x3UrAuonDZaQlhcaTJCOA4YgsgLXnG1ZffeNGZ6OM,1244 +coverage/types.py,sha256=HTk2YiapshzP2zc5Xu4wJirIOc3hDtiGKHGmXEwZcQM,5851 +coverage/version.py,sha256=7NNQ2rxA8QYAwSN9atjuoQI5ddRTgO4moQU6Uq7HpIg,1481 +coverage/xmlreport.py,sha256=R2-2XLNcJuOUydaB5KnVvlCJu3H3vGhxJI0erdm11Qo,10063 diff --git a/.venv/Lib/site-packages/coverage-7.6.4.dist-info/WHEEL b/.venv/Lib/site-packages/coverage-7.6.4.dist-info/WHEEL new file mode 100644 index 00000000..bd4c259e --- /dev/null +++ b/.venv/Lib/site-packages/coverage-7.6.4.dist-info/WHEEL @@ -0,0 +1,5 @@ +Wheel-Version: 1.0 +Generator: setuptools (75.2.0) +Root-Is-Purelib: false +Tag: cp312-cp312-win_amd64 + diff --git a/.venv/Lib/site-packages/coverage-7.6.4.dist-info/entry_points.txt b/.venv/Lib/site-packages/coverage-7.6.4.dist-info/entry_points.txt new file mode 100644 index 00000000..242b4774 --- /dev/null +++ b/.venv/Lib/site-packages/coverage-7.6.4.dist-info/entry_points.txt @@ -0,0 +1,4 @@ +[console_scripts] +coverage = coverage.cmdline:main +coverage-3.12 = coverage.cmdline:main +coverage3 = coverage.cmdline:main diff --git a/.venv/Lib/site-packages/coverage-7.6.4.dist-info/top_level.txt b/.venv/Lib/site-packages/coverage-7.6.4.dist-info/top_level.txt new file mode 100644 index 00000000..4ebc8aea --- /dev/null +++ b/.venv/Lib/site-packages/coverage-7.6.4.dist-info/top_level.txt @@ -0,0 +1 @@ +coverage diff --git a/.venv/Lib/site-packages/coverage/__init__.py b/.venv/Lib/site-packages/coverage/__init__.py new file mode 100644 index 00000000..1bda8921 --- /dev/null +++ b/.venv/Lib/site-packages/coverage/__init__.py @@ -0,0 +1,38 @@ +# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt + +""" +Code coverage measurement for Python. + +Ned Batchelder +https://coverage.readthedocs.io + +""" + +from __future__ import annotations + +# mypy's convention is that "import as" names are public from the module. +# We import names as themselves to indicate that. Pylint sees it as pointless, +# so disable its warning. +# pylint: disable=useless-import-alias + +from coverage.version import ( + __version__ as __version__, + version_info as version_info, +) + +from coverage.control import ( + Coverage as Coverage, + process_startup as process_startup, +) +from coverage.data import CoverageData as CoverageData +from coverage.exceptions import CoverageException as CoverageException +from coverage.plugin import ( + CodeRegion as CodeRegion, + CoveragePlugin as CoveragePlugin, + FileReporter as FileReporter, + FileTracer as FileTracer, +) + +# Backward compatibility. +coverage = Coverage diff --git a/.venv/Lib/site-packages/coverage/__main__.py b/.venv/Lib/site-packages/coverage/__main__.py new file mode 100644 index 00000000..ce2d8dbd --- /dev/null +++ b/.venv/Lib/site-packages/coverage/__main__.py @@ -0,0 +1,10 @@ +# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt + +"""Coverage.py's main entry point.""" + +from __future__ import annotations + +import sys +from coverage.cmdline import main +sys.exit(main()) diff --git a/.venv/Lib/site-packages/coverage/annotate.py b/.venv/Lib/site-packages/coverage/annotate.py new file mode 100644 index 00000000..13d44b21 --- /dev/null +++ b/.venv/Lib/site-packages/coverage/annotate.py @@ -0,0 +1,115 @@ +# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt + +"""Source file annotation for coverage.py.""" + +from __future__ import annotations + +import os +import re + +from typing import TYPE_CHECKING +from collections.abc import Iterable + +from coverage.files import flat_rootname +from coverage.misc import ensure_dir, isolate_module +from coverage.plugin import FileReporter +from coverage.report_core import get_analysis_to_report +from coverage.results import Analysis +from coverage.types import TMorf + +if TYPE_CHECKING: + from coverage import Coverage + +os = isolate_module(os) + + +class AnnotateReporter: + """Generate annotated source files showing line coverage. + + This reporter creates annotated copies of the measured source files. Each + .py file is copied as a .py,cover file, with a left-hand margin annotating + each line:: + + > def h(x): + - if 0: #pragma: no cover + - pass + > if x == 1: + ! a = 1 + > else: + > a = 2 + + > h(2) + + Executed lines use ">", lines not executed use "!", lines excluded from + consideration use "-". + + """ + + def __init__(self, coverage: Coverage) -> None: + self.coverage = coverage + self.config = self.coverage.config + self.directory: str | None = None + + blank_re = re.compile(r"\s*(#|$)") + else_re = re.compile(r"\s*else\s*:\s*(#|$)") + + def report(self, morfs: Iterable[TMorf] | None, directory: str | None = None) -> None: + """Run the report. + + See `coverage.report()` for arguments. + + """ + self.directory = directory + self.coverage.get_data() + for fr, analysis in get_analysis_to_report(self.coverage, morfs): + self.annotate_file(fr, analysis) + + def annotate_file(self, fr: FileReporter, analysis: Analysis) -> None: + """Annotate a single file. + + `fr` is the FileReporter for the file to annotate. + + """ + statements = sorted(analysis.statements) + missing = sorted(analysis.missing) + excluded = sorted(analysis.excluded) + + if self.directory: + ensure_dir(self.directory) + dest_file = os.path.join(self.directory, flat_rootname(fr.relative_filename())) + if dest_file.endswith("_py"): + dest_file = dest_file[:-3] + ".py" + dest_file += ",cover" + else: + dest_file = fr.filename + ",cover" + + with open(dest_file, "w", encoding="utf-8") as dest: + i = j = 0 + covered = True + source = fr.source() + for lineno, line in enumerate(source.splitlines(True), start=1): + while i < len(statements) and statements[i] < lineno: + i += 1 + while j < len(missing) and missing[j] < lineno: + j += 1 + if i < len(statements) and statements[i] == lineno: + covered = j >= len(missing) or missing[j] > lineno + if self.blank_re.match(line): + dest.write(" ") + elif self.else_re.match(line): + # Special logic for lines containing only "else:". + if j >= len(missing): + dest.write("> ") + elif statements[i] == missing[j]: + dest.write("! ") + else: + dest.write("> ") + elif lineno in excluded: + dest.write("- ") + elif covered: + dest.write("> ") + else: + dest.write("! ") + + dest.write(line) diff --git a/.venv/Lib/site-packages/coverage/bytecode.py b/.venv/Lib/site-packages/coverage/bytecode.py new file mode 100644 index 00000000..764b29b8 --- /dev/null +++ b/.venv/Lib/site-packages/coverage/bytecode.py @@ -0,0 +1,22 @@ +# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt + +"""Bytecode manipulation for coverage.py""" + +from __future__ import annotations + +from types import CodeType +from collections.abc import Iterator + + +def code_objects(code: CodeType) -> Iterator[CodeType]: + """Iterate over all the code objects in `code`.""" + stack = [code] + while stack: + # We're going to return the code object on the stack, but first + # push its children for later returning. + code = stack.pop() + for c in code.co_consts: + if isinstance(c, CodeType): + stack.append(c) + yield code diff --git a/.venv/Lib/site-packages/coverage/cmdline.py b/.venv/Lib/site-packages/coverage/cmdline.py new file mode 100644 index 00000000..7c01ccbf --- /dev/null +++ b/.venv/Lib/site-packages/coverage/cmdline.py @@ -0,0 +1,1009 @@ +# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt + +"""Command-line support for coverage.py.""" + +from __future__ import annotations + +import glob +import optparse # pylint: disable=deprecated-module +import os +import os.path +import shlex +import sys +import textwrap +import traceback + +from typing import cast, Any, NoReturn + +import coverage +from coverage import Coverage +from coverage import env +from coverage.config import CoverageConfig +from coverage.control import DEFAULT_DATAFILE +from coverage.core import HAS_CTRACER +from coverage.data import combinable_files, debug_data_file +from coverage.debug import info_header, short_stack, write_formatted_info +from coverage.exceptions import _BaseCoverageException, _ExceptionDuringRun, NoSource +from coverage.execfile import PyRunner +from coverage.results import display_covered, should_fail_under +from coverage.version import __url__ + +# When adding to this file, alphabetization is important. Look for +# "alphabetize" comments throughout. + +class Opts: + """A namespace class for individual options we'll build parsers from.""" + + # Keep these entries alphabetized (roughly) by the option name as it + # appears on the command line. + + append = optparse.make_option( + "-a", "--append", action="store_true", + help="Append coverage data to .coverage, otherwise it starts clean each time.", + ) + branch = optparse.make_option( + "", "--branch", action="store_true", + help="Measure branch coverage in addition to statement coverage.", + ) + concurrency = optparse.make_option( + "", "--concurrency", action="store", metavar="LIBS", + help=( + "Properly measure code using a concurrency library. " + + "Valid values are: {}, or a comma-list of them." + ).format(", ".join(sorted(CoverageConfig.CONCURRENCY_CHOICES))), + ) + context = optparse.make_option( + "", "--context", action="store", metavar="LABEL", + help="The context label to record for this coverage run.", + ) + contexts = optparse.make_option( + "", "--contexts", action="store", metavar="REGEX1,REGEX2,...", + help=( + "Only display data from lines covered in the given contexts. " + + "Accepts Python regexes, which must be quoted." + ), + ) + datafile = optparse.make_option( + "", "--data-file", action="store", metavar="DATAFILE", + help=( + "Base name of the data files to operate on. " + + "Defaults to '.coverage'. [env: COVERAGE_FILE]" + ), + ) + datafle_input = optparse.make_option( + "", "--data-file", action="store", metavar="INFILE", + help=( + "Read coverage data for report generation from this file. " + + "Defaults to '.coverage'. [env: COVERAGE_FILE]" + ), + ) + datafile_output = optparse.make_option( + "", "--data-file", action="store", metavar="OUTFILE", + help=( + "Write the recorded coverage data to this file. " + + "Defaults to '.coverage'. [env: COVERAGE_FILE]" + ), + ) + debug = optparse.make_option( + "", "--debug", action="store", metavar="OPTS", + help="Debug options, separated by commas. [env: COVERAGE_DEBUG]", + ) + directory = optparse.make_option( + "-d", "--directory", action="store", metavar="DIR", + help="Write the output files to DIR.", + ) + fail_under = optparse.make_option( + "", "--fail-under", action="store", metavar="MIN", type="float", + help="Exit with a status of 2 if the total coverage is less than MIN.", + ) + format = optparse.make_option( + "", "--format", action="store", metavar="FORMAT", + help="Output format, either text (default), markdown, or total.", + ) + help = optparse.make_option( + "-h", "--help", action="store_true", + help="Get help on this command.", + ) + ignore_errors = optparse.make_option( + "-i", "--ignore-errors", action="store_true", + help="Ignore errors while reading source files.", + ) + include = optparse.make_option( + "", "--include", action="store", metavar="PAT1,PAT2,...", + help=( + "Include only files whose paths match one of these patterns. " + + "Accepts shell-style wildcards, which must be quoted." + ), + ) + keep = optparse.make_option( + "", "--keep", action="store_true", + help="Keep original coverage files, otherwise they are deleted.", + ) + pylib = optparse.make_option( + "-L", "--pylib", action="store_true", + help=( + "Measure coverage even inside the Python installed library, " + + "which isn't done by default." + ), + ) + show_missing = optparse.make_option( + "-m", "--show-missing", action="store_true", + help="Show line numbers of statements in each module that weren't executed.", + ) + module = optparse.make_option( + "-m", "--module", action="store_true", + help=( + " is an importable Python module, not a script path, " + + "to be run as 'python -m' would run it." + ), + ) + omit = optparse.make_option( + "", "--omit", action="store", metavar="PAT1,PAT2,...", + help=( + "Omit files whose paths match one of these patterns. " + + "Accepts shell-style wildcards, which must be quoted." + ), + ) + output_xml = optparse.make_option( + "-o", "", action="store", dest="outfile", metavar="OUTFILE", + help="Write the XML report to this file. Defaults to 'coverage.xml'", + ) + output_json = optparse.make_option( + "-o", "", action="store", dest="outfile", metavar="OUTFILE", + help="Write the JSON report to this file. Defaults to 'coverage.json'", + ) + output_lcov = optparse.make_option( + "-o", "", action="store", dest="outfile", metavar="OUTFILE", + help="Write the LCOV report to this file. Defaults to 'coverage.lcov'", + ) + json_pretty_print = optparse.make_option( + "", "--pretty-print", action="store_true", + help="Format the JSON for human readers.", + ) + parallel_mode = optparse.make_option( + "-p", "--parallel-mode", action="store_true", + help=( + "Append the machine name, process id and random number to the " + + "data file name to simplify collecting data from " + + "many processes." + ), + ) + precision = optparse.make_option( + "", "--precision", action="store", metavar="N", type=int, + help=( + "Number of digits after the decimal point to display for " + + "reported coverage percentages." + ), + ) + quiet = optparse.make_option( + "-q", "--quiet", action="store_true", + help="Don't print messages about what is happening.", + ) + rcfile = optparse.make_option( + "", "--rcfile", action="store", + help=( + "Specify configuration file. " + + "By default '.coveragerc', 'setup.cfg', 'tox.ini', and " + + "'pyproject.toml' are tried. [env: COVERAGE_RCFILE]" + ), + ) + show_contexts = optparse.make_option( + "--show-contexts", action="store_true", + help="Show contexts for covered lines.", + ) + skip_covered = optparse.make_option( + "--skip-covered", action="store_true", + help="Skip files with 100% coverage.", + ) + no_skip_covered = optparse.make_option( + "--no-skip-covered", action="store_false", dest="skip_covered", + help="Disable --skip-covered.", + ) + skip_empty = optparse.make_option( + "--skip-empty", action="store_true", + help="Skip files with no code.", + ) + sort = optparse.make_option( + "--sort", action="store", metavar="COLUMN", + help=( + "Sort the report by the named column: name, stmts, miss, branch, brpart, or cover. " + + "Default is name." + ), + ) + source = optparse.make_option( + "", "--source", action="store", metavar="SRC1,SRC2,...", + help="A list of directories or importable names of code to measure.", + ) + timid = optparse.make_option( + "", "--timid", action="store_true", + help="Use the slower Python trace function core.", + ) + title = optparse.make_option( + "", "--title", action="store", metavar="TITLE", + help="A text string to use as the title on the HTML.", + ) + version = optparse.make_option( + "", "--version", action="store_true", + help="Display version information and exit.", + ) + + +class CoverageOptionParser(optparse.OptionParser): + """Base OptionParser for coverage.py. + + Problems don't exit the program. + Defaults are initialized for all options. + + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + kwargs["add_help_option"] = False + super().__init__(*args, **kwargs) + self.set_defaults( + # Keep these arguments alphabetized by their names. + action=None, + append=None, + branch=None, + concurrency=None, + context=None, + contexts=None, + data_file=None, + debug=None, + directory=None, + fail_under=None, + format=None, + help=None, + ignore_errors=None, + include=None, + keep=None, + module=None, + omit=None, + parallel_mode=None, + precision=None, + pylib=None, + quiet=None, + rcfile=True, + show_contexts=None, + show_missing=None, + skip_covered=None, + skip_empty=None, + sort=None, + source=None, + timid=None, + title=None, + version=None, + ) + + self.disable_interspersed_args() + + class OptionParserError(Exception): + """Used to stop the optparse error handler ending the process.""" + pass + + def parse_args_ok(self, args: list[str]) -> tuple[bool, optparse.Values | None, list[str]]: + """Call optparse.parse_args, but return a triple: + + (ok, options, args) + + """ + try: + options, args = super().parse_args(args) + except self.OptionParserError: + return False, None, [] + return True, options, args + + def error(self, msg: str) -> NoReturn: + """Override optparse.error so sys.exit doesn't get called.""" + show_help(msg) + raise self.OptionParserError + + +class GlobalOptionParser(CoverageOptionParser): + """Command-line parser for coverage.py global option arguments.""" + + def __init__(self) -> None: + super().__init__() + + self.add_options([ + Opts.help, + Opts.version, + ]) + + +class CmdOptionParser(CoverageOptionParser): + """Parse one of the new-style commands for coverage.py.""" + + def __init__( + self, + action: str, + options: list[optparse.Option], + description: str, + usage: str | None = None, + ): + """Create an OptionParser for a coverage.py command. + + `action` is the slug to put into `options.action`. + `options` is a list of Option's for the command. + `description` is the description of the command, for the help text. + `usage` is the usage string to display in help. + + """ + if usage: + usage = "%prog " + usage + super().__init__( + usage=usage, + description=description, + ) + self.set_defaults(action=action) + self.add_options(options) + self.cmd = action + + def __eq__(self, other: str) -> bool: # type: ignore[override] + # A convenience equality, so that I can put strings in unit test + # results, and they will compare equal to objects. + return (other == f"") + + __hash__ = None # type: ignore[assignment] + + def get_prog_name(self) -> str: + """Override of an undocumented function in optparse.OptionParser.""" + program_name = super().get_prog_name() + + # Include the sub-command for this parser as part of the command. + return f"{program_name} {self.cmd}" + +# In lists of Opts, keep them alphabetized by the option names as they appear +# on the command line, since these lists determine the order of the options in +# the help output. +# +# In COMMANDS, keep the keys (command names) alphabetized. + +GLOBAL_ARGS = [ + Opts.debug, + Opts.help, + Opts.rcfile, +] + +COMMANDS = { + "annotate": CmdOptionParser( + "annotate", + [ + Opts.directory, + Opts.datafle_input, + Opts.ignore_errors, + Opts.include, + Opts.omit, + ] + GLOBAL_ARGS, + usage="[options] [modules]", + description=( + "Make annotated copies of the given files, marking statements that are executed " + + "with > and statements that are missed with !." + ), + ), + + "combine": CmdOptionParser( + "combine", + [ + Opts.append, + Opts.datafile, + Opts.keep, + Opts.quiet, + ] + GLOBAL_ARGS, + usage="[options] ... ", + description=( + "Combine data from multiple coverage files. " + + "The combined results are written to a single " + + "file representing the union of the data. The positional " + + "arguments are data files or directories containing data files. " + + "If no paths are provided, data files in the default data file's " + + "directory are combined." + ), + ), + + "debug": CmdOptionParser( + "debug", GLOBAL_ARGS, + usage="", + description=( + "Display information about the internals of coverage.py, " + + "for diagnosing problems. " + + "Topics are: " + + "'data' to show a summary of the collected data; " + + "'sys' to show installation information; " + + "'config' to show the configuration; " + + "'premain' to show what is calling coverage; " + + "'pybehave' to show internal flags describing Python behavior." + ), + ), + + "erase": CmdOptionParser( + "erase", + [ + Opts.datafile, + ] + GLOBAL_ARGS, + description="Erase previously collected coverage data.", + ), + + "help": CmdOptionParser( + "help", GLOBAL_ARGS, + usage="[command]", + description="Describe how to use coverage.py", + ), + + "html": CmdOptionParser( + "html", + [ + Opts.contexts, + Opts.directory, + Opts.datafle_input, + Opts.fail_under, + Opts.ignore_errors, + Opts.include, + Opts.omit, + Opts.precision, + Opts.quiet, + Opts.show_contexts, + Opts.skip_covered, + Opts.no_skip_covered, + Opts.skip_empty, + Opts.title, + ] + GLOBAL_ARGS, + usage="[options] [modules]", + description=( + "Create an HTML report of the coverage of the files. " + + "Each file gets its own page, with the source decorated to show " + + "executed, excluded, and missed lines." + ), + ), + + "json": CmdOptionParser( + "json", + [ + Opts.contexts, + Opts.datafle_input, + Opts.fail_under, + Opts.ignore_errors, + Opts.include, + Opts.omit, + Opts.output_json, + Opts.json_pretty_print, + Opts.quiet, + Opts.show_contexts, + ] + GLOBAL_ARGS, + usage="[options] [modules]", + description="Generate a JSON report of coverage results.", + ), + + "lcov": CmdOptionParser( + "lcov", + [ + Opts.datafle_input, + Opts.fail_under, + Opts.ignore_errors, + Opts.include, + Opts.output_lcov, + Opts.omit, + Opts.quiet, + ] + GLOBAL_ARGS, + usage="[options] [modules]", + description="Generate an LCOV report of coverage results.", + ), + + "report": CmdOptionParser( + "report", + [ + Opts.contexts, + Opts.datafle_input, + Opts.fail_under, + Opts.format, + Opts.ignore_errors, + Opts.include, + Opts.omit, + Opts.precision, + Opts.sort, + Opts.show_missing, + Opts.skip_covered, + Opts.no_skip_covered, + Opts.skip_empty, + ] + GLOBAL_ARGS, + usage="[options] [modules]", + description="Report coverage statistics on modules.", + ), + + "run": CmdOptionParser( + "run", + [ + Opts.append, + Opts.branch, + Opts.concurrency, + Opts.context, + Opts.datafile_output, + Opts.include, + Opts.module, + Opts.omit, + Opts.pylib, + Opts.parallel_mode, + Opts.source, + Opts.timid, + ] + GLOBAL_ARGS, + usage="[options] [program options]", + description="Run a Python program, measuring code execution.", + ), + + "xml": CmdOptionParser( + "xml", + [ + Opts.datafle_input, + Opts.fail_under, + Opts.ignore_errors, + Opts.include, + Opts.omit, + Opts.output_xml, + Opts.quiet, + Opts.skip_empty, + ] + GLOBAL_ARGS, + usage="[options] [modules]", + description="Generate an XML report of coverage results.", + ), +} + + +def show_help( + error: str | None = None, + topic: str | None = None, + parser: optparse.OptionParser | None = None, +) -> None: + """Display an error message, or the named topic.""" + assert error or topic or parser + + program_path = sys.argv[0] + if program_path.endswith(os.path.sep + "__main__.py"): + # The path is the main module of a package; get that path instead. + program_path = os.path.dirname(program_path) + program_name = os.path.basename(program_path) + if env.WINDOWS: + # entry_points={"console_scripts":...} on Windows makes files + # called coverage.exe, coverage3.exe, and coverage-3.5.exe. These + # invoke coverage-script.py, coverage3-script.py, and + # coverage-3.5-script.py. argv[0] is the .py file, but we want to + # get back to the original form. + auto_suffix = "-script.py" + if program_name.endswith(auto_suffix): + program_name = program_name[:-len(auto_suffix)] + + help_params = dict(coverage.__dict__) + help_params["__url__"] = __url__ + help_params["program_name"] = program_name + if HAS_CTRACER: + help_params["extension_modifier"] = "with C extension" + else: + help_params["extension_modifier"] = "without C extension" + + if error: + print(error, file=sys.stderr) + print(f"Use '{program_name} help' for help.", file=sys.stderr) + elif parser: + print(parser.format_help().strip()) + print() + else: + assert topic is not None + help_msg = textwrap.dedent(HELP_TOPICS.get(topic, "")).strip() + if help_msg: + print(help_msg.format(**help_params)) + else: + print(f"Don't know topic {topic!r}") + print("Full documentation is at {__url__}".format(**help_params)) + + +OK, ERR, FAIL_UNDER = 0, 1, 2 + + +class CoverageScript: + """The command-line interface to coverage.py.""" + + def __init__(self) -> None: + self.global_option = False + self.coverage: Coverage + + def command_line(self, argv: list[str]) -> int: + """The bulk of the command line interface to coverage.py. + + `argv` is the argument list to process. + + Returns 0 if all is well, 1 if something went wrong. + + """ + # Collect the command-line options. + if not argv: + show_help(topic="minimum_help") + return OK + + # The command syntax we parse depends on the first argument. Global + # switch syntax always starts with an option. + parser: optparse.OptionParser | None + self.global_option = argv[0].startswith("-") + if self.global_option: + parser = GlobalOptionParser() + else: + parser = COMMANDS.get(argv[0]) + if not parser: + show_help(f"Unknown command: {argv[0]!r}") + return ERR + argv = argv[1:] + + ok, options, args = parser.parse_args_ok(argv) + if not ok: + return ERR + assert options is not None + + # Handle help and version. + if self.do_help(options, args, parser): + return OK + + # Listify the list options. + source = unshell_list(options.source) + omit = unshell_list(options.omit) + include = unshell_list(options.include) + debug = unshell_list(options.debug) + contexts = unshell_list(options.contexts) + + if options.concurrency is not None: + concurrency = options.concurrency.split(",") + else: + concurrency = None + + # Do something. + self.coverage = Coverage( + data_file=options.data_file or DEFAULT_DATAFILE, + data_suffix=options.parallel_mode, + cover_pylib=options.pylib, + timid=options.timid, + branch=options.branch, + config_file=options.rcfile, + source=source, + omit=omit, + include=include, + debug=debug, + concurrency=concurrency, + check_preimported=True, + context=options.context, + messages=not options.quiet, + ) + + if options.action == "debug": + return self.do_debug(args) + + elif options.action == "erase": + self.coverage.erase() + return OK + + elif options.action == "run": + return self.do_run(options, args) + + elif options.action == "combine": + if options.append: + self.coverage.load() + data_paths = args or None + self.coverage.combine(data_paths, strict=True, keep=bool(options.keep)) + self.coverage.save() + return OK + + # Remaining actions are reporting, with some common options. + report_args = dict( + morfs=unglob_args(args), + ignore_errors=options.ignore_errors, + omit=omit, + include=include, + contexts=contexts, + ) + + # We need to be able to import from the current directory, because + # plugins may try to, for example, to read Django settings. + sys.path.insert(0, "") + + self.coverage.load() + + total = None + if options.action == "report": + total = self.coverage.report( + precision=options.precision, + show_missing=options.show_missing, + skip_covered=options.skip_covered, + skip_empty=options.skip_empty, + sort=options.sort, + output_format=options.format, + **report_args, + ) + elif options.action == "annotate": + self.coverage.annotate(directory=options.directory, **report_args) + elif options.action == "html": + total = self.coverage.html_report( + directory=options.directory, + precision=options.precision, + skip_covered=options.skip_covered, + skip_empty=options.skip_empty, + show_contexts=options.show_contexts, + title=options.title, + **report_args, + ) + elif options.action == "xml": + total = self.coverage.xml_report( + outfile=options.outfile, + skip_empty=options.skip_empty, + **report_args, + ) + elif options.action == "json": + total = self.coverage.json_report( + outfile=options.outfile, + pretty_print=options.pretty_print, + show_contexts=options.show_contexts, + **report_args, + ) + elif options.action == "lcov": + total = self.coverage.lcov_report( + outfile=options.outfile, + **report_args, + ) + else: + # There are no other possible actions. + raise AssertionError + + if total is not None: + # Apply the command line fail-under options, and then use the config + # value, so we can get fail_under from the config file. + if options.fail_under is not None: + self.coverage.set_option("report:fail_under", options.fail_under) + if options.precision is not None: + self.coverage.set_option("report:precision", options.precision) + + fail_under = cast(float, self.coverage.get_option("report:fail_under")) + precision = cast(int, self.coverage.get_option("report:precision")) + if should_fail_under(total, fail_under, precision): + msg = "total of {total} is less than fail-under={fail_under:.{p}f}".format( + total=display_covered(total, precision), + fail_under=fail_under, + p=precision, + ) + print("Coverage failure:", msg) + return FAIL_UNDER + + return OK + + def do_help( + self, + options: optparse.Values, + args: list[str], + parser: optparse.OptionParser, + ) -> bool: + """Deal with help requests. + + Return True if it handled the request, False if not. + + """ + # Handle help. + if options.help: + if self.global_option: + show_help(topic="help") + else: + show_help(parser=parser) + return True + + if options.action == "help": + if args: + for a in args: + parser_maybe = COMMANDS.get(a) + if parser_maybe is not None: + show_help(parser=parser_maybe) + else: + show_help(topic=a) + else: + show_help(topic="help") + return True + + # Handle version. + if options.version: + show_help(topic="version") + return True + + return False + + def do_run(self, options: optparse.Values, args: list[str]) -> int: + """Implementation of 'coverage run'.""" + + if not args: + if options.module: + # Specified -m with nothing else. + show_help("No module specified for -m") + return ERR + command_line = cast(str, self.coverage.get_option("run:command_line")) + if command_line is not None: + args = shlex.split(command_line) + if args and args[0] in {"-m", "--module"}: + options.module = True + args = args[1:] + if not args: + show_help("Nothing to do.") + return ERR + + if options.append and self.coverage.get_option("run:parallel"): + show_help("Can't append to data files in parallel mode.") + return ERR + + if options.concurrency == "multiprocessing": + # Can't set other run-affecting command line options with + # multiprocessing. + for opt_name in ["branch", "include", "omit", "pylib", "source", "timid"]: + # As it happens, all of these options have no default, meaning + # they will be None if they have not been specified. + if getattr(options, opt_name) is not None: + show_help( + "Options affecting multiprocessing must only be specified " + + "in a configuration file.\n" + + f"Remove --{opt_name} from the command line.", + ) + return ERR + + os.environ["COVERAGE_RUN"] = "true" + + runner = PyRunner(args, as_module=bool(options.module)) + runner.prepare() + + if options.append: + self.coverage.load() + + # Run the script. + self.coverage.start() + code_ran = True + try: + runner.run() + except NoSource: + code_ran = False + raise + finally: + self.coverage.stop() + if code_ran: + self.coverage.save() + + return OK + + def do_debug(self, args: list[str]) -> int: + """Implementation of 'coverage debug'.""" + + if not args: + show_help("What information would you like: config, data, sys, premain, pybehave?") + return ERR + if args[1:]: + show_help("Only one topic at a time, please") + return ERR + + if args[0] == "sys": + write_formatted_info(print, "sys", self.coverage.sys_info()) + elif args[0] == "data": + print(info_header("data")) + data_file = self.coverage.config.data_file + debug_data_file(data_file) + for filename in combinable_files(data_file): + print("-----") + debug_data_file(filename) + elif args[0] == "config": + write_formatted_info(print, "config", self.coverage.config.debug_info()) + elif args[0] == "premain": + print(info_header("premain")) + print(short_stack(full=True)) + elif args[0] == "pybehave": + write_formatted_info(print, "pybehave", env.debug_info()) + else: + show_help(f"Don't know what you mean by {args[0]!r}") + return ERR + + return OK + + +def unshell_list(s: str) -> list[str] | None: + """Turn a command-line argument into a list.""" + if not s: + return None + if env.WINDOWS: + # When running coverage.py as coverage.exe, some of the behavior + # of the shell is emulated: wildcards are expanded into a list of + # file names. So you have to single-quote patterns on the command + # line, but (not) helpfully, the single quotes are included in the + # argument, so we have to strip them off here. + s = s.strip("'") + return s.split(",") + + +def unglob_args(args: list[str]) -> list[str]: + """Interpret shell wildcards for platforms that need it.""" + if env.WINDOWS: + globbed = [] + for arg in args: + if "?" in arg or "*" in arg: + globbed.extend(glob.glob(arg)) + else: + globbed.append(arg) + args = globbed + return args + + +HELP_TOPICS = { + "help": """\ + Coverage.py, version {__version__} {extension_modifier} + Measure, collect, and report on code coverage in Python programs. + + usage: {program_name} [options] [args] + + Commands: + annotate Annotate source files with execution information. + combine Combine a number of data files. + debug Display information about the internals of coverage.py + erase Erase previously collected coverage data. + help Get help on using coverage.py. + html Create an HTML report. + json Create a JSON report of coverage results. + lcov Create an LCOV report of coverage results. + report Report coverage stats on modules. + run Run a Python program and measure code execution. + xml Create an XML report of coverage results. + + Use "{program_name} help " for detailed help on any command. + """, + + "minimum_help": ( + "Code coverage for Python, version {__version__} {extension_modifier}. " + + "Use '{program_name} help' for help." + ), + + "version": "Coverage.py, version {__version__} {extension_modifier}", +} + + +def main(argv: list[str] | None = None) -> int | None: + """The main entry point to coverage.py. + + This is installed as the script entry point. + + """ + if argv is None: + argv = sys.argv[1:] + try: + status = CoverageScript().command_line(argv) + except _ExceptionDuringRun as err: + # An exception was caught while running the product code. The + # sys.exc_info() return tuple is packed into an _ExceptionDuringRun + # exception. + traceback.print_exception(*err.args) # pylint: disable=no-value-for-parameter + status = ERR + except _BaseCoverageException as err: + # A controlled error inside coverage.py: print the message to the user. + msg = err.args[0] + print(msg) + status = ERR + except SystemExit as err: + # The user called `sys.exit()`. Exit with their argument, if any. + if err.args: + status = err.args[0] + else: + status = None + return status + +# Profiling using ox_profile. Install it from GitHub: +# pip install git+https://github.com/emin63/ox_profile.git +# +# $set_env.py: COVERAGE_PROFILE - Set to use ox_profile. +_profile = os.getenv("COVERAGE_PROFILE") +if _profile: # pragma: debugging + from ox_profile.core.launchers import SimpleLauncher # pylint: disable=import-error + original_main = main + + def main( # pylint: disable=function-redefined + argv: list[str] | None = None, + ) -> int | None: + """A wrapper around main that profiles.""" + profiler = SimpleLauncher.launch() + try: + return original_main(argv) + finally: + data, _ = profiler.query(re_filter="coverage", max_records=100) + print(profiler.show(query=data, limit=100, sep="", col="")) + profiler.cancel() diff --git a/.venv/Lib/site-packages/coverage/collector.py b/.venv/Lib/site-packages/coverage/collector.py new file mode 100644 index 00000000..53fa6871 --- /dev/null +++ b/.venv/Lib/site-packages/coverage/collector.py @@ -0,0 +1,497 @@ +# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt + +"""Raw data collector for coverage.py.""" + +from __future__ import annotations + +import contextlib +import functools +import os +import sys + +from collections.abc import Mapping +from types import FrameType +from typing import cast, Any, Callable, TypeVar + +from coverage import env +from coverage.config import CoverageConfig +from coverage.core import Core +from coverage.data import CoverageData +from coverage.debug import short_stack +from coverage.exceptions import ConfigError +from coverage.misc import human_sorted_items, isolate_module +from coverage.plugin import CoveragePlugin +from coverage.types import ( + TArc, + TCheckIncludeFn, + TFileDisposition, + TShouldStartContextFn, + TShouldTraceFn, + TTraceData, + TTraceFn, + Tracer, + TWarnFn, +) + +os = isolate_module(os) + + +T = TypeVar("T") + + +class Collector: + """Collects trace data. + + Creates a Tracer object for each thread, since they track stack + information. Each Tracer points to the same shared data, contributing + traced data points. + + When the Collector is started, it creates a Tracer for the current thread, + and installs a function to create Tracers for each new thread started. + When the Collector is stopped, all active Tracers are stopped. + + Threads started while the Collector is stopped will never have Tracers + associated with them. + + """ + + # The stack of active Collectors. Collectors are added here when started, + # and popped when stopped. Collectors on the stack are paused when not + # the top, and resumed when they become the top again. + _collectors: list[Collector] = [] + + # The concurrency settings we support here. + LIGHT_THREADS = {"greenlet", "eventlet", "gevent"} + + def __init__( + self, + core: Core, + should_trace: TShouldTraceFn, + check_include: TCheckIncludeFn, + should_start_context: TShouldStartContextFn | None, + file_mapper: Callable[[str], str], + branch: bool, + warn: TWarnFn, + concurrency: list[str], + ) -> None: + """Create a collector. + + `should_trace` is a function, taking a file name and a frame, and + returning a `coverage.FileDisposition object`. + + `check_include` is a function taking a file name and a frame. It returns + a boolean: True if the file should be traced, False if not. + + `should_start_context` is a function taking a frame, and returning a + string. If the frame should be the start of a new context, the string + is the new context. If the frame should not be the start of a new + context, return None. + + `file_mapper` is a function taking a filename, and returning a Unicode + filename. The result is the name that will be recorded in the data + file. + + If `branch` is true, then branches will be measured. This involves + collecting data on which statements followed each other (arcs). Use + `get_arc_data` to get the arc data. + + `warn` is a warning function, taking a single string message argument + and an optional slug argument which will be a string or None, to be + used if a warning needs to be issued. + + `concurrency` is a list of strings indicating the concurrency libraries + in use. Valid values are "greenlet", "eventlet", "gevent", or "thread" + (the default). "thread" can be combined with one of the other three. + Other values are ignored. + + """ + self.core = core + self.should_trace = should_trace + self.check_include = check_include + self.should_start_context = should_start_context + self.file_mapper = file_mapper + self.branch = branch + self.warn = warn + self.concurrency = concurrency + assert isinstance(self.concurrency, list), f"Expected a list: {self.concurrency!r}" + + self.pid = os.getpid() + + self.covdata: CoverageData + self.threading = None + self.static_context: str | None = None + + self.origin = short_stack() + + self.concur_id_func = None + + # We can handle a few concurrency options here, but only one at a time. + concurrencies = set(self.concurrency) + unknown = concurrencies - CoverageConfig.CONCURRENCY_CHOICES + if unknown: + show = ", ".join(sorted(unknown)) + raise ConfigError(f"Unknown concurrency choices: {show}") + light_threads = concurrencies & self.LIGHT_THREADS + if len(light_threads) > 1: + show = ", ".join(sorted(light_threads)) + raise ConfigError(f"Conflicting concurrency settings: {show}") + do_threading = False + + tried = "nothing" # to satisfy pylint + try: + if "greenlet" in concurrencies: + tried = "greenlet" + import greenlet + self.concur_id_func = greenlet.getcurrent + elif "eventlet" in concurrencies: + tried = "eventlet" + import eventlet.greenthread # pylint: disable=import-error,useless-suppression + self.concur_id_func = eventlet.greenthread.getcurrent + elif "gevent" in concurrencies: + tried = "gevent" + import gevent # pylint: disable=import-error,useless-suppression + self.concur_id_func = gevent.getcurrent + + if "thread" in concurrencies: + do_threading = True + except ImportError as ex: + msg = f"Couldn't trace with concurrency={tried}, the module isn't installed." + raise ConfigError(msg) from ex + + if self.concur_id_func and not hasattr(core.tracer_class, "concur_id_func"): + raise ConfigError( + "Can't support concurrency={} with {}, only threads are supported.".format( + tried, self.tracer_name(), + ), + ) + + if do_threading or not concurrencies: + # It's important to import threading only if we need it. If + # it's imported early, and the program being measured uses + # gevent, then gevent's monkey-patching won't work properly. + import threading + self.threading = threading + + self.reset() + + def __repr__(self) -> str: + return f"" + + def use_data(self, covdata: CoverageData, context: str | None) -> None: + """Use `covdata` for recording data.""" + self.covdata = covdata + self.static_context = context + self.covdata.set_context(self.static_context) + + def tracer_name(self) -> str: + """Return the class name of the tracer we're using.""" + return self.core.tracer_class.__name__ + + def _clear_data(self) -> None: + """Clear out existing data, but stay ready for more collection.""" + # We used to use self.data.clear(), but that would remove filename + # keys and data values that were still in use higher up the stack + # when we are called as part of switch_context. + with self.data_lock or contextlib.nullcontext(): + for d in self.data.values(): + d.clear() + + for tracer in self.tracers: + tracer.reset_activity() + + def reset(self) -> None: + """Clear collected data, and prepare to collect more.""" + self.data_lock = self.threading.Lock() if self.threading else None + + # The trace data we are collecting. + self.data: TTraceData = {} + + # A dictionary mapping file names to file tracer plugin names that will + # handle them. + self.file_tracers: dict[str, str] = {} + + self.disabled_plugins: set[str] = set() + + # The .should_trace_cache attribute is a cache from file names to + # coverage.FileDisposition objects, or None. When a file is first + # considered for tracing, a FileDisposition is obtained from + # Coverage.should_trace. Its .trace attribute indicates whether the + # file should be traced or not. If it should be, a plugin with dynamic + # file names can decide not to trace it based on the dynamic file name + # being excluded by the inclusion rules, in which case the + # FileDisposition will be replaced by None in the cache. + if env.PYPY: + import __pypy__ # pylint: disable=import-error + # Alex Gaynor said: + # should_trace_cache is a strictly growing key: once a key is in + # it, it never changes. Further, the keys used to access it are + # generally constant, given sufficient context. That is to say, at + # any given point _trace() is called, pypy is able to know the key. + # This is because the key is determined by the physical source code + # line, and that's invariant with the call site. + # + # This property of a dict with immutable keys, combined with + # call-site-constant keys is a match for PyPy's module dict, + # which is optimized for such workloads. + # + # This gives a 20% benefit on the workload described at + # https://bitbucket.org/pypy/pypy/issue/1871/10x-slower-than-cpython-under-coverage + self.should_trace_cache = __pypy__.newdict("module") + else: + self.should_trace_cache = {} + + # Our active Tracers. + self.tracers: list[Tracer] = [] + + self._clear_data() + + def lock_data(self) -> None: + """Lock self.data_lock, for use by the C tracer.""" + if self.data_lock is not None: + self.data_lock.acquire() + + def unlock_data(self) -> None: + """Unlock self.data_lock, for use by the C tracer.""" + if self.data_lock is not None: + self.data_lock.release() + + def _start_tracer(self) -> TTraceFn | None: + """Start a new Tracer object, and store it in self.tracers.""" + tracer = self.core.tracer_class(**self.core.tracer_kwargs) + tracer.data = self.data + tracer.lock_data = self.lock_data + tracer.unlock_data = self.unlock_data + tracer.trace_arcs = self.branch + tracer.should_trace = self.should_trace + tracer.should_trace_cache = self.should_trace_cache + tracer.warn = self.warn + + if hasattr(tracer, 'concur_id_func'): + tracer.concur_id_func = self.concur_id_func + if hasattr(tracer, 'file_tracers'): + tracer.file_tracers = self.file_tracers + if hasattr(tracer, 'threading'): + tracer.threading = self.threading + if hasattr(tracer, 'check_include'): + tracer.check_include = self.check_include + if hasattr(tracer, 'should_start_context'): + tracer.should_start_context = self.should_start_context + if hasattr(tracer, 'switch_context'): + tracer.switch_context = self.switch_context + if hasattr(tracer, 'disable_plugin'): + tracer.disable_plugin = self.disable_plugin + + fn = tracer.start() + self.tracers.append(tracer) + + return fn + + # The trace function has to be set individually on each thread before + # execution begins. Ironically, the only support the threading module has + # for running code before the thread main is the tracing function. So we + # install this as a trace function, and the first time it's called, it does + # the real trace installation. + # + # New in 3.12: threading.settrace_all_threads: https://github.com/python/cpython/pull/96681 + + def _installation_trace(self, frame: FrameType, event: str, arg: Any) -> TTraceFn | None: + """Called on new threads, installs the real tracer.""" + # Remove ourselves as the trace function. + sys.settrace(None) + # Install the real tracer. + fn: TTraceFn | None = self._start_tracer() + # Invoke the real trace function with the current event, to be sure + # not to lose an event. + if fn: + fn = fn(frame, event, arg) + # Return the new trace function to continue tracing in this scope. + return fn + + def start(self) -> None: + """Start collecting trace information.""" + # We may be a new collector in a forked process. The old process' + # collectors will be in self._collectors, but they won't be usable. + # Find them and discard them. + keep_collectors = [] + for c in self._collectors: + if c.pid == self.pid: + keep_collectors.append(c) + else: + c.post_fork() + self._collectors[:] = keep_collectors + + if self._collectors: + self._collectors[-1].pause() + + self.tracers = [] + + try: + # Install the tracer on this thread. + self._start_tracer() + except: + if self._collectors: + self._collectors[-1].resume() + raise + + # If _start_tracer succeeded, then we add ourselves to the global + # stack of collectors. + self._collectors.append(self) + + # Install our installation tracer in threading, to jump-start other + # threads. + if self.core.systrace and self.threading: + self.threading.settrace(self._installation_trace) + + def stop(self) -> None: + """Stop collecting trace information.""" + assert self._collectors + if self._collectors[-1] is not self: + print("self._collectors:") + for c in self._collectors: + print(f" {c!r}\n{c.origin}") + assert self._collectors[-1] is self, ( + f"Expected current collector to be {self!r}, but it's {self._collectors[-1]!r}" + ) + + self.pause() + + # Remove this Collector from the stack, and resume the one underneath (if any). + self._collectors.pop() + if self._collectors: + self._collectors[-1].resume() + + def pause(self) -> None: + """Pause tracing, but be prepared to `resume`.""" + for tracer in self.tracers: + tracer.stop() + stats = tracer.get_stats() + if stats: + print("\nCoverage.py tracer stats:") + for k, v in human_sorted_items(stats.items()): + print(f"{k:>20}: {v}") + if self.threading: + self.threading.settrace(None) + + def resume(self) -> None: + """Resume tracing after a `pause`.""" + for tracer in self.tracers: + tracer.start() + if self.core.systrace: + if self.threading: + self.threading.settrace(self._installation_trace) + else: + self._start_tracer() + + def post_fork(self) -> None: + """After a fork, tracers might need to adjust.""" + for tracer in self.tracers: + if hasattr(tracer, "post_fork"): + tracer.post_fork() + + def _activity(self) -> bool: + """Has any activity been traced? + + Returns a boolean, True if any trace function was invoked. + + """ + return any(tracer.activity() for tracer in self.tracers) + + def switch_context(self, new_context: str | None) -> None: + """Switch to a new dynamic context.""" + context: str | None + self.flush_data() + if self.static_context: + context = self.static_context + if new_context: + context += "|" + new_context + else: + context = new_context + self.covdata.set_context(context) + + def disable_plugin(self, disposition: TFileDisposition) -> None: + """Disable the plugin mentioned in `disposition`.""" + file_tracer = disposition.file_tracer + assert file_tracer is not None + plugin = file_tracer._coverage_plugin + plugin_name = plugin._coverage_plugin_name + self.warn(f"Disabling plug-in {plugin_name!r} due to previous exception") + plugin._coverage_enabled = False + disposition.trace = False + + @functools.cache # pylint: disable=method-cache-max-size-none + def cached_mapped_file(self, filename: str) -> str: + """A locally cached version of file names mapped through file_mapper.""" + return self.file_mapper(filename) + + def mapped_file_dict(self, d: Mapping[str, T]) -> dict[str, T]: + """Return a dict like d, but with keys modified by file_mapper.""" + # The call to list(items()) ensures that the GIL protects the dictionary + # iterator against concurrent modifications by tracers running + # in other threads. We try three times in case of concurrent + # access, hoping to get a clean copy. + runtime_err = None + for _ in range(3): # pragma: part covered + try: + items = list(d.items()) + except RuntimeError as ex: # pragma: cant happen + runtime_err = ex + else: + break + else: # pragma: cant happen + assert isinstance(runtime_err, Exception) + raise runtime_err + + return {self.cached_mapped_file(k): v for k, v in items if v} + + def plugin_was_disabled(self, plugin: CoveragePlugin) -> None: + """Record that `plugin` was disabled during the run.""" + self.disabled_plugins.add(plugin._coverage_plugin_name) + + def flush_data(self) -> bool: + """Save the collected data to our associated `CoverageData`. + + Data may have also been saved along the way. This forces the + last of the data to be saved. + + Returns True if there was data to save, False if not. + """ + if not self._activity(): + return False + + if self.branch: + if self.core.packed_arcs: + # Unpack the line number pairs packed into integers. See + # tracer.c:CTracer_record_pair for the C code that creates + # these packed ints. + arc_data: dict[str, list[TArc]] = {} + packed_data = cast(dict[str, set[int]], self.data) + + # The list() here and in the inner loop are to get a clean copy + # even as tracers are continuing to add data. + for fname, packeds in list(packed_data.items()): + tuples = [] + for packed in list(packeds): + l1 = packed & 0xFFFFF + l2 = (packed & (0xFFFFF << 20)) >> 20 + if packed & (1 << 40): + l1 *= -1 + if packed & (1 << 41): + l2 *= -1 + tuples.append((l1, l2)) + arc_data[fname] = tuples + else: + arc_data = cast(dict[str, list[TArc]], self.data) + self.covdata.add_arcs(self.mapped_file_dict(arc_data)) + else: + line_data = cast(dict[str, set[int]], self.data) + self.covdata.add_lines(self.mapped_file_dict(line_data)) + + file_tracers = { + k: v for k, v in self.file_tracers.items() + if v not in self.disabled_plugins + } + self.covdata.add_file_tracers(self.mapped_file_dict(file_tracers)) + + self._clear_data() + return True diff --git a/.venv/Lib/site-packages/coverage/config.py b/.venv/Lib/site-packages/coverage/config.py new file mode 100644 index 00000000..357fc5af --- /dev/null +++ b/.venv/Lib/site-packages/coverage/config.py @@ -0,0 +1,627 @@ +# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt + +"""Config file for coverage.py""" + +from __future__ import annotations + +import collections +import configparser +import copy +import os +import os.path +import re + +from typing import ( + Any, Callable, Union, +) +from collections.abc import Iterable + +from coverage.exceptions import ConfigError +from coverage.misc import isolate_module, human_sorted_items, substitute_variables +from coverage.tomlconfig import TomlConfigParser, TomlDecodeError +from coverage.types import ( + TConfigurable, TConfigSectionIn, TConfigValueIn, TConfigSectionOut, + TConfigValueOut, TPluginConfig, +) + +os = isolate_module(os) + + +class HandyConfigParser(configparser.ConfigParser): + """Our specialization of ConfigParser.""" + + def __init__(self, our_file: bool) -> None: + """Create the HandyConfigParser. + + `our_file` is True if this config file is specifically for coverage, + False if we are examining another config file (tox.ini, setup.cfg) + for possible settings. + """ + + super().__init__(interpolation=None) + self.section_prefixes = ["coverage:"] + if our_file: + self.section_prefixes.append("") + + def read( # type: ignore[override] + self, + filenames: Iterable[str], + encoding_unused: str | None = None, + ) -> list[str]: + """Read a file name as UTF-8 configuration data.""" + return super().read(filenames, encoding="utf-8") + + def real_section(self, section: str) -> str | None: + """Get the actual name of a section.""" + for section_prefix in self.section_prefixes: + real_section = section_prefix + section + has = super().has_section(real_section) + if has: + return real_section + return None + + def has_option(self, section: str, option: str) -> bool: + real_section = self.real_section(section) + if real_section is not None: + return super().has_option(real_section, option) + return False + + def has_section(self, section: str) -> bool: + return bool(self.real_section(section)) + + def options(self, section: str) -> list[str]: + real_section = self.real_section(section) + if real_section is not None: + return super().options(real_section) + raise ConfigError(f"No section: {section!r}") + + def get_section(self, section: str) -> TConfigSectionOut: + """Get the contents of a section, as a dictionary.""" + d: dict[str, TConfigValueOut] = {} + for opt in self.options(section): + d[opt] = self.get(section, opt) + return d + + def get(self, section: str, option: str, *args: Any, **kwargs: Any) -> str: # type: ignore + """Get a value, replacing environment variables also. + + The arguments are the same as `ConfigParser.get`, but in the found + value, ``$WORD`` or ``${WORD}`` are replaced by the value of the + environment variable ``WORD``. + + Returns the finished value. + + """ + for section_prefix in self.section_prefixes: + real_section = section_prefix + section + if super().has_option(real_section, option): + break + else: + raise ConfigError(f"No option {option!r} in section: {section!r}") + + v: str = super().get(real_section, option, *args, **kwargs) + v = substitute_variables(v, os.environ) + return v + + def getlist(self, section: str, option: str) -> list[str]: + """Read a list of strings. + + The value of `section` and `option` is treated as a comma- and newline- + separated list of strings. Each value is stripped of white space. + + Returns the list of strings. + + """ + value_list = self.get(section, option) + values = [] + for value_line in value_list.split("\n"): + for value in value_line.split(","): + value = value.strip() + if value: + values.append(value) + return values + + def getregexlist(self, section: str, option: str) -> list[str]: + """Read a list of full-line regexes. + + The value of `section` and `option` is treated as a newline-separated + list of regexes. Each value is stripped of white space. + + Returns the list of strings. + + """ + line_list = self.get(section, option) + value_list = [] + for value in line_list.splitlines(): + value = value.strip() + try: + re.compile(value) + except re.error as e: + raise ConfigError( + f"Invalid [{section}].{option} value {value!r}: {e}", + ) from e + if value: + value_list.append(value) + return value_list + + +TConfigParser = Union[HandyConfigParser, TomlConfigParser] + + +# The default line exclusion regexes. +DEFAULT_EXCLUDE = [ + r"#\s*(pragma|PRAGMA)[:\s]?\s*(no|NO)\s*(cover|COVER)", +] + +# The default partial branch regexes, to be modified by the user. +DEFAULT_PARTIAL = [ + r"#\s*(pragma|PRAGMA)[:\s]?\s*(no|NO)\s*(branch|BRANCH)", +] + +# The default partial branch regexes, based on Python semantics. +# These are any Python branching constructs that can't actually execute all +# their branches. +DEFAULT_PARTIAL_ALWAYS = [ + "while (True|1|False|0):", + "if (True|1|False|0):", +] + + +class CoverageConfig(TConfigurable, TPluginConfig): + """Coverage.py configuration. + + The attributes of this class are the various settings that control the + operation of coverage.py. + + """ + # pylint: disable=too-many-instance-attributes + + def __init__(self) -> None: + """Initialize the configuration attributes to their defaults.""" + # Metadata about the config. + # We tried to read these config files. + self.config_files_attempted: list[str] = [] + # We did read these config files, but maybe didn't find any content for us. + self.config_files_read: list[str] = [] + # The file that gave us our configuration. + self.config_file: str | None = None + self._config_contents: bytes | None = None + + # Defaults for [run] and [report] + self._include = None + self._omit = None + + # Defaults for [run] + self.branch = False + self.command_line: str | None = None + self.concurrency: list[str] = [] + self.context: str | None = None + self.cover_pylib = False + self.data_file = ".coverage" + self.debug: list[str] = [] + self.debug_file: str | None = None + self.disable_warnings: list[str] = [] + self.dynamic_context: str | None = None + self.parallel = False + self.plugins: list[str] = [] + self.relative_files = False + self.run_include: list[str] = [] + self.run_omit: list[str] = [] + self.sigterm = False + self.source: list[str] | None = None + self.source_pkgs: list[str] = [] + self.timid = False + self._crash: str | None = None + + # Defaults for [report] + self.exclude_list = DEFAULT_EXCLUDE[:] + self.exclude_also: list[str] = [] + self.fail_under = 0.0 + self.format: str | None = None + self.ignore_errors = False + self.include_namespace_packages = False + self.report_include: list[str] | None = None + self.report_omit: list[str] | None = None + self.partial_always_list = DEFAULT_PARTIAL_ALWAYS[:] + self.partial_list = DEFAULT_PARTIAL[:] + self.precision = 0 + self.report_contexts: list[str] | None = None + self.show_missing = False + self.skip_covered = False + self.skip_empty = False + self.sort: str | None = None + + # Defaults for [html] + self.extra_css: str | None = None + self.html_dir = "htmlcov" + self.html_skip_covered: bool | None = None + self.html_skip_empty: bool | None = None + self.html_title = "Coverage report" + self.show_contexts = False + + # Defaults for [xml] + self.xml_output = "coverage.xml" + self.xml_package_depth = 99 + + # Defaults for [json] + self.json_output = "coverage.json" + self.json_pretty_print = False + self.json_show_contexts = False + + # Defaults for [lcov] + self.lcov_output = "coverage.lcov" + self.lcov_line_checksums = False + + # Defaults for [paths] + self.paths: dict[str, list[str]] = {} + + # Options for plugins + self.plugin_options: dict[str, TConfigSectionOut] = {} + + MUST_BE_LIST = { + "debug", "concurrency", "plugins", + "report_omit", "report_include", + "run_omit", "run_include", + } + + def from_args(self, **kwargs: TConfigValueIn) -> None: + """Read config values from `kwargs`.""" + for k, v in kwargs.items(): + if v is not None: + if k in self.MUST_BE_LIST and isinstance(v, str): + v = [v] + setattr(self, k, v) + + def from_file(self, filename: str, warn: Callable[[str], None], our_file: bool) -> bool: + """Read configuration from a .rc file. + + `filename` is a file name to read. + + `our_file` is True if this config file is specifically for coverage, + False if we are examining another config file (tox.ini, setup.cfg) + for possible settings. + + Returns True or False, whether the file could be read, and it had some + coverage.py settings in it. + + """ + _, ext = os.path.splitext(filename) + cp: TConfigParser + if ext == ".toml": + cp = TomlConfigParser(our_file) + else: + cp = HandyConfigParser(our_file) + + self.config_files_attempted.append(os.path.abspath(filename)) + + try: + files_read = cp.read(filename) + except (configparser.Error, TomlDecodeError) as err: + raise ConfigError(f"Couldn't read config file {filename}: {err}") from err + if not files_read: + return False + + self.config_files_read.extend(map(os.path.abspath, files_read)) + + any_set = False + try: + for option_spec in self.CONFIG_FILE_OPTIONS: + was_set = self._set_attr_from_config_option(cp, *option_spec) + if was_set: + any_set = True + except ValueError as err: + raise ConfigError(f"Couldn't read config file {filename}: {err}") from err + + # Check that there are no unrecognized options. + all_options = collections.defaultdict(set) + for option_spec in self.CONFIG_FILE_OPTIONS: + section, option = option_spec[1].split(":") + all_options[section].add(option) + + for section, options in all_options.items(): + real_section = cp.real_section(section) + if real_section: + for unknown in set(cp.options(section)) - options: + warn( + "Unrecognized option '[{}] {}=' in config file {}".format( + real_section, unknown, filename, + ), + ) + + # [paths] is special + if cp.has_section("paths"): + for option in cp.options("paths"): + self.paths[option] = cp.getlist("paths", option) + any_set = True + + # plugins can have options + for plugin in self.plugins: + if cp.has_section(plugin): + self.plugin_options[plugin] = cp.get_section(plugin) + any_set = True + + # Was this file used as a config file? If it's specifically our file, + # then it was used. If we're piggybacking on someone else's file, + # then it was only used if we found some settings in it. + if our_file: + used = True + else: + used = any_set + + if used: + self.config_file = os.path.abspath(filename) + with open(filename, "rb") as f: + self._config_contents = f.read() + + return used + + def copy(self) -> CoverageConfig: + """Return a copy of the configuration.""" + return copy.deepcopy(self) + + CONCURRENCY_CHOICES = {"thread", "gevent", "greenlet", "eventlet", "multiprocessing"} + + CONFIG_FILE_OPTIONS = [ + # These are *args for _set_attr_from_config_option: + # (attr, where, type_="") + # + # attr is the attribute to set on the CoverageConfig object. + # where is the section:name to read from the configuration file. + # type_ is the optional type to apply, by using .getTYPE to read the + # configuration value from the file. + + # [run] + ("branch", "run:branch", "boolean"), + ("command_line", "run:command_line"), + ("concurrency", "run:concurrency", "list"), + ("context", "run:context"), + ("cover_pylib", "run:cover_pylib", "boolean"), + ("data_file", "run:data_file"), + ("debug", "run:debug", "list"), + ("debug_file", "run:debug_file"), + ("disable_warnings", "run:disable_warnings", "list"), + ("dynamic_context", "run:dynamic_context"), + ("parallel", "run:parallel", "boolean"), + ("plugins", "run:plugins", "list"), + ("relative_files", "run:relative_files", "boolean"), + ("run_include", "run:include", "list"), + ("run_omit", "run:omit", "list"), + ("sigterm", "run:sigterm", "boolean"), + ("source", "run:source", "list"), + ("source_pkgs", "run:source_pkgs", "list"), + ("timid", "run:timid", "boolean"), + ("_crash", "run:_crash"), + + # [report] + ("exclude_list", "report:exclude_lines", "regexlist"), + ("exclude_also", "report:exclude_also", "regexlist"), + ("fail_under", "report:fail_under", "float"), + ("format", "report:format"), + ("ignore_errors", "report:ignore_errors", "boolean"), + ("include_namespace_packages", "report:include_namespace_packages", "boolean"), + ("partial_always_list", "report:partial_branches_always", "regexlist"), + ("partial_list", "report:partial_branches", "regexlist"), + ("precision", "report:precision", "int"), + ("report_contexts", "report:contexts", "list"), + ("report_include", "report:include", "list"), + ("report_omit", "report:omit", "list"), + ("show_missing", "report:show_missing", "boolean"), + ("skip_covered", "report:skip_covered", "boolean"), + ("skip_empty", "report:skip_empty", "boolean"), + ("sort", "report:sort"), + + # [html] + ("extra_css", "html:extra_css"), + ("html_dir", "html:directory"), + ("html_skip_covered", "html:skip_covered", "boolean"), + ("html_skip_empty", "html:skip_empty", "boolean"), + ("html_title", "html:title"), + ("show_contexts", "html:show_contexts", "boolean"), + + # [xml] + ("xml_output", "xml:output"), + ("xml_package_depth", "xml:package_depth", "int"), + + # [json] + ("json_output", "json:output"), + ("json_pretty_print", "json:pretty_print", "boolean"), + ("json_show_contexts", "json:show_contexts", "boolean"), + + # [lcov] + ("lcov_output", "lcov:output"), + ("lcov_line_checksums", "lcov:line_checksums", "boolean") + ] + + def _set_attr_from_config_option( + self, + cp: TConfigParser, + attr: str, + where: str, + type_: str = "", + ) -> bool: + """Set an attribute on self if it exists in the ConfigParser. + + Returns True if the attribute was set. + + """ + section, option = where.split(":") + if cp.has_option(section, option): + method = getattr(cp, "get" + type_) + setattr(self, attr, method(section, option)) + return True + return False + + def get_plugin_options(self, plugin: str) -> TConfigSectionOut: + """Get a dictionary of options for the plugin named `plugin`.""" + return self.plugin_options.get(plugin, {}) + + def set_option(self, option_name: str, value: TConfigValueIn | TConfigSectionIn) -> None: + """Set an option in the configuration. + + `option_name` is a colon-separated string indicating the section and + option name. For example, the ``branch`` option in the ``[run]`` + section of the config file would be indicated with `"run:branch"`. + + `value` is the new value for the option. + + """ + # Special-cased options. + if option_name == "paths": + self.paths = value # type: ignore[assignment] + return + + # Check all the hard-coded options. + for option_spec in self.CONFIG_FILE_OPTIONS: + attr, where = option_spec[:2] + if where == option_name: + setattr(self, attr, value) + return + + # See if it's a plugin option. + plugin_name, _, key = option_name.partition(":") + if key and plugin_name in self.plugins: + self.plugin_options.setdefault(plugin_name, {})[key] = value # type: ignore[index] + return + + # If we get here, we didn't find the option. + raise ConfigError(f"No such option: {option_name!r}") + + def get_option(self, option_name: str) -> TConfigValueOut | None: + """Get an option from the configuration. + + `option_name` is a colon-separated string indicating the section and + option name. For example, the ``branch`` option in the ``[run]`` + section of the config file would be indicated with `"run:branch"`. + + Returns the value of the option. + + """ + # Special-cased options. + if option_name == "paths": + return self.paths # type: ignore[return-value] + + # Check all the hard-coded options. + for option_spec in self.CONFIG_FILE_OPTIONS: + attr, where = option_spec[:2] + if where == option_name: + return getattr(self, attr) # type: ignore[no-any-return] + + # See if it's a plugin option. + plugin_name, _, key = option_name.partition(":") + if key and plugin_name in self.plugins: + return self.plugin_options.get(plugin_name, {}).get(key) + + # If we get here, we didn't find the option. + raise ConfigError(f"No such option: {option_name!r}") + + def post_process_file(self, path: str) -> str: + """Make final adjustments to a file path to make it usable.""" + return os.path.expanduser(path) + + def post_process(self) -> None: + """Make final adjustments to settings to make them usable.""" + self.data_file = self.post_process_file(self.data_file) + self.html_dir = self.post_process_file(self.html_dir) + self.xml_output = self.post_process_file(self.xml_output) + self.paths = { + k: [self.post_process_file(f) for f in v] + for k, v in self.paths.items() + } + self.exclude_list += self.exclude_also + + def debug_info(self) -> list[tuple[str, Any]]: + """Make a list of (name, value) pairs for writing debug info.""" + return human_sorted_items( + (k, v) for k, v in self.__dict__.items() if not k.startswith("_") + ) + + +def config_files_to_try(config_file: bool | str) -> list[tuple[str, bool, bool]]: + """What config files should we try to read? + + Returns a list of tuples: + (filename, is_our_file, was_file_specified) + """ + + # Some API users were specifying ".coveragerc" to mean the same as + # True, so make it so. + if config_file == ".coveragerc": + config_file = True + specified_file = (config_file is not True) + if not specified_file: + # No file was specified. Check COVERAGE_RCFILE. + rcfile = os.getenv("COVERAGE_RCFILE") + if rcfile: + config_file = rcfile + specified_file = True + if not specified_file: + # Still no file specified. Default to .coveragerc + config_file = ".coveragerc" + assert isinstance(config_file, str) + files_to_try = [ + (config_file, True, specified_file), + ("setup.cfg", False, False), + ("tox.ini", False, False), + ("pyproject.toml", False, False), + ] + return files_to_try + + +def read_coverage_config( + config_file: bool | str, + warn: Callable[[str], None], + **kwargs: TConfigValueIn, +) -> CoverageConfig: + """Read the coverage.py configuration. + + Arguments: + config_file: a boolean or string, see the `Coverage` class for the + tricky details. + warn: a function to issue warnings. + all others: keyword arguments from the `Coverage` class, used for + setting values in the configuration. + + Returns: + config: + config is a CoverageConfig object read from the appropriate + configuration file. + + """ + # Build the configuration from a number of sources: + # 1) defaults: + config = CoverageConfig() + + # 2) from a file: + if config_file: + files_to_try = config_files_to_try(config_file) + + for fname, our_file, specified_file in files_to_try: + config_read = config.from_file(fname, warn, our_file=our_file) + if config_read: + break + if specified_file: + raise ConfigError(f"Couldn't read {fname!r} as a config file") + + # 3) from environment variables: + env_data_file = os.getenv("COVERAGE_FILE") + if env_data_file: + config.data_file = env_data_file + # $set_env.py: COVERAGE_DEBUG - Debug options: https://coverage.rtfd.io/cmd.html#debug + debugs = os.getenv("COVERAGE_DEBUG") + if debugs: + config.debug.extend(d.strip() for d in debugs.split(",")) + + # 4) from constructor arguments: + config.from_args(**kwargs) + + # 5) for our benchmark, force settings using a secret environment variable: + force_file = os.getenv("COVERAGE_FORCE_CONFIG") + if force_file: + config.from_file(force_file, warn, our_file=True) + + # Once all the config has been collected, there's a little post-processing + # to do. + config.post_process() + + return config diff --git a/.venv/Lib/site-packages/coverage/context.py b/.venv/Lib/site-packages/coverage/context.py new file mode 100644 index 00000000..977e9b4e --- /dev/null +++ b/.venv/Lib/site-packages/coverage/context.py @@ -0,0 +1,75 @@ +# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt + +"""Determine contexts for coverage.py""" + +from __future__ import annotations + +from types import FrameType +from typing import cast +from collections.abc import Sequence + +from coverage.types import TShouldStartContextFn + + +def combine_context_switchers( + context_switchers: Sequence[TShouldStartContextFn], +) -> TShouldStartContextFn | None: + """Create a single context switcher from multiple switchers. + + `context_switchers` is a list of functions that take a frame as an + argument and return a string to use as the new context label. + + Returns a function that composites `context_switchers` functions, or None + if `context_switchers` is an empty list. + + When invoked, the combined switcher calls `context_switchers` one-by-one + until a string is returned. The combined switcher returns None if all + `context_switchers` return None. + """ + if not context_switchers: + return None + + if len(context_switchers) == 1: + return context_switchers[0] + + def should_start_context(frame: FrameType) -> str | None: + """The combiner for multiple context switchers.""" + for switcher in context_switchers: + new_context = switcher(frame) + if new_context is not None: + return new_context + return None + + return should_start_context + + +def should_start_context_test_function(frame: FrameType) -> str | None: + """Is this frame calling a test_* function?""" + co_name = frame.f_code.co_name + if co_name.startswith("test") or co_name == "runTest": + return qualname_from_frame(frame) + return None + + +def qualname_from_frame(frame: FrameType) -> str | None: + """Get a qualified name for the code running in `frame`.""" + co = frame.f_code + fname = co.co_name + method = None + if co.co_argcount and co.co_varnames[0] == "self": + self = frame.f_locals.get("self", None) + method = getattr(self, fname, None) + + if method is None: + func = frame.f_globals.get(fname) + if func is None: + return None + return cast(str, func.__module__ + "." + fname) + + func = getattr(method, "__func__", None) + if func is None: + cls = self.__class__ + return cast(str, cls.__module__ + "." + cls.__name__ + "." + fname) + + return cast(str, func.__module__ + "." + func.__qualname__) diff --git a/.venv/Lib/site-packages/coverage/control.py b/.venv/Lib/site-packages/coverage/control.py new file mode 100644 index 00000000..b052d4b4 --- /dev/null +++ b/.venv/Lib/site-packages/coverage/control.py @@ -0,0 +1,1402 @@ +# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt + +"""Central control stuff for coverage.py.""" + +from __future__ import annotations + +import atexit +import collections +import contextlib +import functools +import os +import os.path +import platform +import signal +import sys +import threading +import time +import warnings + +from types import FrameType +from typing import cast, Any, Callable, IO +from collections.abc import Iterable, Iterator + +from coverage import env +from coverage.annotate import AnnotateReporter +from coverage.collector import Collector +from coverage.config import CoverageConfig, read_coverage_config +from coverage.context import should_start_context_test_function, combine_context_switchers +from coverage.core import Core, HAS_CTRACER +from coverage.data import CoverageData, combine_parallel_data +from coverage.debug import ( + DebugControl, NoDebugging, short_stack, write_formatted_info, relevant_environment_display, +) +from coverage.disposition import disposition_debug_msg +from coverage.exceptions import ConfigError, CoverageException, CoverageWarning, PluginError +from coverage.files import PathAliases, abs_file, relative_filename, set_relative_directory +from coverage.html import HtmlReporter +from coverage.inorout import InOrOut +from coverage.jsonreport import JsonReporter +from coverage.lcovreport import LcovReporter +from coverage.misc import bool_or_none, join_regex +from coverage.misc import DefaultValue, ensure_dir_for_file, isolate_module +from coverage.multiproc import patch_multiprocessing +from coverage.plugin import FileReporter +from coverage.plugin_support import Plugins +from coverage.python import PythonFileReporter +from coverage.report import SummaryReporter +from coverage.report_core import render_report +from coverage.results import Analysis, analysis_from_file_reporter +from coverage.types import ( + FilePath, TConfigurable, TConfigSectionIn, TConfigValueIn, TConfigValueOut, + TFileDisposition, TLineNo, TMorf, +) +from coverage.xmlreport import XmlReporter + +os = isolate_module(os) + +@contextlib.contextmanager +def override_config(cov: Coverage, **kwargs: TConfigValueIn) -> Iterator[None]: + """Temporarily tweak the configuration of `cov`. + + The arguments are applied to `cov.config` with the `from_args` method. + At the end of the with-statement, the old configuration is restored. + """ + original_config = cov.config + cov.config = cov.config.copy() + try: + cov.config.from_args(**kwargs) + yield + finally: + cov.config = original_config + + +DEFAULT_DATAFILE = DefaultValue("MISSING") +_DEFAULT_DATAFILE = DEFAULT_DATAFILE # Just in case, for backwards compatibility + +class Coverage(TConfigurable): + """Programmatic access to coverage.py. + + To use:: + + from coverage import Coverage + + cov = Coverage() + cov.start() + #.. call your code .. + cov.stop() + cov.html_report(directory="covhtml") + + A context manager is available to do the same thing:: + + cov = Coverage() + with cov.collect(): + #.. call your code .. + cov.html_report(directory="covhtml") + + Note: in keeping with Python custom, names starting with underscore are + not part of the public API. They might stop working at any point. Please + limit yourself to documented methods to avoid problems. + + Methods can raise any of the exceptions described in :ref:`api_exceptions`. + + """ + + # The stack of started Coverage instances. + _instances: list[Coverage] = [] + + @classmethod + def current(cls) -> Coverage | None: + """Get the latest started `Coverage` instance, if any. + + Returns: a `Coverage` instance, or None. + + .. versionadded:: 5.0 + + """ + if cls._instances: + return cls._instances[-1] + else: + return None + + def __init__( # pylint: disable=too-many-arguments + self, + data_file: FilePath | DefaultValue | None = DEFAULT_DATAFILE, + data_suffix: str | bool | None = None, + cover_pylib: bool | None = None, + auto_data: bool = False, + timid: bool | None = None, + branch: bool | None = None, + config_file: FilePath | bool = True, + source: Iterable[str] | None = None, + source_pkgs: Iterable[str] | None = None, + omit: str | Iterable[str] | None = None, + include: str | Iterable[str] | None = None, + debug: Iterable[str] | None = None, + concurrency: str | Iterable[str] | None = None, + check_preimported: bool = False, + context: str | None = None, + messages: bool = False, + ) -> None: + """ + Many of these arguments duplicate and override values that can be + provided in a configuration file. Parameters that are missing here + will use values from the config file. + + `data_file` is the base name of the data file to use. The config value + defaults to ".coverage". None can be provided to prevent writing a data + file. `data_suffix` is appended (with a dot) to `data_file` to create + the final file name. If `data_suffix` is simply True, then a suffix is + created with the machine and process identity included. + + `cover_pylib` is a boolean determining whether Python code installed + with the Python interpreter is measured. This includes the Python + standard library and any packages installed with the interpreter. + + If `auto_data` is true, then any existing data file will be read when + coverage measurement starts, and data will be saved automatically when + measurement stops. + + If `timid` is true, then a slower and simpler trace function will be + used. This is important for some environments where manipulation of + tracing functions breaks the faster trace function. + + If `branch` is true, then branch coverage will be measured in addition + to the usual statement coverage. + + `config_file` determines what configuration file to read: + + * If it is ".coveragerc", it is interpreted as if it were True, + for backward compatibility. + + * If it is a string, it is the name of the file to read. If the + file can't be read, it is an error. + + * If it is True, then a few standard files names are tried + (".coveragerc", "setup.cfg", "tox.ini"). It is not an error for + these files to not be found. + + * If it is False, then no configuration file is read. + + `source` is a list of file paths or package names. Only code located + in the trees indicated by the file paths or package names will be + measured. + + `source_pkgs` is a list of package names. It works the same as + `source`, but can be used to name packages where the name can also be + interpreted as a file path. + + `include` and `omit` are lists of file name patterns. Files that match + `include` will be measured, files that match `omit` will not. Each + will also accept a single string argument. + + `debug` is a list of strings indicating what debugging information is + desired. + + `concurrency` is a string indicating the concurrency library being used + in the measured code. Without this, coverage.py will get incorrect + results if these libraries are in use. Valid strings are "greenlet", + "eventlet", "gevent", "multiprocessing", or "thread" (the default). + This can also be a list of these strings. + + If `check_preimported` is true, then when coverage is started, the + already-imported files will be checked to see if they should be + measured by coverage. Importing measured files before coverage is + started can mean that code is missed. + + `context` is a string to use as the :ref:`static context + ` label for collected data. + + If `messages` is true, some messages will be printed to stdout + indicating what is happening. + + .. versionadded:: 4.0 + The `concurrency` parameter. + + .. versionadded:: 4.2 + The `concurrency` parameter can now be a list of strings. + + .. versionadded:: 5.0 + The `check_preimported` and `context` parameters. + + .. versionadded:: 5.3 + The `source_pkgs` parameter. + + .. versionadded:: 6.0 + The `messages` parameter. + + """ + # Start self.config as a usable default configuration. It will soon be + # replaced with the real configuration. + self.config = CoverageConfig() + + # data_file=None means no disk file at all. data_file missing means + # use the value from the config file. + self._no_disk = data_file is None + if isinstance(data_file, DefaultValue): + data_file = None + if data_file is not None: + data_file = os.fspath(data_file) + + # This is injectable by tests. + self._debug_file: IO[str] | None = None + + self._auto_load = self._auto_save = auto_data + self._data_suffix_specified = data_suffix + + # Is it ok for no data to be collected? + self._warn_no_data = True + self._warn_unimported_source = True + self._warn_preimported_source = check_preimported + self._no_warn_slugs: list[str] = [] + self._messages = messages + + # A record of all the warnings that have been issued. + self._warnings: list[str] = [] + + # Other instance attributes, set with placebos or placeholders. + # More useful objects will be created later. + self._debug: DebugControl = NoDebugging() + self._inorout: InOrOut | None = None + self._plugins: Plugins = Plugins() + self._data: CoverageData | None = None + self._core: Core | None = None + self._collector: Collector | None = None + self._metacov = False + + self._file_mapper: Callable[[str], str] = abs_file + self._data_suffix = self._run_suffix = None + self._exclude_re: dict[str, str] = {} + self._old_sigterm: Callable[[int, FrameType | None], Any] | None = None + + # State machine variables: + # Have we initialized everything? + self._inited = False + self._inited_for_start = False + # Have we started collecting and not stopped it? + self._started = False + # Should we write the debug output? + self._should_write_debug = True + + # Build our configuration from a number of sources. + if not isinstance(config_file, bool): + config_file = os.fspath(config_file) + self.config = read_coverage_config( + config_file=config_file, + warn=self._warn, + data_file=data_file, + cover_pylib=cover_pylib, + timid=timid, + branch=branch, + parallel=bool_or_none(data_suffix), + source=source, + source_pkgs=source_pkgs, + run_omit=omit, + run_include=include, + debug=debug, + report_omit=omit, + report_include=include, + concurrency=concurrency, + context=context, + ) + + # If we have sub-process measurement happening automatically, then we + # want any explicit creation of a Coverage object to mean, this process + # is already coverage-aware, so don't auto-measure it. By now, the + # auto-creation of a Coverage object has already happened. But we can + # find it and tell it not to save its data. + if not env.METACOV: + _prevent_sub_process_measurement() + + def _init(self) -> None: + """Set all the initial state. + + This is called by the public methods to initialize state. This lets us + construct a :class:`Coverage` object, then tweak its state before this + function is called. + + """ + if self._inited: + return + + self._inited = True + + # Create and configure the debugging controller. + self._debug = DebugControl(self.config.debug, self._debug_file, self.config.debug_file) + if self._debug.should("process"): + self._debug.write("Coverage._init") + + if "multiprocessing" in (self.config.concurrency or ()): + # Multi-processing uses parallel for the subprocesses, so also use + # it for the main process. + self.config.parallel = True + + # _exclude_re is a dict that maps exclusion list names to compiled regexes. + self._exclude_re = {} + + set_relative_directory() + if self.config.relative_files: + self._file_mapper = relative_filename + + # Load plugins + self._plugins = Plugins.load_plugins(self.config.plugins, self.config, self._debug) + + # Run configuring plugins. + for plugin in self._plugins.configurers: + # We need an object with set_option and get_option. Either self or + # self.config will do. Choosing randomly stops people from doing + # other things with those objects, against the public API. Yes, + # this is a bit childish. :) + plugin.configure([self, self.config][int(time.time()) % 2]) + + def _post_init(self) -> None: + """Stuff to do after everything is initialized.""" + if self._should_write_debug: + self._should_write_debug = False + self._write_startup_debug() + + # "[run] _crash" will raise an exception if the value is close by in + # the call stack, for testing error handling. + if self.config._crash and self.config._crash in short_stack(): + raise RuntimeError(f"Crashing because called by {self.config._crash}") + + def _write_startup_debug(self) -> None: + """Write out debug info at startup if needed.""" + wrote_any = False + with self._debug.without_callers(): + if self._debug.should("config"): + config_info = self.config.debug_info() + write_formatted_info(self._debug.write, "config", config_info) + wrote_any = True + + if self._debug.should("sys"): + write_formatted_info(self._debug.write, "sys", self.sys_info()) + for plugin in self._plugins: + header = "sys: " + plugin._coverage_plugin_name + info = plugin.sys_info() + write_formatted_info(self._debug.write, header, info) + wrote_any = True + + if self._debug.should("pybehave"): + write_formatted_info(self._debug.write, "pybehave", env.debug_info()) + wrote_any = True + + if wrote_any: + write_formatted_info(self._debug.write, "end", ()) + + def _should_trace(self, filename: str, frame: FrameType) -> TFileDisposition: + """Decide whether to trace execution in `filename`. + + Calls `_should_trace_internal`, and returns the FileDisposition. + + """ + assert self._inorout is not None + disp = self._inorout.should_trace(filename, frame) + if self._debug.should("trace"): + self._debug.write(disposition_debug_msg(disp)) + return disp + + def _check_include_omit_etc(self, filename: str, frame: FrameType) -> bool: + """Check a file name against the include/omit/etc, rules, verbosely. + + Returns a boolean: True if the file should be traced, False if not. + + """ + assert self._inorout is not None + reason = self._inorout.check_include_omit_etc(filename, frame) + if self._debug.should("trace"): + if not reason: + msg = f"Including {filename!r}" + else: + msg = f"Not including {filename!r}: {reason}" + self._debug.write(msg) + + return not reason + + def _warn(self, msg: str, slug: str | None = None, once: bool = False) -> None: + """Use `msg` as a warning. + + For warning suppression, use `slug` as the shorthand. + + If `once` is true, only show this warning once (determined by the + slug.) + + """ + if not self._no_warn_slugs: + self._no_warn_slugs = list(self.config.disable_warnings) + + if slug in self._no_warn_slugs: + # Don't issue the warning + return + + self._warnings.append(msg) + if slug: + msg = f"{msg} ({slug})" + if self._debug.should("pid"): + msg = f"[{os.getpid()}] {msg}" + warnings.warn(msg, category=CoverageWarning, stacklevel=2) + + if once: + assert slug is not None + self._no_warn_slugs.append(slug) + + def _message(self, msg: str) -> None: + """Write a message to the user, if configured to do so.""" + if self._messages: + print(msg) + + def get_option(self, option_name: str) -> TConfigValueOut | None: + """Get an option from the configuration. + + `option_name` is a colon-separated string indicating the section and + option name. For example, the ``branch`` option in the ``[run]`` + section of the config file would be indicated with `"run:branch"`. + + Returns the value of the option. The type depends on the option + selected. + + As a special case, an `option_name` of ``"paths"`` will return an + dictionary with the entire ``[paths]`` section value. + + .. versionadded:: 4.0 + + """ + return self.config.get_option(option_name) + + def set_option(self, option_name: str, value: TConfigValueIn | TConfigSectionIn) -> None: + """Set an option in the configuration. + + `option_name` is a colon-separated string indicating the section and + option name. For example, the ``branch`` option in the ``[run]`` + section of the config file would be indicated with ``"run:branch"``. + + `value` is the new value for the option. This should be an + appropriate Python value. For example, use True for booleans, not the + string ``"True"``. + + As an example, calling: + + .. code-block:: python + + cov.set_option("run:branch", True) + + has the same effect as this configuration file: + + .. code-block:: ini + + [run] + branch = True + + As a special case, an `option_name` of ``"paths"`` will replace the + entire ``[paths]`` section. The value should be a dictionary. + + .. versionadded:: 4.0 + + """ + self.config.set_option(option_name, value) + + def load(self) -> None: + """Load previously-collected coverage data from the data file.""" + self._init() + if self._collector is not None: + self._collector.reset() + should_skip = self.config.parallel and not os.path.exists(self.config.data_file) + if not should_skip: + self._init_data(suffix=None) + self._post_init() + if not should_skip: + assert self._data is not None + self._data.read() + + def _init_for_start(self) -> None: + """Initialization for start()""" + # Construct the collector. + concurrency: list[str] = self.config.concurrency or [] + if "multiprocessing" in concurrency: + if self.config.config_file is None: + raise ConfigError("multiprocessing requires a configuration file") + patch_multiprocessing(rcfile=self.config.config_file) + + dycon = self.config.dynamic_context + if not dycon or dycon == "none": + context_switchers = [] + elif dycon == "test_function": + context_switchers = [should_start_context_test_function] + else: + raise ConfigError(f"Don't understand dynamic_context setting: {dycon!r}") + + context_switchers.extend( + plugin.dynamic_context for plugin in self._plugins.context_switchers + ) + + should_start_context = combine_context_switchers(context_switchers) + + self._core = Core( + warn=self._warn, + timid=self.config.timid, + metacov=self._metacov, + ) + self._collector = Collector( + core=self._core, + should_trace=self._should_trace, + check_include=self._check_include_omit_etc, + should_start_context=should_start_context, + file_mapper=self._file_mapper, + branch=self.config.branch, + warn=self._warn, + concurrency=concurrency, + ) + + suffix = self._data_suffix_specified + if suffix: + if not isinstance(suffix, str): + # if data_suffix=True, use .machinename.pid.random + suffix = True + elif self.config.parallel: + if suffix is None: + suffix = True + elif not isinstance(suffix, str): + suffix = bool(suffix) + else: + suffix = None + + self._init_data(suffix) + + assert self._data is not None + self._collector.use_data(self._data, self.config.context) + + # Early warning if we aren't going to be able to support plugins. + if self._plugins.file_tracers and not self._core.supports_plugins: + self._warn( + "Plugin file tracers ({}) aren't supported with {}".format( + ", ".join( + plugin._coverage_plugin_name + for plugin in self._plugins.file_tracers + ), + self._collector.tracer_name(), + ), + ) + for plugin in self._plugins.file_tracers: + plugin._coverage_enabled = False + + # Create the file classifying substructure. + self._inorout = InOrOut( + config=self.config, + warn=self._warn, + debug=(self._debug if self._debug.should("trace") else None), + include_namespace_packages=self.config.include_namespace_packages, + ) + self._inorout.plugins = self._plugins + self._inorout.disp_class = self._core.file_disposition_class + + # It's useful to write debug info after initing for start. + self._should_write_debug = True + + # Register our clean-up handlers. + atexit.register(self._atexit) + if self.config.sigterm: + is_main = (threading.current_thread() == threading.main_thread()) + if is_main and not env.WINDOWS: + # The Python docs seem to imply that SIGTERM works uniformly even + # on Windows, but that's not my experience, and this agrees: + # https://stackoverflow.com/questions/35772001/x/35792192#35792192 + self._old_sigterm = signal.signal( # type: ignore[assignment] + signal.SIGTERM, self._on_sigterm, + ) + + def _init_data(self, suffix: str | bool | None) -> None: + """Create a data file if we don't have one yet.""" + if self._data is None: + # Create the data file. We do this at construction time so that the + # data file will be written into the directory where the process + # started rather than wherever the process eventually chdir'd to. + ensure_dir_for_file(self.config.data_file) + self._data = CoverageData( + basename=self.config.data_file, + suffix=suffix, + warn=self._warn, + debug=self._debug, + no_disk=self._no_disk, + ) + + def start(self) -> None: + """Start measuring code coverage. + + Coverage measurement is only collected in functions called after + :meth:`start` is invoked. Statements in the same scope as + :meth:`start` won't be measured. + + Once you invoke :meth:`start`, you must also call :meth:`stop` + eventually, or your process might not shut down cleanly. + + The :meth:`collect` method is a context manager to handle both + starting and stopping collection. + + """ + self._init() + if not self._inited_for_start: + self._inited_for_start = True + self._init_for_start() + self._post_init() + + assert self._collector is not None + assert self._inorout is not None + + # Issue warnings for possible problems. + self._inorout.warn_conflicting_settings() + + # See if we think some code that would eventually be measured has + # already been imported. + if self._warn_preimported_source: + self._inorout.warn_already_imported_files() + + if self._auto_load: + self.load() + + self._collector.start() + self._started = True + self._instances.append(self) + + def stop(self) -> None: + """Stop measuring code coverage.""" + if self._instances: + if self._instances[-1] is self: + self._instances.pop() + if self._started: + assert self._collector is not None + self._collector.stop() + self._started = False + + @contextlib.contextmanager + def collect(self) -> Iterator[None]: + """A context manager to start/stop coverage measurement collection. + + .. versionadded:: 7.3 + + """ + self.start() + try: + yield + finally: + self.stop() # pragma: nested + + def _atexit(self, event: str = "atexit") -> None: + """Clean up on process shutdown.""" + if self._debug.should("process"): + self._debug.write(f"{event}: pid: {os.getpid()}, instance: {self!r}") + if self._started: + self.stop() + if self._auto_save or event == "sigterm": + self.save() + + def _on_sigterm(self, signum_unused: int, frame_unused: FrameType | None) -> None: + """A handler for signal.SIGTERM.""" + self._atexit("sigterm") + # Statements after here won't be seen by metacov because we just wrote + # the data, and are about to kill the process. + signal.signal(signal.SIGTERM, self._old_sigterm) # pragma: not covered + os.kill(os.getpid(), signal.SIGTERM) # pragma: not covered + + def erase(self) -> None: + """Erase previously collected coverage data. + + This removes the in-memory data collected in this session as well as + discarding the data file. + + """ + self._init() + self._post_init() + if self._collector is not None: + self._collector.reset() + self._init_data(suffix=None) + assert self._data is not None + self._data.erase(parallel=self.config.parallel) + self._data = None + self._inited_for_start = False + + def switch_context(self, new_context: str) -> None: + """Switch to a new dynamic context. + + `new_context` is a string to use as the :ref:`dynamic context + ` label for collected data. If a :ref:`static + context ` is in use, the static and dynamic context + labels will be joined together with a pipe character. + + Coverage collection must be started already. + + .. versionadded:: 5.0 + + """ + if not self._started: # pragma: part started + raise CoverageException("Cannot switch context, coverage is not started") + + assert self._collector is not None + if self._collector.should_start_context: + self._warn("Conflicting dynamic contexts", slug="dynamic-conflict", once=True) + + self._collector.switch_context(new_context) + + def clear_exclude(self, which: str = "exclude") -> None: + """Clear the exclude list.""" + self._init() + setattr(self.config, which + "_list", []) + self._exclude_regex_stale() + + def exclude(self, regex: str, which: str = "exclude") -> None: + """Exclude source lines from execution consideration. + + A number of lists of regular expressions are maintained. Each list + selects lines that are treated differently during reporting. + + `which` determines which list is modified. The "exclude" list selects + lines that are not considered executable at all. The "partial" list + indicates lines with branches that are not taken. + + `regex` is a regular expression. The regex is added to the specified + list. If any of the regexes in the list is found in a line, the line + is marked for special treatment during reporting. + + """ + self._init() + excl_list = getattr(self.config, which + "_list") + excl_list.append(regex) + self._exclude_regex_stale() + + def _exclude_regex_stale(self) -> None: + """Drop all the compiled exclusion regexes, a list was modified.""" + self._exclude_re.clear() + + def _exclude_regex(self, which: str) -> str: + """Return a regex string for the given exclusion list.""" + if which not in self._exclude_re: + excl_list = getattr(self.config, which + "_list") + self._exclude_re[which] = join_regex(excl_list) + return self._exclude_re[which] + + def get_exclude_list(self, which: str = "exclude") -> list[str]: + """Return a list of excluded regex strings. + + `which` indicates which list is desired. See :meth:`exclude` for the + lists that are available, and their meaning. + + """ + self._init() + return cast(list[str], getattr(self.config, which + "_list")) + + def save(self) -> None: + """Save the collected coverage data to the data file.""" + data = self.get_data() + data.write() + + def _make_aliases(self) -> PathAliases: + """Create a PathAliases from our configuration.""" + aliases = PathAliases( + debugfn=(self._debug.write if self._debug.should("pathmap") else None), + relative=self.config.relative_files, + ) + for paths in self.config.paths.values(): + result = paths[0] + for pattern in paths[1:]: + aliases.add(pattern, result) + return aliases + + def combine( + self, + data_paths: Iterable[str] | None = None, + strict: bool = False, + keep: bool = False, + ) -> None: + """Combine together a number of similarly-named coverage data files. + + All coverage data files whose name starts with `data_file` (from the + coverage() constructor) will be read, and combined together into the + current measurements. + + `data_paths` is a list of files or directories from which data should + be combined. If no list is passed, then the data files from the + directory indicated by the current data file (probably the current + directory) will be combined. + + If `strict` is true, then it is an error to attempt to combine when + there are no data files to combine. + + If `keep` is true, then original input data files won't be deleted. + + .. versionadded:: 4.0 + The `data_paths` parameter. + + .. versionadded:: 4.3 + The `strict` parameter. + + .. versionadded: 5.5 + The `keep` parameter. + """ + self._init() + self._init_data(suffix=None) + self._post_init() + self.get_data() + + assert self._data is not None + combine_parallel_data( + self._data, + aliases=self._make_aliases(), + data_paths=data_paths, + strict=strict, + keep=keep, + message=self._message, + ) + + def get_data(self) -> CoverageData: + """Get the collected data. + + Also warn about various problems collecting data. + + Returns a :class:`coverage.CoverageData`, the collected coverage data. + + .. versionadded:: 4.0 + + """ + self._init() + self._init_data(suffix=None) + self._post_init() + + if self._collector is not None: + for plugin in self._plugins: + if not plugin._coverage_enabled: + self._collector.plugin_was_disabled(plugin) + + if self._collector.flush_data(): + self._post_save_work() + + assert self._data is not None + return self._data + + def _post_save_work(self) -> None: + """After saving data, look for warnings, post-work, etc. + + Warn about things that should have happened but didn't. + Look for un-executed files. + + """ + assert self._data is not None + assert self._inorout is not None + + # If there are still entries in the source_pkgs_unmatched list, + # then we never encountered those packages. + if self._warn_unimported_source: + self._inorout.warn_unimported_source() + + # Find out if we got any data. + if not self._data and self._warn_no_data: + self._warn("No data was collected.", slug="no-data-collected") + + # Touch all the files that could have executed, so that we can + # mark completely un-executed files as 0% covered. + file_paths = collections.defaultdict(list) + for file_path, plugin_name in self._inorout.find_possibly_unexecuted_files(): + file_path = self._file_mapper(file_path) + file_paths[plugin_name].append(file_path) + for plugin_name, paths in file_paths.items(): + self._data.touch_files(paths, plugin_name) + + # Backward compatibility with version 1. + def analysis(self, morf: TMorf) -> tuple[str, list[TLineNo], list[TLineNo], str]: + """Like `analysis2` but doesn't return excluded line numbers.""" + f, s, _, m, mf = self.analysis2(morf) + return f, s, m, mf + + def analysis2( + self, + morf: TMorf, + ) -> tuple[str, list[TLineNo], list[TLineNo], list[TLineNo], str]: + """Analyze a module. + + `morf` is a module or a file name. It will be analyzed to determine + its coverage statistics. The return value is a 5-tuple: + + * The file name for the module. + * A list of line numbers of executable statements. + * A list of line numbers of excluded statements. + * A list of line numbers of statements not run (missing from + execution). + * A readable formatted string of the missing line numbers. + + The analysis uses the source file itself and the current measured + coverage data. + + """ + analysis = self._analyze(morf) + return ( + analysis.filename, + sorted(analysis.statements), + sorted(analysis.excluded), + sorted(analysis.missing), + analysis.missing_formatted(), + ) + + def _analyze(self, morf: TMorf) -> Analysis: + """Analyze a module or file. Private for now.""" + self._init() + self._post_init() + + data = self.get_data() + file_reporter = self._get_file_reporter(morf) + filename = self._file_mapper(file_reporter.filename) + return analysis_from_file_reporter(data, self.config.precision, file_reporter, filename) + + @functools.lru_cache(maxsize=1) + def _get_file_reporter(self, morf: TMorf) -> FileReporter: + """Get a FileReporter for a module or file name.""" + assert self._data is not None + plugin = None + file_reporter: str | FileReporter = "python" + + if isinstance(morf, str): + mapped_morf = self._file_mapper(morf) + plugin_name = self._data.file_tracer(mapped_morf) + if plugin_name: + plugin = self._plugins.get(plugin_name) + + if plugin: + file_reporter = plugin.file_reporter(mapped_morf) + if file_reporter is None: + raise PluginError( + "Plugin {!r} did not provide a file reporter for {!r}.".format( + plugin._coverage_plugin_name, morf, + ), + ) + + if file_reporter == "python": + file_reporter = PythonFileReporter(morf, self) + + assert isinstance(file_reporter, FileReporter) + return file_reporter + + def _get_file_reporters( + self, + morfs: Iterable[TMorf] | None = None, + ) -> list[tuple[FileReporter, TMorf]]: + """Get FileReporters for a list of modules or file names. + + For each module or file name in `morfs`, find a FileReporter. Return + a list pairing FileReporters with the morfs. + + If `morfs` is a single module or file name, this returns a list of one + FileReporter. If `morfs` is empty or None, then the list of all files + measured is used to find the FileReporters. + + """ + assert self._data is not None + if not morfs: + morfs = self._data.measured_files() + + # Be sure we have a collection. + if not isinstance(morfs, (list, tuple, set)): + morfs = [morfs] # type: ignore[list-item] + + return [(self._get_file_reporter(morf), morf) for morf in morfs] + + def _prepare_data_for_reporting(self) -> None: + """Re-map data before reporting, to get implicit "combine" behavior.""" + if self.config.paths: + mapped_data = CoverageData(warn=self._warn, debug=self._debug, no_disk=True) + if self._data is not None: + mapped_data.update(self._data, map_path=self._make_aliases().map) + self._data = mapped_data + + def report( + self, + morfs: Iterable[TMorf] | None = None, + show_missing: bool | None = None, + ignore_errors: bool | None = None, + file: IO[str] | None = None, + omit: str | list[str] | None = None, + include: str | list[str] | None = None, + skip_covered: bool | None = None, + contexts: list[str] | None = None, + skip_empty: bool | None = None, + precision: int | None = None, + sort: str | None = None, + output_format: str | None = None, + ) -> float: + """Write a textual summary report to `file`. + + Each module in `morfs` is listed, with counts of statements, executed + statements, missing statements, and a list of lines missed. + + If `show_missing` is true, then details of which lines or branches are + missing will be included in the report. If `ignore_errors` is true, + then a failure while reporting a single file will not stop the entire + report. + + `file` is a file-like object, suitable for writing. + + `output_format` determines the format, either "text" (the default), + "markdown", or "total". + + `include` is a list of file name patterns. Files that match will be + included in the report. Files matching `omit` will not be included in + the report. + + If `skip_covered` is true, don't report on files with 100% coverage. + + If `skip_empty` is true, don't report on empty files (those that have + no statements). + + `contexts` is a list of regular expression strings. Only data from + :ref:`dynamic contexts ` that match one of those + expressions (using :func:`re.search `) will be + included in the report. + + `precision` is the number of digits to display after the decimal + point for percentages. + + All of the arguments default to the settings read from the + :ref:`configuration file `. + + Returns a float, the total percentage covered. + + .. versionadded:: 4.0 + The `skip_covered` parameter. + + .. versionadded:: 5.0 + The `contexts` and `skip_empty` parameters. + + .. versionadded:: 5.2 + The `precision` parameter. + + .. versionadded:: 7.0 + The `format` parameter. + + """ + self._prepare_data_for_reporting() + with override_config( + self, + ignore_errors=ignore_errors, + report_omit=omit, + report_include=include, + show_missing=show_missing, + skip_covered=skip_covered, + report_contexts=contexts, + skip_empty=skip_empty, + precision=precision, + sort=sort, + format=output_format, + ): + reporter = SummaryReporter(self) + return reporter.report(morfs, outfile=file) + + def annotate( + self, + morfs: Iterable[TMorf] | None = None, + directory: str | None = None, + ignore_errors: bool | None = None, + omit: str | list[str] | None = None, + include: str | list[str] | None = None, + contexts: list[str] | None = None, + ) -> None: + """Annotate a list of modules. + + Each module in `morfs` is annotated. The source is written to a new + file, named with a ",cover" suffix, with each line prefixed with a + marker to indicate the coverage of the line. Covered lines have ">", + excluded lines have "-", and missing lines have "!". + + See :meth:`report` for other arguments. + + """ + self._prepare_data_for_reporting() + with override_config( + self, + ignore_errors=ignore_errors, + report_omit=omit, + report_include=include, + report_contexts=contexts, + ): + reporter = AnnotateReporter(self) + reporter.report(morfs, directory=directory) + + def html_report( + self, + morfs: Iterable[TMorf] | None = None, + directory: str | None = None, + ignore_errors: bool | None = None, + omit: str | list[str] | None = None, + include: str | list[str] | None = None, + extra_css: str | None = None, + title: str | None = None, + skip_covered: bool | None = None, + show_contexts: bool | None = None, + contexts: list[str] | None = None, + skip_empty: bool | None = None, + precision: int | None = None, + ) -> float: + """Generate an HTML report. + + The HTML is written to `directory`. The file "index.html" is the + overview starting point, with links to more detailed pages for + individual modules. + + `extra_css` is a path to a file of other CSS to apply on the page. + It will be copied into the HTML directory. + + `title` is a text string (not HTML) to use as the title of the HTML + report. + + See :meth:`report` for other arguments. + + Returns a float, the total percentage covered. + + .. note:: + + The HTML report files are generated incrementally based on the + source files and coverage results. If you modify the report files, + the changes will not be considered. You should be careful about + changing the files in the report folder. + + """ + self._prepare_data_for_reporting() + with override_config( + self, + ignore_errors=ignore_errors, + report_omit=omit, + report_include=include, + html_dir=directory, + extra_css=extra_css, + html_title=title, + html_skip_covered=skip_covered, + show_contexts=show_contexts, + report_contexts=contexts, + html_skip_empty=skip_empty, + precision=precision, + ): + reporter = HtmlReporter(self) + ret = reporter.report(morfs) + return ret + + def xml_report( + self, + morfs: Iterable[TMorf] | None = None, + outfile: str | None = None, + ignore_errors: bool | None = None, + omit: str | list[str] | None = None, + include: str | list[str] | None = None, + contexts: list[str] | None = None, + skip_empty: bool | None = None, + ) -> float: + """Generate an XML report of coverage results. + + The report is compatible with Cobertura reports. + + Each module in `morfs` is included in the report. `outfile` is the + path to write the file to, "-" will write to stdout. + + See :meth:`report` for other arguments. + + Returns a float, the total percentage covered. + + """ + self._prepare_data_for_reporting() + with override_config( + self, + ignore_errors=ignore_errors, + report_omit=omit, + report_include=include, + xml_output=outfile, + report_contexts=contexts, + skip_empty=skip_empty, + ): + return render_report(self.config.xml_output, XmlReporter(self), morfs, self._message) + + def json_report( + self, + morfs: Iterable[TMorf] | None = None, + outfile: str | None = None, + ignore_errors: bool | None = None, + omit: str | list[str] | None = None, + include: str | list[str] | None = None, + contexts: list[str] | None = None, + pretty_print: bool | None = None, + show_contexts: bool | None = None, + ) -> float: + """Generate a JSON report of coverage results. + + Each module in `morfs` is included in the report. `outfile` is the + path to write the file to, "-" will write to stdout. + + `pretty_print` is a boolean, whether to pretty-print the JSON output or not. + + See :meth:`report` for other arguments. + + Returns a float, the total percentage covered. + + .. versionadded:: 5.0 + + """ + self._prepare_data_for_reporting() + with override_config( + self, + ignore_errors=ignore_errors, + report_omit=omit, + report_include=include, + json_output=outfile, + report_contexts=contexts, + json_pretty_print=pretty_print, + json_show_contexts=show_contexts, + ): + return render_report(self.config.json_output, JsonReporter(self), morfs, self._message) + + def lcov_report( + self, + morfs: Iterable[TMorf] | None = None, + outfile: str | None = None, + ignore_errors: bool | None = None, + omit: str | list[str] | None = None, + include: str | list[str] | None = None, + contexts: list[str] | None = None, + ) -> float: + """Generate an LCOV report of coverage results. + + Each module in `morfs` is included in the report. `outfile` is the + path to write the file to, "-" will write to stdout. + + See :meth:`report` for other arguments. + + .. versionadded:: 6.3 + """ + self._prepare_data_for_reporting() + with override_config( + self, + ignore_errors=ignore_errors, + report_omit=omit, + report_include=include, + lcov_output=outfile, + report_contexts=contexts, + ): + return render_report(self.config.lcov_output, LcovReporter(self), morfs, self._message) + + def sys_info(self) -> Iterable[tuple[str, Any]]: + """Return a list of (key, value) pairs showing internal information.""" + + import coverage as covmod + + self._init() + self._post_init() + + def plugin_info(plugins: list[Any]) -> list[str]: + """Make an entry for the sys_info from a list of plug-ins.""" + entries = [] + for plugin in plugins: + entry = plugin._coverage_plugin_name + if not plugin._coverage_enabled: + entry += " (disabled)" + entries.append(entry) + return entries + + info = [ + ("coverage_version", covmod.__version__), + ("coverage_module", covmod.__file__), + ("core", self._collector.tracer_name() if self._collector is not None else "-none-"), + ("CTracer", "available" if HAS_CTRACER else "unavailable"), + ("plugins.file_tracers", plugin_info(self._plugins.file_tracers)), + ("plugins.configurers", plugin_info(self._plugins.configurers)), + ("plugins.context_switchers", plugin_info(self._plugins.context_switchers)), + ("configs_attempted", self.config.config_files_attempted), + ("configs_read", self.config.config_files_read), + ("config_file", self.config.config_file), + ("config_contents", + repr(self.config._config_contents) if self.config._config_contents else "-none-", + ), + ("data_file", self._data.data_filename() if self._data is not None else "-none-"), + ("python", sys.version.replace("\n", "")), + ("platform", platform.platform()), + ("implementation", platform.python_implementation()), + ("gil_enabled", getattr(sys, '_is_gil_enabled', lambda: True)()), + ("executable", sys.executable), + ("def_encoding", sys.getdefaultencoding()), + ("fs_encoding", sys.getfilesystemencoding()), + ("pid", os.getpid()), + ("cwd", os.getcwd()), + ("path", sys.path), + ("environment", [f"{k} = {v}" for k, v in relevant_environment_display(os.environ)]), + ("command_line", " ".join(getattr(sys, "argv", ["-none-"]))), + ] + + if self._inorout is not None: + info.extend(self._inorout.sys_info()) + + info.extend(CoverageData.sys_info()) + + return info + + +# Mega debugging... +# $set_env.py: COVERAGE_DEBUG_CALLS - Lots and lots of output about calls to Coverage. +if int(os.getenv("COVERAGE_DEBUG_CALLS", 0)): # pragma: debugging + from coverage.debug import decorate_methods, show_calls + + Coverage = decorate_methods( # type: ignore[misc] + show_calls(show_args=True), + butnot=["get_data"], + )(Coverage) + + +def process_startup() -> Coverage | None: + """Call this at Python start-up to perhaps measure coverage. + + If the environment variable COVERAGE_PROCESS_START is defined, coverage + measurement is started. The value of the variable is the config file + to use. + + There are two ways to configure your Python installation to invoke this + function when Python starts: + + #. Create or append to sitecustomize.py to add these lines:: + + import coverage + coverage.process_startup() + + #. Create a .pth file in your Python installation containing:: + + import coverage; coverage.process_startup() + + Returns the :class:`Coverage` instance that was started, or None if it was + not started by this call. + + """ + cps = os.getenv("COVERAGE_PROCESS_START") + if not cps: + # No request for coverage, nothing to do. + return None + + # This function can be called more than once in a process. This happens + # because some virtualenv configurations make the same directory visible + # twice in sys.path. This means that the .pth file will be found twice, + # and executed twice, executing this function twice. We set a global + # flag (an attribute on this function) to indicate that coverage.py has + # already been started, so we can avoid doing it twice. + # + # https://github.com/nedbat/coveragepy/issues/340 has more details. + + if hasattr(process_startup, "coverage"): + # We've annotated this function before, so we must have already + # started coverage.py in this process. Nothing to do. + return None + + cov = Coverage(config_file=cps) + process_startup.coverage = cov # type: ignore[attr-defined] + cov._warn_no_data = False + cov._warn_unimported_source = False + cov._warn_preimported_source = False + cov._auto_save = True + cov.start() + + return cov + + +def _prevent_sub_process_measurement() -> None: + """Stop any subprocess auto-measurement from writing data.""" + auto_created_coverage = getattr(process_startup, "coverage", None) + if auto_created_coverage is not None: + auto_created_coverage._auto_save = False diff --git a/.venv/Lib/site-packages/coverage/core.py b/.venv/Lib/site-packages/coverage/core.py new file mode 100644 index 00000000..b8916b68 --- /dev/null +++ b/.venv/Lib/site-packages/coverage/core.py @@ -0,0 +1,99 @@ +# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt + +"""Management of core choices.""" + +from __future__ import annotations + +import os +import sys +from typing import Any + +from coverage import env +from coverage.disposition import FileDisposition +from coverage.exceptions import ConfigError +from coverage.pytracer import PyTracer +from coverage.sysmon import SysMonitor +from coverage.types import ( + TFileDisposition, + Tracer, + TWarnFn, +) + + +try: + # Use the C extension code when we can, for speed. + from coverage.tracer import CTracer, CFileDisposition + HAS_CTRACER = True +except ImportError: + # Couldn't import the C extension, maybe it isn't built. + if os.getenv("COVERAGE_CORE") == "ctrace": # pragma: part covered + # During testing, we use the COVERAGE_CORE environment variable + # to indicate that we've fiddled with the environment to test this + # fallback code. If we thought we had a C tracer, but couldn't import + # it, then exit quickly and clearly instead of dribbling confusing + # errors. I'm using sys.exit here instead of an exception because an + # exception here causes all sorts of other noise in unittest. + sys.stderr.write("*** COVERAGE_CORE is 'ctrace' but can't import CTracer!\n") + sys.exit(1) + HAS_CTRACER = False + + +class Core: + """Information about the central technology enabling execution measurement.""" + + tracer_class: type[Tracer] + tracer_kwargs: dict[str, Any] + file_disposition_class: type[TFileDisposition] + supports_plugins: bool + packed_arcs: bool + systrace: bool + + def __init__(self, + warn: TWarnFn, + timid: bool, + metacov: bool, + ) -> None: + # Defaults + self.tracer_kwargs = {} + + core_name: str | None + if timid: + core_name = "pytrace" + else: + core_name = os.getenv("COVERAGE_CORE") + + if core_name == "sysmon" and not env.PYBEHAVIOR.pep669: + warn("sys.monitoring isn't available, using default core", slug="no-sysmon") + core_name = None + + if not core_name: + # Once we're comfortable with sysmon as a default: + # if env.PYBEHAVIOR.pep669 and self.should_start_context is None: + # core_name = "sysmon" + if HAS_CTRACER: + core_name = "ctrace" + else: + core_name = "pytrace" + + if core_name == "sysmon": + self.tracer_class = SysMonitor + self.tracer_kwargs = {"tool_id": 3 if metacov else 1} + self.file_disposition_class = FileDisposition + self.supports_plugins = False + self.packed_arcs = False + self.systrace = False + elif core_name == "ctrace": + self.tracer_class = CTracer + self.file_disposition_class = CFileDisposition + self.supports_plugins = True + self.packed_arcs = True + self.systrace = True + elif core_name == "pytrace": + self.tracer_class = PyTracer + self.file_disposition_class = FileDisposition + self.supports_plugins = False + self.packed_arcs = False + self.systrace = True + else: + raise ConfigError(f"Unknown core value: {core_name!r}") diff --git a/.venv/Lib/site-packages/coverage/data.py b/.venv/Lib/site-packages/coverage/data.py new file mode 100644 index 00000000..9baab8ed --- /dev/null +++ b/.venv/Lib/site-packages/coverage/data.py @@ -0,0 +1,228 @@ +# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt + +"""Coverage data for coverage.py. + +This file had the 4.x JSON data support, which is now gone. This file still +has storage-agnostic helpers, and is kept to avoid changing too many imports. +CoverageData is now defined in sqldata.py, and imported here to keep the +imports working. + +""" + +from __future__ import annotations + +import functools +import glob +import hashlib +import os.path + +from typing import Callable +from collections.abc import Iterable + +from coverage.exceptions import CoverageException, NoDataError +from coverage.files import PathAliases +from coverage.misc import Hasher, file_be_gone, human_sorted, plural +from coverage.sqldata import CoverageData + + +def line_counts(data: CoverageData, fullpath: bool = False) -> dict[str, int]: + """Return a dict summarizing the line coverage data. + + Keys are based on the file names, and values are the number of executed + lines. If `fullpath` is true, then the keys are the full pathnames of + the files, otherwise they are the basenames of the files. + + Returns a dict mapping file names to counts of lines. + + """ + summ = {} + filename_fn: Callable[[str], str] + if fullpath: + # pylint: disable=unnecessary-lambda-assignment + filename_fn = lambda f: f + else: + filename_fn = os.path.basename + for filename in data.measured_files(): + lines = data.lines(filename) + assert lines is not None + summ[filename_fn(filename)] = len(lines) + return summ + + +def add_data_to_hash(data: CoverageData, filename: str, hasher: Hasher) -> None: + """Contribute `filename`'s data to the `hasher`. + + `hasher` is a `coverage.misc.Hasher` instance to be updated with + the file's data. It should only get the results data, not the run + data. + + """ + if data.has_arcs(): + hasher.update(sorted(data.arcs(filename) or [])) + else: + hasher.update(sorted_lines(data, filename)) + hasher.update(data.file_tracer(filename)) + + +def combinable_files(data_file: str, data_paths: Iterable[str] | None = None) -> list[str]: + """Make a list of data files to be combined. + + `data_file` is a path to a data file. `data_paths` is a list of files or + directories of files. + + Returns a list of absolute file paths. + """ + data_dir, local = os.path.split(os.path.abspath(data_file)) + + data_paths = data_paths or [data_dir] + files_to_combine = [] + for p in data_paths: + if os.path.isfile(p): + files_to_combine.append(os.path.abspath(p)) + elif os.path.isdir(p): + pattern = glob.escape(os.path.join(os.path.abspath(p), local)) +".*" + files_to_combine.extend(glob.glob(pattern)) + else: + raise NoDataError(f"Couldn't combine from non-existent path '{p}'") + + # SQLite might have made journal files alongside our database files. + # We never want to combine those. + files_to_combine = [fnm for fnm in files_to_combine if not fnm.endswith("-journal")] + + # Sorting isn't usually needed, since it shouldn't matter what order files + # are combined, but sorting makes tests more predictable, and makes + # debugging more understandable when things go wrong. + return sorted(files_to_combine) + + +def combine_parallel_data( + data: CoverageData, + aliases: PathAliases | None = None, + data_paths: Iterable[str] | None = None, + strict: bool = False, + keep: bool = False, + message: Callable[[str], None] | None = None, +) -> None: + """Combine a number of data files together. + + `data` is a CoverageData. + + Treat `data.filename` as a file prefix, and combine the data from all + of the data files starting with that prefix plus a dot. + + If `aliases` is provided, it's a `PathAliases` object that is used to + re-map paths to match the local machine's. + + If `data_paths` is provided, it is a list of directories or files to + combine. Directories are searched for files that start with + `data.filename` plus dot as a prefix, and those files are combined. + + If `data_paths` is not provided, then the directory portion of + `data.filename` is used as the directory to search for data files. + + Unless `keep` is True every data file found and combined is then deleted + from disk. If a file cannot be read, a warning will be issued, and the + file will not be deleted. + + If `strict` is true, and no files are found to combine, an error is + raised. + + `message` is a function to use for printing messages to the user. + + """ + files_to_combine = combinable_files(data.base_filename(), data_paths) + + if strict and not files_to_combine: + raise NoDataError("No data to combine") + + if aliases is None: + map_path = None + else: + map_path = functools.cache(aliases.map) + + file_hashes = set() + combined_any = False + + for f in files_to_combine: + if f == data.data_filename(): + # Sometimes we are combining into a file which is one of the + # parallel files. Skip that file. + if data._debug.should("dataio"): + data._debug.write(f"Skipping combining ourself: {f!r}") + continue + + try: + rel_file_name = os.path.relpath(f) + except ValueError: + # ValueError can be raised under Windows when os.getcwd() returns a + # folder from a different drive than the drive of f, in which case + # we print the original value of f instead of its relative path + rel_file_name = f + + with open(f, "rb") as fobj: + hasher = hashlib.new("sha3_256", usedforsecurity=False) + hasher.update(fobj.read()) + sha = hasher.digest() + combine_this_one = sha not in file_hashes + + delete_this_one = not keep + if combine_this_one: + if data._debug.should("dataio"): + data._debug.write(f"Combining data file {f!r}") + file_hashes.add(sha) + try: + new_data = CoverageData(f, debug=data._debug) + new_data.read() + except CoverageException as exc: + if data._warn: + # The CoverageException has the file name in it, so just + # use the message as the warning. + data._warn(str(exc)) + if message: + message(f"Couldn't combine data file {rel_file_name}: {exc}") + delete_this_one = False + else: + data.update(new_data, map_path=map_path) + combined_any = True + if message: + message(f"Combined data file {rel_file_name}") + else: + if message: + message(f"Skipping duplicate data {rel_file_name}") + + if delete_this_one: + if data._debug.should("dataio"): + data._debug.write(f"Deleting data file {f!r}") + file_be_gone(f) + + if strict and not combined_any: + raise NoDataError("No usable data files") + + +def debug_data_file(filename: str) -> None: + """Implementation of 'coverage debug data'.""" + data = CoverageData(filename) + filename = data.data_filename() + print(f"path: {filename}") + if not os.path.exists(filename): + print("No data collected: file doesn't exist") + return + data.read() + print(f"has_arcs: {data.has_arcs()!r}") + summary = line_counts(data, fullpath=True) + filenames = human_sorted(summary.keys()) + nfiles = len(filenames) + print(f"{nfiles} file{plural(nfiles)}:") + for f in filenames: + line = f"{f}: {summary[f]} line{plural(summary[f])}" + plugin = data.file_tracer(f) + if plugin: + line += f" [{plugin}]" + print(line) + + +def sorted_lines(data: CoverageData, filename: str) -> list[int]: + """Get the sorted lines for a file, for tests.""" + lines = data.lines(filename) + return sorted(lines or []) diff --git a/.venv/Lib/site-packages/coverage/debug.py b/.venv/Lib/site-packages/coverage/debug.py new file mode 100644 index 00000000..cf9310dc --- /dev/null +++ b/.venv/Lib/site-packages/coverage/debug.py @@ -0,0 +1,613 @@ +# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt + +"""Control of and utilities for debugging.""" + +from __future__ import annotations + +import atexit +import contextlib +import functools +import inspect +import itertools +import os +import pprint +import re +import reprlib +import sys +import traceback +import types +import _thread + +from typing import ( + overload, + Any, Callable, IO, +) +from collections.abc import Iterable, Iterator, Mapping + +from coverage.misc import human_sorted_items, isolate_module +from coverage.types import AnyCallable, TWritable + +os = isolate_module(os) + + +# When debugging, it can be helpful to force some options, especially when +# debugging the configuration mechanisms you usually use to control debugging! +# This is a list of forced debugging options. +FORCED_DEBUG: list[str] = [] +FORCED_DEBUG_FILE = None + + +class DebugControl: + """Control and output for debugging.""" + + show_repr_attr = False # For auto_repr + + def __init__( + self, + options: Iterable[str], + output: IO[str] | None, + file_name: str | None = None, + ) -> None: + """Configure the options and output file for debugging.""" + self.options = list(options) + FORCED_DEBUG + self.suppress_callers = False + + filters = [] + if self.should("process"): + filters.append(CwdTracker().filter) + filters.append(ProcessTracker().filter) + if self.should("pytest"): + filters.append(PytestTracker().filter) + if self.should("pid"): + filters.append(add_pid_and_tid) + + self.output = DebugOutputFile.get_one( + output, + file_name=file_name, + filters=filters, + ) + self.raw_output = self.output.outfile + + def __repr__(self) -> str: + return f"" + + def should(self, option: str) -> bool: + """Decide whether to output debug information in category `option`.""" + if option == "callers" and self.suppress_callers: + return False + return (option in self.options) + + @contextlib.contextmanager + def without_callers(self) -> Iterator[None]: + """A context manager to prevent call stacks from being logged.""" + old = self.suppress_callers + self.suppress_callers = True + try: + yield + finally: + self.suppress_callers = old + + def write(self, msg: str, *, exc: BaseException | None = None) -> None: + """Write a line of debug output. + + `msg` is the line to write. A newline will be appended. + + If `exc` is provided, a stack trace of the exception will be written + after the message. + + """ + self.output.write(msg + "\n") + if exc is not None: + self.output.write("".join(traceback.format_exception(None, exc, exc.__traceback__))) + if self.should("self"): + caller_self = inspect.stack()[1][0].f_locals.get("self") + if caller_self is not None: + self.output.write(f"self: {caller_self!r}\n") + if self.should("callers"): + dump_stack_frames(out=self.output, skip=1) + self.output.flush() + + +class NoDebugging(DebugControl): + """A replacement for DebugControl that will never try to do anything.""" + def __init__(self) -> None: + # pylint: disable=super-init-not-called + ... + + def should(self, option: str) -> bool: + """Should we write debug messages? Never.""" + return False + + def write(self, msg: str, *, exc: BaseException | None = None) -> None: + """This will never be called.""" + raise AssertionError("NoDebugging.write should never be called.") + + +def info_header(label: str) -> str: + """Make a nice header string.""" + return "--{:-<60s}".format(" "+label+" ") + + +def info_formatter(info: Iterable[tuple[str, Any]]) -> Iterator[str]: + """Produce a sequence of formatted lines from info. + + `info` is a sequence of pairs (label, data). The produced lines are + nicely formatted, ready to print. + + """ + info = list(info) + if not info: + return + label_len = 30 + assert all(len(l) < label_len for l, _ in info) + for label, data in info: + if data == []: + data = "-none-" + if isinstance(data, tuple) and len(repr(tuple(data))) < 30: + # Convert to tuple to scrub namedtuples. + yield "%*s: %r" % (label_len, label, tuple(data)) + elif isinstance(data, (list, set, tuple)): + prefix = "%*s:" % (label_len, label) + for e in data: + yield "%*s %s" % (label_len+1, prefix, e) + prefix = "" + else: + yield "%*s: %s" % (label_len, label, data) + + +def write_formatted_info( + write: Callable[[str], None], + header: str, + info: Iterable[tuple[str, Any]], +) -> None: + """Write a sequence of (label,data) pairs nicely. + + `write` is a function write(str) that accepts each line of output. + `header` is a string to start the section. `info` is a sequence of + (label, data) pairs, where label is a str, and data can be a single + value, or a list/set/tuple. + + """ + write(info_header(header)) + for line in info_formatter(info): + write(f" {line}") + + +def exc_one_line(exc: Exception) -> str: + """Get a one-line summary of an exception, including class name and message.""" + lines = traceback.format_exception_only(type(exc), exc) + return "|".join(l.rstrip() for l in lines) + + +_FILENAME_REGEXES: list[tuple[str, str]] = [ + (r".*[/\\]pytest-of-.*[/\\]pytest-\d+([/\\]popen-gw\d+)?", "tmp:"), +] +_FILENAME_SUBS: list[tuple[str, str]] = [] + +@overload +def short_filename(filename: str) -> str: + pass + +@overload +def short_filename(filename: None) -> None: + pass + +def short_filename(filename: str | None) -> str | None: + """Shorten a file name. Directories are replaced by prefixes like 'syspath:'""" + if not _FILENAME_SUBS: + for pathdir in sys.path: + _FILENAME_SUBS.append((pathdir, "syspath:")) + import coverage + _FILENAME_SUBS.append((os.path.dirname(coverage.__file__), "cov:")) + _FILENAME_SUBS.sort(key=(lambda pair: len(pair[0])), reverse=True) + if filename is not None: + for pat, sub in _FILENAME_REGEXES: + filename = re.sub(pat, sub, filename) + for before, after in _FILENAME_SUBS: + filename = filename.replace(before, after) + return filename + + +def short_stack( + skip: int = 0, + full: bool = False, + frame_ids: bool = False, + short_filenames: bool = False, +) -> str: + """Return a string summarizing the call stack. + + The string is multi-line, with one line per stack frame. Each line shows + the function name, the file name, and the line number: + + ... + start_import_stop : /Users/ned/coverage/trunk/tests/coveragetest.py:95 + import_local_file : /Users/ned/coverage/trunk/tests/coveragetest.py:81 + import_local_file : /Users/ned/coverage/trunk/coverage/backward.py:159 + ... + + `skip` is the number of closest immediate frames to skip, so that debugging + functions can call this and not be included in the result. + + If `full` is true, then include all frames. Otherwise, initial "boring" + frames (ones in site-packages and earlier) are omitted. + + `short_filenames` will shorten filenames using `short_filename`, to reduce + the amount of repetitive noise in stack traces. + + """ + # Regexes in initial frames that we don't care about. + BORING_PRELUDE = [ + "", # pytest-xdist has string execution. + r"\bigor.py$", # Our test runner. + r"\bsite-packages\b", # pytest etc getting to our tests. + ] + + stack: Iterable[inspect.FrameInfo] = inspect.stack()[:skip:-1] + if not full: + for pat in BORING_PRELUDE: + stack = itertools.dropwhile( + (lambda fi, pat=pat: re.search(pat, fi.filename)), # type: ignore[misc] + stack, + ) + lines = [] + for frame_info in stack: + line = f"{frame_info.function:>30s} : " + if frame_ids: + line += f"{id(frame_info.frame):#x} " + filename = frame_info.filename + if short_filenames: + filename = short_filename(filename) + line += f"{filename}:{frame_info.lineno}" + lines.append(line) + return "\n".join(lines) + + +def dump_stack_frames(out: TWritable, skip: int = 0) -> None: + """Print a summary of the stack to `out`.""" + out.write(short_stack(skip=skip+1) + "\n") + + +def clipped_repr(text: str, numchars: int = 50) -> str: + """`repr(text)`, but limited to `numchars`.""" + r = reprlib.Repr() + r.maxstring = numchars + return r.repr(text) + + +def short_id(id64: int) -> int: + """Given a 64-bit id, make a shorter 16-bit one.""" + id16 = 0 + for offset in range(0, 64, 16): + id16 ^= id64 >> offset + return id16 & 0xFFFF + + +def add_pid_and_tid(text: str) -> str: + """A filter to add pid and tid to debug messages.""" + # Thread ids are useful, but too long. Make a shorter one. + tid = f"{short_id(_thread.get_ident()):04x}" + text = f"{os.getpid():5d}.{tid}: {text}" + return text + + +AUTO_REPR_IGNORE = {"$coverage.object_id"} + +def auto_repr(self: Any) -> str: + """A function implementing an automatic __repr__ for debugging.""" + show_attrs = ( + (k, v) for k, v in self.__dict__.items() + if getattr(v, "show_repr_attr", True) + and not inspect.ismethod(v) + and k not in AUTO_REPR_IGNORE + ) + return "<{klass} @{id:#x}{attrs}>".format( + klass=self.__class__.__name__, + id=id(self), + attrs="".join(f" {k}={v!r}" for k, v in show_attrs), + ) + + +def simplify(v: Any) -> Any: # pragma: debugging + """Turn things which are nearly dict/list/etc into dict/list/etc.""" + if isinstance(v, dict): + return {k:simplify(vv) for k, vv in v.items()} + elif isinstance(v, (list, tuple)): + return type(v)(simplify(vv) for vv in v) + elif hasattr(v, "__dict__"): + return simplify({"."+k: v for k, v in v.__dict__.items()}) + else: + return v + + +def pp(v: Any) -> None: # pragma: debugging + """Debug helper to pretty-print data, including SimpleNamespace objects.""" + # Might not be needed in 3.9+ + pprint.pprint(simplify(v)) + + +def filter_text(text: str, filters: Iterable[Callable[[str], str]]) -> str: + """Run `text` through a series of filters. + + `filters` is a list of functions. Each takes a string and returns a + string. Each is run in turn. After each filter, the text is split into + lines, and each line is passed through the next filter. + + Returns: the final string that results after all of the filters have + run. + + """ + clean_text = text.rstrip() + ending = text[len(clean_text):] + text = clean_text + for filter_fn in filters: + lines = [] + for line in text.splitlines(): + lines.extend(filter_fn(line).splitlines()) + text = "\n".join(lines) + return text + ending + + +class CwdTracker: + """A class to add cwd info to debug messages.""" + def __init__(self) -> None: + self.cwd: str | None = None + + def filter(self, text: str) -> str: + """Add a cwd message for each new cwd.""" + cwd = os.getcwd() + if cwd != self.cwd: + text = f"cwd is now {cwd!r}\n" + text + self.cwd = cwd + return text + + +class ProcessTracker: + """Track process creation for debug logging.""" + def __init__(self) -> None: + self.pid: int = os.getpid() + self.did_welcome = False + + def filter(self, text: str) -> str: + """Add a message about how new processes came to be.""" + welcome = "" + pid = os.getpid() + if self.pid != pid: + welcome = f"New process: forked {self.pid} -> {pid}\n" + self.pid = pid + elif not self.did_welcome: + argv = getattr(sys, "argv", None) + welcome = ( + f"New process: {pid=}, executable: {sys.executable!r}\n" + + f"New process: cmd: {argv!r}\n" + + f"New process parent pid: {os.getppid()!r}\n" + ) + + if welcome: + self.did_welcome = True + return welcome + text + else: + return text + + +class PytestTracker: + """Track the current pytest test name to add to debug messages.""" + def __init__(self) -> None: + self.test_name: str | None = None + + def filter(self, text: str) -> str: + """Add a message when the pytest test changes.""" + test_name = os.getenv("PYTEST_CURRENT_TEST") + if test_name != self.test_name: + text = f"Pytest context: {test_name}\n" + text + self.test_name = test_name + return text + + +class DebugOutputFile: + """A file-like object that includes pid and cwd information.""" + def __init__( + self, + outfile: IO[str] | None, + filters: Iterable[Callable[[str], str]], + ): + self.outfile = outfile + self.filters = list(filters) + self.pid = os.getpid() + + @classmethod + def get_one( + cls, + fileobj: IO[str] | None = None, + file_name: str | None = None, + filters: Iterable[Callable[[str], str]] = (), + interim: bool = False, + ) -> DebugOutputFile: + """Get a DebugOutputFile. + + If `fileobj` is provided, then a new DebugOutputFile is made with it. + + If `fileobj` isn't provided, then a file is chosen (`file_name` if + provided, or COVERAGE_DEBUG_FILE, or stderr), and a process-wide + singleton DebugOutputFile is made. + + `filters` are the text filters to apply to the stream to annotate with + pids, etc. + + If `interim` is true, then a future `get_one` can replace this one. + + """ + if fileobj is not None: + # Make DebugOutputFile around the fileobj passed. + return cls(fileobj, filters) + + the_one, is_interim = cls._get_singleton_data() + if the_one is None or is_interim: + if file_name is not None: + fileobj = open(file_name, "a", encoding="utf-8") + else: + # $set_env.py: COVERAGE_DEBUG_FILE - Where to write debug output + file_name = os.getenv("COVERAGE_DEBUG_FILE", FORCED_DEBUG_FILE) + if file_name in ("stdout", "stderr"): + fileobj = getattr(sys, file_name) + elif file_name: + fileobj = open(file_name, "a", encoding="utf-8") + atexit.register(fileobj.close) + else: + fileobj = sys.stderr + the_one = cls(fileobj, filters) + cls._set_singleton_data(the_one, interim) + + if not(the_one.filters): + the_one.filters = list(filters) + return the_one + + # Because of the way igor.py deletes and re-imports modules, + # this class can be defined more than once. But we really want + # a process-wide singleton. So stash it in sys.modules instead of + # on a class attribute. Yes, this is aggressively gross. + + SYS_MOD_NAME = "$coverage.debug.DebugOutputFile.the_one" + SINGLETON_ATTR = "the_one_and_is_interim" + + @classmethod + def _set_singleton_data(cls, the_one: DebugOutputFile, interim: bool) -> None: + """Set the one DebugOutputFile to rule them all.""" + singleton_module = types.ModuleType(cls.SYS_MOD_NAME) + setattr(singleton_module, cls.SINGLETON_ATTR, (the_one, interim)) + sys.modules[cls.SYS_MOD_NAME] = singleton_module + + @classmethod + def _get_singleton_data(cls) -> tuple[DebugOutputFile | None, bool]: + """Get the one DebugOutputFile.""" + singleton_module = sys.modules.get(cls.SYS_MOD_NAME) + return getattr(singleton_module, cls.SINGLETON_ATTR, (None, True)) + + @classmethod + def _del_singleton_data(cls) -> None: + """Delete the one DebugOutputFile, just for tests to use.""" + if cls.SYS_MOD_NAME in sys.modules: + del sys.modules[cls.SYS_MOD_NAME] + + def write(self, text: str) -> None: + """Just like file.write, but filter through all our filters.""" + assert self.outfile is not None + self.outfile.write(filter_text(text, self.filters)) + self.outfile.flush() + + def flush(self) -> None: + """Flush our file.""" + assert self.outfile is not None + self.outfile.flush() + + +def log(msg: str, stack: bool = False) -> None: # pragma: debugging + """Write a log message as forcefully as possible.""" + out = DebugOutputFile.get_one(interim=True) + out.write(msg+"\n") + if stack: + dump_stack_frames(out=out, skip=1) + + +def decorate_methods( + decorator: Callable[..., Any], + butnot: Iterable[str] = (), + private: bool = False, +) -> Callable[..., Any]: # pragma: debugging + """A class decorator to apply a decorator to methods.""" + def _decorator(cls): # type: ignore[no-untyped-def] + for name, meth in inspect.getmembers(cls, inspect.isroutine): + if name not in cls.__dict__: + continue + if name != "__init__": + if not private and name.startswith("_"): + continue + if name in butnot: + continue + setattr(cls, name, decorator(meth)) + return cls + return _decorator + + +def break_in_pudb(func: AnyCallable) -> AnyCallable: # pragma: debugging + """A function decorator to stop in the debugger for each call.""" + @functools.wraps(func) + def _wrapper(*args: Any, **kwargs: Any) -> Any: + import pudb + sys.stdout = sys.__stdout__ + pudb.set_trace() + return func(*args, **kwargs) + return _wrapper + + +OBJ_IDS = itertools.count() +CALLS = itertools.count() +OBJ_ID_ATTR = "$coverage.object_id" + +def show_calls( + show_args: bool = True, + show_stack: bool = False, + show_return: bool = False, +) -> Callable[..., Any]: # pragma: debugging + """A method decorator to debug-log each call to the function.""" + def _decorator(func: AnyCallable) -> AnyCallable: + @functools.wraps(func) + def _wrapper(self: Any, *args: Any, **kwargs: Any) -> Any: + oid = getattr(self, OBJ_ID_ATTR, None) + if oid is None: + oid = f"{os.getpid():08d} {next(OBJ_IDS):04d}" + setattr(self, OBJ_ID_ATTR, oid) + extra = "" + if show_args: + eargs = ", ".join(map(repr, args)) + ekwargs = ", ".join("{}={!r}".format(*item) for item in kwargs.items()) + extra += "(" + extra += eargs + if eargs and ekwargs: + extra += ", " + extra += ekwargs + extra += ")" + if show_stack: + extra += " @ " + extra += "; ".join(short_stack(short_filenames=True).splitlines()) + callid = next(CALLS) + msg = f"{oid} {callid:04d} {func.__name__}{extra}\n" + DebugOutputFile.get_one(interim=True).write(msg) + ret = func(self, *args, **kwargs) + if show_return: + msg = f"{oid} {callid:04d} {func.__name__} return {ret!r}\n" + DebugOutputFile.get_one(interim=True).write(msg) + return ret + return _wrapper + return _decorator + + +def relevant_environment_display(env: Mapping[str, str]) -> list[tuple[str, str]]: + """Filter environment variables for a debug display. + + Select variables to display (with COV or PY in the name, or HOME, TEMP, or + TMP), and also cloak sensitive values with asterisks. + + Arguments: + env: a dict of environment variable names and values. + + Returns: + A list of pairs (name, value) to show. + + """ + slugs = {"COV", "PY"} + include = {"HOME", "TEMP", "TMP"} + cloak = {"API", "TOKEN", "KEY", "SECRET", "PASS", "SIGNATURE"} + + to_show = [] + for name, val in env.items(): + keep = False + if name in include: + keep = True + elif any(slug in name for slug in slugs): + keep = True + if keep: + if any(slug in name for slug in cloak): + val = re.sub(r"\w", "*", val) + to_show.append((name, val)) + return human_sorted_items(to_show) diff --git a/.venv/Lib/site-packages/coverage/disposition.py b/.venv/Lib/site-packages/coverage/disposition.py new file mode 100644 index 00000000..7aa15e97 --- /dev/null +++ b/.venv/Lib/site-packages/coverage/disposition.py @@ -0,0 +1,58 @@ +# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt + +"""Simple value objects for tracking what to do with files.""" + +from __future__ import annotations + +from typing import TYPE_CHECKING + +from coverage.types import TFileDisposition + +if TYPE_CHECKING: + from coverage.plugin import FileTracer + + +class FileDisposition: + """A simple value type for recording what to do with a file.""" + + original_filename: str + canonical_filename: str + source_filename: str | None + trace: bool + reason: str + file_tracer: FileTracer | None + has_dynamic_filename: bool + + def __repr__(self) -> str: + return f"" + + +# FileDisposition "methods": FileDisposition is a pure value object, so it can +# be implemented in either C or Python. Acting on them is done with these +# functions. + +def disposition_init(cls: type[TFileDisposition], original_filename: str) -> TFileDisposition: + """Construct and initialize a new FileDisposition object.""" + disp = cls() + disp.original_filename = original_filename + disp.canonical_filename = original_filename + disp.source_filename = None + disp.trace = False + disp.reason = "" + disp.file_tracer = None + disp.has_dynamic_filename = False + return disp + + +def disposition_debug_msg(disp: TFileDisposition) -> str: + """Make a nice debug message of what the FileDisposition is doing.""" + if disp.trace: + msg = f"Tracing {disp.original_filename!r}" + if disp.original_filename != disp.source_filename: + msg += f" as {disp.source_filename!r}" + if disp.file_tracer: + msg += f": will be traced by {disp.file_tracer!r}" + else: + msg = f"Not tracing {disp.original_filename!r}: {disp.reason}" + return msg diff --git a/.venv/Lib/site-packages/coverage/env.py b/.venv/Lib/site-packages/coverage/env.py new file mode 100644 index 00000000..39ec169c --- /dev/null +++ b/.venv/Lib/site-packages/coverage/env.py @@ -0,0 +1,125 @@ +# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt + +"""Determine facts about the environment.""" + +from __future__ import annotations + +import os +import platform +import sys + +from typing import Any +from collections.abc import Iterable + +# debug_info() at the bottom wants to show all the globals, but not imports. +# Grab the global names here to know which names to not show. Nothing defined +# above this line will be in the output. +_UNINTERESTING_GLOBALS = list(globals()) +# These names also shouldn't be shown. +_UNINTERESTING_GLOBALS += ["PYBEHAVIOR", "debug_info"] + +# Operating systems. +WINDOWS = sys.platform == "win32" +LINUX = sys.platform.startswith("linux") +OSX = sys.platform == "darwin" + +# Python implementations. +CPYTHON = (platform.python_implementation() == "CPython") +PYPY = (platform.python_implementation() == "PyPy") + +# Python versions. We amend version_info with one more value, a zero if an +# official version, or 1 if built from source beyond an official version. +# Only use sys.version_info directly where tools like mypy need it to understand +# version-specfic code, otherwise use PYVERSION. +PYVERSION = sys.version_info + (int(platform.python_version()[-1] == "+"),) + +if PYPY: + # Minimum now is 7.3.16 + PYPYVERSION = sys.pypy_version_info # type: ignore[attr-defined] +else: + PYPYVERSION = (0,) + +# Python behavior. +class PYBEHAVIOR: + """Flags indicating this Python's behavior.""" + + # Does Python conform to PEP626, Precise line numbers for debugging and other tools. + # https://www.python.org/dev/peps/pep-0626 + pep626 = (PYVERSION > (3, 10, 0, "alpha", 4)) + + # Is "if __debug__" optimized away? + optimize_if_debug = not pep626 + + # Is "if not __debug__" optimized away? The exact details have changed + # across versions. + if pep626: + optimize_if_not_debug = 1 + else: + optimize_if_not_debug = 2 + + # 3.7 changed how functions with only docstrings are numbered. + docstring_only_function = (not PYPY) and (PYVERSION <= (3, 10)) + + # Lines after break/continue/return/raise are no longer compiled into the + # bytecode. They used to be marked as missing, now they aren't executable. + omit_after_jump = pep626 or PYPY + + # PyPy has always omitted statements after return. + omit_after_return = omit_after_jump or PYPY + + # Optimize away unreachable try-else clauses. + optimize_unreachable_try_else = pep626 + + # Modules used to have firstlineno equal to the line number of the first + # real line of code. Now they always start at 1. + module_firstline_1 = pep626 + + # Are "if 0:" lines (and similar) kept in the compiled code? + keep_constant_test = pep626 + + # When leaving a with-block, do we visit the with-line again for the exit? + exit_through_with = (PYVERSION >= (3, 10, 0, "beta")) + + # When leaving a with-block, do we visit the with-line exactly, + # or the inner-most context manager? + exit_with_through_ctxmgr = (PYVERSION >= (3, 12)) + + # Match-case construct. + match_case = (PYVERSION >= (3, 10)) + + # Some words are keywords in some places, identifiers in other places. + soft_keywords = (PYVERSION >= (3, 10)) + + # PEP669 Low Impact Monitoring: https://peps.python.org/pep-0669/ + pep669 = bool(getattr(sys, "monitoring", None)) + + # Where does frame.f_lasti point when yielding from a generator? + # It used to point at the YIELD, in 3.13 it points at the RESUME, + # then it went back to the YIELD. + # https://github.com/python/cpython/issues/113728 + lasti_is_yield = (PYVERSION[:2] != (3, 13)) + + +# Coverage.py specifics, about testing scenarios. See tests/testenv.py also. + +# Are we coverage-measuring ourselves? +METACOV = os.getenv("COVERAGE_COVERAGE") is not None + +# Are we running our test suite? +# Even when running tests, you can use COVERAGE_TESTING=0 to disable the +# test-specific behavior like AST checking. +TESTING = os.getenv("COVERAGE_TESTING") == "True" + + +def debug_info() -> Iterable[tuple[str, Any]]: + """Return a list of (name, value) pairs for printing debug information.""" + info = [ + (name, value) for name, value in globals().items() + if not name.startswith("_") and name not in _UNINTERESTING_GLOBALS + ] + info += [ + (name, value) for name, value in PYBEHAVIOR.__dict__.items() + if not name.startswith("_") + ] + return sorted(info) diff --git a/.venv/Lib/site-packages/coverage/exceptions.py b/.venv/Lib/site-packages/coverage/exceptions.py new file mode 100644 index 00000000..ecd1b5e6 --- /dev/null +++ b/.venv/Lib/site-packages/coverage/exceptions.py @@ -0,0 +1,63 @@ +# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt + +"""Exceptions coverage.py can raise.""" + +from __future__ import annotations + +class _BaseCoverageException(Exception): + """The base-base of all Coverage exceptions.""" + pass + + +class CoverageException(_BaseCoverageException): + """The base class of all exceptions raised by Coverage.py.""" + pass + + +class ConfigError(_BaseCoverageException): + """A problem with a config file, or a value in one.""" + pass + + +class DataError(CoverageException): + """An error in using a data file.""" + pass + +class NoDataError(CoverageException): + """We didn't have data to work with.""" + pass + + +class NoSource(CoverageException): + """We couldn't find the source for a module.""" + pass + + +class NoCode(NoSource): + """We couldn't find any code at all.""" + pass + + +class NotPython(CoverageException): + """A source file turned out not to be parsable Python.""" + pass + + +class PluginError(CoverageException): + """A plugin misbehaved.""" + pass + + +class _ExceptionDuringRun(CoverageException): + """An exception happened while running customer code. + + Construct it with three arguments, the values from `sys.exc_info`. + + """ + pass + + +class CoverageWarning(Warning): + """A warning from Coverage.py.""" + pass diff --git a/.venv/Lib/site-packages/coverage/execfile.py b/.venv/Lib/site-packages/coverage/execfile.py new file mode 100644 index 00000000..cbecec84 --- /dev/null +++ b/.venv/Lib/site-packages/coverage/execfile.py @@ -0,0 +1,324 @@ +# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt + +"""Execute files of Python code.""" + +from __future__ import annotations + +import importlib.machinery +import importlib.util +import inspect +import marshal +import os +import struct +import sys + +from importlib.machinery import ModuleSpec +from types import CodeType, ModuleType +from typing import Any + +from coverage.exceptions import CoverageException, _ExceptionDuringRun, NoCode, NoSource +from coverage.files import canonical_filename, python_reported_file +from coverage.misc import isolate_module +from coverage.python import get_python_source + +os = isolate_module(os) + + +PYC_MAGIC_NUMBER = importlib.util.MAGIC_NUMBER + +class DummyLoader: + """A shim for the pep302 __loader__, emulating pkgutil.ImpLoader. + + Currently only implements the .fullname attribute + """ + def __init__(self, fullname: str, *_args: Any) -> None: + self.fullname = fullname + + +def find_module( + modulename: str, +) -> tuple[str | None, str, ModuleSpec]: + """Find the module named `modulename`. + + Returns the file path of the module, the name of the enclosing + package, and the spec. + """ + try: + spec = importlib.util.find_spec(modulename) + except ImportError as err: + raise NoSource(str(err)) from err + if not spec: + raise NoSource(f"No module named {modulename!r}") + pathname = spec.origin + packagename = spec.name + if spec.submodule_search_locations: + mod_main = modulename + ".__main__" + spec = importlib.util.find_spec(mod_main) + if not spec: + raise NoSource( + f"No module named {mod_main}; " + + f"{modulename!r} is a package and cannot be directly executed", + ) + pathname = spec.origin + packagename = spec.name + packagename = packagename.rpartition(".")[0] + return pathname, packagename, spec + + +class PyRunner: + """Multi-stage execution of Python code. + + This is meant to emulate real Python execution as closely as possible. + + """ + def __init__(self, args: list[str], as_module: bool = False) -> None: + self.args = args + self.as_module = as_module + + self.arg0 = args[0] + self.package: str | None = None + self.modulename: str | None = None + self.pathname: str | None = None + self.loader: DummyLoader | None = None + self.spec: ModuleSpec | None = None + + def prepare(self) -> None: + """Set sys.path properly. + + This needs to happen before any importing, and without importing anything. + """ + path0: str | None + if self.as_module: + path0 = os.getcwd() + elif os.path.isdir(self.arg0): + # Running a directory means running the __main__.py file in that + # directory. + path0 = self.arg0 + else: + path0 = os.path.abspath(os.path.dirname(self.arg0)) + + if os.path.isdir(sys.path[0]): + # sys.path fakery. If we are being run as a command, then sys.path[0] + # is the directory of the "coverage" script. If this is so, replace + # sys.path[0] with the directory of the file we're running, or the + # current directory when running modules. If it isn't so, then we + # don't know what's going on, and just leave it alone. + top_file = inspect.stack()[-1][0].f_code.co_filename + sys_path_0_abs = os.path.abspath(sys.path[0]) + top_file_dir_abs = os.path.abspath(os.path.dirname(top_file)) + sys_path_0_abs = canonical_filename(sys_path_0_abs) + top_file_dir_abs = canonical_filename(top_file_dir_abs) + if sys_path_0_abs != top_file_dir_abs: + path0 = None + + else: + # sys.path[0] is a file. Is the next entry the directory containing + # that file? + if sys.path[1] == os.path.dirname(sys.path[0]): + # Can it be right to always remove that? + del sys.path[1] + + if path0 is not None: + sys.path[0] = python_reported_file(path0) + + def _prepare2(self) -> None: + """Do more preparation to run Python code. + + Includes finding the module to run and adjusting sys.argv[0]. + This method is allowed to import code. + + """ + if self.as_module: + self.modulename = self.arg0 + pathname, self.package, self.spec = find_module(self.modulename) + if self.spec is not None: + self.modulename = self.spec.name + self.loader = DummyLoader(self.modulename) + assert pathname is not None + self.pathname = os.path.abspath(pathname) + self.args[0] = self.arg0 = self.pathname + elif os.path.isdir(self.arg0): + # Running a directory means running the __main__.py file in that + # directory. + for ext in [".py", ".pyc", ".pyo"]: + try_filename = os.path.join(self.arg0, "__main__" + ext) + # 3.8.10 changed how files are reported when running a + # directory. + try_filename = os.path.abspath(try_filename) + if os.path.exists(try_filename): + self.arg0 = try_filename + break + else: + raise NoSource(f"Can't find '__main__' module in '{self.arg0}'") + + # Make a spec. I don't know if this is the right way to do it. + try_filename = python_reported_file(try_filename) + self.spec = importlib.machinery.ModuleSpec("__main__", None, origin=try_filename) + self.spec.has_location = True + self.package = "" + self.loader = DummyLoader("__main__") + else: + self.loader = DummyLoader("__main__") + + self.arg0 = python_reported_file(self.arg0) + + def run(self) -> None: + """Run the Python code!""" + + self._prepare2() + + # Create a module to serve as __main__ + main_mod = ModuleType("__main__") + + from_pyc = self.arg0.endswith((".pyc", ".pyo")) + main_mod.__file__ = self.arg0 + if from_pyc: + main_mod.__file__ = main_mod.__file__[:-1] + if self.package is not None: + main_mod.__package__ = self.package + main_mod.__loader__ = self.loader # type: ignore[assignment] + if self.spec is not None: + main_mod.__spec__ = self.spec + + main_mod.__builtins__ = sys.modules["builtins"] # type: ignore[attr-defined] + + sys.modules["__main__"] = main_mod + + # Set sys.argv properly. + sys.argv = self.args + + try: + # Make a code object somehow. + if from_pyc: + code = make_code_from_pyc(self.arg0) + else: + code = make_code_from_py(self.arg0) + except CoverageException: + raise + except Exception as exc: + msg = f"Couldn't run '{self.arg0}' as Python code: {exc.__class__.__name__}: {exc}" + raise CoverageException(msg) from exc + + # Execute the code object. + # Return to the original directory in case the test code exits in + # a non-existent directory. + cwd = os.getcwd() + try: + exec(code, main_mod.__dict__) + except SystemExit: # pylint: disable=try-except-raise + # The user called sys.exit(). Just pass it along to the upper + # layers, where it will be handled. + raise + except Exception: + # Something went wrong while executing the user code. + # Get the exc_info, and pack them into an exception that we can + # throw up to the outer loop. We peel one layer off the traceback + # so that the coverage.py code doesn't appear in the final printed + # traceback. + typ, err, tb = sys.exc_info() + assert typ is not None + assert err is not None + assert tb is not None + + # PyPy3 weirdness. If I don't access __context__, then somehow it + # is non-None when the exception is reported at the upper layer, + # and a nested exception is shown to the user. This getattr fixes + # it somehow? https://bitbucket.org/pypy/pypy/issue/1903 + getattr(err, "__context__", None) + + # Call the excepthook. + try: + assert err.__traceback__ is not None + err.__traceback__ = err.__traceback__.tb_next + sys.excepthook(typ, err, tb.tb_next) + except SystemExit: # pylint: disable=try-except-raise + raise + except Exception as exc: + # Getting the output right in the case of excepthook + # shenanigans is kind of involved. + sys.stderr.write("Error in sys.excepthook:\n") + typ2, err2, tb2 = sys.exc_info() + assert typ2 is not None + assert err2 is not None + assert tb2 is not None + err2.__suppress_context__ = True + assert err2.__traceback__ is not None + err2.__traceback__ = err2.__traceback__.tb_next + sys.__excepthook__(typ2, err2, tb2.tb_next) + sys.stderr.write("\nOriginal exception was:\n") + raise _ExceptionDuringRun(typ, err, tb.tb_next) from exc + else: + sys.exit(1) + finally: + os.chdir(cwd) + + +def run_python_module(args: list[str]) -> None: + """Run a Python module, as though with ``python -m name args...``. + + `args` is the argument array to present as sys.argv, including the first + element naming the module being executed. + + This is a helper for tests, to encapsulate how to use PyRunner. + + """ + runner = PyRunner(args, as_module=True) + runner.prepare() + runner.run() + + +def run_python_file(args: list[str]) -> None: + """Run a Python file as if it were the main program on the command line. + + `args` is the argument array to present as sys.argv, including the first + element naming the file being executed. `package` is the name of the + enclosing package, if any. + + This is a helper for tests, to encapsulate how to use PyRunner. + + """ + runner = PyRunner(args, as_module=False) + runner.prepare() + runner.run() + + +def make_code_from_py(filename: str) -> CodeType: + """Get source from `filename` and make a code object of it.""" + try: + source = get_python_source(filename) + except (OSError, NoSource) as exc: + raise NoSource(f"No file to run: '{filename}'") from exc + + code = compile(source, filename, mode="exec", dont_inherit=True) + return code + + +def make_code_from_pyc(filename: str) -> CodeType: + """Get a code object from a .pyc file.""" + try: + fpyc = open(filename, "rb") + except OSError as exc: + raise NoCode(f"No file to run: '{filename}'") from exc + + with fpyc: + # First four bytes are a version-specific magic number. It has to + # match or we won't run the file. + magic = fpyc.read(4) + if magic != PYC_MAGIC_NUMBER: + raise NoCode(f"Bad magic number in .pyc file: {magic!r} != {PYC_MAGIC_NUMBER!r}") + + flags = struct.unpack(" None: + """Set the directory that `relative_filename` will be relative to.""" + global RELATIVE_DIR, CANONICAL_FILENAME_CACHE + + # The current directory + abs_curdir = abs_file(os.curdir) + if not abs_curdir.endswith(os.sep): + # Suffix with separator only if not at the system root + abs_curdir = abs_curdir + os.sep + + # The absolute path to our current directory. + RELATIVE_DIR = os.path.normcase(abs_curdir) + + # Cache of results of calling the canonical_filename() method, to + # avoid duplicating work. + CANONICAL_FILENAME_CACHE = {} + + +def relative_directory() -> str: + """Return the directory that `relative_filename` is relative to.""" + return RELATIVE_DIR + + +def relative_filename(filename: str) -> str: + """Return the relative form of `filename`. + + The file name will be relative to the current directory when the + `set_relative_directory` was called. + + """ + fnorm = os.path.normcase(filename) + if fnorm.startswith(RELATIVE_DIR): + filename = filename[len(RELATIVE_DIR):] + return filename + + +def canonical_filename(filename: str) -> str: + """Return a canonical file name for `filename`. + + An absolute path with no redundant components and normalized case. + + """ + if filename not in CANONICAL_FILENAME_CACHE: + cf = filename + if not os.path.isabs(filename): + for path in [os.curdir] + sys.path: + if path is None: + continue # type: ignore[unreachable] + f = os.path.join(path, filename) + try: + exists = os.path.exists(f) + except UnicodeError: + exists = False + if exists: + cf = f + break + cf = abs_file(cf) + CANONICAL_FILENAME_CACHE[filename] = cf + return CANONICAL_FILENAME_CACHE[filename] + + +def flat_rootname(filename: str) -> str: + """A base for a flat file name to correspond to this file. + + Useful for writing files about the code where you want all the files in + the same directory, but need to differentiate same-named files from + different directories. + + For example, the file a/b/c.py will return 'z_86bbcbe134d28fd2_c_py' + + """ + dirname, basename = ntpath.split(filename) + if dirname: + fp = hashlib.new( + "sha3_256", + dirname.encode("UTF-8"), + usedforsecurity=False, + ).hexdigest()[:16] + prefix = f"z_{fp}_" + else: + prefix = "" + return prefix + basename.replace(".", "_") + + +if env.WINDOWS: + + _ACTUAL_PATH_CACHE: dict[str, str] = {} + _ACTUAL_PATH_LIST_CACHE: dict[str, list[str]] = {} + + def actual_path(path: str) -> str: + """Get the actual path of `path`, including the correct case.""" + if path in _ACTUAL_PATH_CACHE: + return _ACTUAL_PATH_CACHE[path] + + head, tail = os.path.split(path) + if not tail: + # This means head is the drive spec: normalize it. + actpath = head.upper() + elif not head: + actpath = tail + else: + head = actual_path(head) + if head in _ACTUAL_PATH_LIST_CACHE: + files = _ACTUAL_PATH_LIST_CACHE[head] + else: + try: + files = os.listdir(head) + except Exception: + # This will raise OSError, or this bizarre TypeError: + # https://bugs.python.org/issue1776160 + files = [] + _ACTUAL_PATH_LIST_CACHE[head] = files + normtail = os.path.normcase(tail) + for f in files: + if os.path.normcase(f) == normtail: + tail = f + break + actpath = os.path.join(head, tail) + _ACTUAL_PATH_CACHE[path] = actpath + return actpath + +else: + def actual_path(path: str) -> str: + """The actual path for non-Windows platforms.""" + return path + + +def abs_file(path: str) -> str: + """Return the absolute normalized form of `path`.""" + return actual_path(os.path.abspath(os.path.realpath(path))) + + +def zip_location(filename: str) -> tuple[str, str] | None: + """Split a filename into a zipfile / inner name pair. + + Only return a pair if the zipfile exists. No check is made if the inner + name is in the zipfile. + + """ + for ext in [".zip", ".whl", ".egg", ".pex"]: + zipbase, extension, inner = filename.partition(ext + sep(filename)) + if extension: + zipfile = zipbase + ext + if os.path.exists(zipfile): + return zipfile, inner + return None + + +def source_exists(path: str) -> bool: + """Determine if a source file path exists.""" + if os.path.exists(path): + return True + + if zip_location(path): + # If zip_location returns anything, then it's a zipfile that + # exists. That's good enough for us. + return True + + return False + + +def python_reported_file(filename: str) -> str: + """Return the string as Python would describe this file name.""" + return os.path.abspath(filename) + + +def isabs_anywhere(filename: str) -> bool: + """Is `filename` an absolute path on any OS?""" + return ntpath.isabs(filename) or posixpath.isabs(filename) + + +def prep_patterns(patterns: Iterable[str]) -> list[str]: + """Prepare the file patterns for use in a `GlobMatcher`. + + If a pattern starts with a wildcard, it is used as a pattern + as-is. If it does not start with a wildcard, then it is made + absolute with the current directory. + + If `patterns` is None, an empty list is returned. + + """ + prepped = [] + for p in patterns or []: + prepped.append(p) + if not p.startswith(("*", "?")): + prepped.append(abs_file(p)) + return prepped + + +class TreeMatcher: + """A matcher for files in a tree. + + Construct with a list of paths, either files or directories. Paths match + with the `match` method if they are one of the files, or if they are + somewhere in a subtree rooted at one of the directories. + + """ + def __init__(self, paths: Iterable[str], name: str = "unknown") -> None: + self.original_paths: list[str] = human_sorted(paths) + #self.paths = list(map(os.path.normcase, paths)) + self.paths = [os.path.normcase(p) for p in paths] + self.name = name + + def __repr__(self) -> str: + return f"" + + def info(self) -> list[str]: + """A list of strings for displaying when dumping state.""" + return self.original_paths + + def match(self, fpath: str) -> bool: + """Does `fpath` indicate a file in one of our trees?""" + fpath = os.path.normcase(fpath) + for p in self.paths: + if fpath.startswith(p): + if fpath == p: + # This is the same file! + return True + if fpath[len(p)] == os.sep: + # This is a file in the directory + return True + return False + + +class ModuleMatcher: + """A matcher for modules in a tree.""" + def __init__(self, module_names: Iterable[str], name:str = "unknown") -> None: + self.modules = list(module_names) + self.name = name + + def __repr__(self) -> str: + return f"" + + def info(self) -> list[str]: + """A list of strings for displaying when dumping state.""" + return self.modules + + def match(self, module_name: str) -> bool: + """Does `module_name` indicate a module in one of our packages?""" + if not module_name: + return False + + for m in self.modules: + if module_name.startswith(m): + if module_name == m: + return True + if module_name[len(m)] == ".": + # This is a module in the package + return True + + return False + + +class GlobMatcher: + """A matcher for files by file name pattern.""" + def __init__(self, pats: Iterable[str], name: str = "unknown") -> None: + self.pats = list(pats) + self.re = globs_to_regex(self.pats, case_insensitive=env.WINDOWS) + self.name = name + + def __repr__(self) -> str: + return f"" + + def info(self) -> list[str]: + """A list of strings for displaying when dumping state.""" + return self.pats + + def match(self, fpath: str) -> bool: + """Does `fpath` match one of our file name patterns?""" + return self.re.match(fpath) is not None + + +def sep(s: str) -> str: + """Find the path separator used in this string, or os.sep if none.""" + if sep_match := re.search(r"[\\/]", s): + the_sep = sep_match[0] + else: + the_sep = os.sep + return the_sep + + +# Tokenizer for _glob_to_regex. +# None as a sub means disallowed. +G2RX_TOKENS = [(re.compile(rx), sub) for rx, sub in [ + (r"\*\*\*+", None), # Can't have *** + (r"[^/]+\*\*+", None), # Can't have x** + (r"\*\*+[^/]+", None), # Can't have **x + (r"\*\*/\*\*", None), # Can't have **/** + (r"^\*+/", r"(.*[/\\\\])?"), # ^*/ matches any prefix-slash, or nothing. + (r"/\*+$", r"[/\\\\].*"), # /*$ matches any slash-suffix. + (r"\*\*/", r"(.*[/\\\\])?"), # **/ matches any subdirs, including none + (r"/", r"[/\\\\]"), # / matches either slash or backslash + (r"\*", r"[^/\\\\]*"), # * matches any number of non slash-likes + (r"\?", r"[^/\\\\]"), # ? matches one non slash-like + (r"\[.*?\]", r"\g<0>"), # [a-f] matches [a-f] + (r"[a-zA-Z0-9_-]+", r"\g<0>"), # word chars match themselves + (r"[\[\]]", None), # Can't have single square brackets + (r".", r"\\\g<0>"), # Anything else is escaped to be safe +]] + +def _glob_to_regex(pattern: str) -> str: + """Convert a file-path glob pattern into a regex.""" + # Turn all backslashes into slashes to simplify the tokenizer. + pattern = pattern.replace("\\", "/") + if "/" not in pattern: + pattern = "**/" + pattern + path_rx = [] + pos = 0 + while pos < len(pattern): + for rx, sub in G2RX_TOKENS: # pragma: always breaks + if m := rx.match(pattern, pos=pos): + if sub is None: + raise ConfigError(f"File pattern can't include {m[0]!r}") + path_rx.append(m.expand(sub)) + pos = m.end() + break + return "".join(path_rx) + + +def globs_to_regex( + patterns: Iterable[str], + case_insensitive: bool = False, + partial: bool = False, +) -> re.Pattern[str]: + """Convert glob patterns to a compiled regex that matches any of them. + + Slashes are always converted to match either slash or backslash, for + Windows support, even when running elsewhere. + + If the pattern has no slash or backslash, then it is interpreted as + matching a file name anywhere it appears in the tree. Otherwise, the glob + pattern must match the whole file path. + + If `partial` is true, then the pattern will match if the target string + starts with the pattern. Otherwise, it must match the entire string. + + Returns: a compiled regex object. Use the .match method to compare target + strings. + + """ + flags = 0 + if case_insensitive: + flags |= re.IGNORECASE + rx = join_regex(map(_glob_to_regex, patterns)) + if not partial: + rx = fr"(?:{rx})\Z" + compiled = re.compile(rx, flags=flags) + return compiled + + +class PathAliases: + """A collection of aliases for paths. + + When combining data files from remote machines, often the paths to source + code are different, for example, due to OS differences, or because of + serialized checkouts on continuous integration machines. + + A `PathAliases` object tracks a list of pattern/result pairs, and can + map a path through those aliases to produce a unified path. + + """ + def __init__( + self, + debugfn: Callable[[str], None] | None = None, + relative: bool = False, + ) -> None: + # A list of (original_pattern, regex, result) + self.aliases: list[tuple[str, re.Pattern[str], str]] = [] + self.debugfn = debugfn or (lambda msg: 0) + self.relative = relative + self.pprinted = False + + def pprint(self) -> None: + """Dump the important parts of the PathAliases, for debugging.""" + self.debugfn(f"Aliases (relative={self.relative}):") + for original_pattern, regex, result in self.aliases: + self.debugfn(f" Rule: {original_pattern!r} -> {result!r} using regex {regex.pattern!r}") + + def add(self, pattern: str, result: str) -> None: + """Add the `pattern`/`result` pair to the list of aliases. + + `pattern` is an `glob`-style pattern. `result` is a simple + string. When mapping paths, if a path starts with a match against + `pattern`, then that match is replaced with `result`. This models + isomorphic source trees being rooted at different places on two + different machines. + + `pattern` can't end with a wildcard component, since that would + match an entire tree, and not just its root. + + """ + original_pattern = pattern + pattern_sep = sep(pattern) + + if len(pattern) > 1: + pattern = pattern.rstrip(r"\/") + + # The pattern can't end with a wildcard component. + if pattern.endswith("*"): + raise ConfigError("Pattern must not end with wildcards.") + + # The pattern is meant to match a file path. Let's make it absolute + # unless it already is, or is meant to match any prefix. + if not self.relative: + if not pattern.startswith("*") and not isabs_anywhere(pattern + pattern_sep): + pattern = abs_file(pattern) + if not pattern.endswith(pattern_sep): + pattern += pattern_sep + + # Make a regex from the pattern. + regex = globs_to_regex([pattern], case_insensitive=True, partial=True) + + # Normalize the result: it must end with a path separator. + result_sep = sep(result) + result = result.rstrip(r"\/") + result_sep + self.aliases.append((original_pattern, regex, result)) + + def map(self, path: str, exists:Callable[[str], bool] = source_exists) -> str: + """Map `path` through the aliases. + + `path` is checked against all of the patterns. The first pattern to + match is used to replace the root of the path with the result root. + Only one pattern is ever used. If no patterns match, `path` is + returned unchanged. + + The separator style in the result is made to match that of the result + in the alias. + + `exists` is a function to determine if the resulting path actually + exists. + + Returns the mapped path. If a mapping has happened, this is a + canonical path. If no mapping has happened, it is the original value + of `path` unchanged. + + """ + if not self.pprinted: + self.pprint() + self.pprinted = True + + for original_pattern, regex, result in self.aliases: + if m := regex.match(path): + new = path.replace(m[0], result) + new = new.replace(sep(path), sep(result)) + if not self.relative: + new = canonical_filename(new) + dot_start = result.startswith(("./", ".\\")) and len(result) > 2 + if new.startswith(("./", ".\\")) and not dot_start: + new = new[2:] + if not exists(new): + self.debugfn( + f"Rule {original_pattern!r} changed {path!r} to {new!r} " + + "which doesn't exist, continuing", + ) + continue + self.debugfn( + f"Matched path {path!r} to rule {original_pattern!r} -> {result!r}, " + + f"producing {new!r}", + ) + return new + + # If we get here, no pattern matched. + + if self.relative: + path = relative_filename(path) + + if self.relative and not isabs_anywhere(path): + # Auto-generate a pattern to implicitly match relative files + parts = re.split(r"[/\\]", path) + if len(parts) > 1: + dir1 = parts[0] + pattern = f"*/{dir1}" + regex_pat = fr"^(.*[\\/])?{re.escape(dir1)}[\\/]" + result = f"{dir1}{os.sep}" + # Only add a new pattern if we don't already have this pattern. + if not any(p == pattern for p, _, _ in self.aliases): + self.debugfn( + f"Generating rule: {pattern!r} -> {result!r} using regex {regex_pat!r}", + ) + self.aliases.append((pattern, re.compile(regex_pat), result)) + return self.map(path, exists=exists) + + self.debugfn(f"No rules match, path {path!r} is unchanged") + return path + + +def find_python_files(dirname: str, include_namespace_packages: bool) -> Iterable[str]: + """Yield all of the importable Python files in `dirname`, recursively. + + To be importable, the files have to be in a directory with a __init__.py, + except for `dirname` itself, which isn't required to have one. The + assumption is that `dirname` was specified directly, so the user knows + best, but sub-directories are checked for a __init__.py to be sure we only + find the importable files. + + If `include_namespace_packages` is True, then the check for __init__.py + files is skipped. + + Files with strange characters are skipped, since they couldn't have been + imported, and are probably editor side-files. + + """ + for i, (dirpath, dirnames, filenames) in enumerate(os.walk(dirname)): + if not include_namespace_packages: + if i > 0 and "__init__.py" not in filenames: + # If a directory doesn't have __init__.py, then it isn't + # importable and neither are its files + del dirnames[:] + continue + for filename in filenames: + # We're only interested in files that look like reasonable Python + # files: Must end with .py or .pyw, and must not have certain funny + # characters that probably mean they are editor junk. + if re.match(r"^[^.#~!$@%^&*()+=,]+\.pyw?$", filename): + yield os.path.join(dirpath, filename) + + +# Globally set the relative directory. +set_relative_directory() diff --git a/.venv/Lib/site-packages/coverage/html.py b/.venv/Lib/site-packages/coverage/html.py new file mode 100644 index 00000000..20a354b1 --- /dev/null +++ b/.venv/Lib/site-packages/coverage/html.py @@ -0,0 +1,810 @@ +# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt + +"""HTML reporting for coverage.py.""" + +from __future__ import annotations + +import collections +import dataclasses +import datetime +import functools +import json +import os +import re +import string + +from dataclasses import dataclass, field +from typing import Any, TYPE_CHECKING +from collections.abc import Iterable + +import coverage +from coverage.data import CoverageData, add_data_to_hash +from coverage.exceptions import NoDataError +from coverage.files import flat_rootname +from coverage.misc import ( + ensure_dir, file_be_gone, Hasher, isolate_module, format_local_datetime, + human_sorted, plural, stdout_link, +) +from coverage.report_core import get_analysis_to_report +from coverage.results import Analysis, Numbers +from coverage.templite import Templite +from coverage.types import TLineNo, TMorf +from coverage.version import __url__ + + +if TYPE_CHECKING: + from coverage import Coverage + from coverage.plugins import FileReporter + + +os = isolate_module(os) + + +def data_filename(fname: str) -> str: + """Return the path to an "htmlfiles" data file of ours. + """ + static_dir = os.path.join(os.path.dirname(__file__), "htmlfiles") + static_filename = os.path.join(static_dir, fname) + return static_filename + + +def read_data(fname: str) -> str: + """Return the contents of a data file of ours.""" + with open(data_filename(fname)) as data_file: + return data_file.read() + + +def write_html(fname: str, html: str) -> None: + """Write `html` to `fname`, properly encoded.""" + html = re.sub(r"(\A\s+)|(\s+$)", "", html, flags=re.MULTILINE) + "\n" + with open(fname, "wb") as fout: + fout.write(html.encode("ascii", "xmlcharrefreplace")) + + +@dataclass +class LineData: + """The data for each source line of HTML output.""" + tokens: list[tuple[str, str]] + number: TLineNo + category: str + contexts: list[str] + contexts_label: str + context_list: list[str] + short_annotations: list[str] + long_annotations: list[str] + html: str = "" + context_str: str | None = None + annotate: str | None = None + annotate_long: str | None = None + css_class: str = "" + + +@dataclass +class FileData: + """The data for each source file of HTML output.""" + relative_filename: str + nums: Numbers + lines: list[LineData] + + +@dataclass +class IndexItem: + """Information for each index entry, to render an index page.""" + url: str = "" + file: str = "" + description: str = "" + nums: Numbers = field(default_factory=Numbers) + + +@dataclass +class IndexPage: + """Data for each index page.""" + noun: str + plural: str + filename: str + summaries: list[IndexItem] + totals: Numbers + skipped_covered_count: int + skipped_empty_count: int + + +class HtmlDataGeneration: + """Generate structured data to be turned into HTML reports.""" + + EMPTY = "(empty)" + + def __init__(self, cov: Coverage) -> None: + self.coverage = cov + self.config = self.coverage.config + self.data = self.coverage.get_data() + self.has_arcs = self.data.has_arcs() + if self.config.show_contexts: + if self.data.measured_contexts() == {""}: + self.coverage._warn("No contexts were measured") + self.data.set_query_contexts(self.config.report_contexts) + + def data_for_file(self, fr: FileReporter, analysis: Analysis) -> FileData: + """Produce the data needed for one file's report.""" + if self.has_arcs: + missing_branch_arcs = analysis.missing_branch_arcs() + arcs_executed = analysis.arcs_executed + else: + missing_branch_arcs = {} + arcs_executed = [] + + if self.config.show_contexts: + contexts_by_lineno = self.data.contexts_by_lineno(analysis.filename) + + lines = [] + + for lineno, tokens in enumerate(fr.source_token_lines(), start=1): + # Figure out how to mark this line. + category = "" + short_annotations = [] + long_annotations = [] + + if lineno in analysis.excluded: + category = "exc" + elif lineno in analysis.missing: + category = "mis" + elif self.has_arcs and lineno in missing_branch_arcs: + category = "par" + for b in missing_branch_arcs[lineno]: + if b < 0: + short_annotations.append("exit") + else: + short_annotations.append(str(b)) + long_annotations.append(fr.missing_arc_description(lineno, b, arcs_executed)) + elif lineno in analysis.statements: + category = "run" + + contexts = [] + contexts_label = "" + context_list = [] + if category and self.config.show_contexts: + contexts = human_sorted(c or self.EMPTY for c in contexts_by_lineno.get(lineno, ())) + if contexts == [self.EMPTY]: + contexts_label = self.EMPTY + else: + contexts_label = f"{len(contexts)} ctx" + context_list = contexts + + lines.append(LineData( + tokens=tokens, + number=lineno, + category=category, + contexts=contexts, + contexts_label=contexts_label, + context_list=context_list, + short_annotations=short_annotations, + long_annotations=long_annotations, + )) + + file_data = FileData( + relative_filename=fr.relative_filename(), + nums=analysis.numbers, + lines=lines, + ) + + return file_data + + +class FileToReport: + """A file we're considering reporting.""" + def __init__(self, fr: FileReporter, analysis: Analysis) -> None: + self.fr = fr + self.analysis = analysis + self.rootname = flat_rootname(fr.relative_filename()) + self.html_filename = self.rootname + ".html" + self.prev_html = self.next_html = "" + + +HTML_SAFE = string.ascii_letters + string.digits + "!#$%'()*+,-./:;=?@[]^_`{|}~" + +@functools.cache +def encode_int(n: int) -> str: + """Create a short HTML-safe string from an integer, using HTML_SAFE.""" + if n == 0: + return HTML_SAFE[0] + + r = [] + while n: + n, t = divmod(n, len(HTML_SAFE)) + r.append(HTML_SAFE[t]) + return "".join(r) + + +def copy_with_cache_bust(src: str, dest_dir: str) -> str: + """Copy `src` to `dest_dir`, adding a hash to the name. + + Returns the updated destination file name with hash. + """ + with open(src, "rb") as f: + text = f.read() + h = Hasher() + h.update(text) + cache_bust = h.hexdigest()[:8] + src_base = os.path.basename(src) + dest = src_base.replace(".", f"_cb_{cache_bust}.") + with open(os.path.join(dest_dir, dest), "wb") as f: + f.write(text) + return dest + + +class HtmlReporter: + """HTML reporting.""" + + # These files will be copied from the htmlfiles directory to the output + # directory. + STATIC_FILES = [ + "style.css", + "coverage_html.js", + "keybd_closed.png", + "favicon_32.png", + ] + + def __init__(self, cov: Coverage) -> None: + self.coverage = cov + self.config = self.coverage.config + self.directory = self.config.html_dir + + self.skip_covered = self.config.html_skip_covered + if self.skip_covered is None: + self.skip_covered = self.config.skip_covered + self.skip_empty = self.config.html_skip_empty + if self.skip_empty is None: + self.skip_empty = self.config.skip_empty + + title = self.config.html_title + + self.extra_css = bool(self.config.extra_css) + + self.data = self.coverage.get_data() + self.has_arcs = self.data.has_arcs() + + self.index_pages: dict[str, IndexPage] = { + "file": self.new_index_page("file", "files"), + } + self.incr = IncrementalChecker(self.directory) + self.datagen = HtmlDataGeneration(self.coverage) + self.directory_was_empty = False + self.first_fr = None + self.final_fr = None + + self.template_globals = { + # Functions available in the templates. + "escape": escape, + "pair": pair, + "len": len, + + # Constants for this report. + "__url__": __url__, + "__version__": coverage.__version__, + "title": title, + "time_stamp": format_local_datetime(datetime.datetime.now()), + "extra_css": self.extra_css, + "has_arcs": self.has_arcs, + "show_contexts": self.config.show_contexts, + "statics": {}, + + # Constants for all reports. + # These css classes determine which lines are highlighted by default. + "category": { + "exc": "exc show_exc", + "mis": "mis show_mis", + "par": "par run show_par", + "run": "run", + }, + } + self.index_tmpl = Templite(read_data("index.html"), self.template_globals) + self.pyfile_html_source = read_data("pyfile.html") + self.source_tmpl = Templite(self.pyfile_html_source, self.template_globals) + + def new_index_page(self, noun: str, plural_noun: str) -> IndexPage: + """Create an IndexPage for a kind of region.""" + return IndexPage( + noun=noun, + plural=plural_noun, + filename="index.html" if noun == "file" else f"{noun}_index.html", + summaries=[], + totals=Numbers(precision=self.config.precision), + skipped_covered_count=0, + skipped_empty_count=0, + ) + + def report(self, morfs: Iterable[TMorf] | None) -> float: + """Generate an HTML report for `morfs`. + + `morfs` is a list of modules or file names. + + """ + # Read the status data and check that this run used the same + # global data as the last run. + self.incr.read() + self.incr.check_global_data(self.config, self.pyfile_html_source) + + # Process all the files. For each page we need to supply a link + # to the next and previous page. + files_to_report = [] + + have_data = False + for fr, analysis in get_analysis_to_report(self.coverage, morfs): + have_data = True + ftr = FileToReport(fr, analysis) + if self.should_report(analysis, self.index_pages["file"]): + files_to_report.append(ftr) + else: + file_be_gone(os.path.join(self.directory, ftr.html_filename)) + + if not have_data: + raise NoDataError("No data to report.") + + self.make_directory() + self.make_local_static_report_files() + + if files_to_report: + for ftr1, ftr2 in zip(files_to_report[:-1], files_to_report[1:]): + ftr1.next_html = ftr2.html_filename + ftr2.prev_html = ftr1.html_filename + files_to_report[0].prev_html = "index.html" + files_to_report[-1].next_html = "index.html" + + for ftr in files_to_report: + self.write_html_page(ftr) + for noun, plural_noun in ftr.fr.code_region_kinds(): + if noun not in self.index_pages: + self.index_pages[noun] = self.new_index_page(noun, plural_noun) + + # Write the index page. + if files_to_report: + first_html = files_to_report[0].html_filename + final_html = files_to_report[-1].html_filename + else: + first_html = final_html = "index.html" + self.write_file_index_page(first_html, final_html) + + # Write function and class index pages. + self.write_region_index_pages(files_to_report) + + return ( + self.index_pages["file"].totals.n_statements + and self.index_pages["file"].totals.pc_covered + ) + + def make_directory(self) -> None: + """Make sure our htmlcov directory exists.""" + ensure_dir(self.directory) + if not os.listdir(self.directory): + self.directory_was_empty = True + + def copy_static_file(self, src: str, slug: str = "") -> None: + """Copy a static file into the output directory with cache busting.""" + dest = copy_with_cache_bust(src, self.directory) + if not slug: + slug = os.path.basename(src).replace(".", "_") + self.template_globals["statics"][slug] = dest # type: ignore + + def make_local_static_report_files(self) -> None: + """Make local instances of static files for HTML report.""" + + # The files we provide must always be copied. + for static in self.STATIC_FILES: + self.copy_static_file(data_filename(static)) + + # The user may have extra CSS they want copied. + if self.extra_css: + assert self.config.extra_css is not None + self.copy_static_file(self.config.extra_css, slug="extra_css") + + # Only write the .gitignore file if the directory was originally empty. + # .gitignore can't be copied from the source tree because if it was in + # the source tree, it would stop the static files from being checked in. + if self.directory_was_empty: + with open(os.path.join(self.directory, ".gitignore"), "w") as fgi: + fgi.write("# Created by coverage.py\n*\n") + + def should_report(self, analysis: Analysis, index_page: IndexPage) -> bool: + """Determine if we'll report this file or region.""" + # Get the numbers for this file. + nums = analysis.numbers + index_page.totals += nums + + if self.skip_covered: + # Don't report on 100% files. + no_missing_lines = (nums.n_missing == 0) + no_missing_branches = (nums.n_partial_branches == 0) + if no_missing_lines and no_missing_branches: + index_page.skipped_covered_count += 1 + return False + + if self.skip_empty: + # Don't report on empty files. + if nums.n_statements == 0: + index_page.skipped_empty_count += 1 + return False + + return True + + def write_html_page(self, ftr: FileToReport) -> None: + """Generate an HTML page for one source file. + + If the page on disk is already correct based on our incremental status + checking, then the page doesn't have to be generated, and this function + only does page summary bookkeeping. + + """ + # Find out if the page on disk is already correct. + if self.incr.can_skip_file(self.data, ftr.fr, ftr.rootname): + self.index_pages["file"].summaries.append(self.incr.index_info(ftr.rootname)) + return + + # Write the HTML page for this source file. + file_data = self.datagen.data_for_file(ftr.fr, ftr.analysis) + + contexts = collections.Counter(c for cline in file_data.lines for c in cline.contexts) + context_codes = {y: i for (i, y) in enumerate(x[0] for x in contexts.most_common())} + if context_codes: + contexts_json = json.dumps( + {encode_int(v): k for (k, v) in context_codes.items()}, + indent=2, + ) + else: + contexts_json = None + + for ldata in file_data.lines: + # Build the HTML for the line. + html_parts = [] + for tok_type, tok_text in ldata.tokens: + if tok_type == "ws": + html_parts.append(escape(tok_text)) + else: + tok_html = escape(tok_text) or " " + html_parts.append(f'{tok_html}') + ldata.html = "".join(html_parts) + if ldata.context_list: + encoded_contexts = [ + encode_int(context_codes[c_context]) for c_context in ldata.context_list + ] + code_width = max(len(ec) for ec in encoded_contexts) + ldata.context_str = ( + str(code_width) + + "".join(ec.ljust(code_width) for ec in encoded_contexts) + ) + else: + ldata.context_str = "" + + if ldata.short_annotations: + # 202F is NARROW NO-BREAK SPACE. + # 219B is RIGHTWARDS ARROW WITH STROKE. + ldata.annotate = ",   ".join( + f"{ldata.number} ↛ {d}" + for d in ldata.short_annotations + ) + else: + ldata.annotate = None + + if ldata.long_annotations: + longs = ldata.long_annotations + if len(longs) == 1: + ldata.annotate_long = longs[0] + else: + ldata.annotate_long = "{:d} missed branches: {}".format( + len(longs), + ", ".join( + f"{num:d}) {ann_long}" + for num, ann_long in enumerate(longs, start=1) + ), + ) + else: + ldata.annotate_long = None + + css_classes = [] + if ldata.category: + css_classes.append( + self.template_globals["category"][ldata.category], # type: ignore[index] + ) + ldata.css_class = " ".join(css_classes) or "pln" + + html_path = os.path.join(self.directory, ftr.html_filename) + html = self.source_tmpl.render({ + **file_data.__dict__, + "contexts_json": contexts_json, + "prev_html": ftr.prev_html, + "next_html": ftr.next_html, + }) + write_html(html_path, html) + + # Save this file's information for the index page. + index_info = IndexItem( + url = ftr.html_filename, + file = escape(ftr.fr.relative_filename()), + nums = ftr.analysis.numbers, + ) + self.index_pages["file"].summaries.append(index_info) + self.incr.set_index_info(ftr.rootname, index_info) + + def write_file_index_page(self, first_html: str, final_html: str) -> None: + """Write the file index page for this report.""" + index_file = self.write_index_page( + self.index_pages["file"], + first_html=first_html, + final_html=final_html, + ) + + print_href = stdout_link(index_file, f"file://{os.path.abspath(index_file)}") + self.coverage._message(f"Wrote HTML report to {print_href}") + + # Write the latest hashes for next time. + self.incr.write() + + def write_region_index_pages(self, files_to_report: Iterable[FileToReport]) -> None: + """Write the other index pages for this report.""" + for ftr in files_to_report: + region_nouns = [pair[0] for pair in ftr.fr.code_region_kinds()] + num_lines = len(ftr.fr.source().splitlines()) + regions = ftr.fr.code_regions() + + for noun in region_nouns: + page_data = self.index_pages[noun] + outside_lines = set(range(1, num_lines + 1)) + + for region in regions: + if region.kind != noun: + continue + outside_lines -= region.lines + analysis = ftr.analysis.narrow(region.lines) + if not self.should_report(analysis, page_data): + continue + sorting_name = region.name.rpartition(".")[-1].lstrip("_") + page_data.summaries.append(IndexItem( + url=f"{ftr.html_filename}#t{region.start}", + file=escape(ftr.fr.relative_filename()), + description=( + f"" + + escape(region.name) + + "" + ), + nums=analysis.numbers, + )) + + analysis = ftr.analysis.narrow(outside_lines) + if self.should_report(analysis, page_data): + page_data.summaries.append(IndexItem( + url=ftr.html_filename, + file=escape(ftr.fr.relative_filename()), + description=( + "" + + f"(no {escape(noun)})" + + "" + ), + nums=analysis.numbers, + )) + + for noun, index_page in self.index_pages.items(): + if noun != "file": + self.write_index_page(index_page) + + def write_index_page(self, index_page: IndexPage, **kwargs: str) -> str: + """Write an index page specified by `index_page`. + + Returns the filename created. + """ + skipped_covered_msg = skipped_empty_msg = "" + if n := index_page.skipped_covered_count: + word = plural(n, index_page.noun, index_page.plural) + skipped_covered_msg = f"{n} {word} skipped due to complete coverage." + if n := index_page.skipped_empty_count: + word = plural(n, index_page.noun, index_page.plural) + skipped_empty_msg = f"{n} empty {word} skipped." + + index_buttons = [ + { + "label": ip.plural.title(), + "url": ip.filename if ip.noun != index_page.noun else "", + "current": ip.noun == index_page.noun, + } + for ip in self.index_pages.values() + ] + render_data = { + "regions": index_page.summaries, + "totals": index_page.totals, + "noun": index_page.noun, + "region_noun": index_page.noun if index_page.noun != "file" else "", + "skip_covered": self.skip_covered, + "skipped_covered_msg": skipped_covered_msg, + "skipped_empty_msg": skipped_empty_msg, + "first_html": "", + "final_html": "", + "index_buttons": index_buttons, + } + render_data.update(kwargs) + html = self.index_tmpl.render(render_data) + + index_file = os.path.join(self.directory, index_page.filename) + write_html(index_file, html) + return index_file + + +@dataclass +class FileInfo: + """Summary of the information from last rendering, to avoid duplicate work.""" + hash: str = "" + index: IndexItem = field(default_factory=IndexItem) + + +class IncrementalChecker: + """Logic and data to support incremental reporting. + + When generating an HTML report, often only a few of the source files have + changed since the last time we made the HTML report. This means previously + created HTML pages can be reused without generating them again, speeding + the command. + + This class manages a JSON data file that captures enough information to + know whether an HTML page for a .py file needs to be regenerated or not. + The data file also needs to store all the information needed to create the + entry for the file on the index page so that if the HTML page is reused, + the index page can still be created to refer to it. + + The data looks like:: + + { + "note": "This file is an internal implementation detail ...", + // A fixed number indicating the data format. STATUS_FORMAT + "format": 5, + // The version of coverage.py + "version": "7.4.4", + // A hash of a number of global things, including the configuration + // settings and the pyfile.html template itself. + "globals": "540ee119c15d52a68a53fe6f0897346d", + "files": { + // An entry for each source file keyed by the flat_rootname(). + "z_7b071bdc2a35fa80___init___py": { + // Hash of the source, the text of the .py file. + "hash": "e45581a5b48f879f301c0f30bf77a50c", + // Information for the index.html file. + "index": { + "url": "z_7b071bdc2a35fa80___init___py.html", + "file": "cogapp/__init__.py", + "description": "", + // The Numbers for this file. + "nums": { "precision": 2, "n_files": 1, "n_statements": 43, ... } + } + }, + ... + } + } + + """ + + STATUS_FILE = "status.json" + STATUS_FORMAT = 5 + NOTE = ( + "This file is an internal implementation detail to speed up HTML report" + + " generation. Its format can change at any time. You might be looking" + + " for the JSON report: https://coverage.rtfd.io/cmd.html#cmd-json" + ) + + def __init__(self, directory: str) -> None: + self.directory = directory + self._reset() + + def _reset(self) -> None: + """Initialize to empty. Causes all files to be reported.""" + self.globals = "" + self.files: dict[str, FileInfo] = {} + + def read(self) -> None: + """Read the information we stored last time.""" + try: + status_file = os.path.join(self.directory, self.STATUS_FILE) + with open(status_file) as fstatus: + status = json.load(fstatus) + except (OSError, ValueError): + # Status file is missing or malformed. + usable = False + else: + if status["format"] != self.STATUS_FORMAT: + usable = False + elif status["version"] != coverage.__version__: + usable = False + else: + usable = True + + if usable: + self.files = {} + for filename, filedict in status["files"].items(): + indexdict = filedict["index"] + index_item = IndexItem(**indexdict) + index_item.nums = Numbers(**indexdict["nums"]) + fileinfo = FileInfo( + hash=filedict["hash"], + index=index_item, + ) + self.files[filename] = fileinfo + self.globals = status["globals"] + else: + self._reset() + + def write(self) -> None: + """Write the current status.""" + status_file = os.path.join(self.directory, self.STATUS_FILE) + status_data = { + "note": self.NOTE, + "format": self.STATUS_FORMAT, + "version": coverage.__version__, + "globals": self.globals, + "files": { + fname: dataclasses.asdict(finfo) + for fname, finfo in self.files.items() + }, + } + with open(status_file, "w") as fout: + json.dump(status_data, fout, separators=(",", ":")) + + def check_global_data(self, *data: Any) -> None: + """Check the global data that can affect incremental reporting. + + Pass in whatever global information could affect the content of the + HTML pages. If the global data has changed since last time, this will + clear the data so that all files are regenerated. + + """ + m = Hasher() + for d in data: + m.update(d) + these_globals = m.hexdigest() + if self.globals != these_globals: + self._reset() + self.globals = these_globals + + def can_skip_file(self, data: CoverageData, fr: FileReporter, rootname: str) -> bool: + """Can we skip reporting this file? + + `data` is a CoverageData object, `fr` is a `FileReporter`, and + `rootname` is the name being used for the file. + + Returns True if the HTML page is fine as-is, False if we need to recreate + the HTML page. + + """ + m = Hasher() + m.update(fr.source().encode("utf-8")) + add_data_to_hash(data, fr.filename, m) + this_hash = m.hexdigest() + + file_info = self.files.setdefault(rootname, FileInfo()) + + if this_hash == file_info.hash: + # Nothing has changed to require the file to be reported again. + return True + else: + # File has changed, record the latest hash and force regeneration. + file_info.hash = this_hash + return False + + def index_info(self, fname: str) -> IndexItem: + """Get the information for index.html for `fname`.""" + return self.files.get(fname, FileInfo()).index + + def set_index_info(self, fname: str, info: IndexItem) -> None: + """Set the information for index.html for `fname`.""" + self.files.setdefault(fname, FileInfo()).index = info + + +# Helpers for templates and generating HTML + +def escape(t: str) -> str: + """HTML-escape the text in `t`. + + This is only suitable for HTML text, not attributes. + + """ + # Convert HTML special chars into HTML entities. + return t.replace("&", "&").replace("<", "<") + + +def pair(ratio: tuple[int, int]) -> str: + """Format a pair of numbers so JavaScript can read them in an attribute.""" + return "{} {}".format(*ratio) diff --git a/.venv/Lib/site-packages/coverage/htmlfiles/coverage_html.js b/.venv/Lib/site-packages/coverage/htmlfiles/coverage_html.js new file mode 100644 index 00000000..1face13d --- /dev/null +++ b/.venv/Lib/site-packages/coverage/htmlfiles/coverage_html.js @@ -0,0 +1,733 @@ +// Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 +// For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt + +// Coverage.py HTML report browser code. +/*jslint browser: true, sloppy: true, vars: true, plusplus: true, maxerr: 50, indent: 4 */ +/*global coverage: true, document, window, $ */ + +coverage = {}; + +// General helpers +function debounce(callback, wait) { + let timeoutId = null; + return function(...args) { + clearTimeout(timeoutId); + timeoutId = setTimeout(() => { + callback.apply(this, args); + }, wait); + }; +}; + +function checkVisible(element) { + const rect = element.getBoundingClientRect(); + const viewBottom = Math.max(document.documentElement.clientHeight, window.innerHeight); + const viewTop = 30; + return !(rect.bottom < viewTop || rect.top >= viewBottom); +} + +function on_click(sel, fn) { + const elt = document.querySelector(sel); + if (elt) { + elt.addEventListener("click", fn); + } +} + +// Helpers for table sorting +function getCellValue(row, column = 0) { + const cell = row.cells[column] // nosemgrep: eslint.detect-object-injection + if (cell.childElementCount == 1) { + var child = cell.firstElementChild; + if (child.tagName === "A") { + child = child.firstElementChild; + } + if (child instanceof HTMLDataElement && child.value) { + return child.value; + } + } + return cell.innerText || cell.textContent; +} + +function rowComparator(rowA, rowB, column = 0) { + let valueA = getCellValue(rowA, column); + let valueB = getCellValue(rowB, column); + if (!isNaN(valueA) && !isNaN(valueB)) { + return valueA - valueB; + } + return valueA.localeCompare(valueB, undefined, {numeric: true}); +} + +function sortColumn(th) { + // Get the current sorting direction of the selected header, + // clear state on other headers and then set the new sorting direction. + const currentSortOrder = th.getAttribute("aria-sort"); + [...th.parentElement.cells].forEach(header => header.setAttribute("aria-sort", "none")); + var direction; + if (currentSortOrder === "none") { + direction = th.dataset.defaultSortOrder || "ascending"; + } + else if (currentSortOrder === "ascending") { + direction = "descending"; + } + else { + direction = "ascending"; + } + th.setAttribute("aria-sort", direction); + + const column = [...th.parentElement.cells].indexOf(th) + + // Sort all rows and afterwards append them in order to move them in the DOM. + Array.from(th.closest("table").querySelectorAll("tbody tr")) + .sort((rowA, rowB) => rowComparator(rowA, rowB, column) * (direction === "ascending" ? 1 : -1)) + .forEach(tr => tr.parentElement.appendChild(tr)); + + // Save the sort order for next time. + if (th.id !== "region") { + let th_id = "file"; // Sort by file if we don't have a column id + let current_direction = direction; + const stored_list = localStorage.getItem(coverage.INDEX_SORT_STORAGE); + if (stored_list) { + ({th_id, direction} = JSON.parse(stored_list)) + } + localStorage.setItem(coverage.INDEX_SORT_STORAGE, JSON.stringify({ + "th_id": th.id, + "direction": current_direction + })); + if (th.id !== th_id || document.getElementById("region")) { + // Sort column has changed, unset sorting by function or class. + localStorage.setItem(coverage.SORTED_BY_REGION, JSON.stringify({ + "by_region": false, + "region_direction": current_direction + })); + } + } + else { + // Sort column has changed to by function or class, remember that. + localStorage.setItem(coverage.SORTED_BY_REGION, JSON.stringify({ + "by_region": true, + "region_direction": direction + })); + } +} + +// Find all the elements with data-shortcut attribute, and use them to assign a shortcut key. +coverage.assign_shortkeys = function () { + document.querySelectorAll("[data-shortcut]").forEach(element => { + document.addEventListener("keypress", event => { + if (event.target.tagName.toLowerCase() === "input") { + return; // ignore keypress from search filter + } + if (event.key === element.dataset.shortcut) { + element.click(); + } + }); + }); +}; + +// Create the events for the filter box. +coverage.wire_up_filter = function () { + // Populate the filter and hide100 inputs if there are saved values for them. + const saved_filter_value = localStorage.getItem(coverage.FILTER_STORAGE); + if (saved_filter_value) { + document.getElementById("filter").value = saved_filter_value; + } + const saved_hide100_value = localStorage.getItem(coverage.HIDE100_STORAGE); + if (saved_hide100_value) { + document.getElementById("hide100").checked = JSON.parse(saved_hide100_value); + } + + // Cache elements. + const table = document.querySelector("table.index"); + const table_body_rows = table.querySelectorAll("tbody tr"); + const no_rows = document.getElementById("no_rows"); + + // Observe filter keyevents. + const filter_handler = (event => { + // Keep running total of each metric, first index contains number of shown rows + const totals = new Array(table.rows[0].cells.length).fill(0); + // Accumulate the percentage as fraction + totals[totals.length - 1] = { "numer": 0, "denom": 0 }; // nosemgrep: eslint.detect-object-injection + + var text = document.getElementById("filter").value; + // Store filter value + localStorage.setItem(coverage.FILTER_STORAGE, text); + const casefold = (text === text.toLowerCase()); + const hide100 = document.getElementById("hide100").checked; + // Store hide value. + localStorage.setItem(coverage.HIDE100_STORAGE, JSON.stringify(hide100)); + + // Hide / show elements. + table_body_rows.forEach(row => { + var show = false; + // Check the text filter. + for (let column = 0; column < totals.length; column++) { + cell = row.cells[column]; + if (cell.classList.contains("name")) { + var celltext = cell.textContent; + if (casefold) { + celltext = celltext.toLowerCase(); + } + if (celltext.includes(text)) { + show = true; + } + } + } + + // Check the "hide covered" filter. + if (show && hide100) { + const [numer, denom] = row.cells[row.cells.length - 1].dataset.ratio.split(" "); + show = (numer !== denom); + } + + if (!show) { + // hide + row.classList.add("hidden"); + return; + } + + // show + row.classList.remove("hidden"); + totals[0]++; + + for (let column = 0; column < totals.length; column++) { + // Accumulate dynamic totals + cell = row.cells[column] // nosemgrep: eslint.detect-object-injection + if (cell.classList.contains("name")) { + continue; + } + if (column === totals.length - 1) { + // Last column contains percentage + const [numer, denom] = cell.dataset.ratio.split(" "); + totals[column]["numer"] += parseInt(numer, 10); // nosemgrep: eslint.detect-object-injection + totals[column]["denom"] += parseInt(denom, 10); // nosemgrep: eslint.detect-object-injection + } + else { + totals[column] += parseInt(cell.textContent, 10); // nosemgrep: eslint.detect-object-injection + } + } + }); + + // Show placeholder if no rows will be displayed. + if (!totals[0]) { + // Show placeholder, hide table. + no_rows.style.display = "block"; + table.style.display = "none"; + return; + } + + // Hide placeholder, show table. + no_rows.style.display = null; + table.style.display = null; + + const footer = table.tFoot.rows[0]; + // Calculate new dynamic sum values based on visible rows. + for (let column = 0; column < totals.length; column++) { + // Get footer cell element. + const cell = footer.cells[column]; // nosemgrep: eslint.detect-object-injection + if (cell.classList.contains("name")) { + continue; + } + + // Set value into dynamic footer cell element. + if (column === totals.length - 1) { + // Percentage column uses the numerator and denominator, + // and adapts to the number of decimal places. + const match = /\.([0-9]+)/.exec(cell.textContent); + const places = match ? match[1].length : 0; + const { numer, denom } = totals[column]; // nosemgrep: eslint.detect-object-injection + cell.dataset.ratio = `${numer} ${denom}`; + // Check denom to prevent NaN if filtered files contain no statements + cell.textContent = denom + ? `${(numer * 100 / denom).toFixed(places)}%` + : `${(100).toFixed(places)}%`; + } + else { + cell.textContent = totals[column]; // nosemgrep: eslint.detect-object-injection + } + } + }); + + document.getElementById("filter").addEventListener("input", debounce(filter_handler)); + document.getElementById("hide100").addEventListener("input", debounce(filter_handler)); + + // Trigger change event on setup, to force filter on page refresh + // (filter value may still be present). + document.getElementById("filter").dispatchEvent(new Event("input")); + document.getElementById("hide100").dispatchEvent(new Event("input")); +}; +coverage.FILTER_STORAGE = "COVERAGE_FILTER_VALUE"; +coverage.HIDE100_STORAGE = "COVERAGE_HIDE100_VALUE"; + +// Set up the click-to-sort columns. +coverage.wire_up_sorting = function () { + document.querySelectorAll("[data-sortable] th[aria-sort]").forEach( + th => th.addEventListener("click", e => sortColumn(e.target)) + ); + + // Look for a localStorage item containing previous sort settings: + let th_id = "file", direction = "ascending"; + const stored_list = localStorage.getItem(coverage.INDEX_SORT_STORAGE); + if (stored_list) { + ({th_id, direction} = JSON.parse(stored_list)); + } + let by_region = false, region_direction = "ascending"; + const sorted_by_region = localStorage.getItem(coverage.SORTED_BY_REGION); + if (sorted_by_region) { + ({ + by_region, + region_direction + } = JSON.parse(sorted_by_region)); + } + + const region_id = "region"; + if (by_region && document.getElementById(region_id)) { + direction = region_direction; + } + // If we are in a page that has a column with id of "region", sort on + // it if the last sort was by function or class. + let th; + if (document.getElementById(region_id)) { + th = document.getElementById(by_region ? region_id : th_id); + } + else { + th = document.getElementById(th_id); + } + th.setAttribute("aria-sort", direction === "ascending" ? "descending" : "ascending"); + th.click() +}; + +coverage.INDEX_SORT_STORAGE = "COVERAGE_INDEX_SORT_2"; +coverage.SORTED_BY_REGION = "COVERAGE_SORT_REGION"; + +// Loaded on index.html +coverage.index_ready = function () { + coverage.assign_shortkeys(); + coverage.wire_up_filter(); + coverage.wire_up_sorting(); + + on_click(".button_prev_file", coverage.to_prev_file); + on_click(".button_next_file", coverage.to_next_file); + + on_click(".button_show_hide_help", coverage.show_hide_help); +}; + +// -- pyfile stuff -- + +coverage.LINE_FILTERS_STORAGE = "COVERAGE_LINE_FILTERS"; + +coverage.pyfile_ready = function () { + // If we're directed to a particular line number, highlight the line. + var frag = location.hash; + if (frag.length > 2 && frag[1] === "t") { + document.querySelector(frag).closest(".n").classList.add("highlight"); + coverage.set_sel(parseInt(frag.substr(2), 10)); + } + else { + coverage.set_sel(0); + } + + on_click(".button_toggle_run", coverage.toggle_lines); + on_click(".button_toggle_mis", coverage.toggle_lines); + on_click(".button_toggle_exc", coverage.toggle_lines); + on_click(".button_toggle_par", coverage.toggle_lines); + + on_click(".button_next_chunk", coverage.to_next_chunk_nicely); + on_click(".button_prev_chunk", coverage.to_prev_chunk_nicely); + on_click(".button_top_of_page", coverage.to_top); + on_click(".button_first_chunk", coverage.to_first_chunk); + + on_click(".button_prev_file", coverage.to_prev_file); + on_click(".button_next_file", coverage.to_next_file); + on_click(".button_to_index", coverage.to_index); + + on_click(".button_show_hide_help", coverage.show_hide_help); + + coverage.filters = undefined; + try { + coverage.filters = localStorage.getItem(coverage.LINE_FILTERS_STORAGE); + } catch(err) {} + + if (coverage.filters) { + coverage.filters = JSON.parse(coverage.filters); + } + else { + coverage.filters = {run: false, exc: true, mis: true, par: true}; + } + + for (cls in coverage.filters) { + coverage.set_line_visibilty(cls, coverage.filters[cls]); // nosemgrep: eslint.detect-object-injection + } + + coverage.assign_shortkeys(); + coverage.init_scroll_markers(); + coverage.wire_up_sticky_header(); + + document.querySelectorAll("[id^=ctxs]").forEach( + cbox => cbox.addEventListener("click", coverage.expand_contexts) + ); + + // Rebuild scroll markers when the window height changes. + window.addEventListener("resize", coverage.build_scroll_markers); +}; + +coverage.toggle_lines = function (event) { + const btn = event.target.closest("button"); + const category = btn.value + const show = !btn.classList.contains("show_" + category); + coverage.set_line_visibilty(category, show); + coverage.build_scroll_markers(); + coverage.filters[category] = show; + try { + localStorage.setItem(coverage.LINE_FILTERS_STORAGE, JSON.stringify(coverage.filters)); + } catch(err) {} +}; + +coverage.set_line_visibilty = function (category, should_show) { + const cls = "show_" + category; + const btn = document.querySelector(".button_toggle_" + category); + if (btn) { + if (should_show) { + document.querySelectorAll("#source ." + category).forEach(e => e.classList.add(cls)); + btn.classList.add(cls); + } + else { + document.querySelectorAll("#source ." + category).forEach(e => e.classList.remove(cls)); + btn.classList.remove(cls); + } + } +}; + +// Return the nth line div. +coverage.line_elt = function (n) { + return document.getElementById("t" + n)?.closest("p"); +}; + +// Set the selection. b and e are line numbers. +coverage.set_sel = function (b, e) { + // The first line selected. + coverage.sel_begin = b; + // The next line not selected. + coverage.sel_end = (e === undefined) ? b+1 : e; +}; + +coverage.to_top = function () { + coverage.set_sel(0, 1); + coverage.scroll_window(0); +}; + +coverage.to_first_chunk = function () { + coverage.set_sel(0, 1); + coverage.to_next_chunk(); +}; + +coverage.to_prev_file = function () { + window.location = document.getElementById("prevFileLink").href; +} + +coverage.to_next_file = function () { + window.location = document.getElementById("nextFileLink").href; +} + +coverage.to_index = function () { + location.href = document.getElementById("indexLink").href; +} + +coverage.show_hide_help = function () { + const helpCheck = document.getElementById("help_panel_state") + helpCheck.checked = !helpCheck.checked; +} + +// Return a string indicating what kind of chunk this line belongs to, +// or null if not a chunk. +coverage.chunk_indicator = function (line_elt) { + const classes = line_elt?.className; + if (!classes) { + return null; + } + const match = classes.match(/\bshow_\w+\b/); + if (!match) { + return null; + } + return match[0]; +}; + +coverage.to_next_chunk = function () { + const c = coverage; + + // Find the start of the next colored chunk. + var probe = c.sel_end; + var chunk_indicator, probe_line; + while (true) { + probe_line = c.line_elt(probe); + if (!probe_line) { + return; + } + chunk_indicator = c.chunk_indicator(probe_line); + if (chunk_indicator) { + break; + } + probe++; + } + + // There's a next chunk, `probe` points to it. + var begin = probe; + + // Find the end of this chunk. + var next_indicator = chunk_indicator; + while (next_indicator === chunk_indicator) { + probe++; + probe_line = c.line_elt(probe); + next_indicator = c.chunk_indicator(probe_line); + } + c.set_sel(begin, probe); + c.show_selection(); +}; + +coverage.to_prev_chunk = function () { + const c = coverage; + + // Find the end of the prev colored chunk. + var probe = c.sel_begin-1; + var probe_line = c.line_elt(probe); + if (!probe_line) { + return; + } + var chunk_indicator = c.chunk_indicator(probe_line); + while (probe > 1 && !chunk_indicator) { + probe--; + probe_line = c.line_elt(probe); + if (!probe_line) { + return; + } + chunk_indicator = c.chunk_indicator(probe_line); + } + + // There's a prev chunk, `probe` points to its last line. + var end = probe+1; + + // Find the beginning of this chunk. + var prev_indicator = chunk_indicator; + while (prev_indicator === chunk_indicator) { + probe--; + if (probe <= 0) { + return; + } + probe_line = c.line_elt(probe); + prev_indicator = c.chunk_indicator(probe_line); + } + c.set_sel(probe+1, end); + c.show_selection(); +}; + +// Returns 0, 1, or 2: how many of the two ends of the selection are on +// the screen right now? +coverage.selection_ends_on_screen = function () { + if (coverage.sel_begin === 0) { + return 0; + } + + const begin = coverage.line_elt(coverage.sel_begin); + const end = coverage.line_elt(coverage.sel_end-1); + + return ( + (checkVisible(begin) ? 1 : 0) + + (checkVisible(end) ? 1 : 0) + ); +}; + +coverage.to_next_chunk_nicely = function () { + if (coverage.selection_ends_on_screen() === 0) { + // The selection is entirely off the screen: + // Set the top line on the screen as selection. + + // This will select the top-left of the viewport + // As this is most likely the span with the line number we take the parent + const line = document.elementFromPoint(0, 0).parentElement; + if (line.parentElement !== document.getElementById("source")) { + // The element is not a source line but the header or similar + coverage.select_line_or_chunk(1); + } + else { + // We extract the line number from the id + coverage.select_line_or_chunk(parseInt(line.id.substring(1), 10)); + } + } + coverage.to_next_chunk(); +}; + +coverage.to_prev_chunk_nicely = function () { + if (coverage.selection_ends_on_screen() === 0) { + // The selection is entirely off the screen: + // Set the lowest line on the screen as selection. + + // This will select the bottom-left of the viewport + // As this is most likely the span with the line number we take the parent + const line = document.elementFromPoint(document.documentElement.clientHeight-1, 0).parentElement; + if (line.parentElement !== document.getElementById("source")) { + // The element is not a source line but the header or similar + coverage.select_line_or_chunk(coverage.lines_len); + } + else { + // We extract the line number from the id + coverage.select_line_or_chunk(parseInt(line.id.substring(1), 10)); + } + } + coverage.to_prev_chunk(); +}; + +// Select line number lineno, or if it is in a colored chunk, select the +// entire chunk +coverage.select_line_or_chunk = function (lineno) { + var c = coverage; + var probe_line = c.line_elt(lineno); + if (!probe_line) { + return; + } + var the_indicator = c.chunk_indicator(probe_line); + if (the_indicator) { + // The line is in a highlighted chunk. + // Search backward for the first line. + var probe = lineno; + var indicator = the_indicator; + while (probe > 0 && indicator === the_indicator) { + probe--; + probe_line = c.line_elt(probe); + if (!probe_line) { + break; + } + indicator = c.chunk_indicator(probe_line); + } + var begin = probe + 1; + + // Search forward for the last line. + probe = lineno; + indicator = the_indicator; + while (indicator === the_indicator) { + probe++; + probe_line = c.line_elt(probe); + indicator = c.chunk_indicator(probe_line); + } + + coverage.set_sel(begin, probe); + } + else { + coverage.set_sel(lineno); + } +}; + +coverage.show_selection = function () { + // Highlight the lines in the chunk + document.querySelectorAll("#source .highlight").forEach(e => e.classList.remove("highlight")); + for (let probe = coverage.sel_begin; probe < coverage.sel_end; probe++) { + coverage.line_elt(probe).querySelector(".n").classList.add("highlight"); + } + + coverage.scroll_to_selection(); +}; + +coverage.scroll_to_selection = function () { + // Scroll the page if the chunk isn't fully visible. + if (coverage.selection_ends_on_screen() < 2) { + const element = coverage.line_elt(coverage.sel_begin); + coverage.scroll_window(element.offsetTop - 60); + } +}; + +coverage.scroll_window = function (to_pos) { + window.scroll({top: to_pos, behavior: "smooth"}); +}; + +coverage.init_scroll_markers = function () { + // Init some variables + coverage.lines_len = document.querySelectorAll("#source > p").length; + + // Build html + coverage.build_scroll_markers(); +}; + +coverage.build_scroll_markers = function () { + const temp_scroll_marker = document.getElementById("scroll_marker") + if (temp_scroll_marker) temp_scroll_marker.remove(); + // Don't build markers if the window has no scroll bar. + if (document.body.scrollHeight <= window.innerHeight) { + return; + } + + const marker_scale = window.innerHeight / document.body.scrollHeight; + const line_height = Math.min(Math.max(3, window.innerHeight / coverage.lines_len), 10); + + let previous_line = -99, last_mark, last_top; + + const scroll_marker = document.createElement("div"); + scroll_marker.id = "scroll_marker"; + document.getElementById("source").querySelectorAll( + "p.show_run, p.show_mis, p.show_exc, p.show_exc, p.show_par" + ).forEach(element => { + const line_top = Math.floor(element.offsetTop * marker_scale); + const line_number = parseInt(element.querySelector(".n a").id.substr(1)); + + if (line_number === previous_line + 1) { + // If this solid missed block just make previous mark higher. + last_mark.style.height = `${line_top + line_height - last_top}px`; + } + else { + // Add colored line in scroll_marker block. + last_mark = document.createElement("div"); + last_mark.id = `m${line_number}`; + last_mark.classList.add("marker"); + last_mark.style.height = `${line_height}px`; + last_mark.style.top = `${line_top}px`; + scroll_marker.append(last_mark); + last_top = line_top; + } + + previous_line = line_number; + }); + + // Append last to prevent layout calculation + document.body.append(scroll_marker); +}; + +coverage.wire_up_sticky_header = function () { + const header = document.querySelector("header"); + const header_bottom = ( + header.querySelector(".content h2").getBoundingClientRect().top - + header.getBoundingClientRect().top + ); + + function updateHeader() { + if (window.scrollY > header_bottom) { + header.classList.add("sticky"); + } + else { + header.classList.remove("sticky"); + } + } + + window.addEventListener("scroll", updateHeader); + updateHeader(); +}; + +coverage.expand_contexts = function (e) { + var ctxs = e.target.parentNode.querySelector(".ctxs"); + + if (!ctxs.classList.contains("expanded")) { + var ctxs_text = ctxs.textContent; + var width = Number(ctxs_text[0]); + ctxs.textContent = ""; + for (var i = 1; i < ctxs_text.length; i += width) { + key = ctxs_text.substring(i, i + width).trim(); + ctxs.appendChild(document.createTextNode(contexts[key])); + ctxs.appendChild(document.createElement("br")); + } + ctxs.classList.add("expanded"); + } +}; + +document.addEventListener("DOMContentLoaded", () => { + if (document.body.classList.contains("indexfile")) { + coverage.index_ready(); + } + else { + coverage.pyfile_ready(); + } +}); diff --git a/.venv/Lib/site-packages/coverage/htmlfiles/favicon_32.png b/.venv/Lib/site-packages/coverage/htmlfiles/favicon_32.png new file mode 100644 index 00000000..8649f047 Binary files /dev/null and b/.venv/Lib/site-packages/coverage/htmlfiles/favicon_32.png differ diff --git a/.venv/Lib/site-packages/coverage/htmlfiles/index.html b/.venv/Lib/site-packages/coverage/htmlfiles/index.html new file mode 100644 index 00000000..e856011d --- /dev/null +++ b/.venv/Lib/site-packages/coverage/htmlfiles/index.html @@ -0,0 +1,164 @@ +{# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 #} +{# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt #} + + + + + + {{ title|escape }} + + + {% if extra_css %} + + {% endif %} + + + + +
+
+

{{ title|escape }}: + {{totals.pc_covered_str}}% +

+ + + +
+ +
+ + +
+
+ +

+ {% for ibtn in index_buttons %} + {{ ibtn.label }}{#-#} + {% endfor %} +

+ +

+ coverage.py v{{__version__}}, + created at {{ time_stamp }} +

+
+
+ +
+ + + {# The title="" attr doesn't work in Safari. #} + + + {% if region_noun %} + + {% endif %} + + + + {% if has_arcs %} + + + {% endif %} + + + + + {% for region in regions %} + + + {% if region_noun %} + + {% endif %} + + + + {% if has_arcs %} + + + {% endif %} + + + {% endfor %} + + + + + {% if region_noun %} + + {% endif %} + + + + {% if has_arcs %} + + + {% endif %} + + + +
File{{ region_noun }}statementsmissingexcludedbranchespartialcoverage
{{region.file}}{{region.description}}{{region.nums.n_statements}}{{region.nums.n_missing}}{{region.nums.n_excluded}}{{region.nums.n_branches}}{{region.nums.n_partial_branches}}{{region.nums.pc_covered_str}}%
Total {{totals.n_statements}}{{totals.n_missing}}{{totals.n_excluded}}{{totals.n_branches}}{{totals.n_partial_branches}}{{totals.pc_covered_str}}%
+ +

+ No items found using the specified filter. +

+ + {% if skipped_covered_msg %} +

{{ skipped_covered_msg }}

+ {% endif %} + {% if skipped_empty_msg %} +

{{ skipped_empty_msg }}

+ {% endif %} +
+ + + + + diff --git a/.venv/Lib/site-packages/coverage/htmlfiles/keybd_closed.png b/.venv/Lib/site-packages/coverage/htmlfiles/keybd_closed.png new file mode 100644 index 00000000..ba119c47 Binary files /dev/null and b/.venv/Lib/site-packages/coverage/htmlfiles/keybd_closed.png differ diff --git a/.venv/Lib/site-packages/coverage/htmlfiles/pyfile.html b/.venv/Lib/site-packages/coverage/htmlfiles/pyfile.html new file mode 100644 index 00000000..5a6ea43d --- /dev/null +++ b/.venv/Lib/site-packages/coverage/htmlfiles/pyfile.html @@ -0,0 +1,149 @@ +{# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 #} +{# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt #} + + + + + + Coverage for {{relative_filename|escape}}: {{nums.pc_covered_str}}% + + + {% if extra_css %} + + {% endif %} + + {% if contexts_json %} + + {% endif %} + + + + + +
+
+

+ Coverage for {{relative_filename|escape}}: + {{nums.pc_covered_str}}% +

+ + + +

+ {{nums.n_statements}} statements   + + + + {% if has_arcs %} + + {% endif %} +

+ +

+ « prev     + ^ index     + » next +       + coverage.py v{{__version__}}, + created at {{ time_stamp }} +

+ + +
+
+ +
+ {% for line in lines -%} + {% joined %} +

+ {{line.number}} + {{line.html}}  + {% if line.context_list %} + + {% endif %} + {# Things that should float right in the line. #} + + {% if line.annotate %} + {{line.annotate}} + {{line.annotate_long}} + {% endif %} + {% if line.contexts %} + + {% endif %} + + {# Things that should appear below the line. #} + {% if line.context_str %} + {{ line.context_str }} + {% endif %} +

+ {% endjoined %} + {% endfor %} +
+ + + + + diff --git a/.venv/Lib/site-packages/coverage/htmlfiles/style.css b/.venv/Lib/site-packages/coverage/htmlfiles/style.css new file mode 100644 index 00000000..3cdaf05a --- /dev/null +++ b/.venv/Lib/site-packages/coverage/htmlfiles/style.css @@ -0,0 +1,337 @@ +@charset "UTF-8"; +/* Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 */ +/* For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt */ +/* Don't edit this .css file. Edit the .scss file instead! */ +html, body, h1, h2, h3, p, table, td, th { margin: 0; padding: 0; border: 0; font-weight: inherit; font-style: inherit; font-size: 100%; font-family: inherit; vertical-align: baseline; } + +body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; font-size: 1em; background: #fff; color: #000; } + +@media (prefers-color-scheme: dark) { body { background: #1e1e1e; } } + +@media (prefers-color-scheme: dark) { body { color: #eee; } } + +html > body { font-size: 16px; } + +a:active, a:focus { outline: 2px dashed #007acc; } + +p { font-size: .875em; line-height: 1.4em; } + +table { border-collapse: collapse; } + +td { vertical-align: top; } + +table tr.hidden { display: none !important; } + +p#no_rows { display: none; font-size: 1.15em; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; } + +a.nav { text-decoration: none; color: inherit; } + +a.nav:hover { text-decoration: underline; color: inherit; } + +.hidden { display: none; } + +header { background: #f8f8f8; width: 100%; z-index: 2; border-bottom: 1px solid #ccc; } + +@media (prefers-color-scheme: dark) { header { background: black; } } + +@media (prefers-color-scheme: dark) { header { border-color: #333; } } + +header .content { padding: 1rem 3.5rem; } + +header h2 { margin-top: .5em; font-size: 1em; } + +header h2 a.button { font-family: inherit; font-size: inherit; border: 1px solid; border-radius: .2em; background: #eee; color: inherit; text-decoration: none; padding: .1em .5em; margin: 1px calc(.1em + 1px); cursor: pointer; border-color: #ccc; } + +@media (prefers-color-scheme: dark) { header h2 a.button { background: #333; } } + +@media (prefers-color-scheme: dark) { header h2 a.button { border-color: #444; } } + +header h2 a.button.current { border: 2px solid; background: #fff; border-color: #999; cursor: default; } + +@media (prefers-color-scheme: dark) { header h2 a.button.current { background: #1e1e1e; } } + +@media (prefers-color-scheme: dark) { header h2 a.button.current { border-color: #777; } } + +header p.text { margin: .5em 0 -.5em; color: #666; font-style: italic; } + +@media (prefers-color-scheme: dark) { header p.text { color: #aaa; } } + +header.sticky { position: fixed; left: 0; right: 0; height: 2.5em; } + +header.sticky .text { display: none; } + +header.sticky h1, header.sticky h2 { font-size: 1em; margin-top: 0; display: inline-block; } + +header.sticky .content { padding: 0.5rem 3.5rem; } + +header.sticky .content p { font-size: 1em; } + +header.sticky ~ #source { padding-top: 6.5em; } + +main { position: relative; z-index: 1; } + +footer { margin: 1rem 3.5rem; } + +footer .content { padding: 0; color: #666; font-style: italic; } + +@media (prefers-color-scheme: dark) { footer .content { color: #aaa; } } + +#index { margin: 1rem 0 0 3.5rem; } + +h1 { font-size: 1.25em; display: inline-block; } + +#filter_container { float: right; margin: 0 2em 0 0; line-height: 1.66em; } + +#filter_container #filter { width: 10em; padding: 0.2em 0.5em; border: 2px solid #ccc; background: #fff; color: #000; } + +@media (prefers-color-scheme: dark) { #filter_container #filter { border-color: #444; } } + +@media (prefers-color-scheme: dark) { #filter_container #filter { background: #1e1e1e; } } + +@media (prefers-color-scheme: dark) { #filter_container #filter { color: #eee; } } + +#filter_container #filter:focus { border-color: #007acc; } + +#filter_container :disabled ~ label { color: #ccc; } + +@media (prefers-color-scheme: dark) { #filter_container :disabled ~ label { color: #444; } } + +#filter_container label { font-size: .875em; color: #666; } + +@media (prefers-color-scheme: dark) { #filter_container label { color: #aaa; } } + +header button { font-family: inherit; font-size: inherit; border: 1px solid; border-radius: .2em; background: #eee; color: inherit; text-decoration: none; padding: .1em .5em; margin: 1px calc(.1em + 1px); cursor: pointer; border-color: #ccc; } + +@media (prefers-color-scheme: dark) { header button { background: #333; } } + +@media (prefers-color-scheme: dark) { header button { border-color: #444; } } + +header button:active, header button:focus { outline: 2px dashed #007acc; } + +header button.run { background: #eeffee; } + +@media (prefers-color-scheme: dark) { header button.run { background: #373d29; } } + +header button.run.show_run { background: #dfd; border: 2px solid #00dd00; margin: 0 .1em; } + +@media (prefers-color-scheme: dark) { header button.run.show_run { background: #373d29; } } + +header button.mis { background: #ffeeee; } + +@media (prefers-color-scheme: dark) { header button.mis { background: #4b1818; } } + +header button.mis.show_mis { background: #fdd; border: 2px solid #ff0000; margin: 0 .1em; } + +@media (prefers-color-scheme: dark) { header button.mis.show_mis { background: #4b1818; } } + +header button.exc { background: #f7f7f7; } + +@media (prefers-color-scheme: dark) { header button.exc { background: #333; } } + +header button.exc.show_exc { background: #eee; border: 2px solid #808080; margin: 0 .1em; } + +@media (prefers-color-scheme: dark) { header button.exc.show_exc { background: #333; } } + +header button.par { background: #ffffd5; } + +@media (prefers-color-scheme: dark) { header button.par { background: #650; } } + +header button.par.show_par { background: #ffa; border: 2px solid #bbbb00; margin: 0 .1em; } + +@media (prefers-color-scheme: dark) { header button.par.show_par { background: #650; } } + +#help_panel, #source p .annotate.long { display: none; position: absolute; z-index: 999; background: #ffffcc; border: 1px solid #888; border-radius: .2em; color: #333; padding: .25em .5em; } + +#source p .annotate.long { white-space: normal; float: right; top: 1.75em; right: 1em; height: auto; } + +#help_panel_wrapper { float: right; position: relative; } + +#keyboard_icon { margin: 5px; } + +#help_panel_state { display: none; } + +#help_panel { top: 25px; right: 0; padding: .75em; border: 1px solid #883; color: #333; } + +#help_panel .keyhelp p { margin-top: .75em; } + +#help_panel .legend { font-style: italic; margin-bottom: 1em; } + +.indexfile #help_panel { width: 25em; } + +.pyfile #help_panel { width: 18em; } + +#help_panel_state:checked ~ #help_panel { display: block; } + +kbd { border: 1px solid black; border-color: #888 #333 #333 #888; padding: .1em .35em; font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-weight: bold; background: #eee; border-radius: 3px; } + +#source { padding: 1em 0 1em 3.5rem; font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace; } + +#source p { position: relative; white-space: pre; } + +#source p * { box-sizing: border-box; } + +#source p .n { float: left; text-align: right; width: 3.5rem; box-sizing: border-box; margin-left: -3.5rem; padding-right: 1em; color: #999; user-select: none; } + +@media (prefers-color-scheme: dark) { #source p .n { color: #777; } } + +#source p .n.highlight { background: #ffdd00; } + +#source p .n a { scroll-margin-top: 6em; text-decoration: none; color: #999; } + +@media (prefers-color-scheme: dark) { #source p .n a { color: #777; } } + +#source p .n a:hover { text-decoration: underline; color: #999; } + +@media (prefers-color-scheme: dark) { #source p .n a:hover { color: #777; } } + +#source p .t { display: inline-block; width: 100%; box-sizing: border-box; margin-left: -.5em; padding-left: 0.3em; border-left: 0.2em solid #fff; } + +@media (prefers-color-scheme: dark) { #source p .t { border-color: #1e1e1e; } } + +#source p .t:hover { background: #f2f2f2; } + +@media (prefers-color-scheme: dark) { #source p .t:hover { background: #282828; } } + +#source p .t:hover ~ .r .annotate.long { display: block; } + +#source p .t .com { color: #008000; font-style: italic; line-height: 1px; } + +@media (prefers-color-scheme: dark) { #source p .t .com { color: #6a9955; } } + +#source p .t .key { font-weight: bold; line-height: 1px; } + +#source p .t .str { color: #0451a5; } + +@media (prefers-color-scheme: dark) { #source p .t .str { color: #9cdcfe; } } + +#source p.mis .t { border-left: 0.2em solid #ff0000; } + +#source p.mis.show_mis .t { background: #fdd; } + +@media (prefers-color-scheme: dark) { #source p.mis.show_mis .t { background: #4b1818; } } + +#source p.mis.show_mis .t:hover { background: #f2d2d2; } + +@media (prefers-color-scheme: dark) { #source p.mis.show_mis .t:hover { background: #532323; } } + +#source p.run .t { border-left: 0.2em solid #00dd00; } + +#source p.run.show_run .t { background: #dfd; } + +@media (prefers-color-scheme: dark) { #source p.run.show_run .t { background: #373d29; } } + +#source p.run.show_run .t:hover { background: #d2f2d2; } + +@media (prefers-color-scheme: dark) { #source p.run.show_run .t:hover { background: #404633; } } + +#source p.exc .t { border-left: 0.2em solid #808080; } + +#source p.exc.show_exc .t { background: #eee; } + +@media (prefers-color-scheme: dark) { #source p.exc.show_exc .t { background: #333; } } + +#source p.exc.show_exc .t:hover { background: #e2e2e2; } + +@media (prefers-color-scheme: dark) { #source p.exc.show_exc .t:hover { background: #3c3c3c; } } + +#source p.par .t { border-left: 0.2em solid #bbbb00; } + +#source p.par.show_par .t { background: #ffa; } + +@media (prefers-color-scheme: dark) { #source p.par.show_par .t { background: #650; } } + +#source p.par.show_par .t:hover { background: #f2f2a2; } + +@media (prefers-color-scheme: dark) { #source p.par.show_par .t:hover { background: #6d5d0c; } } + +#source p .r { position: absolute; top: 0; right: 2.5em; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; } + +#source p .annotate { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; color: #666; padding-right: .5em; } + +@media (prefers-color-scheme: dark) { #source p .annotate { color: #ddd; } } + +#source p .annotate.short:hover ~ .long { display: block; } + +#source p .annotate.long { width: 30em; right: 2.5em; } + +#source p input { display: none; } + +#source p input ~ .r label.ctx { cursor: pointer; border-radius: .25em; } + +#source p input ~ .r label.ctx::before { content: "▶ "; } + +#source p input ~ .r label.ctx:hover { background: #e8f4ff; color: #666; } + +@media (prefers-color-scheme: dark) { #source p input ~ .r label.ctx:hover { background: #0f3a42; } } + +@media (prefers-color-scheme: dark) { #source p input ~ .r label.ctx:hover { color: #aaa; } } + +#source p input:checked ~ .r label.ctx { background: #d0e8ff; color: #666; border-radius: .75em .75em 0 0; padding: 0 .5em; margin: -.25em 0; } + +@media (prefers-color-scheme: dark) { #source p input:checked ~ .r label.ctx { background: #056; } } + +@media (prefers-color-scheme: dark) { #source p input:checked ~ .r label.ctx { color: #aaa; } } + +#source p input:checked ~ .r label.ctx::before { content: "▼ "; } + +#source p input:checked ~ .ctxs { padding: .25em .5em; overflow-y: scroll; max-height: 10.5em; } + +#source p label.ctx { color: #999; display: inline-block; padding: 0 .5em; font-size: .8333em; } + +@media (prefers-color-scheme: dark) { #source p label.ctx { color: #777; } } + +#source p .ctxs { display: block; max-height: 0; overflow-y: hidden; transition: all .2s; padding: 0 .5em; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; white-space: nowrap; background: #d0e8ff; border-radius: .25em; margin-right: 1.75em; text-align: right; } + +@media (prefers-color-scheme: dark) { #source p .ctxs { background: #056; } } + +#index { font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 0.875em; } + +#index table.index { margin-left: -.5em; } + +#index td, #index th { text-align: right; padding: .25em .5em; border-bottom: 1px solid #eee; } + +@media (prefers-color-scheme: dark) { #index td, #index th { border-color: #333; } } + +#index td.name, #index th.name { text-align: left; width: auto; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; min-width: 15em; } + +#index th { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; font-style: italic; color: #333; cursor: pointer; } + +@media (prefers-color-scheme: dark) { #index th { color: #ddd; } } + +#index th:hover { background: #eee; } + +@media (prefers-color-scheme: dark) { #index th:hover { background: #333; } } + +#index th .arrows { color: #666; font-size: 85%; font-family: sans-serif; font-style: normal; pointer-events: none; } + +#index th[aria-sort="ascending"], #index th[aria-sort="descending"] { white-space: nowrap; background: #eee; padding-left: .5em; } + +@media (prefers-color-scheme: dark) { #index th[aria-sort="ascending"], #index th[aria-sort="descending"] { background: #333; } } + +#index th[aria-sort="ascending"] .arrows::after { content: " ▲"; } + +#index th[aria-sort="descending"] .arrows::after { content: " ▼"; } + +#index td.name { font-size: 1.15em; } + +#index td.name a { text-decoration: none; color: inherit; } + +#index td.name .no-noun { font-style: italic; } + +#index tr.total td, #index tr.total_dynamic td { font-weight: bold; border-top: 1px solid #ccc; border-bottom: none; } + +#index tr.region:hover { background: #eee; } + +@media (prefers-color-scheme: dark) { #index tr.region:hover { background: #333; } } + +#index tr.region:hover td.name { text-decoration: underline; color: inherit; } + +#scroll_marker { position: fixed; z-index: 3; right: 0; top: 0; width: 16px; height: 100%; background: #fff; border-left: 1px solid #eee; will-change: transform; } + +@media (prefers-color-scheme: dark) { #scroll_marker { background: #1e1e1e; } } + +@media (prefers-color-scheme: dark) { #scroll_marker { border-color: #333; } } + +#scroll_marker .marker { background: #ccc; position: absolute; min-height: 3px; width: 100%; } + +@media (prefers-color-scheme: dark) { #scroll_marker .marker { background: #444; } } diff --git a/.venv/Lib/site-packages/coverage/htmlfiles/style.scss b/.venv/Lib/site-packages/coverage/htmlfiles/style.scss new file mode 100644 index 00000000..9bf1a7cc --- /dev/null +++ b/.venv/Lib/site-packages/coverage/htmlfiles/style.scss @@ -0,0 +1,760 @@ +/* Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 */ +/* For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt */ + +// CSS styles for coverage.py HTML reports. + +// When you edit this file, you need to run "make css" to get the CSS file +// generated, and then check in both the .scss and the .css files. + +// When working on the file, this command is useful: +// sass --watch --style=compact --sourcemap=none --no-cache coverage/htmlfiles/style.scss:htmlcov/style.css +// +// OR you can process sass purely in python with `pip install pysass`, then: +// pysassc --style=compact coverage/htmlfiles/style.scss coverage/htmlfiles/style.css + +// Ignore this comment, it's for the CSS output file: +/* Don't edit this .css file. Edit the .scss file instead! */ + +// Dimensions +$left-gutter: 3.5rem; + +// +// Declare colors and variables +// + +$font-normal: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; +$font-code: SFMono-Regular, Menlo, Monaco, Consolas, monospace; + +$off-button-lighten: 50%; +$hover-dark-amt: 95%; + +$focus-color: #007acc; + +$mis-color: #ff0000; +$run-color: #00dd00; +$exc-color: #808080; +$par-color: #bbbb00; + +$light-bg: #fff; +$light-fg: #000; +$light-gray1: #f8f8f8; +$light-gray2: #eee; +$light-gray3: #ccc; +$light-gray4: #999; +$light-gray5: #666; +$light-gray6: #333; +$light-pln-bg: $light-bg; +$light-mis-bg: #fdd; +$light-run-bg: #dfd; +$light-exc-bg: $light-gray2; +$light-par-bg: #ffa; +$light-token-com: #008000; +$light-token-str: #0451a5; +$light-context-bg-color: #d0e8ff; + +$dark-bg: #1e1e1e; +$dark-fg: #eee; +$dark-gray1: #222; +$dark-gray2: #333; +$dark-gray3: #444; +$dark-gray4: #777; +$dark-gray5: #aaa; +$dark-gray6: #ddd; +$dark-pln-bg: $dark-bg; +$dark-mis-bg: #4b1818; +$dark-run-bg: #373d29; +$dark-exc-bg: $dark-gray2; +$dark-par-bg: #650; +$dark-token-com: #6a9955; +$dark-token-str: #9cdcfe; +$dark-context-bg-color: #056; + +// +// Mixins and utilities +// + +@mixin background-dark($color) { + @media (prefers-color-scheme: dark) { + background: $color; + } +} +@mixin color-dark($color) { + @media (prefers-color-scheme: dark) { + color: $color; + } +} +@mixin border-color-dark($color) { + @media (prefers-color-scheme: dark) { + border-color: $color; + } +} + +// Add visual outline to navigable elements on focus improve accessibility. +@mixin focus-border { + &:active, &:focus { + outline: 2px dashed $focus-color; + } +} + +@mixin button-shape { + font-family: inherit; + font-size: inherit; + border: 1px solid; + border-radius: .2em; + background: $light-gray2; + @include background-dark($dark-gray2); + color: inherit; + text-decoration: none; + padding: .1em .5em; + margin: 1px calc(.1em + 1px); + cursor: pointer; + border-color: $light-gray3; + @include border-color-dark($dark-gray3); +} + +// Page-wide styles +html, body, h1, h2, h3, p, table, td, th { + margin: 0; + padding: 0; + border: 0; + font-weight: inherit; + font-style: inherit; + font-size: 100%; + font-family: inherit; + vertical-align: baseline; +} + +// Set baseline grid to 16 pt. +body { + font-family: $font-normal; + font-size: 1em; + background: $light-bg; + color: $light-fg; + @include background-dark($dark-bg); + @include color-dark($dark-fg); +} + +html>body { + font-size: 16px; +} + +a { + @include focus-border; +} + +p { + font-size: .875em; + line-height: 1.4em; +} + +table { + border-collapse: collapse; +} +td { + vertical-align: top; +} +table tr.hidden { + display: none !important; +} + +p#no_rows { + display: none; + font-size: 1.15em; + font-family: $font-normal; +} + +a.nav { + text-decoration: none; + color: inherit; + + &:hover { + text-decoration: underline; + color: inherit; + } +} + +.hidden { + display: none; +} + +// Page structure +header { + background: $light-gray1; + @include background-dark(black); + width: 100%; + z-index: 2; + border-bottom: 1px solid $light-gray3; + @include border-color-dark($dark-gray2); + + .content { + padding: 1rem $left-gutter; + } + + h2 { + margin-top: .5em; + font-size: 1em; + + a.button { + @include button-shape; + &.current { + border: 2px solid; + background: $light-bg; + @include background-dark($dark-bg); + border-color: $light-gray4; + @include border-color-dark($dark-gray4); + cursor: default; + } + } + } + + p.text { + margin: .5em 0 -.5em; + color: $light-gray5; + @include color-dark($dark-gray5); + font-style: italic; + } + + &.sticky { + position: fixed; + left: 0; + right: 0; + height: 2.5em; + + .text { + display: none; + } + + h1, h2 { + font-size: 1em; + margin-top: 0; + display: inline-block; + } + + .content { + padding: .5rem $left-gutter; + p { + font-size: 1em; + } + } + + & ~ #source { + padding-top: 6.5em; + } + } +} + +main { + position: relative; + z-index: 1; +} + +footer { + margin: 1rem $left-gutter; + + .content { + padding: 0; + color: $light-gray5; + @include color-dark($dark-gray5); + font-style: italic; + } +} + +#index { + margin: 1rem 0 0 $left-gutter; +} + +// Header styles + +h1 { + font-size: 1.25em; + display: inline-block; +} + +#filter_container { + float: right; + margin: 0 2em 0 0; + line-height: 1.66em; + + #filter { + width: 10em; + padding: 0.2em 0.5em; + border: 2px solid $light-gray3; + background: $light-bg; + color: $light-fg; + @include border-color-dark($dark-gray3); + @include background-dark($dark-bg); + @include color-dark($dark-fg); + &:focus { + border-color: $focus-color; + } + } + + :disabled ~ label{ + color: $light-gray3; + @include color-dark($dark-gray3); + } + + label { + font-size: .875em; + color: $light-gray5; + @include color-dark($dark-gray5); + } +} + +header button { + @include button-shape; + @include focus-border; + + &.run { + background: mix($light-run-bg, $light-bg, $off-button-lighten); + @include background-dark($dark-run-bg); + &.show_run { + background: $light-run-bg; + @include background-dark($dark-run-bg); + border: 2px solid $run-color; + margin: 0 .1em; + } + } + &.mis { + background: mix($light-mis-bg, $light-bg, $off-button-lighten); + @include background-dark($dark-mis-bg); + &.show_mis { + background: $light-mis-bg; + @include background-dark($dark-mis-bg); + border: 2px solid $mis-color; + margin: 0 .1em; + } + } + &.exc { + background: mix($light-exc-bg, $light-bg, $off-button-lighten); + @include background-dark($dark-exc-bg); + &.show_exc { + background: $light-exc-bg; + @include background-dark($dark-exc-bg); + border: 2px solid $exc-color; + margin: 0 .1em; + } + } + &.par { + background: mix($light-par-bg, $light-bg, $off-button-lighten); + @include background-dark($dark-par-bg); + &.show_par { + background: $light-par-bg; + @include background-dark($dark-par-bg); + border: 2px solid $par-color; + margin: 0 .1em; + } + } +} + +// Yellow post-it things. +%popup { + display: none; + position: absolute; + z-index: 999; + background: #ffffcc; + border: 1px solid #888; + border-radius: .2em; + color: #333; + padding: .25em .5em; +} + +// Yellow post-it's in the text listings. +%in-text-popup { + @extend %popup; + white-space: normal; + float: right; + top: 1.75em; + right: 1em; + height: auto; +} + +// Help panel +#help_panel_wrapper { + float: right; + position: relative; +} + +#keyboard_icon { + margin: 5px; +} + +#help_panel_state { + display: none; +} + +#help_panel { + @extend %popup; + top: 25px; + right: 0; + padding: .75em; + border: 1px solid #883; + + color: #333; + + .keyhelp p { + margin-top: .75em; + } + + .legend { + font-style: italic; + margin-bottom: 1em; + } + + .indexfile & { + width: 25em; + } + + .pyfile & { + width: 18em; + } + + #help_panel_state:checked ~ & { + display: block; + } +} + +kbd { + border: 1px solid black; + border-color: #888 #333 #333 #888; + padding: .1em .35em; + font-family: $font-code; + font-weight: bold; + background: #eee; + border-radius: 3px; +} + +// Source file styles + +// The slim bar at the left edge of the source lines, colored by coverage. +$border-indicator-width: .2em; + +#source { + padding: 1em 0 1em $left-gutter; + font-family: $font-code; + + p { + // position relative makes position:absolute pop-ups appear in the right place. + position: relative; + white-space: pre; + + * { + box-sizing: border-box; + } + + .n { + float: left; + text-align: right; + width: $left-gutter; + box-sizing: border-box; + margin-left: -$left-gutter; + padding-right: 1em; + color: $light-gray4; + user-select: none; + @include color-dark($dark-gray4); + + &.highlight { + background: #ffdd00; + } + + a { + // Make anchors to the line scroll the line to be + // visible beneath the fixed-position header. + scroll-margin-top: 6em; + text-decoration: none; + color: $light-gray4; + @include color-dark($dark-gray4); + &:hover { + text-decoration: underline; + color: $light-gray4; + @include color-dark($dark-gray4); + } + } + } + + .t { + display: inline-block; + width: 100%; + box-sizing: border-box; + margin-left: -.5em; + padding-left: .5em - $border-indicator-width; + border-left: $border-indicator-width solid $light-bg; + @include border-color-dark($dark-bg); + + &:hover { + background: mix($light-pln-bg, $light-fg, $hover-dark-amt); + @include background-dark(mix($dark-pln-bg, $dark-fg, $hover-dark-amt)); + + & ~ .r .annotate.long { + display: block; + } + } + + // Syntax coloring + .com { + color: $light-token-com; + @include color-dark($dark-token-com); + font-style: italic; + line-height: 1px; + } + .key { + font-weight: bold; + line-height: 1px; + } + .str { + color: $light-token-str; + @include color-dark($dark-token-str); + } + } + + &.mis { + .t { + border-left: $border-indicator-width solid $mis-color; + } + + &.show_mis .t { + background: $light-mis-bg; + @include background-dark($dark-mis-bg); + + &:hover { + background: mix($light-mis-bg, $light-fg, $hover-dark-amt); + @include background-dark(mix($dark-mis-bg, $dark-fg, $hover-dark-amt)); + } + } + } + + &.run { + .t { + border-left: $border-indicator-width solid $run-color; + } + + &.show_run .t { + background: $light-run-bg; + @include background-dark($dark-run-bg); + + &:hover { + background: mix($light-run-bg, $light-fg, $hover-dark-amt); + @include background-dark(mix($dark-run-bg, $dark-fg, $hover-dark-amt)); + } + } + } + + &.exc { + .t { + border-left: $border-indicator-width solid $exc-color; + } + + &.show_exc .t { + background: $light-exc-bg; + @include background-dark($dark-exc-bg); + + &:hover { + background: mix($light-exc-bg, $light-fg, $hover-dark-amt); + @include background-dark(mix($dark-exc-bg, $dark-fg, $hover-dark-amt)); + } + } + } + + &.par { + .t { + border-left: $border-indicator-width solid $par-color; + } + + &.show_par .t { + background: $light-par-bg; + @include background-dark($dark-par-bg); + + &:hover { + background: mix($light-par-bg, $light-fg, $hover-dark-amt); + @include background-dark(mix($dark-par-bg, $dark-fg, $hover-dark-amt)); + } + } + + } + + .r { + position: absolute; + top: 0; + right: 2.5em; + font-family: $font-normal; + } + + .annotate { + font-family: $font-normal; + color: $light-gray5; + @include color-dark($dark-gray6); + padding-right: .5em; + + &.short:hover ~ .long { + display: block; + } + + &.long { + @extend %in-text-popup; + width: 30em; + right: 2.5em; + } + } + + input { + display: none; + + & ~ .r label.ctx { + cursor: pointer; + border-radius: .25em; + &::before { + content: "▶ "; + } + &:hover { + background: mix($light-context-bg-color, $light-bg, $off-button-lighten); + @include background-dark(mix($dark-context-bg-color, $dark-bg, $off-button-lighten)); + color: $light-gray5; + @include color-dark($dark-gray5); + } + } + + &:checked ~ .r label.ctx { + background: $light-context-bg-color; + @include background-dark($dark-context-bg-color); + color: $light-gray5; + @include color-dark($dark-gray5); + border-radius: .75em .75em 0 0; + padding: 0 .5em; + margin: -.25em 0; + &::before { + content: "▼ "; + } + } + + &:checked ~ .ctxs { + padding: .25em .5em; + overflow-y: scroll; + max-height: 10.5em; + } + } + + label.ctx { + color: $light-gray4; + @include color-dark($dark-gray4); + display: inline-block; + padding: 0 .5em; + font-size: .8333em; // 10/12 + } + + .ctxs { + display: block; + max-height: 0; + overflow-y: hidden; + transition: all .2s; + padding: 0 .5em; + font-family: $font-normal; + white-space: nowrap; + background: $light-context-bg-color; + @include background-dark($dark-context-bg-color); + border-radius: .25em; + margin-right: 1.75em; + text-align: right; + } + } +} + + +// index styles +#index { + font-family: $font-code; + font-size: 0.875em; + + table.index { + margin-left: -.5em; + } + td, th { + text-align: right; + padding: .25em .5em; + border-bottom: 1px solid $light-gray2; + @include border-color-dark($dark-gray2); + &.name { + text-align: left; + width: auto; + font-family: $font-normal; + min-width: 15em; + } + } + th { + font-family: $font-normal; + font-style: italic; + color: $light-gray6; + @include color-dark($dark-gray6); + cursor: pointer; + &:hover { + background: $light-gray2; + @include background-dark($dark-gray2); + } + .arrows { + color: #666; + font-size: 85%; + font-family: sans-serif; + font-style: normal; + pointer-events: none; + } + &[aria-sort="ascending"], &[aria-sort="descending"] { + white-space: nowrap; + background: $light-gray2; + @include background-dark($dark-gray2); + padding-left: .5em; + } + &[aria-sort="ascending"] .arrows::after { + content: " ▲"; + } + &[aria-sort="descending"] .arrows::after { + content: " ▼"; + } + } + td.name { + font-size: 1.15em; + a { + text-decoration: none; + color: inherit; + } + & .no-noun { + font-style: italic; + } + } + + tr.total td, + tr.total_dynamic td { + font-weight: bold; + border-top: 1px solid #ccc; + border-bottom: none; + } + tr.region:hover { + background: $light-gray2; + @include background-dark($dark-gray2); + td.name { + text-decoration: underline; + color: inherit; + } + } +} + +// scroll marker styles +#scroll_marker { + position: fixed; + z-index: 3; + right: 0; + top: 0; + width: 16px; + height: 100%; + background: $light-bg; + border-left: 1px solid $light-gray2; + @include background-dark($dark-bg); + @include border-color-dark($dark-gray2); + will-change: transform; // for faster scrolling of fixed element in Chrome + + .marker { + background: $light-gray3; + @include background-dark($dark-gray3); + position: absolute; + min-height: 3px; + width: 100%; + } +} diff --git a/.venv/Lib/site-packages/coverage/inorout.py b/.venv/Lib/site-packages/coverage/inorout.py new file mode 100644 index 00000000..75f48dbd --- /dev/null +++ b/.venv/Lib/site-packages/coverage/inorout.py @@ -0,0 +1,594 @@ +# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt + +"""Determining whether files are being measured/reported or not.""" + +from __future__ import annotations + +import importlib.util +import inspect +import itertools +import os +import platform +import re +import sys +import sysconfig +import traceback + +from types import FrameType, ModuleType +from typing import ( + cast, Any, TYPE_CHECKING, +) +from collections.abc import Iterable + +from coverage import env +from coverage.disposition import FileDisposition, disposition_init +from coverage.exceptions import CoverageException, PluginError +from coverage.files import TreeMatcher, GlobMatcher, ModuleMatcher +from coverage.files import prep_patterns, find_python_files, canonical_filename +from coverage.misc import sys_modules_saved +from coverage.python import source_for_file, source_for_morf +from coverage.types import TFileDisposition, TMorf, TWarnFn, TDebugCtl + +if TYPE_CHECKING: + from coverage.config import CoverageConfig + from coverage.plugin_support import Plugins + + +# Pypy has some unusual stuff in the "stdlib". Consider those locations +# when deciding where the stdlib is. These modules are not used for anything, +# they are modules importable from the pypy lib directories, so that we can +# find those directories. +modules_we_happen_to_have: list[ModuleType] = [ + inspect, itertools, os, platform, re, sysconfig, traceback, +] + +if env.PYPY: + try: + import _structseq + modules_we_happen_to_have.append(_structseq) + except ImportError: + pass + + try: + import _pypy_irc_topic + modules_we_happen_to_have.append(_pypy_irc_topic) + except ImportError: + pass + + +def canonical_path(morf: TMorf, directory: bool = False) -> str: + """Return the canonical path of the module or file `morf`. + + If the module is a package, then return its directory. If it is a + module, then return its file, unless `directory` is True, in which + case return its enclosing directory. + + """ + morf_path = canonical_filename(source_for_morf(morf)) + if morf_path.endswith("__init__.py") or directory: + morf_path = os.path.split(morf_path)[0] + return morf_path + + +def name_for_module(filename: str, frame: FrameType | None) -> str: + """Get the name of the module for a filename and frame. + + For configurability's sake, we allow __main__ modules to be matched by + their importable name. + + If loaded via runpy (aka -m), we can usually recover the "original" + full dotted module name, otherwise, we resort to interpreting the + file name to get the module's name. In the case that the module name + can't be determined, None is returned. + + """ + module_globals = frame.f_globals if frame is not None else {} + dunder_name: str = module_globals.get("__name__", None) + + if isinstance(dunder_name, str) and dunder_name != "__main__": + # This is the usual case: an imported module. + return dunder_name + + spec = module_globals.get("__spec__", None) + if spec: + fullname = spec.name + if isinstance(fullname, str) and fullname != "__main__": + # Module loaded via: runpy -m + return fullname + + # Script as first argument to Python command line. + inspectedname = inspect.getmodulename(filename) + if inspectedname is not None: + return inspectedname + else: + return dunder_name + + +def module_is_namespace(mod: ModuleType) -> bool: + """Is the module object `mod` a PEP420 namespace module?""" + return hasattr(mod, "__path__") and getattr(mod, "__file__", None) is None + + +def module_has_file(mod: ModuleType) -> bool: + """Does the module object `mod` have an existing __file__ ?""" + mod__file__ = getattr(mod, "__file__", None) + if mod__file__ is None: + return False + return os.path.exists(mod__file__) + + +def file_and_path_for_module(modulename: str) -> tuple[str | None, list[str]]: + """Find the file and search path for `modulename`. + + Returns: + filename: The filename of the module, or None. + path: A list (possibly empty) of directories to find submodules in. + + """ + filename = None + path = [] + try: + spec = importlib.util.find_spec(modulename) + except Exception: + pass + else: + if spec is not None: + filename = spec.origin + path = list(spec.submodule_search_locations or ()) + return filename, path + + +def add_stdlib_paths(paths: set[str]) -> None: + """Add paths where the stdlib can be found to the set `paths`.""" + # Look at where some standard modules are located. That's the + # indication for "installed with the interpreter". In some + # environments (virtualenv, for example), these modules may be + # spread across a few locations. Look at all the candidate modules + # we've imported, and take all the different ones. + for m in modules_we_happen_to_have: + if hasattr(m, "__file__"): + paths.add(canonical_path(m, directory=True)) + + +def add_third_party_paths(paths: set[str]) -> None: + """Add locations for third-party packages to the set `paths`.""" + # Get the paths that sysconfig knows about. + scheme_names = set(sysconfig.get_scheme_names()) + + for scheme in scheme_names: + # https://foss.heptapod.net/pypy/pypy/-/issues/3433 + better_scheme = "pypy_posix" if scheme == "pypy" else scheme + if os.name in better_scheme.split("_"): + config_paths = sysconfig.get_paths(scheme) + for path_name in ["platlib", "purelib", "scripts"]: + paths.add(config_paths[path_name]) + + +def add_coverage_paths(paths: set[str]) -> None: + """Add paths where coverage.py code can be found to the set `paths`.""" + cover_path = canonical_path(__file__, directory=True) + paths.add(cover_path) + if env.TESTING: + # Don't include our own test code. + paths.add(os.path.join(cover_path, "tests")) + + +class InOrOut: + """Machinery for determining what files to measure.""" + + def __init__( + self, + config: CoverageConfig, + warn: TWarnFn, + debug: TDebugCtl | None, + include_namespace_packages: bool, + ) -> None: + self.warn = warn + self.debug = debug + self.include_namespace_packages = include_namespace_packages + + self.source: list[str] = [] + self.source_pkgs: list[str] = [] + self.source_pkgs.extend(config.source_pkgs) + for src in config.source or []: + if os.path.isdir(src): + self.source.append(canonical_filename(src)) + else: + self.source_pkgs.append(src) + self.source_pkgs_unmatched = self.source_pkgs[:] + + self.include = prep_patterns(config.run_include) + self.omit = prep_patterns(config.run_omit) + + # The directories for files considered "installed with the interpreter". + self.pylib_paths: set[str] = set() + if not config.cover_pylib: + add_stdlib_paths(self.pylib_paths) + + # To avoid tracing the coverage.py code itself, we skip anything + # located where we are. + self.cover_paths: set[str] = set() + add_coverage_paths(self.cover_paths) + + # Find where third-party packages are installed. + self.third_paths: set[str] = set() + add_third_party_paths(self.third_paths) + + def _debug(msg: str) -> None: + if self.debug: + self.debug.write(msg) + + # The matchers for should_trace. + + # Generally useful information + _debug("sys.path:" + "".join(f"\n {p}" for p in sys.path)) + + # Create the matchers we need for should_trace + self.source_match = None + self.source_pkgs_match = None + self.pylib_match = None + self.include_match = self.omit_match = None + + if self.source or self.source_pkgs: + against = [] + if self.source: + self.source_match = TreeMatcher(self.source, "source") + against.append(f"trees {self.source_match!r}") + if self.source_pkgs: + self.source_pkgs_match = ModuleMatcher(self.source_pkgs, "source_pkgs") + against.append(f"modules {self.source_pkgs_match!r}") + _debug("Source matching against " + " and ".join(against)) + else: + if self.pylib_paths: + self.pylib_match = TreeMatcher(self.pylib_paths, "pylib") + _debug(f"Python stdlib matching: {self.pylib_match!r}") + if self.include: + self.include_match = GlobMatcher(self.include, "include") + _debug(f"Include matching: {self.include_match!r}") + if self.omit: + self.omit_match = GlobMatcher(self.omit, "omit") + _debug(f"Omit matching: {self.omit_match!r}") + + self.cover_match = TreeMatcher(self.cover_paths, "coverage") + _debug(f"Coverage code matching: {self.cover_match!r}") + + self.third_match = TreeMatcher(self.third_paths, "third") + _debug(f"Third-party lib matching: {self.third_match!r}") + + # Check if the source we want to measure has been installed as a + # third-party package. + # Is the source inside a third-party area? + self.source_in_third_paths = set() + with sys_modules_saved(): + for pkg in self.source_pkgs: + try: + modfile, path = file_and_path_for_module(pkg) + _debug(f"Imported source package {pkg!r} as {modfile!r}") + except CoverageException as exc: + _debug(f"Couldn't import source package {pkg!r}: {exc}") + continue + if modfile: + if self.third_match.match(modfile): + _debug( + f"Source in third-party: source_pkg {pkg!r} at {modfile!r}", + ) + self.source_in_third_paths.add(canonical_path(source_for_file(modfile))) + else: + for pathdir in path: + if self.third_match.match(pathdir): + _debug( + f"Source in third-party: {pkg!r} path directory at {pathdir!r}", + ) + self.source_in_third_paths.add(pathdir) + + for src in self.source: + if self.third_match.match(src): + _debug(f"Source in third-party: source directory {src!r}") + self.source_in_third_paths.add(src) + self.source_in_third_match = TreeMatcher(self.source_in_third_paths, "source_in_third") + _debug(f"Source in third-party matching: {self.source_in_third_match}") + + self.plugins: Plugins + self.disp_class: type[TFileDisposition] = FileDisposition + + def should_trace(self, filename: str, frame: FrameType | None = None) -> TFileDisposition: + """Decide whether to trace execution in `filename`, with a reason. + + This function is called from the trace function. As each new file name + is encountered, this function determines whether it is traced or not. + + Returns a FileDisposition object. + + """ + original_filename = filename + disp = disposition_init(self.disp_class, filename) + + def nope(disp: TFileDisposition, reason: str) -> TFileDisposition: + """Simple helper to make it easy to return NO.""" + disp.trace = False + disp.reason = reason + return disp + + if original_filename.startswith("<"): + return nope(disp, "original file name is not real") + + if frame is not None: + # Compiled Python files have two file names: frame.f_code.co_filename is + # the file name at the time the .pyc was compiled. The second name is + # __file__, which is where the .pyc was actually loaded from. Since + # .pyc files can be moved after compilation (for example, by being + # installed), we look for __file__ in the frame and prefer it to the + # co_filename value. + dunder_file = frame.f_globals and frame.f_globals.get("__file__") + if dunder_file: + # Danger: __file__ can (rarely?) be of type Path. + filename = source_for_file(str(dunder_file)) + if original_filename and not original_filename.startswith("<"): + orig = os.path.basename(original_filename) + if orig != os.path.basename(filename): + # Files shouldn't be renamed when moved. This happens when + # exec'ing code. If it seems like something is wrong with + # the frame's file name, then just use the original. + filename = original_filename + + if not filename: + # Empty string is pretty useless. + return nope(disp, "empty string isn't a file name") + + if filename.startswith("memory:"): + return nope(disp, "memory isn't traceable") + + if filename.startswith("<"): + # Lots of non-file execution is represented with artificial + # file names like "", "", or + # "". Don't ever trace these executions, since we + # can't do anything with the data later anyway. + return nope(disp, "file name is not real") + + canonical = canonical_filename(filename) + disp.canonical_filename = canonical + + # Try the plugins, see if they have an opinion about the file. + plugin = None + for plugin in self.plugins.file_tracers: + if not plugin._coverage_enabled: + continue + + try: + file_tracer = plugin.file_tracer(canonical) + if file_tracer is not None: + file_tracer._coverage_plugin = plugin + disp.trace = True + disp.file_tracer = file_tracer + if file_tracer.has_dynamic_source_filename(): + disp.has_dynamic_filename = True + else: + disp.source_filename = canonical_filename( + file_tracer.source_filename(), + ) + break + except Exception: + plugin_name = plugin._coverage_plugin_name + tb = traceback.format_exc() + self.warn(f"Disabling plug-in {plugin_name!r} due to an exception:\n{tb}") + plugin._coverage_enabled = False + continue + else: + # No plugin wanted it: it's Python. + disp.trace = True + disp.source_filename = canonical + + if not disp.has_dynamic_filename: + if not disp.source_filename: + raise PluginError( + f"Plugin {plugin!r} didn't set source_filename for '{disp.original_filename}'", + ) + reason = self.check_include_omit_etc(disp.source_filename, frame) + if reason: + nope(disp, reason) + + return disp + + def check_include_omit_etc(self, filename: str, frame: FrameType | None) -> str | None: + """Check a file name against the include, omit, etc, rules. + + Returns a string or None. String means, don't trace, and is the reason + why. None means no reason found to not trace. + + """ + modulename = name_for_module(filename, frame) + + # If the user specified source or include, then that's authoritative + # about the outer bound of what to measure and we don't have to apply + # any canned exclusions. If they didn't, then we have to exclude the + # stdlib and coverage.py directories. + if self.source_match or self.source_pkgs_match: + extra = "" + ok = False + if self.source_pkgs_match: + if self.source_pkgs_match.match(modulename): + ok = True + if modulename in self.source_pkgs_unmatched: + self.source_pkgs_unmatched.remove(modulename) + else: + extra = f"module {modulename!r} " + if not ok and self.source_match: + if self.source_match.match(filename): + ok = True + if not ok: + return extra + "falls outside the --source spec" + if self.third_match.match(filename) and not self.source_in_third_match.match(filename): + return "inside --source, but is third-party" + elif self.include_match: + if not self.include_match.match(filename): + return "falls outside the --include trees" + else: + # We exclude the coverage.py code itself, since a little of it + # will be measured otherwise. + if self.cover_match.match(filename): + return "is part of coverage.py" + + # If we aren't supposed to trace installed code, then check if this + # is near the Python standard library and skip it if so. + if self.pylib_match and self.pylib_match.match(filename): + return "is in the stdlib" + + # Exclude anything in the third-party installation areas. + if self.third_match.match(filename): + return "is a third-party module" + + # Check the file against the omit pattern. + if self.omit_match and self.omit_match.match(filename): + return "is inside an --omit pattern" + + # No point tracing a file we can't later write to SQLite. + try: + filename.encode("utf-8") + except UnicodeEncodeError: + return "non-encodable filename" + + # No reason found to skip this file. + return None + + def warn_conflicting_settings(self) -> None: + """Warn if there are settings that conflict.""" + if self.include: + if self.source or self.source_pkgs: + self.warn("--include is ignored because --source is set", slug="include-ignored") + + def warn_already_imported_files(self) -> None: + """Warn if files have already been imported that we will be measuring.""" + if self.include or self.source or self.source_pkgs: + warned = set() + for mod in list(sys.modules.values()): + filename = getattr(mod, "__file__", None) + if filename is None: + continue + if filename in warned: + continue + + if len(getattr(mod, "__path__", ())) > 1: + # A namespace package, which confuses this code, so ignore it. + continue + + disp = self.should_trace(filename) + if disp.has_dynamic_filename: + # A plugin with dynamic filenames: the Python file + # shouldn't cause a warning, since it won't be the subject + # of tracing anyway. + continue + if disp.trace: + msg = f"Already imported a file that will be measured: {filename}" + self.warn(msg, slug="already-imported") + warned.add(filename) + elif self.debug and self.debug.should("trace"): + self.debug.write( + "Didn't trace already imported file {!r}: {}".format( + disp.original_filename, disp.reason, + ), + ) + + def warn_unimported_source(self) -> None: + """Warn about source packages that were of interest, but never traced.""" + for pkg in self.source_pkgs_unmatched: + self._warn_about_unmeasured_code(pkg) + + def _warn_about_unmeasured_code(self, pkg: str) -> None: + """Warn about a package or module that we never traced. + + `pkg` is a string, the name of the package or module. + + """ + mod = sys.modules.get(pkg) + if mod is None: + self.warn(f"Module {pkg} was never imported.", slug="module-not-imported") + return + + if module_is_namespace(mod): + # A namespace package. It's OK for this not to have been traced, + # since there is no code directly in it. + return + + if not module_has_file(mod): + self.warn(f"Module {pkg} has no Python source.", slug="module-not-python") + return + + # The module was in sys.modules, and seems like a module with code, but + # we never measured it. I guess that means it was imported before + # coverage even started. + msg = f"Module {pkg} was previously imported, but not measured" + self.warn(msg, slug="module-not-measured") + + def find_possibly_unexecuted_files(self) -> Iterable[tuple[str, str | None]]: + """Find files in the areas of interest that might be untraced. + + Yields pairs: file path, and responsible plug-in name. + """ + for pkg in self.source_pkgs: + if (pkg not in sys.modules or + not module_has_file(sys.modules[pkg])): + continue + pkg_file = source_for_file(cast(str, sys.modules[pkg].__file__)) + yield from self._find_executable_files(canonical_path(pkg_file)) + + for src in self.source: + yield from self._find_executable_files(src) + + def _find_plugin_files(self, src_dir: str) -> Iterable[tuple[str, str]]: + """Get executable files from the plugins.""" + for plugin in self.plugins.file_tracers: + for x_file in plugin.find_executable_files(src_dir): + yield x_file, plugin._coverage_plugin_name + + def _find_executable_files(self, src_dir: str) -> Iterable[tuple[str, str | None]]: + """Find executable files in `src_dir`. + + Search for files in `src_dir` that can be executed because they + are probably importable. Don't include ones that have been omitted + by the configuration. + + Yield the file path, and the plugin name that handles the file. + + """ + py_files = ( + (py_file, None) for py_file in + find_python_files(src_dir, self.include_namespace_packages) + ) + plugin_files = self._find_plugin_files(src_dir) + + for file_path, plugin_name in itertools.chain(py_files, plugin_files): + file_path = canonical_filename(file_path) + if self.omit_match and self.omit_match.match(file_path): + # Turns out this file was omitted, so don't pull it back + # in as un-executed. + continue + yield file_path, plugin_name + + def sys_info(self) -> Iterable[tuple[str, Any]]: + """Our information for Coverage.sys_info. + + Returns a list of (key, value) pairs. + """ + info = [ + ("coverage_paths", self.cover_paths), + ("stdlib_paths", self.pylib_paths), + ("third_party_paths", self.third_paths), + ("source_in_third_party_paths", self.source_in_third_paths), + ] + + matcher_names = [ + "source_match", "source_pkgs_match", + "include_match", "omit_match", + "cover_match", "pylib_match", "third_match", "source_in_third_match", + ] + + for matcher_name in matcher_names: + matcher = getattr(self, matcher_name) + if matcher: + matcher_info = matcher.info() + else: + matcher_info = "-none-" + info.append((matcher_name, matcher_info)) + + return info diff --git a/.venv/Lib/site-packages/coverage/jsonreport.py b/.venv/Lib/site-packages/coverage/jsonreport.py new file mode 100644 index 00000000..00053ebf --- /dev/null +++ b/.venv/Lib/site-packages/coverage/jsonreport.py @@ -0,0 +1,179 @@ +# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt + +"""Json reporting for coverage.py""" + +from __future__ import annotations + +import datetime +import json +import sys + +from collections.abc import Iterable +from typing import Any, IO, TYPE_CHECKING + +from coverage import __version__ +from coverage.report_core import get_analysis_to_report +from coverage.results import Analysis, Numbers +from coverage.types import TMorf, TLineNo + +if TYPE_CHECKING: + from coverage import Coverage + from coverage.data import CoverageData + from coverage.plugin import FileReporter + + +# A type for data that can be JSON-serialized. +JsonObj = dict[str, Any] + +# "Version 1" had no format number at all. +# 2: add the meta.format field. +# 3: add region information (functions, classes) +FORMAT_VERSION = 3 + +class JsonReporter: + """A reporter for writing JSON coverage results.""" + + report_type = "JSON report" + + def __init__(self, coverage: Coverage) -> None: + self.coverage = coverage + self.config = self.coverage.config + self.total = Numbers(self.config.precision) + self.report_data: JsonObj = {} + + def make_summary(self, nums: Numbers) -> JsonObj: + """Create a dict summarizing `nums`.""" + return { + "covered_lines": nums.n_executed, + "num_statements": nums.n_statements, + "percent_covered": nums.pc_covered, + "percent_covered_display": nums.pc_covered_str, + "missing_lines": nums.n_missing, + "excluded_lines": nums.n_excluded, + } + + def make_branch_summary(self, nums: Numbers) -> JsonObj: + """Create a dict summarizing the branch info in `nums`.""" + return { + "num_branches": nums.n_branches, + "num_partial_branches": nums.n_partial_branches, + "covered_branches": nums.n_executed_branches, + "missing_branches": nums.n_missing_branches, + } + + def report(self, morfs: Iterable[TMorf] | None, outfile: IO[str]) -> float: + """Generate a json report for `morfs`. + + `morfs` is a list of modules or file names. + + `outfile` is a file object to write the json to. + + """ + outfile = outfile or sys.stdout + coverage_data = self.coverage.get_data() + coverage_data.set_query_contexts(self.config.report_contexts) + self.report_data["meta"] = { + "format": FORMAT_VERSION, + "version": __version__, + "timestamp": datetime.datetime.now().isoformat(), + "branch_coverage": coverage_data.has_arcs(), + "show_contexts": self.config.json_show_contexts, + } + + measured_files = {} + for file_reporter, analysis in get_analysis_to_report(self.coverage, morfs): + measured_files[file_reporter.relative_filename()] = self.report_one_file( + coverage_data, + analysis, + file_reporter, + ) + + self.report_data["files"] = measured_files + self.report_data["totals"] = self.make_summary(self.total) + + if coverage_data.has_arcs(): + self.report_data["totals"].update(self.make_branch_summary(self.total)) + + json.dump( + self.report_data, + outfile, + indent=(4 if self.config.json_pretty_print else None), + ) + + return self.total.n_statements and self.total.pc_covered + + def report_one_file( + self, coverage_data: CoverageData, analysis: Analysis, file_reporter: FileReporter + ) -> JsonObj: + """Extract the relevant report data for a single file.""" + nums = analysis.numbers + self.total += nums + summary = self.make_summary(nums) + reported_file: JsonObj = { + "executed_lines": sorted(analysis.executed), + "summary": summary, + "missing_lines": sorted(analysis.missing), + "excluded_lines": sorted(analysis.excluded), + } + if self.config.json_show_contexts: + reported_file["contexts"] = coverage_data.contexts_by_lineno(analysis.filename) + if coverage_data.has_arcs(): + summary.update(self.make_branch_summary(nums)) + reported_file["executed_branches"] = list( + _convert_branch_arcs(analysis.executed_branch_arcs()), + ) + reported_file["missing_branches"] = list( + _convert_branch_arcs(analysis.missing_branch_arcs()), + ) + + num_lines = len(file_reporter.source().splitlines()) + for noun, plural in file_reporter.code_region_kinds(): + reported_file[plural] = region_data = {} + outside_lines = set(range(1, num_lines + 1)) + for region in file_reporter.code_regions(): + if region.kind != noun: + continue + outside_lines -= region.lines + region_data[region.name] = self.make_region_data( + coverage_data, + analysis.narrow(region.lines), + ) + + region_data[""] = self.make_region_data( + coverage_data, + analysis.narrow(outside_lines), + ) + return reported_file + + def make_region_data(self, coverage_data: CoverageData, narrowed_analysis: Analysis) -> JsonObj: + """Create the data object for one region of a file.""" + narrowed_nums = narrowed_analysis.numbers + narrowed_summary = self.make_summary(narrowed_nums) + this_region = { + "executed_lines": sorted(narrowed_analysis.executed), + "summary": narrowed_summary, + "missing_lines": sorted(narrowed_analysis.missing), + "excluded_lines": sorted(narrowed_analysis.excluded), + } + if self.config.json_show_contexts: + contexts = coverage_data.contexts_by_lineno(narrowed_analysis.filename) + this_region["contexts"] = contexts + if coverage_data.has_arcs(): + narrowed_summary.update(self.make_branch_summary(narrowed_nums)) + this_region["executed_branches"] = list( + _convert_branch_arcs(narrowed_analysis.executed_branch_arcs()), + ) + this_region["missing_branches"] = list( + _convert_branch_arcs(narrowed_analysis.missing_branch_arcs()), + ) + return this_region + + +def _convert_branch_arcs( + branch_arcs: dict[TLineNo, list[TLineNo]], +) -> Iterable[tuple[TLineNo, TLineNo]]: + """Convert branch arcs to a list of two-element tuples.""" + for source, targets in branch_arcs.items(): + for target in targets: + yield source, target diff --git a/.venv/Lib/site-packages/coverage/lcovreport.py b/.venv/Lib/site-packages/coverage/lcovreport.py new file mode 100644 index 00000000..70507c00 --- /dev/null +++ b/.venv/Lib/site-packages/coverage/lcovreport.py @@ -0,0 +1,223 @@ +# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt + +"""LCOV reporting for coverage.py.""" + +from __future__ import annotations + +import base64 +import hashlib +import sys + +from typing import IO, TYPE_CHECKING +from collections.abc import Iterable + +from coverage.plugin import FileReporter +from coverage.report_core import get_analysis_to_report +from coverage.results import Analysis, Numbers +from coverage.types import TMorf + +if TYPE_CHECKING: + from coverage import Coverage + + +def line_hash(line: str) -> str: + """Produce a hash of a source line for use in the LCOV file.""" + # The LCOV file format optionally allows each line to be MD5ed as a + # fingerprint of the file. This is not a security use. Some security + # scanners raise alarms about the use of MD5 here, but it is a false + # positive. This is not a security concern. + # The unusual encoding of the MD5 hash, as a base64 sequence with the + # trailing = signs stripped, is specified by the LCOV file format. + hashed = hashlib.md5(line.encode("utf-8"), usedforsecurity=False).digest() + return base64.b64encode(hashed).decode("ascii").rstrip("=") + + +def lcov_lines( + analysis: Analysis, + lines: list[int], + source_lines: list[str], + outfile: IO[str], +) -> None: + """Emit line coverage records for an analyzed file.""" + hash_suffix = "" + for line in lines: + if source_lines: + hash_suffix = "," + line_hash(source_lines[line-1]) + # Q: can we get info about the number of times a statement is + # executed? If so, that should be recorded here. + hit = int(line not in analysis.missing) + outfile.write(f"DA:{line},{hit}{hash_suffix}\n") + + if analysis.numbers.n_statements > 0: + outfile.write(f"LF:{analysis.numbers.n_statements}\n") + outfile.write(f"LH:{analysis.numbers.n_executed}\n") + + +def lcov_functions( + fr: FileReporter, + file_analysis: Analysis, + outfile: IO[str], +) -> None: + """Emit function coverage records for an analyzed file.""" + # lcov 2.2 introduces a new format for function coverage records. + # We continue to generate the old format because we don't know what + # version of the lcov tools will be used to read this report. + + # "and region.lines" below avoids a crash due to a bug in PyPy 3.8 + # where, for whatever reason, when collecting data in --branch mode, + # top-level functions have an empty lines array. Instead we just don't + # emit function records for those. + + # suppressions because of https://github.com/pylint-dev/pylint/issues/9923 + functions = [ + (min(region.start, min(region.lines)), #pylint: disable=nested-min-max + max(region.start, max(region.lines)), #pylint: disable=nested-min-max + region) + for region in fr.code_regions() + if region.kind == "function" and region.lines + ] + if not functions: + return + + functions.sort() + functions_hit = 0 + for first_line, last_line, region in functions: + # A function counts as having been executed if any of it has been + # executed. + analysis = file_analysis.narrow(region.lines) + hit = int(analysis.numbers.n_executed > 0) + functions_hit += hit + + outfile.write(f"FN:{first_line},{last_line},{region.name}\n") + outfile.write(f"FNDA:{hit},{region.name}\n") + + outfile.write(f"FNF:{len(functions)}\n") + outfile.write(f"FNH:{functions_hit}\n") + + +def lcov_arcs( + fr: FileReporter, + analysis: Analysis, + lines: list[int], + outfile: IO[str], +) -> None: + """Emit branch coverage records for an analyzed file.""" + branch_stats = analysis.branch_stats() + executed_arcs = analysis.executed_branch_arcs() + missing_arcs = analysis.missing_branch_arcs() + + for line in lines: + if line not in branch_stats: + continue + + # This is only one of several possible ways to map our sets of executed + # and not-executed arcs to BRDA codes. It seems to produce reasonable + # results when fed through genhtml. + _, taken = branch_stats[line] + + if taken == 0: + # When _none_ of the out arcs from 'line' were executed, + # this probably means 'line' was never executed at all. + # Cross-check with the line stats. + assert len(executed_arcs[line]) == 0 + assert line in analysis.missing + destinations = [ + (dst, "-") for dst in missing_arcs[line] + ] + else: + # Q: can we get counts of the number of times each arc was executed? + # branch_stats has "total" and "taken" counts for each branch, + # but it doesn't have "taken" broken down by destination. + destinations = [ + (dst, "1") for dst in executed_arcs[line] + ] + destinations.extend( + (dst, "0") for dst in missing_arcs[line] + ) + + # Sort exit arcs after normal arcs. Exit arcs typically come from + # an if statement, at the end of a function, with no else clause. + # This structure reads like you're jumping to the end of the function + # when the conditional expression is false, so it should be presented + # as the second alternative for the branch, after the alternative that + # enters the if clause. + destinations.sort(key=lambda d: (d[0] < 0, d)) + + for dst, hit in destinations: + branch = fr.arc_description(line, dst) + outfile.write(f"BRDA:{line},0,{branch},{hit}\n") + + # Summary of the branch coverage. + brf = sum(t for t, k in branch_stats.values()) + brh = brf - sum(t - k for t, k in branch_stats.values()) + if brf > 0: + outfile.write(f"BRF:{brf}\n") + outfile.write(f"BRH:{brh}\n") + + +class LcovReporter: + """A reporter for writing LCOV coverage reports.""" + + report_type = "LCOV report" + + def __init__(self, coverage: Coverage) -> None: + self.coverage = coverage + self.config = coverage.config + self.total = Numbers(self.coverage.config.precision) + + def report(self, morfs: Iterable[TMorf] | None, outfile: IO[str]) -> float: + """Renders the full lcov report. + + `morfs` is a list of modules or filenames + + outfile is the file object to write the file into. + """ + + self.coverage.get_data() + outfile = outfile or sys.stdout + + # ensure file records are sorted by the _relative_ filename, not the full path + to_report = [ + (fr.relative_filename(), fr, analysis) + for fr, analysis in get_analysis_to_report(self.coverage, morfs) + ] + to_report.sort() + + for fname, fr, analysis in to_report: + self.total += analysis.numbers + self.lcov_file(fname, fr, analysis, outfile) + + return self.total.n_statements and self.total.pc_covered + + def lcov_file( + self, + rel_fname: str, + fr: FileReporter, + analysis: Analysis, + outfile: IO[str], + ) -> None: + """Produces the lcov data for a single file. + + This currently supports both line and branch coverage, + however function coverage is not supported. + """ + + if analysis.numbers.n_statements == 0: + if self.config.skip_empty: + return + + outfile.write(f"SF:{rel_fname}\n") + + lines = sorted(analysis.statements) + if self.config.lcov_line_checksums: + source_lines = fr.source().splitlines() + else: + source_lines = [] + + lcov_lines(analysis, lines, source_lines, outfile) + lcov_functions(fr, analysis, outfile) + if analysis.has_arcs: + lcov_arcs(fr, analysis, lines, outfile) + + outfile.write("end_of_record\n") diff --git a/.venv/Lib/site-packages/coverage/misc.py b/.venv/Lib/site-packages/coverage/misc.py new file mode 100644 index 00000000..c5ce7f4a --- /dev/null +++ b/.venv/Lib/site-packages/coverage/misc.py @@ -0,0 +1,369 @@ +# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt + +"""Miscellaneous stuff for coverage.py.""" + +from __future__ import annotations + +import contextlib +import datetime +import errno +import functools +import hashlib +import importlib +import importlib.util +import inspect +import os +import os.path +import re +import sys +import types + +from types import ModuleType +from typing import ( + Any, NoReturn, TypeVar, +) +from collections.abc import Iterable, Iterator, Mapping, Sequence + +from coverage.exceptions import CoverageException +from coverage.types import TArc + +# In 6.0, the exceptions moved from misc.py to exceptions.py. But a number of +# other packages were importing the exceptions from misc, so import them here. +# pylint: disable=unused-wildcard-import +from coverage.exceptions import * # pylint: disable=wildcard-import + +ISOLATED_MODULES: dict[ModuleType, ModuleType] = {} + + +def isolate_module(mod: ModuleType) -> ModuleType: + """Copy a module so that we are isolated from aggressive mocking. + + If a test suite mocks os.path.exists (for example), and then we need to use + it during the test, everything will get tangled up if we use their mock. + Making a copy of the module when we import it will isolate coverage.py from + those complications. + """ + if mod not in ISOLATED_MODULES: + new_mod = types.ModuleType(mod.__name__) + ISOLATED_MODULES[mod] = new_mod + for name in dir(mod): + value = getattr(mod, name) + if isinstance(value, types.ModuleType): + value = isolate_module(value) + setattr(new_mod, name, value) + return ISOLATED_MODULES[mod] + +os = isolate_module(os) + + +class SysModuleSaver: + """Saves the contents of sys.modules, and removes new modules later.""" + def __init__(self) -> None: + self.old_modules = set(sys.modules) + + def restore(self) -> None: + """Remove any modules imported since this object started.""" + new_modules = set(sys.modules) - self.old_modules + for m in new_modules: + del sys.modules[m] + + +@contextlib.contextmanager +def sys_modules_saved() -> Iterator[None]: + """A context manager to remove any modules imported during a block.""" + saver = SysModuleSaver() + try: + yield + finally: + saver.restore() + + +def import_third_party(modname: str) -> tuple[ModuleType, bool]: + """Import a third-party module we need, but might not be installed. + + This also cleans out the module after the import, so that coverage won't + appear to have imported it. This lets the third party use coverage for + their own tests. + + Arguments: + modname (str): the name of the module to import. + + Returns: + The imported module, and a boolean indicating if the module could be imported. + + If the boolean is False, the module returned is not the one you want: don't use it. + + """ + with sys_modules_saved(): + try: + return importlib.import_module(modname), True + except ImportError: + return sys, False + + +def nice_pair(pair: TArc) -> str: + """Make a nice string representation of a pair of numbers. + + If the numbers are equal, just return the number, otherwise return the pair + with a dash between them, indicating the range. + + """ + start, end = pair + if start == end: + return "%d" % start + else: + return "%d-%d" % (start, end) + + +def bool_or_none(b: Any) -> bool | None: + """Return bool(b), but preserve None.""" + if b is None: + return None + else: + return bool(b) + + +def join_regex(regexes: Iterable[str]) -> str: + """Combine a series of regex strings into one that matches any of them.""" + regexes = list(regexes) + if len(regexes) == 1: + return regexes[0] + else: + return "|".join(f"(?:{r})" for r in regexes) + + +def file_be_gone(path: str) -> None: + """Remove a file, and don't get annoyed if it doesn't exist.""" + try: + os.remove(path) + except OSError as e: + if e.errno != errno.ENOENT: + raise + + +def ensure_dir(directory: str) -> None: + """Make sure the directory exists. + + If `directory` is None or empty, do nothing. + """ + if directory: + os.makedirs(directory, exist_ok=True) + + +def ensure_dir_for_file(path: str) -> None: + """Make sure the directory for the path exists.""" + ensure_dir(os.path.dirname(path)) + + +class Hasher: + """Hashes Python data for fingerprinting.""" + def __init__(self) -> None: + self.hash = hashlib.new("sha3_256", usedforsecurity=False) + + def update(self, v: Any) -> None: + """Add `v` to the hash, recursively if needed.""" + self.hash.update(str(type(v)).encode("utf-8")) + if isinstance(v, str): + self.hash.update(v.encode("utf-8")) + elif isinstance(v, bytes): + self.hash.update(v) + elif v is None: + pass + elif isinstance(v, (int, float)): + self.hash.update(str(v).encode("utf-8")) + elif isinstance(v, (tuple, list)): + for e in v: + self.update(e) + elif isinstance(v, dict): + keys = v.keys() + for k in sorted(keys): + self.update(k) + self.update(v[k]) + else: + for k in dir(v): + if k.startswith("__"): + continue + a = getattr(v, k) + if inspect.isroutine(a): + continue + self.update(k) + self.update(a) + self.hash.update(b".") + + def hexdigest(self) -> str: + """Retrieve the hex digest of the hash.""" + return self.hash.hexdigest()[:32] + + +def _needs_to_implement(that: Any, func_name: str) -> NoReturn: + """Helper to raise NotImplementedError in interface stubs.""" + if hasattr(that, "_coverage_plugin_name"): + thing = "Plugin" + name = that._coverage_plugin_name + else: + thing = "Class" + klass = that.__class__ + name = f"{klass.__module__}.{klass.__name__}" + + raise NotImplementedError( + f"{thing} {name!r} needs to implement {func_name}()", + ) + + +class DefaultValue: + """A sentinel object to use for unusual default-value needs. + + Construct with a string that will be used as the repr, for display in help + and Sphinx output. + + """ + def __init__(self, display_as: str) -> None: + self.display_as = display_as + + def __repr__(self) -> str: + return self.display_as + + +def substitute_variables(text: str, variables: Mapping[str, str]) -> str: + """Substitute ``${VAR}`` variables in `text` with their values. + + Variables in the text can take a number of shell-inspired forms:: + + $VAR + ${VAR} + ${VAR?} strict: an error if VAR isn't defined. + ${VAR-missing} defaulted: "missing" if VAR isn't defined. + $$ just a dollar sign. + + `variables` is a dictionary of variable values. + + Returns the resulting text with values substituted. + + """ + dollar_pattern = r"""(?x) # Use extended regex syntax + \$ # A dollar sign, + (?: # then + (?P\$) | # a dollar sign, or + (?P\w+) | # a plain word, or + { # a {-wrapped + (?P\w+) # word, + (?: + (?P\?) | # with a strict marker + -(?P[^}]*) # or a default value + )? # maybe. + } + ) + """ + + dollar_groups = ("dollar", "word1", "word2") + + def dollar_replace(match: re.Match[str]) -> str: + """Called for each $replacement.""" + # Only one of the dollar_groups will have matched, just get its text. + word = next(g for g in match.group(*dollar_groups) if g) # pragma: always breaks + if word == "$": + return "$" + elif word in variables: + return variables[word] + elif match["strict"]: + msg = f"Variable {word} is undefined: {text!r}" + raise CoverageException(msg) + else: + return match["defval"] + + text = re.sub(dollar_pattern, dollar_replace, text) + return text + + +def format_local_datetime(dt: datetime.datetime) -> str: + """Return a string with local timezone representing the date. + """ + return dt.astimezone().strftime("%Y-%m-%d %H:%M %z") + + +def import_local_file(modname: str, modfile: str | None = None) -> ModuleType: + """Import a local file as a module. + + Opens a file in the current directory named `modname`.py, imports it + as `modname`, and returns the module object. `modfile` is the file to + import if it isn't in the current directory. + + """ + if modfile is None: + modfile = modname + ".py" + spec = importlib.util.spec_from_file_location(modname, modfile) + assert spec is not None + mod = importlib.util.module_from_spec(spec) + sys.modules[modname] = mod + assert spec.loader is not None + spec.loader.exec_module(mod) + + return mod + + +@functools.cache +def _human_key(s: str) -> tuple[list[str | int], str]: + """Turn a string into a list of string and number chunks. + + "z23a" -> (["z", 23, "a"], "z23a") + + The original string is appended as a last value to ensure the + key is unique enough so that "x1y" and "x001y" can be distinguished. + """ + def tryint(s: str) -> str | int: + """If `s` is a number, return an int, else `s` unchanged.""" + try: + return int(s) + except ValueError: + return s + + return ([tryint(c) for c in re.split(r"(\d+)", s)], s) + +def human_sorted(strings: Iterable[str]) -> list[str]: + """Sort the given iterable of strings the way that humans expect. + + Numeric components in the strings are sorted as numbers. + + Returns the sorted list. + + """ + return sorted(strings, key=_human_key) + +SortableItem = TypeVar("SortableItem", bound=Sequence[Any]) + +def human_sorted_items( + items: Iterable[SortableItem], + reverse: bool = False, +) -> list[SortableItem]: + """Sort (string, ...) items the way humans expect. + + The elements of `items` can be any tuple/list. They'll be sorted by the + first element (a string), with ties broken by the remaining elements. + + Returns the sorted list of items. + """ + return sorted(items, key=lambda item: (_human_key(item[0]), *item[1:]), reverse=reverse) + + +def plural(n: int, thing: str = "", things: str = "") -> str: + """Pluralize a word. + + If n is 1, return thing. Otherwise return things, or thing+s. + """ + if n == 1: + return thing + else: + return things or (thing + "s") + + +def stdout_link(text: str, url: str) -> str: + """Format text+url as a clickable link for stdout. + + If attached to a terminal, use escape sequences. Otherwise, just return + the text. + """ + if hasattr(sys.stdout, "isatty") and sys.stdout.isatty(): + return f"\033]8;;{url}\a{text}\033]8;;\a" + else: + return text diff --git a/.venv/Lib/site-packages/coverage/multiproc.py b/.venv/Lib/site-packages/coverage/multiproc.py new file mode 100644 index 00000000..6d5a8273 --- /dev/null +++ b/.venv/Lib/site-packages/coverage/multiproc.py @@ -0,0 +1,115 @@ +# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt + +"""Monkey-patching to add multiprocessing support for coverage.py""" + +from __future__ import annotations + +import multiprocessing +import multiprocessing.process +import os +import os.path +import sys +import traceback + +from typing import Any + +from coverage.debug import DebugControl + +# An attribute that will be set on the module to indicate that it has been +# monkey-patched. +PATCHED_MARKER = "_coverage$patched" + + +OriginalProcess = multiprocessing.process.BaseProcess +original_bootstrap = OriginalProcess._bootstrap # type: ignore[attr-defined] + +class ProcessWithCoverage(OriginalProcess): # pylint: disable=abstract-method + """A replacement for multiprocess.Process that starts coverage.""" + + def _bootstrap(self, *args, **kwargs): # type: ignore[no-untyped-def] + """Wrapper around _bootstrap to start coverage.""" + debug: DebugControl | None = None + try: + from coverage import Coverage # avoid circular import + cov = Coverage(data_suffix=True, auto_data=True) + cov._warn_preimported_source = False + cov.start() + _debug = cov._debug + assert _debug is not None + if _debug.should("multiproc"): + debug = _debug + if debug: + debug.write("Calling multiprocessing bootstrap") + except Exception: + print("Exception during multiprocessing bootstrap init:", file=sys.stderr) + traceback.print_exc(file=sys.stderr) + sys.stderr.flush() + raise + try: + return original_bootstrap(self, *args, **kwargs) + finally: + if debug: + debug.write("Finished multiprocessing bootstrap") + try: + cov.stop() + cov.save() + except Exception as exc: + if debug: + debug.write("Exception during multiprocessing bootstrap cleanup", exc=exc) + raise + if debug: + debug.write("Saved multiprocessing data") + +class Stowaway: + """An object to pickle, so when it is unpickled, it can apply the monkey-patch.""" + def __init__(self, rcfile: str) -> None: + self.rcfile = rcfile + + def __getstate__(self) -> dict[str, str]: + return {"rcfile": self.rcfile} + + def __setstate__(self, state: dict[str, str]) -> None: + patch_multiprocessing(state["rcfile"]) + + +def patch_multiprocessing(rcfile: str) -> None: + """Monkey-patch the multiprocessing module. + + This enables coverage measurement of processes started by multiprocessing. + This involves aggressive monkey-patching. + + `rcfile` is the path to the rcfile being used. + + """ + + if hasattr(multiprocessing, PATCHED_MARKER): + return + + OriginalProcess._bootstrap = ProcessWithCoverage._bootstrap # type: ignore[attr-defined] + + # Set the value in ProcessWithCoverage that will be pickled into the child + # process. + os.environ["COVERAGE_RCFILE"] = os.path.abspath(rcfile) + + # When spawning processes rather than forking them, we have no state in the + # new process. We sneak in there with a Stowaway: we stuff one of our own + # objects into the data that gets pickled and sent to the sub-process. When + # the Stowaway is unpickled, its __setstate__ method is called, which + # re-applies the monkey-patch. + # Windows only spawns, so this is needed to keep Windows working. + try: + from multiprocessing import spawn + original_get_preparation_data = spawn.get_preparation_data + except (ImportError, AttributeError): + pass + else: + def get_preparation_data_with_stowaway(name: str) -> dict[str, Any]: + """Get the original preparation data, and also insert our stowaway.""" + d = original_get_preparation_data(name) + d["stowaway"] = Stowaway(rcfile) + return d + + spawn.get_preparation_data = get_preparation_data_with_stowaway + + setattr(multiprocessing, PATCHED_MARKER, True) diff --git a/.venv/Lib/site-packages/coverage/numbits.py b/.venv/Lib/site-packages/coverage/numbits.py new file mode 100644 index 00000000..0975a098 --- /dev/null +++ b/.venv/Lib/site-packages/coverage/numbits.py @@ -0,0 +1,147 @@ +# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt + +""" +Functions to manipulate packed binary representations of number sets. + +To save space, coverage stores sets of line numbers in SQLite using a packed +binary representation called a numbits. A numbits is a set of positive +integers. + +A numbits is stored as a blob in the database. The exact meaning of the bytes +in the blobs should be considered an implementation detail that might change in +the future. Use these functions to work with those binary blobs of data. + +""" + +from __future__ import annotations + +import json +import sqlite3 + +from itertools import zip_longest +from collections.abc import Iterable + + +def nums_to_numbits(nums: Iterable[int]) -> bytes: + """Convert `nums` into a numbits. + + Arguments: + nums: a reusable iterable of integers, the line numbers to store. + + Returns: + A binary blob. + """ + try: + nbytes = max(nums) // 8 + 1 + except ValueError: + # nums was empty. + return b"" + b = bytearray(nbytes) + for num in nums: + b[num//8] |= 1 << num % 8 + return bytes(b) + + +def numbits_to_nums(numbits: bytes) -> list[int]: + """Convert a numbits into a list of numbers. + + Arguments: + numbits: a binary blob, the packed number set. + + Returns: + A list of ints. + + When registered as a SQLite function by :func:`register_sqlite_functions`, + this returns a string, a JSON-encoded list of ints. + + """ + nums = [] + for byte_i, byte in enumerate(numbits): + for bit_i in range(8): + if (byte & (1 << bit_i)): + nums.append(byte_i * 8 + bit_i) + return nums + + +def numbits_union(numbits1: bytes, numbits2: bytes) -> bytes: + """Compute the union of two numbits. + + Returns: + A new numbits, the union of `numbits1` and `numbits2`. + """ + byte_pairs = zip_longest(numbits1, numbits2, fillvalue=0) + return bytes(b1 | b2 for b1, b2 in byte_pairs) + + +def numbits_intersection(numbits1: bytes, numbits2: bytes) -> bytes: + """Compute the intersection of two numbits. + + Returns: + A new numbits, the intersection `numbits1` and `numbits2`. + """ + byte_pairs = zip_longest(numbits1, numbits2, fillvalue=0) + intersection_bytes = bytes(b1 & b2 for b1, b2 in byte_pairs) + return intersection_bytes.rstrip(b"\0") + + +def numbits_any_intersection(numbits1: bytes, numbits2: bytes) -> bool: + """Is there any number that appears in both numbits? + + Determine whether two number sets have a non-empty intersection. This is + faster than computing the intersection. + + Returns: + A bool, True if there is any number in both `numbits1` and `numbits2`. + """ + byte_pairs = zip_longest(numbits1, numbits2, fillvalue=0) + return any(b1 & b2 for b1, b2 in byte_pairs) + + +def num_in_numbits(num: int, numbits: bytes) -> bool: + """Does the integer `num` appear in `numbits`? + + Returns: + A bool, True if `num` is a member of `numbits`. + """ + nbyte, nbit = divmod(num, 8) + if nbyte >= len(numbits): + return False + return bool(numbits[nbyte] & (1 << nbit)) + + +def register_sqlite_functions(connection: sqlite3.Connection) -> None: + """ + Define numbits functions in a SQLite connection. + + This defines these functions for use in SQLite statements: + + * :func:`numbits_union` + * :func:`numbits_intersection` + * :func:`numbits_any_intersection` + * :func:`num_in_numbits` + * :func:`numbits_to_nums` + + `connection` is a :class:`sqlite3.Connection ` + object. After creating the connection, pass it to this function to + register the numbits functions. Then you can use numbits functions in your + queries:: + + import sqlite3 + from coverage.numbits import register_sqlite_functions + + conn = sqlite3.connect("example.db") + register_sqlite_functions(conn) + c = conn.cursor() + # Kind of a nonsense query: + # Find all the files and contexts that executed line 47 in any file: + c.execute( + "select file_id, context_id from line_bits where num_in_numbits(?, numbits)", + (47,) + ) + """ + connection.create_function("numbits_union", 2, numbits_union) + connection.create_function("numbits_intersection", 2, numbits_intersection) + connection.create_function("numbits_any_intersection", 2, numbits_any_intersection) + connection.create_function("num_in_numbits", 2, num_in_numbits) + connection.create_function("numbits_to_nums", 1, lambda b: json.dumps(numbits_to_nums(b))) diff --git a/.venv/Lib/site-packages/coverage/parser.py b/.venv/Lib/site-packages/coverage/parser.py new file mode 100644 index 00000000..c68fb4ea --- /dev/null +++ b/.venv/Lib/site-packages/coverage/parser.py @@ -0,0 +1,1287 @@ +# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt + +"""Code parsing for coverage.py.""" + +from __future__ import annotations + +import ast +import functools +import collections +import os +import re +import sys +import token +import tokenize + +from collections.abc import Iterable, Sequence +from dataclasses import dataclass +from types import CodeType +from typing import cast, Callable, Optional, Protocol + +from coverage import env +from coverage.bytecode import code_objects +from coverage.debug import short_stack +from coverage.exceptions import NoSource, NotPython +from coverage.misc import nice_pair +from coverage.phystokens import generate_tokens +from coverage.types import TArc, TLineNo + + +class PythonParser: + """Parse code to find executable lines, excluded lines, etc. + + This information is all based on static analysis: no code execution is + involved. + + """ + def __init__( + self, + text: str | None = None, + filename: str | None = None, + exclude: str | None = None, + ) -> None: + """ + Source can be provided as `text`, the text itself, or `filename`, from + which the text will be read. Excluded lines are those that match + `exclude`, a regex string. + + """ + assert text or filename, "PythonParser needs either text or filename" + self.filename = filename or "" + if text is not None: + self.text: str = text + else: + from coverage.python import get_python_source + try: + self.text = get_python_source(self.filename) + except OSError as err: + raise NoSource(f"No source for code: '{self.filename}': {err}") from err + + self.exclude = exclude + + # The parsed AST of the text. + self._ast_root: ast.AST | None = None + + # The normalized line numbers of the statements in the code. Exclusions + # are taken into account, and statements are adjusted to their first + # lines. + self.statements: set[TLineNo] = set() + + # The normalized line numbers of the excluded lines in the code, + # adjusted to their first lines. + self.excluded: set[TLineNo] = set() + + # The raw_* attributes are only used in this class, and in + # lab/parser.py to show how this class is working. + + # The line numbers that start statements, as reported by the line + # number table in the bytecode. + self.raw_statements: set[TLineNo] = set() + + # The raw line numbers of excluded lines of code, as marked by pragmas. + self.raw_excluded: set[TLineNo] = set() + + # The line numbers of docstring lines. + self.raw_docstrings: set[TLineNo] = set() + + # Internal detail, used by lab/parser.py. + self.show_tokens = False + + # A dict mapping line numbers to lexical statement starts for + # multi-line statements. + self._multiline: dict[TLineNo, TLineNo] = {} + + # Lazily-created arc data, and missing arc descriptions. + self._all_arcs: set[TArc] | None = None + self._missing_arc_fragments: TArcFragments | None = None + self._with_jump_fixers: dict[TArc, tuple[TArc, TArc]] = {} + + def lines_matching(self, regex: str) -> set[TLineNo]: + """Find the lines matching a regex. + + Returns a set of line numbers, the lines that contain a match for + `regex`. The entire line needn't match, just a part of it. + Handles multiline regex patterns. + + """ + matches: set[TLineNo] = set() + + last_start = 0 + last_start_line = 0 + for match in re.finditer(regex, self.text, flags=re.MULTILINE): + start, end = match.span() + start_line = last_start_line + self.text.count('\n', last_start, start) + end_line = last_start_line + self.text.count('\n', last_start, end) + matches.update(self._multiline.get(i, i) for i in range(start_line + 1, end_line + 2)) + last_start = start + last_start_line = start_line + return matches + + def _raw_parse(self) -> None: + """Parse the source to find the interesting facts about its lines. + + A handful of attributes are updated. + + """ + # Find lines which match an exclusion pattern. + if self.exclude: + self.raw_excluded = self.lines_matching(self.exclude) + self.excluded = set(self.raw_excluded) + + # The current number of indents. + indent: int = 0 + # An exclusion comment will exclude an entire clause at this indent. + exclude_indent: int = 0 + # Are we currently excluding lines? + excluding: bool = False + # The line number of the first line in a multi-line statement. + first_line: int = 0 + # Is the file empty? + empty: bool = True + # Parenthesis (and bracket) nesting level. + nesting: int = 0 + + assert self.text is not None + tokgen = generate_tokens(self.text) + for toktype, ttext, (slineno, _), (elineno, _), ltext in tokgen: + if self.show_tokens: # pragma: debugging + print("%10s %5s %-20r %r" % ( + tokenize.tok_name.get(toktype, toktype), + nice_pair((slineno, elineno)), ttext, ltext, + )) + if toktype == token.INDENT: + indent += 1 + elif toktype == token.DEDENT: + indent -= 1 + elif toktype == token.OP: + if ttext == ":" and nesting == 0: + should_exclude = ( + self.excluded.intersection(range(first_line, elineno + 1)) + ) + if not excluding and should_exclude: + # Start excluding a suite. We trigger off of the colon + # token so that the #pragma comment will be recognized on + # the same line as the colon. + self.excluded.add(elineno) + exclude_indent = indent + excluding = True + elif ttext in "([{": + nesting += 1 + elif ttext in ")]}": + nesting -= 1 + elif toktype == token.NEWLINE: + if first_line and elineno != first_line: + # We're at the end of a line, and we've ended on a + # different line than the first line of the statement, + # so record a multi-line range. + for l in range(first_line, elineno+1): + self._multiline[l] = first_line + first_line = 0 + + if ttext.strip() and toktype != tokenize.COMMENT: + # A non-white-space token. + empty = False + if not first_line: + # The token is not white space, and is the first in a statement. + first_line = slineno + # Check whether to end an excluded suite. + if excluding and indent <= exclude_indent: + excluding = False + if excluding: + self.excluded.add(elineno) + + # Find the starts of the executable statements. + if not empty: + byte_parser = ByteParser(self.text, filename=self.filename) + self.raw_statements.update(byte_parser._find_statements()) + + # The first line of modules can lie and say 1 always, even if the first + # line of code is later. If so, map 1 to the actual first line of the + # module. + if env.PYBEHAVIOR.module_firstline_1 and self._multiline: + self._multiline[1] = min(self.raw_statements) + + self.excluded = self.first_lines(self.excluded) + + # AST lets us find classes, docstrings, and decorator-affected + # functions and classes. + assert self._ast_root is not None + for node in ast.walk(self._ast_root): + # Find docstrings. + if isinstance(node, (ast.ClassDef, ast.FunctionDef, ast.AsyncFunctionDef, ast.Module)): + if node.body: + first = node.body[0] + if ( + isinstance(first, ast.Expr) + and isinstance(first.value, ast.Constant) + and isinstance(first.value.value, str) + ): + self.raw_docstrings.update( + range(first.lineno, cast(int, first.end_lineno) + 1) + ) + # Exclusions carry from decorators and signatures to the bodies of + # functions and classes. + if isinstance(node, (ast.ClassDef, ast.FunctionDef, ast.AsyncFunctionDef)): + first_line = min((d.lineno for d in node.decorator_list), default=node.lineno) + if self.excluded.intersection(range(first_line, node.lineno + 1)): + self.excluded.update(range(first_line, cast(int, node.end_lineno) + 1)) + + @functools.lru_cache(maxsize=1000) + def first_line(self, lineno: TLineNo) -> TLineNo: + """Return the first line number of the statement including `lineno`.""" + if lineno < 0: + lineno = -self._multiline.get(-lineno, -lineno) + else: + lineno = self._multiline.get(lineno, lineno) + return lineno + + def first_lines(self, linenos: Iterable[TLineNo]) -> set[TLineNo]: + """Map the line numbers in `linenos` to the correct first line of the + statement. + + Returns a set of the first lines. + + """ + return {self.first_line(l) for l in linenos} + + def translate_lines(self, lines: Iterable[TLineNo]) -> set[TLineNo]: + """Implement `FileReporter.translate_lines`.""" + return self.first_lines(lines) + + def translate_arcs(self, arcs: Iterable[TArc]) -> set[TArc]: + """Implement `FileReporter.translate_arcs`.""" + return {(self.first_line(a), self.first_line(b)) for (a, b) in self.fix_with_jumps(arcs)} + + def parse_source(self) -> None: + """Parse source text to find executable lines, excluded lines, etc. + + Sets the .excluded and .statements attributes, normalized to the first + line of multi-line statements. + + """ + try: + self._ast_root = ast.parse(self.text) + self._raw_parse() + except (tokenize.TokenError, IndentationError, SyntaxError) as err: + if hasattr(err, "lineno"): + lineno = err.lineno # IndentationError + else: + lineno = err.args[1][0] # TokenError + raise NotPython( + f"Couldn't parse '{self.filename}' as Python source: " + + f"{err.args[0]!r} at line {lineno}", + ) from err + + ignore = self.excluded | self.raw_docstrings + starts = self.raw_statements - ignore + self.statements = self.first_lines(starts) - ignore + + def arcs(self) -> set[TArc]: + """Get information about the arcs available in the code. + + Returns a set of line number pairs. Line numbers have been normalized + to the first line of multi-line statements. + + """ + if self._all_arcs is None: + self._analyze_ast() + assert self._all_arcs is not None + return self._all_arcs + + def _analyze_ast(self) -> None: + """Run the AstArcAnalyzer and save its results. + + `_all_arcs` is the set of arcs in the code. + + """ + assert self._ast_root is not None + aaa = AstArcAnalyzer(self._ast_root, self.raw_statements, self._multiline) + aaa.analyze() + self._with_jump_fixers = aaa.with_jump_fixers() + + self._all_arcs = set() + for l1, l2 in self.fix_with_jumps(aaa.arcs): + fl1 = self.first_line(l1) + fl2 = self.first_line(l2) + if fl1 != fl2: + self._all_arcs.add((fl1, fl2)) + + self._missing_arc_fragments = aaa.missing_arc_fragments + + def fix_with_jumps(self, arcs: Iterable[TArc]) -> set[TArc]: + """Adjust arcs to fix jumps leaving `with` statements.""" + to_remove = set() + to_add = set() + for arc in arcs: + if arc in self._with_jump_fixers: + start = arc[0] + to_remove.add(arc) + start_next, prev_next = self._with_jump_fixers[arc] + while start_next in self._with_jump_fixers: + to_remove.add(start_next) + start_next, prev_next = self._with_jump_fixers[start_next] + to_remove.add(prev_next) + to_add.add((start, prev_next[1])) + to_remove.add(arc) + to_remove.add(start_next) + arcs = (set(arcs) | to_add) - to_remove + return arcs + + @functools.lru_cache + def exit_counts(self) -> dict[TLineNo, int]: + """Get a count of exits from that each line. + + Excluded lines are excluded. + + """ + exit_counts: dict[TLineNo, int] = collections.defaultdict(int) + for l1, l2 in self.arcs(): + if l1 < 0: + # Don't ever report -1 as a line number + continue + if l1 in self.excluded: + # Don't report excluded lines as line numbers. + continue + if l2 in self.excluded: + # Arcs to excluded lines shouldn't count. + continue + exit_counts[l1] += 1 + + return exit_counts + + def _finish_action_msg(self, action_msg: str | None, end: TLineNo) -> str: + """Apply some defaulting and formatting to an arc's description.""" + if action_msg is None: + if end < 0: + action_msg = "jump to the function exit" + else: + action_msg = "jump to line {lineno}" + action_msg = action_msg.format(lineno=end) + return action_msg + + def missing_arc_description(self, start: TLineNo, end: TLineNo) -> str: + """Provide an English sentence describing a missing arc.""" + if self._missing_arc_fragments is None: + self._analyze_ast() + assert self._missing_arc_fragments is not None + + fragment_pairs = self._missing_arc_fragments.get((start, end), [(None, None)]) + + msgs = [] + for missing_cause_msg, action_msg in fragment_pairs: + action_msg = self._finish_action_msg(action_msg, end) + msg = f"line {start} didn't {action_msg}" + if missing_cause_msg is not None: + msg += f" because {missing_cause_msg.format(lineno=start)}" + + msgs.append(msg) + + return " or ".join(msgs) + + def arc_description(self, start: TLineNo, end: TLineNo) -> str: + """Provide an English description of an arc's effect.""" + if self._missing_arc_fragments is None: + self._analyze_ast() + assert self._missing_arc_fragments is not None + + fragment_pairs = self._missing_arc_fragments.get((start, end), [(None, None)]) + action_msg = self._finish_action_msg(fragment_pairs[0][1], end) + return action_msg + + +class ByteParser: + """Parse bytecode to understand the structure of code.""" + + def __init__( + self, + text: str, + code: CodeType | None = None, + filename: str | None = None, + ) -> None: + self.text = text + if code is not None: + self.code = code + else: + assert filename is not None + # We only get here if earlier ast parsing succeeded, so no need to + # catch errors. + self.code = compile(text, filename, "exec", dont_inherit=True) + + def child_parsers(self) -> Iterable[ByteParser]: + """Iterate over all the code objects nested within this one. + + The iteration includes `self` as its first value. + + """ + return (ByteParser(self.text, code=c) for c in code_objects(self.code)) + + def _line_numbers(self) -> Iterable[TLineNo]: + """Yield the line numbers possible in this code object. + + Uses co_lnotab described in Python/compile.c to find the + line numbers. Produces a sequence: l0, l1, ... + """ + if hasattr(self.code, "co_lines"): + # PYVERSIONS: new in 3.10 + for _, _, line in self.code.co_lines(): + if line: + yield line + else: + # Adapted from dis.py in the standard library. + byte_increments = self.code.co_lnotab[0::2] + line_increments = self.code.co_lnotab[1::2] + + last_line_num = None + line_num = self.code.co_firstlineno + byte_num = 0 + for byte_incr, line_incr in zip(byte_increments, line_increments): + if byte_incr: + if line_num != last_line_num: + yield line_num + last_line_num = line_num + byte_num += byte_incr + if line_incr >= 0x80: + line_incr -= 0x100 + line_num += line_incr + if line_num != last_line_num: + yield line_num + + def _find_statements(self) -> Iterable[TLineNo]: + """Find the statements in `self.code`. + + Produce a sequence of line numbers that start statements. Recurses + into all code objects reachable from `self.code`. + + """ + for bp in self.child_parsers(): + # Get all of the lineno information from this code. + yield from bp._line_numbers() + + +# +# AST analysis +# + +@dataclass(frozen=True, order=True) +class ArcStart: + """The information needed to start an arc. + + `lineno` is the line number the arc starts from. + + `cause` is an English text fragment used as the `missing_cause_msg` for + AstArcAnalyzer.missing_arc_fragments. It will be used to describe why an + arc wasn't executed, so should fit well into a sentence of the form, + "Line 17 didn't run because {cause}." The fragment can include "{lineno}" + to have `lineno` interpolated into it. + + As an example, this code:: + + if something(x): # line 1 + func(x) # line 2 + more_stuff() # line 3 + + would have two ArcStarts: + + - ArcStart(1, "the condition on line 1 was always true") + - ArcStart(1, "the condition on line 1 was never true") + + The first would be used to create an arc from 1 to 3, creating a message like + "line 1 didn't jump to line 3 because the condition on line 1 was always true." + + The second would be used for the arc from 1 to 2, creating a message like + "line 1 didn't jump to line 2 because the condition on line 1 was never true." + + """ + lineno: TLineNo + cause: str = "" + + +class TAddArcFn(Protocol): + """The type for AstArcAnalyzer.add_arc().""" + def __call__( + self, + start: TLineNo, + end: TLineNo, + missing_cause_msg: str | None = None, + action_msg: str | None = None, + ) -> None: + """ + Record an arc from `start` to `end`. + + `missing_cause_msg` is a description of the reason the arc wasn't + taken if it wasn't taken. For example, "the condition on line 10 was + never true." + + `action_msg` is a description of what the arc does, like "jump to line + 10" or "exit from function 'fooey'." + + """ + + +TArcFragments = dict[TArc, list[tuple[Optional[str], Optional[str]]]] + +class Block: + """ + Blocks need to handle various exiting statements in their own ways. + + All of these methods take a list of exits, and a callable `add_arc` + function that they can use to add arcs if needed. They return True if the + exits are handled, or False if the search should continue up the block + stack. + """ + # pylint: disable=unused-argument + def process_break_exits(self, exits: set[ArcStart], add_arc: TAddArcFn) -> bool: + """Process break exits.""" + return False + + def process_continue_exits(self, exits: set[ArcStart], add_arc: TAddArcFn) -> bool: + """Process continue exits.""" + return False + + def process_raise_exits(self, exits: set[ArcStart], add_arc: TAddArcFn) -> bool: + """Process raise exits.""" + return False + + def process_return_exits(self, exits: set[ArcStart], add_arc: TAddArcFn) -> bool: + """Process return exits.""" + return False + + +class LoopBlock(Block): + """A block on the block stack representing a `for` or `while` loop.""" + def __init__(self, start: TLineNo) -> None: + # The line number where the loop starts. + self.start = start + # A set of ArcStarts, the arcs from break statements exiting this loop. + self.break_exits: set[ArcStart] = set() + + def process_break_exits(self, exits: set[ArcStart], add_arc: TAddArcFn) -> bool: + self.break_exits.update(exits) + return True + + def process_continue_exits(self, exits: set[ArcStart], add_arc: TAddArcFn) -> bool: + for xit in exits: + add_arc(xit.lineno, self.start, xit.cause) + return True + + +class FunctionBlock(Block): + """A block on the block stack representing a function definition.""" + def __init__(self, start: TLineNo, name: str) -> None: + # The line number where the function starts. + self.start = start + # The name of the function. + self.name = name + + def process_raise_exits(self, exits: set[ArcStart], add_arc: TAddArcFn) -> bool: + for xit in exits: + add_arc( + xit.lineno, -self.start, xit.cause, + f"except from function {self.name!r}", + ) + return True + + def process_return_exits(self, exits: set[ArcStart], add_arc: TAddArcFn) -> bool: + for xit in exits: + add_arc( + xit.lineno, -self.start, xit.cause, + f"return from function {self.name!r}", + ) + return True + + +class TryBlock(Block): + """A block on the block stack representing a `try` block.""" + def __init__(self, handler_start: TLineNo | None, final_start: TLineNo | None) -> None: + # The line number of the first "except" handler, if any. + self.handler_start = handler_start + # The line number of the "finally:" clause, if any. + self.final_start = final_start + + def process_raise_exits(self, exits: set[ArcStart], add_arc: TAddArcFn) -> bool: + if self.handler_start is not None: + for xit in exits: + add_arc(xit.lineno, self.handler_start, xit.cause) + return True + + +class NodeList(ast.AST): + """A synthetic fictitious node, containing a sequence of nodes. + + This is used when collapsing optimized if-statements, to represent the + unconditional execution of one of the clauses. + + """ + def __init__(self, body: Sequence[ast.AST]) -> None: + self.body = body + self.lineno = body[0].lineno # type: ignore[attr-defined] + +# TODO: Shouldn't the cause messages join with "and" instead of "or"? + + +class AstArcAnalyzer: + """Analyze source text with an AST to find executable code paths. + + The .analyze() method does the work, and populates these attributes: + + `arcs`: a set of (from, to) pairs of the the arcs possible in the code. + + `missing_arc_fragments`: a dict mapping (from, to) arcs to lists of + message fragments explaining why the arc is missing from execution:: + + { (start, end): [(missing_cause_msg, action_msg), ...], } + + For an arc starting from line 17, they should be usable to form complete + sentences like: "Line 17 didn't {action_msg} because {missing_cause_msg}". + + NOTE: Starting in July 2024, I've been whittling this down to only report + arc that are part of true branches. It's not clear how far this work will + go. + + """ + + def __init__( + self, + root_node: ast.AST, + statements: set[TLineNo], + multiline: dict[TLineNo, TLineNo], + ) -> None: + self.root_node = root_node + # TODO: I think this is happening in too many places. + self.statements = {multiline.get(l, l) for l in statements} + self.multiline = multiline + + # Turn on AST dumps with an environment variable. + # $set_env.py: COVERAGE_AST_DUMP - Dump the AST nodes when parsing code. + dump_ast = bool(int(os.getenv("COVERAGE_AST_DUMP", "0"))) + + if dump_ast: # pragma: debugging + # Dump the AST so that failing tests have helpful output. + print(f"Statements: {self.statements}") + print(f"Multiline map: {self.multiline}") + print(ast.dump(self.root_node, include_attributes=True, indent=4)) + + self.arcs: set[TArc] = set() + self.missing_arc_fragments: TArcFragments = collections.defaultdict(list) + self.block_stack: list[Block] = [] + + # If `with` clauses jump to their start on the way out, we need + # information to be able to skip over that jump. We record the arcs + # from `with` into the clause (with_entries), and the arcs from the + # clause to the `with` (with_exits). + self.current_with_starts: set[TLineNo] = set() + self.all_with_starts: set[TLineNo] = set() + self.with_entries: set[TArc] = set() + self.with_exits: set[TArc] = set() + + # $set_env.py: COVERAGE_TRACK_ARCS - Trace possible arcs added while parsing code. + self.debug = bool(int(os.getenv("COVERAGE_TRACK_ARCS", "0"))) + + def analyze(self) -> None: + """Examine the AST tree from `self.root_node` to determine possible arcs.""" + for node in ast.walk(self.root_node): + node_name = node.__class__.__name__ + code_object_handler = getattr(self, "_code_object__" + node_name, None) + if code_object_handler is not None: + code_object_handler(node) + + def with_jump_fixers(self) -> dict[TArc, tuple[TArc, TArc]]: + """Get a dict with data for fixing jumps out of with statements. + + Returns a dict. The keys are arcs leaving a with statement by jumping + back to its start. The values are pairs: first, the arc from the start + to the next statement, then the arc that exits the with without going + to the start. + + """ + if not env.PYBEHAVIOR.exit_through_with: + return {} + + fixers = {} + with_nexts = { + arc + for arc in self.arcs + if arc[0] in self.all_with_starts and arc not in self.with_entries + } + for start in self.all_with_starts: + nexts = {arc[1] for arc in with_nexts if arc[0] == start} + if not nexts: + continue + assert len(nexts) == 1, f"Expected one arc, got {nexts} with {start = }" + nxt = nexts.pop() + prvs = {arc[0] for arc in self.with_exits if arc[1] == start} + for prv in prvs: + fixers[(prv, start)] = ((start, nxt), (prv, nxt)) + return fixers + + # Code object dispatchers: _code_object__* + # + # These methods are used by analyze() as the start of the analysis. + # There is one for each construct with a code object. + + def _code_object__Module(self, node: ast.Module) -> None: + start = self.line_for_node(node) + if node.body: + exits = self.process_body(node.body) + for xit in exits: + self.add_arc(xit.lineno, -start, xit.cause, "exit the module") + else: + # Empty module. + self.add_arc(start, -start) + + def _code_object__FunctionDef(self, node: ast.FunctionDef) -> None: + start = self.line_for_node(node) + self.block_stack.append(FunctionBlock(start=start, name=node.name)) + exits = self.process_body(node.body) + self.process_return_exits(exits) + self.block_stack.pop() + + _code_object__AsyncFunctionDef = _code_object__FunctionDef + + def _code_object__ClassDef(self, node: ast.ClassDef) -> None: + start = self.line_for_node(node) + exits = self.process_body(node.body) + for xit in exits: + self.add_arc(xit.lineno, -start, xit.cause, f"exit class {node.name!r}") + + def add_arc( + self, + start: TLineNo, + end: TLineNo, + missing_cause_msg: str | None = None, + action_msg: str | None = None, + ) -> None: + """Add an arc, including message fragments to use if it is missing.""" + if self.debug: # pragma: debugging + print(f"Adding possible arc: ({start}, {end}): {missing_cause_msg!r}, {action_msg!r}") + print(short_stack(), end="\n\n") + self.arcs.add((start, end)) + if start in self.current_with_starts: + self.with_entries.add((start, end)) + + if missing_cause_msg is not None or action_msg is not None: + self.missing_arc_fragments[(start, end)].append((missing_cause_msg, action_msg)) + + def nearest_blocks(self) -> Iterable[Block]: + """Yield the blocks in nearest-to-farthest order.""" + return reversed(self.block_stack) + + def line_for_node(self, node: ast.AST) -> TLineNo: + """What is the right line number to use for this node? + + This dispatches to _line__Node functions where needed. + + """ + node_name = node.__class__.__name__ + handler = cast( + Optional[Callable[[ast.AST], TLineNo]], + getattr(self, "_line__" + node_name, None), + ) + if handler is not None: + return handler(node) + else: + return node.lineno # type: ignore[attr-defined, no-any-return] + + # First lines: _line__* + # + # Dispatched by line_for_node, each method knows how to identify the first + # line number in the node, as Python will report it. + + def _line_decorated(self, node: ast.FunctionDef) -> TLineNo: + """Compute first line number for things that can be decorated (classes and functions).""" + if node.decorator_list: + lineno = node.decorator_list[0].lineno + else: + lineno = node.lineno + return lineno + + def _line__Assign(self, node: ast.Assign) -> TLineNo: + return self.line_for_node(node.value) + + _line__ClassDef = _line_decorated + + def _line__Dict(self, node: ast.Dict) -> TLineNo: + if node.keys: + if node.keys[0] is not None: + return node.keys[0].lineno + else: + # Unpacked dict literals `{**{"a":1}}` have None as the key, + # use the value in that case. + return node.values[0].lineno + else: + return node.lineno + + _line__FunctionDef = _line_decorated + _line__AsyncFunctionDef = _line_decorated + + def _line__List(self, node: ast.List) -> TLineNo: + if node.elts: + return self.line_for_node(node.elts[0]) + else: + return node.lineno + + def _line__Module(self, node: ast.Module) -> TLineNo: + if env.PYBEHAVIOR.module_firstline_1: + return 1 + elif node.body: + return self.line_for_node(node.body[0]) + else: + # Empty modules have no line number, they always start at 1. + return 1 + + # The node types that just flow to the next node with no complications. + OK_TO_DEFAULT = { + "AnnAssign", "Assign", "Assert", "AugAssign", "Delete", "Expr", "Global", + "Import", "ImportFrom", "Nonlocal", "Pass", + } + + def node_exits(self, node: ast.AST) -> set[ArcStart]: + """Find the set of arc starts that exit this node. + + Return a set of ArcStarts, exits from this node to the next. Because a + node represents an entire sub-tree (including its children), the exits + from a node can be arbitrarily complex:: + + if something(1): + if other(2): + doit(3) + else: + doit(5) + + There are three exits from line 1: they start at lines 1, 3 and 5. + There are two exits from line 2: lines 3 and 5. + + """ + node_name = node.__class__.__name__ + handler = cast( + Optional[Callable[[ast.AST], set[ArcStart]]], + getattr(self, "_handle__" + node_name, None), + ) + if handler is not None: + arc_starts = handler(node) + else: + # No handler: either it's something that's ok to default (a simple + # statement), or it's something we overlooked. + if env.TESTING: + if node_name not in self.OK_TO_DEFAULT: + raise RuntimeError(f"*** Unhandled: {node}") # pragma: only failure + + # Default for simple statements: one exit from this node. + arc_starts = {ArcStart(self.line_for_node(node))} + return arc_starts + + def process_body( + self, + body: Sequence[ast.AST], + from_start: ArcStart | None = None, + prev_starts: set[ArcStart] | None = None, + ) -> set[ArcStart]: + """Process the body of a compound statement. + + `body` is the body node to process. + + `from_start` is a single `ArcStart` that starts an arc into this body. + `prev_starts` is a set of ArcStarts that can all be the start of arcs + into this body. Only one of `from_start` and `prev_starts` should be + given. + + Records arcs within the body by calling `self.add_arc`. + + Returns a set of ArcStarts, the exits from this body. + + """ + if prev_starts is None: + if from_start is None: + prev_starts = set() + else: + prev_starts = {from_start} + else: + assert from_start is None + + # Loop over the nodes in the body, making arcs from each one's exits to + # the next node. + for body_node in body: + lineno = self.line_for_node(body_node) + first_line = self.multiline.get(lineno, lineno) + if first_line not in self.statements: + maybe_body_node = self.find_non_missing_node(body_node) + if maybe_body_node is None: + continue + body_node = maybe_body_node + lineno = self.line_for_node(body_node) + for prev_start in prev_starts: + self.add_arc(prev_start.lineno, lineno, prev_start.cause) + prev_starts = self.node_exits(body_node) + return prev_starts + + def find_non_missing_node(self, node: ast.AST) -> ast.AST | None: + """Search `node` looking for a child that has not been optimized away. + + This might return the node you started with, or it will work recursively + to find a child node in self.statements. + + Returns a node, or None if none of the node remains. + + """ + # This repeats work just done in process_body, but this duplication + # means we can avoid a function call in the 99.9999% case of not + # optimizing away statements. + lineno = self.line_for_node(node) + first_line = self.multiline.get(lineno, lineno) + if first_line in self.statements: + return node + + missing_fn = cast( + Optional[Callable[[ast.AST], Optional[ast.AST]]], + getattr(self, "_missing__" + node.__class__.__name__, None), + ) + if missing_fn is not None: + ret_node = missing_fn(node) + else: + ret_node = None + return ret_node + + # Missing nodes: _missing__* + # + # Entire statements can be optimized away by Python. They will appear in + # the AST, but not the bytecode. These functions are called (by + # find_non_missing_node) to find a node to use instead of the missing + # node. They can return None if the node should truly be gone. + + def _missing__If(self, node: ast.If) -> ast.AST | None: + # If the if-node is missing, then one of its children might still be + # here, but not both. So return the first of the two that isn't missing. + # Use a NodeList to hold the clauses as a single node. + non_missing = self.find_non_missing_node(NodeList(node.body)) + if non_missing: + return non_missing + if node.orelse: + return self.find_non_missing_node(NodeList(node.orelse)) + return None + + def _missing__NodeList(self, node: NodeList) -> ast.AST | None: + # A NodeList might be a mixture of missing and present nodes. Find the + # ones that are present. + non_missing_children = [] + for child in node.body: + maybe_child = self.find_non_missing_node(child) + if maybe_child is not None: + non_missing_children.append(maybe_child) + + # Return the simplest representation of the present children. + if not non_missing_children: + return None + if len(non_missing_children) == 1: + return non_missing_children[0] + return NodeList(non_missing_children) + + def _missing__While(self, node: ast.While) -> ast.AST | None: + body_nodes = self.find_non_missing_node(NodeList(node.body)) + if not body_nodes: + return None + # Make a synthetic While-true node. + new_while = ast.While() # type: ignore[call-arg] + new_while.lineno = body_nodes.lineno # type: ignore[attr-defined] + new_while.test = ast.Name() # type: ignore[call-arg] + new_while.test.lineno = body_nodes.lineno # type: ignore[attr-defined] + new_while.test.id = "True" + assert hasattr(body_nodes, "body") + new_while.body = body_nodes.body + new_while.orelse = [] + return new_while + + def is_constant_expr(self, node: ast.AST) -> str | None: + """Is this a compile-time constant?""" + node_name = node.__class__.__name__ + if node_name in ["Constant", "NameConstant", "Num"]: + return "Num" + elif isinstance(node, ast.Name): + if node.id in ["True", "False", "None", "__debug__"]: + return "Name" + return None + + # In the fullness of time, these might be good tests to write: + # while EXPR: + # while False: + # listcomps hidden deep in other expressions + # listcomps hidden in lists: x = [[i for i in range(10)]] + # nested function definitions + + # Exit processing: process_*_exits + # + # These functions process the four kinds of jump exits: break, continue, + # raise, and return. To figure out where an exit goes, we have to look at + # the block stack context. For example, a break will jump to the nearest + # enclosing loop block, or the nearest enclosing finally block, whichever + # is nearer. + + def process_break_exits(self, exits: set[ArcStart]) -> None: + """Add arcs due to jumps from `exits` being breaks.""" + for block in self.nearest_blocks(): # pragma: always breaks + if block.process_break_exits(exits, self.add_arc): + break + + def process_continue_exits(self, exits: set[ArcStart]) -> None: + """Add arcs due to jumps from `exits` being continues.""" + for block in self.nearest_blocks(): # pragma: always breaks + if block.process_continue_exits(exits, self.add_arc): + break + + def process_raise_exits(self, exits: set[ArcStart]) -> None: + """Add arcs due to jumps from `exits` being raises.""" + for block in self.nearest_blocks(): + if block.process_raise_exits(exits, self.add_arc): + break + + def process_return_exits(self, exits: set[ArcStart]) -> None: + """Add arcs due to jumps from `exits` being returns.""" + for block in self.nearest_blocks(): # pragma: always breaks + if block.process_return_exits(exits, self.add_arc): + break + + # Node handlers: _handle__* + # + # Each handler deals with a specific AST node type, dispatched from + # node_exits. Handlers return the set of exits from that node, and can + # also call self.add_arc to record arcs they find. These functions mirror + # the Python semantics of each syntactic construct. See the docstring + # for node_exits to understand the concept of exits from a node. + # + # Every node type that represents a statement should have a handler, or it + # should be listed in OK_TO_DEFAULT. + + def _handle__Break(self, node: ast.Break) -> set[ArcStart]: + here = self.line_for_node(node) + break_start = ArcStart(here, cause="the break on line {lineno} wasn't executed") + self.process_break_exits({break_start}) + return set() + + def _handle_decorated(self, node: ast.FunctionDef) -> set[ArcStart]: + """Add arcs for things that can be decorated (classes and functions).""" + main_line: TLineNo = node.lineno + last: TLineNo | None = node.lineno + decs = node.decorator_list + if decs: + last = None + for dec_node in decs: + dec_start = self.line_for_node(dec_node) + if last is not None and dec_start != last: # type: ignore[unreachable] + self.add_arc(last, dec_start) # type: ignore[unreachable] + last = dec_start + assert last is not None + self.add_arc(last, main_line) + last = main_line + # The definition line may have been missed, but we should have it + # in `self.statements`. For some constructs, `line_for_node` is + # not what we'd think of as the first line in the statement, so map + # it to the first one. + if node.body: + body_start = self.line_for_node(node.body[0]) + body_start = self.multiline.get(body_start, body_start) + # The body is handled in collect_arcs. + assert last is not None + return {ArcStart(last)} + + _handle__ClassDef = _handle_decorated + + def _handle__Continue(self, node: ast.Continue) -> set[ArcStart]: + here = self.line_for_node(node) + continue_start = ArcStart(here, cause="the continue on line {lineno} wasn't executed") + self.process_continue_exits({continue_start}) + return set() + + def _handle__For(self, node: ast.For) -> set[ArcStart]: + start = self.line_for_node(node.iter) + self.block_stack.append(LoopBlock(start=start)) + from_start = ArcStart(start, cause="the loop on line {lineno} never started") + exits = self.process_body(node.body, from_start=from_start) + # Any exit from the body will go back to the top of the loop. + for xit in exits: + self.add_arc(xit.lineno, start, xit.cause) + my_block = self.block_stack.pop() + assert isinstance(my_block, LoopBlock) + exits = my_block.break_exits + from_start = ArcStart(start, cause="the loop on line {lineno} didn't complete") + if node.orelse: + else_exits = self.process_body(node.orelse, from_start=from_start) + exits |= else_exits + else: + # No else clause: exit from the for line. + exits.add(from_start) + return exits + + _handle__AsyncFor = _handle__For + + _handle__FunctionDef = _handle_decorated + _handle__AsyncFunctionDef = _handle_decorated + + def _handle__If(self, node: ast.If) -> set[ArcStart]: + start = self.line_for_node(node.test) + from_start = ArcStart(start, cause="the condition on line {lineno} was never true") + exits = self.process_body(node.body, from_start=from_start) + from_start = ArcStart(start, cause="the condition on line {lineno} was always true") + exits |= self.process_body(node.orelse, from_start=from_start) + return exits + + if sys.version_info >= (3, 10): + def _handle__Match(self, node: ast.Match) -> set[ArcStart]: + start = self.line_for_node(node) + last_start = start + exits = set() + for case in node.cases: + case_start = self.line_for_node(case.pattern) + self.add_arc(last_start, case_start, "the pattern on line {lineno} always matched") + from_start = ArcStart( + case_start, + cause="the pattern on line {lineno} never matched", + ) + exits |= self.process_body(case.body, from_start=from_start) + last_start = case_start + + # case is now the last case, check for wildcard match. + pattern = case.pattern # pylint: disable=undefined-loop-variable + while isinstance(pattern, ast.MatchOr): + pattern = pattern.patterns[-1] + while isinstance(pattern, ast.MatchAs) and pattern.pattern is not None: + pattern = pattern.pattern + had_wildcard = ( + isinstance(pattern, ast.MatchAs) + and pattern.pattern is None + and case.guard is None # pylint: disable=undefined-loop-variable + ) + + if not had_wildcard: + exits.add( + ArcStart(case_start, cause="the pattern on line {lineno} always matched"), + ) + return exits + + def _handle__NodeList(self, node: NodeList) -> set[ArcStart]: + start = self.line_for_node(node) + exits = self.process_body(node.body, from_start=ArcStart(start)) + return exits + + def _handle__Raise(self, node: ast.Raise) -> set[ArcStart]: + here = self.line_for_node(node) + raise_start = ArcStart(here, cause="the raise on line {lineno} wasn't executed") + self.process_raise_exits({raise_start}) + # `raise` statement jumps away, no exits from here. + return set() + + def _handle__Return(self, node: ast.Return) -> set[ArcStart]: + here = self.line_for_node(node) + return_start = ArcStart(here, cause="the return on line {lineno} wasn't executed") + self.process_return_exits({return_start}) + # `return` statement jumps away, no exits from here. + return set() + + def _handle__Try(self, node: ast.Try) -> set[ArcStart]: + if node.handlers: + handler_start = self.line_for_node(node.handlers[0]) + else: + handler_start = None + + if node.finalbody: + final_start = self.line_for_node(node.finalbody[0]) + else: + final_start = None + + # This is true by virtue of Python syntax: have to have either except + # or finally, or both. + assert handler_start is not None or final_start is not None + try_block = TryBlock(handler_start, final_start) + self.block_stack.append(try_block) + + start = self.line_for_node(node) + exits = self.process_body(node.body, from_start=ArcStart(start)) + + # We're done with the `try` body, so this block no longer handles + # exceptions. We keep the block so the `finally` clause can pick up + # flows from the handlers and `else` clause. + if node.finalbody: + try_block.handler_start = None + else: + self.block_stack.pop() + + handler_exits: set[ArcStart] = set() + + if node.handlers: + for handler_node in node.handlers: + handler_start = self.line_for_node(handler_node) + from_cause = "the exception caught by line {lineno} didn't happen" + from_start = ArcStart(handler_start, cause=from_cause) + handler_exits |= self.process_body(handler_node.body, from_start=from_start) + + if node.orelse: + exits = self.process_body(node.orelse, prev_starts=exits) + + exits |= handler_exits + + if node.finalbody: + self.block_stack.pop() + final_from = exits + + final_exits = self.process_body(node.finalbody, prev_starts=final_from) + + if exits: + # The finally clause's exits are only exits for the try block + # as a whole if the try block had some exits to begin with. + exits = final_exits + + return exits + + def _handle__While(self, node: ast.While) -> set[ArcStart]: + start = to_top = self.line_for_node(node.test) + constant_test = self.is_constant_expr(node.test) + top_is_body0 = False + if constant_test: + top_is_body0 = True + if env.PYBEHAVIOR.keep_constant_test: + top_is_body0 = False + if top_is_body0: + to_top = self.line_for_node(node.body[0]) + self.block_stack.append(LoopBlock(start=to_top)) + from_start = ArcStart(start, cause="the condition on line {lineno} was never true") + exits = self.process_body(node.body, from_start=from_start) + for xit in exits: + self.add_arc(xit.lineno, to_top, xit.cause) + exits = set() + my_block = self.block_stack.pop() + assert isinstance(my_block, LoopBlock) + exits.update(my_block.break_exits) + from_start = ArcStart(start, cause="the condition on line {lineno} was always true") + if node.orelse: + else_exits = self.process_body(node.orelse, from_start=from_start) + exits |= else_exits + else: + # No `else` clause: you can exit from the start. + if not constant_test: + exits.add(from_start) + return exits + + def _handle__With(self, node: ast.With) -> set[ArcStart]: + if env.PYBEHAVIOR.exit_with_through_ctxmgr: + starts = [self.line_for_node(item.context_expr) for item in node.items] + else: + starts = [self.line_for_node(node)] + if env.PYBEHAVIOR.exit_through_with: + for start in starts: + self.current_with_starts.add(start) + self.all_with_starts.add(start) + + exits = self.process_body(node.body, from_start=ArcStart(starts[-1])) + + if env.PYBEHAVIOR.exit_through_with: + start = starts[-1] + self.current_with_starts.remove(start) + with_exit = {ArcStart(start)} + if exits: + for xit in exits: + self.add_arc(xit.lineno, start) + self.with_exits.add((xit.lineno, start)) + exits = with_exit + + return exits + + _handle__AsyncWith = _handle__With diff --git a/.venv/Lib/site-packages/coverage/phystokens.py b/.venv/Lib/site-packages/coverage/phystokens.py new file mode 100644 index 00000000..8c29402a --- /dev/null +++ b/.venv/Lib/site-packages/coverage/phystokens.py @@ -0,0 +1,198 @@ +# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt + +"""Better tokenizing for coverage.py.""" + +from __future__ import annotations + +import ast +import io +import keyword +import re +import sys +import token +import tokenize + +from collections.abc import Iterable + +from coverage import env +from coverage.types import TLineNo, TSourceTokenLines + + +TokenInfos = Iterable[tokenize.TokenInfo] + + +def _phys_tokens(toks: TokenInfos) -> TokenInfos: + """Return all physical tokens, even line continuations. + + tokenize.generate_tokens() doesn't return a token for the backslash that + continues lines. This wrapper provides those tokens so that we can + re-create a faithful representation of the original source. + + Returns the same values as generate_tokens() + + """ + last_line: str | None = None + last_lineno = -1 + last_ttext: str = "" + for ttype, ttext, (slineno, scol), (elineno, ecol), ltext in toks: + if last_lineno != elineno: + if last_line and last_line.endswith("\\\n"): + # We are at the beginning of a new line, and the last line + # ended with a backslash. We probably have to inject a + # backslash token into the stream. Unfortunately, there's more + # to figure out. This code:: + # + # usage = """\ + # HEY THERE + # """ + # + # triggers this condition, but the token text is:: + # + # '"""\\\nHEY THERE\n"""' + # + # so we need to figure out if the backslash is already in the + # string token or not. + inject_backslash = True + if last_ttext.endswith("\\"): + inject_backslash = False + elif ttype == token.STRING: + if (last_line.endswith("\\\n") and # pylint: disable=simplifiable-if-statement + last_line.rstrip(" \\\n").endswith(last_ttext)): + # Deal with special cases like such code:: + # + # a = ["aaa",\ # there may be zero or more blanks between "," and "\". + # "bbb \ + # ccc"] + # + inject_backslash = True + else: + # It's a multi-line string and the first line ends with + # a backslash, so we don't need to inject another. + inject_backslash = False + elif sys.version_info >= (3, 12) and ttype == token.FSTRING_MIDDLE: + inject_backslash = False + if inject_backslash: + # Figure out what column the backslash is in. + ccol = len(last_line.split("\n")[-2]) - 1 + # Yield the token, with a fake token type. + yield tokenize.TokenInfo( + 99999, "\\\n", + (slineno, ccol), (slineno, ccol+2), + last_line, + ) + last_line = ltext + if ttype not in (tokenize.NEWLINE, tokenize.NL): + last_ttext = ttext + yield tokenize.TokenInfo(ttype, ttext, (slineno, scol), (elineno, ecol), ltext) + last_lineno = elineno + + +def find_soft_key_lines(source: str) -> set[TLineNo]: + """Helper for finding lines with soft keywords, like match/case lines.""" + soft_key_lines: set[TLineNo] = set() + + for node in ast.walk(ast.parse(source)): + if sys.version_info >= (3, 10) and isinstance(node, ast.Match): + soft_key_lines.add(node.lineno) + for case in node.cases: + soft_key_lines.add(case.pattern.lineno) + elif sys.version_info >= (3, 12) and isinstance(node, ast.TypeAlias): + soft_key_lines.add(node.lineno) + + return soft_key_lines + + +def source_token_lines(source: str) -> TSourceTokenLines: + """Generate a series of lines, one for each line in `source`. + + Each line is a list of pairs, each pair is a token:: + + [('key', 'def'), ('ws', ' '), ('nam', 'hello'), ('op', '('), ... ] + + Each pair has a token class, and the token text. + + If you concatenate all the token texts, and then join them with newlines, + you should have your original `source` back, with two differences: + trailing white space is not preserved, and a final line with no newline + is indistinguishable from a final line with a newline. + + """ + + ws_tokens = {token.INDENT, token.DEDENT, token.NEWLINE, tokenize.NL} + line: list[tuple[str, str]] = [] + col = 0 + + source = source.expandtabs(8).replace("\r\n", "\n") + tokgen = generate_tokens(source) + + if env.PYBEHAVIOR.soft_keywords: + soft_key_lines = find_soft_key_lines(source) + else: + soft_key_lines = set() + + for ttype, ttext, (sline, scol), (_, ecol), _ in _phys_tokens(tokgen): + mark_start = True + for part in re.split("(\n)", ttext): + if part == "\n": + yield line + line = [] + col = 0 + mark_end = False + elif part == "": + mark_end = False + elif ttype in ws_tokens: + mark_end = False + else: + if mark_start and scol > col: + line.append(("ws", " " * (scol - col))) + mark_start = False + tok_class = tokenize.tok_name.get(ttype, "xx").lower()[:3] + if ttype == token.NAME: + if keyword.iskeyword(ttext): + # Hard keywords are always keywords. + tok_class = "key" + elif sys.version_info >= (3, 10): # PYVERSIONS + # Need the version_info check to keep mypy from borking + # on issoftkeyword here. + if env.PYBEHAVIOR.soft_keywords and keyword.issoftkeyword(ttext): + # Soft keywords appear at the start of their line. + if len(line) == 0: + is_start_of_line = True + elif (len(line) == 1) and line[0][0] == "ws": + is_start_of_line = True + else: + is_start_of_line = False + if is_start_of_line and sline in soft_key_lines: + tok_class = "key" + line.append((tok_class, part)) + mark_end = True + scol = 0 + if mark_end: + col = ecol + + if line: + yield line + + +def generate_tokens(text: str) -> TokenInfos: + """A helper around `tokenize.generate_tokens`. + + Originally this was used to cache the results, but it didn't seem to make + reporting go faster, and caused issues with using too much memory. + + """ + readline = io.StringIO(text).readline + return tokenize.generate_tokens(readline) + + +def source_encoding(source: bytes) -> str: + """Determine the encoding for `source`, according to PEP 263. + + `source` is a byte string: the text of the program. + + Returns a string, the name of the encoding. + + """ + readline = iter(source.splitlines(True)).__next__ + return tokenize.detect_encoding(readline)[0] diff --git a/.venv/Lib/site-packages/coverage/plugin.py b/.venv/Lib/site-packages/coverage/plugin.py new file mode 100644 index 00000000..11c0679f --- /dev/null +++ b/.venv/Lib/site-packages/coverage/plugin.py @@ -0,0 +1,617 @@ +# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt + +""" +.. versionadded:: 4.0 + +Plug-in interfaces for coverage.py. + +Coverage.py supports a few different kinds of plug-ins that change its +behavior: + +* File tracers implement tracing of non-Python file types. + +* Configurers add custom configuration, using Python code to change the + configuration. + +* Dynamic context switchers decide when the dynamic context has changed, for + example, to record what test function produced the coverage. + +To write a coverage.py plug-in, create a module with a subclass of +:class:`~coverage.CoveragePlugin`. You will override methods in your class to +participate in various aspects of coverage.py's processing. +Different types of plug-ins have to override different methods. + +Any plug-in can optionally implement :meth:`~coverage.CoveragePlugin.sys_info` +to provide debugging information about their operation. + +Your module must also contain a ``coverage_init`` function that registers an +instance of your plug-in class:: + + import coverage + + class MyPlugin(coverage.CoveragePlugin): + ... + + def coverage_init(reg, options): + reg.add_file_tracer(MyPlugin()) + +You use the `reg` parameter passed to your ``coverage_init`` function to +register your plug-in object. The registration method you call depends on +what kind of plug-in it is. + +If your plug-in takes options, the `options` parameter is a dictionary of your +plug-in's options from the coverage.py configuration file. Use them however +you want to configure your object before registering it. + +Coverage.py will store its own information on your plug-in object, using +attributes whose names start with ``_coverage_``. Don't be startled. + +.. warning:: + Plug-ins are imported by coverage.py before it begins measuring code. + If you write a plugin in your own project, it might import your product + code before coverage.py can start measuring. This can result in your + own code being reported as missing. + + One solution is to put your plugins in your project tree, but not in + your importable Python package. + + +.. _file_tracer_plugins: + +File Tracers +============ + +File tracers implement measurement support for non-Python files. File tracers +implement the :meth:`~coverage.CoveragePlugin.file_tracer` method to claim +files and the :meth:`~coverage.CoveragePlugin.file_reporter` method to report +on those files. + +In your ``coverage_init`` function, use the ``add_file_tracer`` method to +register your file tracer. + + +.. _configurer_plugins: + +Configurers +=========== + +.. versionadded:: 4.5 + +Configurers modify the configuration of coverage.py during start-up. +Configurers implement the :meth:`~coverage.CoveragePlugin.configure` method to +change the configuration. + +In your ``coverage_init`` function, use the ``add_configurer`` method to +register your configurer. + + +.. _dynamic_context_plugins: + +Dynamic Context Switchers +========================= + +.. versionadded:: 5.0 + +Dynamic context switcher plugins implement the +:meth:`~coverage.CoveragePlugin.dynamic_context` method to dynamically compute +the context label for each measured frame. + +Computed context labels are useful when you want to group measured data without +modifying the source code. + +For example, you could write a plugin that checks `frame.f_code` to inspect +the currently executed method, and set the context label to a fully qualified +method name if it's an instance method of `unittest.TestCase` and the method +name starts with 'test'. Such a plugin would provide basic coverage grouping +by test and could be used with test runners that have no built-in coveragepy +support. + +In your ``coverage_init`` function, use the ``add_dynamic_context`` method to +register your dynamic context switcher. + +""" + +from __future__ import annotations + +import dataclasses +import functools + +from types import FrameType +from typing import Any +from collections.abc import Iterable + +from coverage import files +from coverage.misc import _needs_to_implement +from coverage.types import TArc, TConfigurable, TLineNo, TSourceTokenLines + + +class CoveragePlugin: + """Base class for coverage.py plug-ins.""" + + _coverage_plugin_name: str + _coverage_enabled: bool + + def file_tracer(self, filename: str) -> FileTracer | None: # pylint: disable=unused-argument + """Get a :class:`FileTracer` object for a file. + + Plug-in type: file tracer. + + Every Python source file is offered to your plug-in to give it a chance + to take responsibility for tracing the file. If your plug-in can + handle the file, it should return a :class:`FileTracer` object. + Otherwise return None. + + There is no way to register your plug-in for particular files. + Instead, this method is invoked for all files as they are executed, + and the plug-in decides whether it can trace the file or not. + Be prepared for `filename` to refer to all kinds of files that have + nothing to do with your plug-in. + + The file name will be a Python file being executed. There are two + broad categories of behavior for a plug-in, depending on the kind of + files your plug-in supports: + + * Static file names: each of your original source files has been + converted into a distinct Python file. Your plug-in is invoked with + the Python file name, and it maps it back to its original source + file. + + * Dynamic file names: all of your source files are executed by the same + Python file. In this case, your plug-in implements + :meth:`FileTracer.dynamic_source_filename` to provide the actual + source file for each execution frame. + + `filename` is a string, the path to the file being considered. This is + the absolute real path to the file. If you are comparing to other + paths, be sure to take this into account. + + Returns a :class:`FileTracer` object to use to trace `filename`, or + None if this plug-in cannot trace this file. + + """ + return None + + def file_reporter( + self, + filename: str, # pylint: disable=unused-argument + ) -> FileReporter | str: # str should be Literal["python"] + """Get the :class:`FileReporter` class to use for a file. + + Plug-in type: file tracer. + + This will only be invoked if `filename` returns non-None from + :meth:`file_tracer`. It's an error to return None from this method. + + Returns a :class:`FileReporter` object to use to report on `filename`, + or the string `"python"` to have coverage.py treat the file as Python. + + """ + _needs_to_implement(self, "file_reporter") + + def dynamic_context( + self, + frame: FrameType, # pylint: disable=unused-argument + ) -> str | None: + """Get the dynamically computed context label for `frame`. + + Plug-in type: dynamic context. + + This method is invoked for each frame when outside of a dynamic + context, to see if a new dynamic context should be started. If it + returns a string, a new context label is set for this and deeper + frames. The dynamic context ends when this frame returns. + + Returns a string to start a new dynamic context, or None if no new + context should be started. + + """ + return None + + def find_executable_files( + self, + src_dir: str, # pylint: disable=unused-argument + ) -> Iterable[str]: + """Yield all of the executable files in `src_dir`, recursively. + + Plug-in type: file tracer. + + Executability is a plug-in-specific property, but generally means files + which would have been considered for coverage analysis, had they been + included automatically. + + Returns or yields a sequence of strings, the paths to files that could + have been executed, including files that had been executed. + + """ + return [] + + def configure(self, config: TConfigurable) -> None: + """Modify the configuration of coverage.py. + + Plug-in type: configurer. + + This method is called during coverage.py start-up, to give your plug-in + a chance to change the configuration. The `config` parameter is an + object with :meth:`~coverage.Coverage.get_option` and + :meth:`~coverage.Coverage.set_option` methods. Do not call any other + methods on the `config` object. + + """ + pass + + def sys_info(self) -> Iterable[tuple[str, Any]]: + """Get a list of information useful for debugging. + + Plug-in type: any. + + This method will be invoked for ``--debug=sys``. Your + plug-in can return any information it wants to be displayed. + + Returns a list of pairs: `[(name, value), ...]`. + + """ + return [] + + +class CoveragePluginBase: + """Plugins produce specialized objects, which point back to the original plugin.""" + _coverage_plugin: CoveragePlugin + + +class FileTracer(CoveragePluginBase): + """Support needed for files during the execution phase. + + File tracer plug-ins implement subclasses of FileTracer to return from + their :meth:`~CoveragePlugin.file_tracer` method. + + You may construct this object from :meth:`CoveragePlugin.file_tracer` any + way you like. A natural choice would be to pass the file name given to + `file_tracer`. + + `FileTracer` objects should only be created in the + :meth:`CoveragePlugin.file_tracer` method. + + See :ref:`howitworks` for details of the different coverage.py phases. + + """ + + def source_filename(self) -> str: + """The source file name for this file. + + This may be any file name you like. A key responsibility of a plug-in + is to own the mapping from Python execution back to whatever source + file name was originally the source of the code. + + See :meth:`CoveragePlugin.file_tracer` for details about static and + dynamic file names. + + Returns the file name to credit with this execution. + + """ + _needs_to_implement(self, "source_filename") + + def has_dynamic_source_filename(self) -> bool: + """Does this FileTracer have dynamic source file names? + + FileTracers can provide dynamically determined file names by + implementing :meth:`dynamic_source_filename`. Invoking that function + is expensive. To determine whether to invoke it, coverage.py uses the + result of this function to know if it needs to bother invoking + :meth:`dynamic_source_filename`. + + See :meth:`CoveragePlugin.file_tracer` for details about static and + dynamic file names. + + Returns True if :meth:`dynamic_source_filename` should be called to get + dynamic source file names. + + """ + return False + + def dynamic_source_filename( + self, + filename: str, # pylint: disable=unused-argument + frame: FrameType, # pylint: disable=unused-argument + ) -> str | None: + """Get a dynamically computed source file name. + + Some plug-ins need to compute the source file name dynamically for each + frame. + + This function will not be invoked if + :meth:`has_dynamic_source_filename` returns False. + + Returns the source file name for this frame, or None if this frame + shouldn't be measured. + + """ + return None + + def line_number_range(self, frame: FrameType) -> tuple[TLineNo, TLineNo]: + """Get the range of source line numbers for a given a call frame. + + The call frame is examined, and the source line number in the original + file is returned. The return value is a pair of numbers, the starting + line number and the ending line number, both inclusive. For example, + returning (5, 7) means that lines 5, 6, and 7 should be considered + executed. + + This function might decide that the frame doesn't indicate any lines + from the source file were executed. Return (-1, -1) in this case to + tell coverage.py that no lines should be recorded for this frame. + + """ + lineno = frame.f_lineno + return lineno, lineno + + +@dataclasses.dataclass +class CodeRegion: + """Data for a region of code found by :meth:`FileReporter.code_regions`.""" + + #: The kind of region, like `"function"` or `"class"`. Must be one of the + #: singular values returned by :meth:`FileReporter.code_region_kinds`. + kind: str + + #: The name of the region. For example, a function or class name. + name: str + + #: The line in the source file to link to when navigating to the region. + #: Can be a line not mentioned in `lines`. + start: int + + #: The lines in the region. Should be lines that could be executed in the + #: region. For example, a class region includes all of the lines in the + #: methods of the class, but not the lines defining class attributes, since + #: they are executed on import, not as part of exercising the class. The + #: set can include non-executable lines like blanks and comments. + lines: set[int] + + def __lt__(self, other: CodeRegion) -> bool: + """To support sorting to make test-writing easier.""" + if self.name == other.name: + return min(self.lines) < min(other.lines) + return self.name < other.name + + +@functools.total_ordering +class FileReporter(CoveragePluginBase): + """Support needed for files during the analysis and reporting phases. + + File tracer plug-ins implement a subclass of `FileReporter`, and return + instances from their :meth:`CoveragePlugin.file_reporter` method. + + There are many methods here, but only :meth:`lines` is required, to provide + the set of executable lines in the file. + + See :ref:`howitworks` for details of the different coverage.py phases. + + """ + + def __init__(self, filename: str) -> None: + """Simple initialization of a `FileReporter`. + + The `filename` argument is the path to the file being reported. This + will be available as the `.filename` attribute on the object. Other + method implementations on this base class rely on this attribute. + + """ + self.filename = filename + + def __repr__(self) -> str: + return f"<{self.__class__.__name__} filename={self.filename!r}>" + + def relative_filename(self) -> str: + """Get the relative file name for this file. + + This file path will be displayed in reports. The default + implementation will supply the actual project-relative file path. You + only need to supply this method if you have an unusual syntax for file + paths. + + """ + return files.relative_filename(self.filename) + + def source(self) -> str: + """Get the source for the file. + + Returns a Unicode string. + + The base implementation simply reads the `self.filename` file and + decodes it as UTF-8. Override this method if your file isn't readable + as a text file, or if you need other encoding support. + + """ + with open(self.filename, encoding="utf-8") as f: + return f.read() + + def lines(self) -> set[TLineNo]: + """Get the executable lines in this file. + + Your plug-in must determine which lines in the file were possibly + executable. This method returns a set of those line numbers. + + Returns a set of line numbers. + + """ + _needs_to_implement(self, "lines") + + def excluded_lines(self) -> set[TLineNo]: + """Get the excluded executable lines in this file. + + Your plug-in can use any method it likes to allow the user to exclude + executable lines from consideration. + + Returns a set of line numbers. + + The base implementation returns the empty set. + + """ + return set() + + def translate_lines(self, lines: Iterable[TLineNo]) -> set[TLineNo]: + """Translate recorded lines into reported lines. + + Some file formats will want to report lines slightly differently than + they are recorded. For example, Python records the last line of a + multi-line statement, but reports are nicer if they mention the first + line. + + Your plug-in can optionally define this method to perform these kinds + of adjustment. + + `lines` is a sequence of integers, the recorded line numbers. + + Returns a set of integers, the adjusted line numbers. + + The base implementation returns the numbers unchanged. + + """ + return set(lines) + + def arcs(self) -> set[TArc]: + """Get the executable arcs in this file. + + To support branch coverage, your plug-in needs to be able to indicate + possible execution paths, as a set of line number pairs. Each pair is + a `(prev, next)` pair indicating that execution can transition from the + `prev` line number to the `next` line number. + + Returns a set of pairs of line numbers. The default implementation + returns an empty set. + + """ + return set() + + def no_branch_lines(self) -> set[TLineNo]: + """Get the lines excused from branch coverage in this file. + + Your plug-in can use any method it likes to allow the user to exclude + lines from consideration of branch coverage. + + Returns a set of line numbers. + + The base implementation returns the empty set. + + """ + return set() + + def translate_arcs(self, arcs: Iterable[TArc]) -> set[TArc]: + """Translate recorded arcs into reported arcs. + + Similar to :meth:`translate_lines`, but for arcs. `arcs` is a set of + line number pairs. + + Returns a set of line number pairs. + + The default implementation returns `arcs` unchanged. + + """ + return set(arcs) + + def exit_counts(self) -> dict[TLineNo, int]: + """Get a count of exits from that each line. + + To determine which lines are branches, coverage.py looks for lines that + have more than one exit. This function creates a dict mapping each + executable line number to a count of how many exits it has. + + To be honest, this feels wrong, and should be refactored. Let me know + if you attempt to implement this method in your plug-in... + + """ + return {} + + def missing_arc_description( + self, + start: TLineNo, + end: TLineNo, + executed_arcs: Iterable[TArc] | None = None, # pylint: disable=unused-argument + ) -> str: + """Provide an English sentence describing a missing arc. + + The `start` and `end` arguments are the line numbers of the missing + arc. Negative numbers indicate entering or exiting code objects. + + The `executed_arcs` argument is a set of line number pairs, the arcs + that were executed in this file. + + By default, this simply returns the string "Line {start} didn't jump + to {end}". + + """ + return f"Line {start} didn't jump to line {end}" + + def arc_description( + self, + start: TLineNo, # pylint: disable=unused-argument + end: TLineNo + ) -> str: + """Provide an English description of an arc's effect.""" + return f"jump to line {end}" + + def source_token_lines(self) -> TSourceTokenLines: + """Generate a series of tokenized lines, one for each line in `source`. + + These tokens are used for syntax-colored reports. + + Each line is a list of pairs, each pair is a token:: + + [("key", "def"), ("ws", " "), ("nam", "hello"), ("op", "("), ... ] + + Each pair has a token class, and the token text. The token classes + are: + + * ``"com"``: a comment + * ``"key"``: a keyword + * ``"nam"``: a name, or identifier + * ``"num"``: a number + * ``"op"``: an operator + * ``"str"``: a string literal + * ``"ws"``: some white space + * ``"txt"``: some other kind of text + + If you concatenate all the token texts, and then join them with + newlines, you should have your original source back. + + The default implementation simply returns each line tagged as + ``"txt"``. + + """ + for line in self.source().splitlines(): + yield [("txt", line)] + + def code_regions(self) -> Iterable[CodeRegion]: + """Identify regions in the source file for finer reporting than by file. + + Returns an iterable of :class:`CodeRegion` objects. The kinds reported + should be in the possibilities returned by :meth:`code_region_kinds`. + + """ + return [] + + def code_region_kinds(self) -> Iterable[tuple[str, str]]: + """Return the kinds of code regions this plugin can find. + + The returned pairs are the singular and plural forms of the kinds:: + + [ + ("function", "functions"), + ("class", "classes"), + ] + + This will usually be hard-coded, but could also differ by the specific + source file involved. + + """ + return [] + + def __eq__(self, other: Any) -> bool: + return isinstance(other, FileReporter) and self.filename == other.filename + + def __lt__(self, other: Any) -> bool: + return isinstance(other, FileReporter) and self.filename < other.filename + + # This object doesn't need to be hashed. + __hash__ = None # type: ignore[assignment] diff --git a/.venv/Lib/site-packages/coverage/plugin_support.py b/.venv/Lib/site-packages/coverage/plugin_support.py new file mode 100644 index 00000000..99e3bc22 --- /dev/null +++ b/.venv/Lib/site-packages/coverage/plugin_support.py @@ -0,0 +1,298 @@ +# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt + +"""Support for plugins.""" + +from __future__ import annotations + +import os +import os.path +import sys + +from types import FrameType +from typing import Any +from collections.abc import Iterable, Iterator + +from coverage.exceptions import PluginError +from coverage.misc import isolate_module +from coverage.plugin import CoveragePlugin, FileTracer, FileReporter +from coverage.types import ( + TArc, TConfigurable, TDebugCtl, TLineNo, TPluginConfig, TSourceTokenLines, +) + +os = isolate_module(os) + + +class Plugins: + """The currently loaded collection of coverage.py plugins.""" + + def __init__(self) -> None: + self.order: list[CoveragePlugin] = [] + self.names: dict[str, CoveragePlugin] = {} + self.file_tracers: list[CoveragePlugin] = [] + self.configurers: list[CoveragePlugin] = [] + self.context_switchers: list[CoveragePlugin] = [] + + self.current_module: str | None = None + self.debug: TDebugCtl | None + + @classmethod + def load_plugins( + cls, + modules: Iterable[str], + config: TPluginConfig, + debug: TDebugCtl | None = None, + ) -> Plugins: + """Load plugins from `modules`. + + Returns a Plugins object with the loaded and configured plugins. + + """ + plugins = cls() + plugins.debug = debug + + for module in modules: + plugins.current_module = module + __import__(module) + mod = sys.modules[module] + + coverage_init = getattr(mod, "coverage_init", None) + if not coverage_init: + raise PluginError( + f"Plugin module {module!r} didn't define a coverage_init function", + ) + + options = config.get_plugin_options(module) + coverage_init(plugins, options) + + plugins.current_module = None + return plugins + + def add_file_tracer(self, plugin: CoveragePlugin) -> None: + """Add a file tracer plugin. + + `plugin` is an instance of a third-party plugin class. It must + implement the :meth:`CoveragePlugin.file_tracer` method. + + """ + self._add_plugin(plugin, self.file_tracers) + + def add_configurer(self, plugin: CoveragePlugin) -> None: + """Add a configuring plugin. + + `plugin` is an instance of a third-party plugin class. It must + implement the :meth:`CoveragePlugin.configure` method. + + """ + self._add_plugin(plugin, self.configurers) + + def add_dynamic_context(self, plugin: CoveragePlugin) -> None: + """Add a dynamic context plugin. + + `plugin` is an instance of a third-party plugin class. It must + implement the :meth:`CoveragePlugin.dynamic_context` method. + + """ + self._add_plugin(plugin, self.context_switchers) + + def add_noop(self, plugin: CoveragePlugin) -> None: + """Add a plugin that does nothing. + + This is only useful for testing the plugin support. + + """ + self._add_plugin(plugin, None) + + def _add_plugin( + self, + plugin: CoveragePlugin, + specialized: list[CoveragePlugin] | None, + ) -> None: + """Add a plugin object. + + `plugin` is a :class:`CoveragePlugin` instance to add. `specialized` + is a list to append the plugin to. + + """ + plugin_name = f"{self.current_module}.{plugin.__class__.__name__}" + if self.debug and self.debug.should("plugin"): + self.debug.write(f"Loaded plugin {self.current_module!r}: {plugin!r}") + labelled = LabelledDebug(f"plugin {self.current_module!r}", self.debug) + plugin = DebugPluginWrapper(plugin, labelled) + + plugin._coverage_plugin_name = plugin_name + plugin._coverage_enabled = True + self.order.append(plugin) + self.names[plugin_name] = plugin + if specialized is not None: + specialized.append(plugin) + + def __bool__(self) -> bool: + return bool(self.order) + + def __iter__(self) -> Iterator[CoveragePlugin]: + return iter(self.order) + + def get(self, plugin_name: str) -> CoveragePlugin: + """Return a plugin by name.""" + return self.names[plugin_name] + + +class LabelledDebug: + """A Debug writer, but with labels for prepending to the messages.""" + + def __init__(self, label: str, debug: TDebugCtl, prev_labels: Iterable[str] = ()): + self.labels = list(prev_labels) + [label] + self.debug = debug + + def add_label(self, label: str) -> LabelledDebug: + """Add a label to the writer, and return a new `LabelledDebug`.""" + return LabelledDebug(label, self.debug, self.labels) + + def message_prefix(self) -> str: + """The prefix to use on messages, combining the labels.""" + prefixes = self.labels + [""] + return ":\n".join(" "*i+label for i, label in enumerate(prefixes)) + + def write(self, message: str) -> None: + """Write `message`, but with the labels prepended.""" + self.debug.write(f"{self.message_prefix()}{message}") + + +class DebugPluginWrapper(CoveragePlugin): + """Wrap a plugin, and use debug to report on what it's doing.""" + + def __init__(self, plugin: CoveragePlugin, debug: LabelledDebug) -> None: + super().__init__() + self.plugin = plugin + self.debug = debug + + def file_tracer(self, filename: str) -> FileTracer | None: + tracer = self.plugin.file_tracer(filename) + self.debug.write(f"file_tracer({filename!r}) --> {tracer!r}") + if tracer: + debug = self.debug.add_label(f"file {filename!r}") + tracer = DebugFileTracerWrapper(tracer, debug) + return tracer + + def file_reporter(self, filename: str) -> FileReporter | str: + reporter = self.plugin.file_reporter(filename) + assert isinstance(reporter, FileReporter) + self.debug.write(f"file_reporter({filename!r}) --> {reporter!r}") + if reporter: + debug = self.debug.add_label(f"file {filename!r}") + reporter = DebugFileReporterWrapper(filename, reporter, debug) + return reporter + + def dynamic_context(self, frame: FrameType) -> str | None: + context = self.plugin.dynamic_context(frame) + self.debug.write(f"dynamic_context({frame!r}) --> {context!r}") + return context + + def find_executable_files(self, src_dir: str) -> Iterable[str]: + executable_files = self.plugin.find_executable_files(src_dir) + self.debug.write(f"find_executable_files({src_dir!r}) --> {executable_files!r}") + return executable_files + + def configure(self, config: TConfigurable) -> None: + self.debug.write(f"configure({config!r})") + self.plugin.configure(config) + + def sys_info(self) -> Iterable[tuple[str, Any]]: + return self.plugin.sys_info() + + +class DebugFileTracerWrapper(FileTracer): + """A debugging `FileTracer`.""" + + def __init__(self, tracer: FileTracer, debug: LabelledDebug) -> None: + self.tracer = tracer + self.debug = debug + + def _show_frame(self, frame: FrameType) -> str: + """A short string identifying a frame, for debug messages.""" + return "%s@%d" % ( + os.path.basename(frame.f_code.co_filename), + frame.f_lineno, + ) + + def source_filename(self) -> str: + sfilename = self.tracer.source_filename() + self.debug.write(f"source_filename() --> {sfilename!r}") + return sfilename + + def has_dynamic_source_filename(self) -> bool: + has = self.tracer.has_dynamic_source_filename() + self.debug.write(f"has_dynamic_source_filename() --> {has!r}") + return has + + def dynamic_source_filename(self, filename: str, frame: FrameType) -> str | None: + dyn = self.tracer.dynamic_source_filename(filename, frame) + self.debug.write("dynamic_source_filename({!r}, {}) --> {!r}".format( + filename, self._show_frame(frame), dyn, + )) + return dyn + + def line_number_range(self, frame: FrameType) -> tuple[TLineNo, TLineNo]: + pair = self.tracer.line_number_range(frame) + self.debug.write(f"line_number_range({self._show_frame(frame)}) --> {pair!r}") + return pair + + +class DebugFileReporterWrapper(FileReporter): + """A debugging `FileReporter`.""" + + def __init__(self, filename: str, reporter: FileReporter, debug: LabelledDebug) -> None: + super().__init__(filename) + self.reporter = reporter + self.debug = debug + + def relative_filename(self) -> str: + ret = self.reporter.relative_filename() + self.debug.write(f"relative_filename() --> {ret!r}") + return ret + + def lines(self) -> set[TLineNo]: + ret = self.reporter.lines() + self.debug.write(f"lines() --> {ret!r}") + return ret + + def excluded_lines(self) -> set[TLineNo]: + ret = self.reporter.excluded_lines() + self.debug.write(f"excluded_lines() --> {ret!r}") + return ret + + def translate_lines(self, lines: Iterable[TLineNo]) -> set[TLineNo]: + ret = self.reporter.translate_lines(lines) + self.debug.write(f"translate_lines({lines!r}) --> {ret!r}") + return ret + + def translate_arcs(self, arcs: Iterable[TArc]) -> set[TArc]: + ret = self.reporter.translate_arcs(arcs) + self.debug.write(f"translate_arcs({arcs!r}) --> {ret!r}") + return ret + + def no_branch_lines(self) -> set[TLineNo]: + ret = self.reporter.no_branch_lines() + self.debug.write(f"no_branch_lines() --> {ret!r}") + return ret + + def exit_counts(self) -> dict[TLineNo, int]: + ret = self.reporter.exit_counts() + self.debug.write(f"exit_counts() --> {ret!r}") + return ret + + def arcs(self) -> set[TArc]: + ret = self.reporter.arcs() + self.debug.write(f"arcs() --> {ret!r}") + return ret + + def source(self) -> str: + ret = self.reporter.source() + self.debug.write("source() --> %d chars" % (len(ret),)) + return ret + + def source_token_lines(self) -> TSourceTokenLines: + ret = list(self.reporter.source_token_lines()) + self.debug.write("source_token_lines() --> %d tokens" % (len(ret),)) + return ret diff --git a/.venv/Lib/site-packages/coverage/py.typed b/.venv/Lib/site-packages/coverage/py.typed new file mode 100644 index 00000000..bacd23a1 --- /dev/null +++ b/.venv/Lib/site-packages/coverage/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561 to indicate that this package has type hints. diff --git a/.venv/Lib/site-packages/coverage/python.py b/.venv/Lib/site-packages/coverage/python.py new file mode 100644 index 00000000..e87ff43c --- /dev/null +++ b/.venv/Lib/site-packages/coverage/python.py @@ -0,0 +1,273 @@ +# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt + +"""Python source expertise for coverage.py""" + +from __future__ import annotations + +import os.path +import types +import zipimport + +from typing import TYPE_CHECKING +from collections.abc import Iterable + +from coverage import env +from coverage.exceptions import CoverageException, NoSource +from coverage.files import canonical_filename, relative_filename, zip_location +from coverage.misc import isolate_module, join_regex +from coverage.parser import PythonParser +from coverage.phystokens import source_token_lines, source_encoding +from coverage.plugin import CodeRegion, FileReporter +from coverage.regions import code_regions +from coverage.types import TArc, TLineNo, TMorf, TSourceTokenLines + +if TYPE_CHECKING: + from coverage import Coverage + +os = isolate_module(os) + + +def read_python_source(filename: str) -> bytes: + """Read the Python source text from `filename`. + + Returns bytes. + + """ + with open(filename, "rb") as f: + source = f.read() + + return source.replace(b"\r\n", b"\n").replace(b"\r", b"\n") + + +def get_python_source(filename: str) -> str: + """Return the source code, as unicode.""" + base, ext = os.path.splitext(filename) + if ext == ".py" and env.WINDOWS: + exts = [".py", ".pyw"] + else: + exts = [ext] + + source_bytes: bytes | None + for ext in exts: + try_filename = base + ext + if os.path.exists(try_filename): + # A regular text file: open it. + source_bytes = read_python_source(try_filename) + break + + # Maybe it's in a zip file? + source_bytes = get_zip_bytes(try_filename) + if source_bytes is not None: + break + else: + # Couldn't find source. + raise NoSource(f"No source for code: '{filename}'.") + + # Replace \f because of http://bugs.python.org/issue19035 + source_bytes = source_bytes.replace(b"\f", b" ") + source = source_bytes.decode(source_encoding(source_bytes), "replace") + + # Python code should always end with a line with a newline. + if source and source[-1] != "\n": + source += "\n" + + return source + + +def get_zip_bytes(filename: str) -> bytes | None: + """Get data from `filename` if it is a zip file path. + + Returns the bytestring data read from the zip file, or None if no zip file + could be found or `filename` isn't in it. The data returned will be + an empty string if the file is empty. + + """ + zipfile_inner = zip_location(filename) + if zipfile_inner is not None: + zipfile, inner = zipfile_inner + try: + zi = zipimport.zipimporter(zipfile) + except zipimport.ZipImportError: + return None + try: + data = zi.get_data(inner) + except OSError: + return None + return data + return None + + +def source_for_file(filename: str) -> str: + """Return the source filename for `filename`. + + Given a file name being traced, return the best guess as to the source + file to attribute it to. + + """ + if filename.endswith(".py"): + # .py files are themselves source files. + return filename + + elif filename.endswith((".pyc", ".pyo")): + # Bytecode files probably have source files near them. + py_filename = filename[:-1] + if os.path.exists(py_filename): + # Found a .py file, use that. + return py_filename + if env.WINDOWS: + # On Windows, it could be a .pyw file. + pyw_filename = py_filename + "w" + if os.path.exists(pyw_filename): + return pyw_filename + # Didn't find source, but it's probably the .py file we want. + return py_filename + + # No idea, just use the file name as-is. + return filename + + +def source_for_morf(morf: TMorf) -> str: + """Get the source filename for the module-or-file `morf`.""" + if hasattr(morf, "__file__") and morf.__file__: + filename = morf.__file__ + elif isinstance(morf, types.ModuleType): + # A module should have had .__file__, otherwise we can't use it. + # This could be a PEP-420 namespace package. + raise CoverageException(f"Module {morf} has no file") + else: + filename = morf + + filename = source_for_file(filename) + return filename + + +class PythonFileReporter(FileReporter): + """Report support for a Python file.""" + + def __init__(self, morf: TMorf, coverage: Coverage | None = None) -> None: + self.coverage = coverage + + filename = source_for_morf(morf) + + fname = filename + canonicalize = True + if self.coverage is not None: + if self.coverage.config.relative_files: + canonicalize = False + if canonicalize: + fname = canonical_filename(filename) + super().__init__(fname) + + if hasattr(morf, "__name__"): + name = morf.__name__.replace(".", os.sep) + if os.path.basename(filename).startswith("__init__."): + name += os.sep + "__init__" + name += ".py" + else: + name = relative_filename(filename) + self.relname = name + + self._source: str | None = None + self._parser: PythonParser | None = None + self._excluded = None + + def __repr__(self) -> str: + return f"" + + def relative_filename(self) -> str: + return self.relname + + @property + def parser(self) -> PythonParser: + """Lazily create a :class:`PythonParser`.""" + assert self.coverage is not None + if self._parser is None: + self._parser = PythonParser( + filename=self.filename, + exclude=self.coverage._exclude_regex("exclude"), + ) + self._parser.parse_source() + return self._parser + + def lines(self) -> set[TLineNo]: + """Return the line numbers of statements in the file.""" + return self.parser.statements + + def excluded_lines(self) -> set[TLineNo]: + """Return the line numbers of statements in the file.""" + return self.parser.excluded + + def translate_lines(self, lines: Iterable[TLineNo]) -> set[TLineNo]: + return self.parser.translate_lines(lines) + + def translate_arcs(self, arcs: Iterable[TArc]) -> set[TArc]: + return self.parser.translate_arcs(arcs) + + def no_branch_lines(self) -> set[TLineNo]: + assert self.coverage is not None + no_branch = self.parser.lines_matching( + join_regex( + self.coverage.config.partial_list + + self.coverage.config.partial_always_list + ) + ) + return no_branch + + def arcs(self) -> set[TArc]: + return self.parser.arcs() + + def exit_counts(self) -> dict[TLineNo, int]: + return self.parser.exit_counts() + + def missing_arc_description( + self, + start: TLineNo, + end: TLineNo, + executed_arcs: Iterable[TArc] | None = None, + ) -> str: + return self.parser.missing_arc_description(start, end) + + def arc_description( + self, + start: TLineNo, + end: TLineNo + ) -> str: + return self.parser.arc_description(start, end) + + def source(self) -> str: + if self._source is None: + self._source = get_python_source(self.filename) + return self._source + + def should_be_python(self) -> bool: + """Does it seem like this file should contain Python? + + This is used to decide if a file reported as part of the execution of + a program was really likely to have contained Python in the first + place. + + """ + # Get the file extension. + _, ext = os.path.splitext(self.filename) + + # Anything named *.py* should be Python. + if ext.startswith(".py"): + return True + # A file with no extension should be Python. + if not ext: + return True + # Everything else is probably not Python. + return False + + def source_token_lines(self) -> TSourceTokenLines: + return source_token_lines(self.source()) + + def code_regions(self) -> Iterable[CodeRegion]: + return code_regions(self.source()) + + def code_region_kinds(self) -> Iterable[tuple[str, str]]: + return [ + ("function", "functions"), + ("class", "classes"), + ] diff --git a/.venv/Lib/site-packages/coverage/pytracer.py b/.venv/Lib/site-packages/coverage/pytracer.py new file mode 100644 index 00000000..81401db3 --- /dev/null +++ b/.venv/Lib/site-packages/coverage/pytracer.py @@ -0,0 +1,362 @@ +# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt + +"""Raw data collector for coverage.py.""" + +from __future__ import annotations + +import atexit +import dis +import itertools +import sys +import threading + +from types import FrameType, ModuleType +from typing import Any, Callable, cast + +from coverage import env +from coverage.types import ( + TArc, + TFileDisposition, + TLineNo, + TShouldStartContextFn, + TShouldTraceFn, + TTraceData, + TTraceFileData, + TTraceFn, + TWarnFn, + Tracer, +) + +# We need the YIELD_VALUE opcode below, in a comparison-friendly form. +# PYVERSIONS: RESUME is new in Python3.11 +RESUME = dis.opmap.get("RESUME") +RETURN_VALUE = dis.opmap["RETURN_VALUE"] +if RESUME is None: + YIELD_VALUE = dis.opmap["YIELD_VALUE"] + YIELD_FROM = dis.opmap["YIELD_FROM"] + YIELD_FROM_OFFSET = 0 if env.PYPY else 2 +else: + YIELD_VALUE = YIELD_FROM = YIELD_FROM_OFFSET = -1 + +# When running meta-coverage, this file can try to trace itself, which confuses +# everything. Don't trace ourselves. + +THIS_FILE = __file__.rstrip("co") + +class PyTracer(Tracer): + """Python implementation of the raw data tracer.""" + + # Because of poor implementations of trace-function-manipulating tools, + # the Python trace function must be kept very simple. In particular, there + # must be only one function ever set as the trace function, both through + # sys.settrace, and as the return value from the trace function. Put + # another way, the trace function must always return itself. It cannot + # swap in other functions, or return None to avoid tracing a particular + # frame. + # + # The trace manipulator that introduced this restriction is DecoratorTools, + # which sets a trace function, and then later restores the pre-existing one + # by calling sys.settrace with a function it found in the current frame. + # + # Systems that use DecoratorTools (or similar trace manipulations) must use + # PyTracer to get accurate results. The command-line --timid argument is + # used to force the use of this tracer. + + tracer_ids = itertools.count() + + def __init__(self) -> None: + # Which tracer are we? + self.id = next(self.tracer_ids) + + # Attributes set from the collector: + self.data: TTraceData + self.trace_arcs = False + self.should_trace: TShouldTraceFn + self.should_trace_cache: dict[str, TFileDisposition | None] + self.should_start_context: TShouldStartContextFn | None = None + self.switch_context: Callable[[str | None], None] | None = None + self.lock_data: Callable[[], None] + self.unlock_data: Callable[[], None] + self.warn: TWarnFn + + # The threading module to use, if any. + self.threading: ModuleType | None = None + + self.cur_file_data: TTraceFileData | None = None + self.last_line: TLineNo = 0 + self.cur_file_name: str | None = None + self.context: str | None = None + self.started_context = False + + # The data_stack parallels the Python call stack. Each entry is + # information about an active frame, a four-element tuple: + # [0] The TTraceData for this frame's file. Could be None if we + # aren't tracing this frame. + # [1] The current file name for the frame. None if we aren't tracing + # this frame. + # [2] The last line number executed in this frame. + # [3] Boolean: did this frame start a new context? + self.data_stack: list[tuple[TTraceFileData | None, str | None, TLineNo, bool]] = [] + self.thread: threading.Thread | None = None + self.stopped = False + self._activity = False + + self.in_atexit = False + # On exit, self.in_atexit = True + atexit.register(setattr, self, "in_atexit", True) + + # Cache a bound method on the instance, so that we don't have to + # re-create a bound method object all the time. + self._cached_bound_method_trace: TTraceFn = self._trace + + def __repr__(self) -> str: + points = sum(len(v) for v in self.data.values()) + files = len(self.data) + return f"" + + def log(self, marker: str, *args: Any) -> None: + """For hard-core logging of what this tracer is doing.""" + with open("/tmp/debug_trace.txt", "a") as f: + f.write(f"{marker} {self.id}[{len(self.data_stack)}]") + if 0: # if you want thread ids.. + f.write(".{:x}.{:x}".format( # type: ignore[unreachable] + self.thread.ident, + self.threading.current_thread().ident, + )) + f.write(" {}".format(" ".join(map(str, args)))) + if 0: # if you want callers.. + f.write(" | ") # type: ignore[unreachable] + stack = " / ".join( + (fname or "???").rpartition("/")[-1] + for _, fname, _, _ in self.data_stack + ) + f.write(stack) + f.write("\n") + + def _trace( + self, + frame: FrameType, + event: str, + arg: Any, # pylint: disable=unused-argument + lineno: TLineNo | None = None, # pylint: disable=unused-argument + ) -> TTraceFn | None: + """The trace function passed to sys.settrace.""" + + if THIS_FILE in frame.f_code.co_filename: + return None + + # f = frame; code = f.f_code + # self.log(":", f"{code.co_filename} {f.f_lineno} {code.co_name}()", event) + + if (self.stopped and sys.gettrace() == self._cached_bound_method_trace): # pylint: disable=comparison-with-callable + # The PyTrace.stop() method has been called, possibly by another + # thread, let's deactivate ourselves now. + if 0: + f = frame # type: ignore[unreachable] + self.log("---\nX", f.f_code.co_filename, f.f_lineno) + while f: + self.log(">", f.f_code.co_filename, f.f_lineno, f.f_code.co_name, f.f_trace) + f = f.f_back + sys.settrace(None) + try: + self.cur_file_data, self.cur_file_name, self.last_line, self.started_context = ( + self.data_stack.pop() + ) + except IndexError: + self.log( + "Empty stack!", + frame.f_code.co_filename, + frame.f_lineno, + frame.f_code.co_name, + ) + return None + + # if event != "call" and frame.f_code.co_filename != self.cur_file_name: + # self.log("---\n*", frame.f_code.co_filename, self.cur_file_name, frame.f_lineno) + + if event == "call": + # Should we start a new context? + if self.should_start_context and self.context is None: + context_maybe = self.should_start_context(frame) # pylint: disable=not-callable + if context_maybe is not None: + self.context = context_maybe + started_context = True + assert self.switch_context is not None + self.switch_context(self.context) # pylint: disable=not-callable + else: + started_context = False + else: + started_context = False + self.started_context = started_context + + # Entering a new frame. Decide if we should trace in this file. + self._activity = True + self.data_stack.append( + ( + self.cur_file_data, + self.cur_file_name, + self.last_line, + started_context, + ), + ) + + # Improve tracing performance: when calling a function, both caller + # and callee are often within the same file. if that's the case, we + # don't have to re-check whether to trace the corresponding + # function (which is a little bit expensive since it involves + # dictionary lookups). This optimization is only correct if we + # didn't start a context. + filename = frame.f_code.co_filename + if filename != self.cur_file_name or started_context: + self.cur_file_name = filename + disp = self.should_trace_cache.get(filename) + if disp is None: + disp = self.should_trace(filename, frame) + self.should_trace_cache[filename] = disp + + self.cur_file_data = None + if disp.trace: + tracename = disp.source_filename + assert tracename is not None + self.lock_data() + try: + if tracename not in self.data: + self.data[tracename] = set() + finally: + self.unlock_data() + self.cur_file_data = self.data[tracename] + else: + frame.f_trace_lines = False + elif not self.cur_file_data: + frame.f_trace_lines = False + + # The call event is really a "start frame" event, and happens for + # function calls and re-entering generators. The f_lasti field is + # -1 for calls, and a real offset for generators. Use <0 as the + # line number for calls, and the real line number for generators. + if RESUME is not None: + # The current opcode is guaranteed to be RESUME. The argument + # determines what kind of resume it is. + oparg = frame.f_code.co_code[frame.f_lasti + 1] + real_call = (oparg == 0) + else: + real_call = (getattr(frame, "f_lasti", -1) < 0) + if real_call: + self.last_line = -frame.f_code.co_firstlineno + else: + self.last_line = frame.f_lineno + + elif event == "line": + # Record an executed line. + if self.cur_file_data is not None: + flineno: TLineNo = frame.f_lineno + + if self.trace_arcs: + cast(set[TArc], self.cur_file_data).add((self.last_line, flineno)) + else: + cast(set[TLineNo], self.cur_file_data).add(flineno) + self.last_line = flineno + + elif event == "return": + if self.trace_arcs and self.cur_file_data: + # Record an arc leaving the function, but beware that a + # "return" event might just mean yielding from a generator. + code = frame.f_code.co_code + lasti = frame.f_lasti + if RESUME is not None: + if len(code) == lasti + 2: + # A return from the end of a code object is a real return. + real_return = True + else: + # It is a real return if we aren't going to resume next. + if env.PYBEHAVIOR.lasti_is_yield: + lasti += 2 + real_return = (code[lasti] != RESUME) + else: + if code[lasti] == RETURN_VALUE: + real_return = True + elif code[lasti] == YIELD_VALUE: + real_return = False + elif len(code) <= lasti + YIELD_FROM_OFFSET: + real_return = True + elif code[lasti + YIELD_FROM_OFFSET] == YIELD_FROM: + real_return = False + else: + real_return = True + if real_return: + first = frame.f_code.co_firstlineno + cast(set[TArc], self.cur_file_data).add((self.last_line, -first)) + + # Leaving this function, pop the filename stack. + self.cur_file_data, self.cur_file_name, self.last_line, self.started_context = ( + self.data_stack.pop() + ) + # Leaving a context? + if self.started_context: + assert self.switch_context is not None + self.context = None + self.switch_context(None) # pylint: disable=not-callable + return self._cached_bound_method_trace + + def start(self) -> TTraceFn: + """Start this Tracer. + + Return a Python function suitable for use with sys.settrace(). + + """ + self.stopped = False + if self.threading: + if self.thread is None: + self.thread = self.threading.current_thread() + + sys.settrace(self._cached_bound_method_trace) + return self._cached_bound_method_trace + + def stop(self) -> None: + """Stop this Tracer.""" + # Get the active tracer callback before setting the stop flag to be + # able to detect if the tracer was changed prior to stopping it. + tf = sys.gettrace() + + # Set the stop flag. The actual call to sys.settrace(None) will happen + # in the self._trace callback itself to make sure to call it from the + # right thread. + self.stopped = True + + if self.threading: + assert self.thread is not None + if self.thread.ident != self.threading.current_thread().ident: + # Called on a different thread than started us: we can't unhook + # ourselves, but we've set the flag that we should stop, so we + # won't do any more tracing. + #self.log("~", "stopping on different threads") + return + + # PyPy clears the trace function before running atexit functions, + # so don't warn if we are in atexit on PyPy and the trace function + # has changed to None. Metacoverage also messes this up, so don't + # warn if we are measuring ourselves. + suppress_warning = ( + (env.PYPY and self.in_atexit and tf is None) + or env.METACOV + ) + if self.warn and not suppress_warning: + if tf != self._cached_bound_method_trace: # pylint: disable=comparison-with-callable + self.warn( + "Trace function changed, data is likely wrong: " + + f"{tf!r} != {self._cached_bound_method_trace!r}", + slug="trace-changed", + ) + + def activity(self) -> bool: + """Has there been any activity?""" + return self._activity + + def reset_activity(self) -> None: + """Reset the activity() flag.""" + self._activity = False + + def get_stats(self) -> dict[str, int] | None: + """Return a dictionary of statistics, or None.""" + return None diff --git a/.venv/Lib/site-packages/coverage/regions.py b/.venv/Lib/site-packages/coverage/regions.py new file mode 100644 index 00000000..7954be69 --- /dev/null +++ b/.venv/Lib/site-packages/coverage/regions.py @@ -0,0 +1,126 @@ +# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt + +"""Find functions and classes in Python code.""" + +from __future__ import annotations + +import ast +import dataclasses + +from typing import cast + +from coverage.plugin import CodeRegion + + +@dataclasses.dataclass +class Context: + """The nested named context of a function or class.""" + name: str + kind: str + lines: set[int] + + +class RegionFinder: + """An ast visitor that will find and track regions of code. + + Functions and classes are tracked by name. Results are in the .regions + attribute. + + """ + def __init__(self) -> None: + self.regions: list[CodeRegion] = [] + self.context: list[Context] = [] + + def parse_source(self, source: str) -> None: + """Parse `source` and walk the ast to populate the .regions attribute.""" + self.handle_node(ast.parse(source)) + + def fq_node_name(self) -> str: + """Get the current fully qualified name we're processing.""" + return ".".join(c.name for c in self.context) + + def handle_node(self, node: ast.AST) -> None: + """Recursively handle any node.""" + if isinstance(node, (ast.FunctionDef, ast.AsyncFunctionDef)): + self.handle_FunctionDef(node) + elif isinstance(node, ast.ClassDef): + self.handle_ClassDef(node) + else: + self.handle_node_body(node) + + def handle_node_body(self, node: ast.AST) -> None: + """Recursively handle the nodes in this node's body, if any.""" + for body_node in getattr(node, "body", ()): + self.handle_node(body_node) + + def handle_FunctionDef(self, node: ast.FunctionDef | ast.AsyncFunctionDef) -> None: + """Called for `def` or `async def`.""" + lines = set(range(node.body[0].lineno, cast(int, node.body[-1].end_lineno) + 1)) + if self.context and self.context[-1].kind == "class": + # Function bodies are part of their enclosing class. + self.context[-1].lines |= lines + # Function bodies should be excluded from the nearest enclosing function. + for ancestor in reversed(self.context): + if ancestor.kind == "function": + ancestor.lines -= lines + break + self.context.append(Context(node.name, "function", lines)) + self.regions.append( + CodeRegion( + kind="function", + name=self.fq_node_name(), + start=node.lineno, + lines=lines, + ) + ) + self.handle_node_body(node) + self.context.pop() + + def handle_ClassDef(self, node: ast.ClassDef) -> None: + """Called for `class`.""" + # The lines for a class are the lines in the methods of the class. + # We start empty, and count on visit_FunctionDef to add the lines it + # finds. + lines: set[int] = set() + self.context.append(Context(node.name, "class", lines)) + self.regions.append( + CodeRegion( + kind="class", + name=self.fq_node_name(), + start=node.lineno, + lines=lines, + ) + ) + self.handle_node_body(node) + self.context.pop() + # Class bodies should be excluded from the enclosing classes. + for ancestor in reversed(self.context): + if ancestor.kind == "class": + ancestor.lines -= lines + + +def code_regions(source: str) -> list[CodeRegion]: + """Find function and class regions in source code. + + Analyzes the code in `source`, and returns a list of :class:`CodeRegion` + objects describing functions and classes as regions of the code:: + + [ + CodeRegion(kind="function", name="func1", start=8, lines={10, 11, 12}), + CodeRegion(kind="function", name="MyClass.method", start=30, lines={34, 35, 36}), + CodeRegion(kind="class", name="MyClass", start=25, lines={34, 35, 36}), + ] + + The line numbers will include comments and blank lines. Later processing + will need to ignore those lines as needed. + + Nested functions and classes are excluded from their enclosing region. No + line should be reported as being part of more than one function, or more + than one class. Lines in methods are reported as being in a function and + in a class. + + """ + rf = RegionFinder() + rf.parse_source(source) + return rf.regions diff --git a/.venv/Lib/site-packages/coverage/report.py b/.venv/Lib/site-packages/coverage/report.py new file mode 100644 index 00000000..bf04f2a8 --- /dev/null +++ b/.venv/Lib/site-packages/coverage/report.py @@ -0,0 +1,282 @@ +# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt + +"""Summary reporting""" + +from __future__ import annotations + +import sys + +from typing import Any, IO, TYPE_CHECKING +from collections.abc import Iterable + +from coverage.exceptions import ConfigError, NoDataError +from coverage.misc import human_sorted_items +from coverage.plugin import FileReporter +from coverage.report_core import get_analysis_to_report +from coverage.results import Analysis, Numbers +from coverage.types import TMorf + +if TYPE_CHECKING: + from coverage import Coverage + + +class SummaryReporter: + """A reporter for writing the summary report.""" + + def __init__(self, coverage: Coverage) -> None: + self.coverage = coverage + self.config = self.coverage.config + self.branches = coverage.get_data().has_arcs() + self.outfile: IO[str] | None = None + self.output_format = self.config.format or "text" + if self.output_format not in {"text", "markdown", "total"}: + raise ConfigError(f"Unknown report format choice: {self.output_format!r}") + self.fr_analysis: list[tuple[FileReporter, Analysis]] = [] + self.skipped_count = 0 + self.empty_count = 0 + self.total = Numbers(precision=self.config.precision) + + def write(self, line: str) -> None: + """Write a line to the output, adding a newline.""" + assert self.outfile is not None + self.outfile.write(line.rstrip()) + self.outfile.write("\n") + + def write_items(self, items: Iterable[str]) -> None: + """Write a list of strings, joined together.""" + self.write("".join(items)) + + def _report_text( + self, + header: list[str], + lines_values: list[list[Any]], + total_line: list[Any], + end_lines: list[str], + ) -> None: + """Internal method that prints report data in text format. + + `header` is a list with captions. + `lines_values` is list of lists of sortable values. + `total_line` is a list with values of the total line. + `end_lines` is a list of ending lines with information about skipped files. + + """ + # Prepare the formatting strings, header, and column sorting. + max_name = max([len(line[0]) for line in lines_values] + [5]) + 1 + max_n = max(len(total_line[header.index("Cover")]) + 2, len(" Cover")) + 1 + max_n = max([max_n] + [len(line[header.index("Cover")]) + 2 for line in lines_values]) + formats = dict( + Name="{:{name_len}}", + Stmts="{:>7}", + Miss="{:>7}", + Branch="{:>7}", + BrPart="{:>7}", + Cover="{:>{n}}", + Missing="{:>10}", + ) + header_items = [ + formats[item].format(item, name_len=max_name, n=max_n) + for item in header + ] + header_str = "".join(header_items) + rule = "-" * len(header_str) + + # Write the header + self.write(header_str) + self.write(rule) + + formats.update(dict(Cover="{:>{n}}%"), Missing=" {:9}") + for values in lines_values: + # build string with line values + line_items = [ + formats[item].format(str(value), + name_len=max_name, n=max_n-1) for item, value in zip(header, values) + ] + self.write_items(line_items) + + # Write a TOTAL line + if lines_values: + self.write(rule) + + line_items = [ + formats[item].format(str(value), + name_len=max_name, n=max_n-1) for item, value in zip(header, total_line) + ] + self.write_items(line_items) + + for end_line in end_lines: + self.write(end_line) + + def _report_markdown( + self, + header: list[str], + lines_values: list[list[Any]], + total_line: list[Any], + end_lines: list[str], + ) -> None: + """Internal method that prints report data in markdown format. + + `header` is a list with captions. + `lines_values` is a sorted list of lists containing coverage information. + `total_line` is a list with values of the total line. + `end_lines` is a list of ending lines with information about skipped files. + + """ + # Prepare the formatting strings, header, and column sorting. + max_name = max((len(line[0].replace("_", "\\_")) for line in lines_values), default=0) + max_name = max(max_name, len("**TOTAL**")) + 1 + formats = dict( + Name="| {:{name_len}}|", + Stmts="{:>9} |", + Miss="{:>9} |", + Branch="{:>9} |", + BrPart="{:>9} |", + Cover="{:>{n}} |", + Missing="{:>10} |", + ) + max_n = max(len(total_line[header.index("Cover")]) + 6, len(" Cover ")) + header_items = [formats[item].format(item, name_len=max_name, n=max_n) for item in header] + header_str = "".join(header_items) + rule_str = "|" + " ".join(["- |".rjust(len(header_items[0])-1, "-")] + + ["-: |".rjust(len(item)-1, "-") for item in header_items[1:]], + ) + + # Write the header + self.write(header_str) + self.write(rule_str) + + for values in lines_values: + # build string with line values + formats.update(dict(Cover="{:>{n}}% |")) + line_items = [ + formats[item].format(str(value).replace("_", "\\_"), name_len=max_name, n=max_n-1) + for item, value in zip(header, values) + ] + self.write_items(line_items) + + # Write the TOTAL line + formats.update(dict(Name="|{:>{name_len}} |", Cover="{:>{n}} |")) + total_line_items: list[str] = [] + for item, value in zip(header, total_line): + if value == "": + insert = value + elif item == "Cover": + insert = f" **{value}%**" + else: + insert = f" **{value}**" + total_line_items += formats[item].format(insert, name_len=max_name, n=max_n) + self.write_items(total_line_items) + for end_line in end_lines: + self.write(end_line) + + def report(self, morfs: Iterable[TMorf] | None, outfile: IO[str] | None = None) -> float: + """Writes a report summarizing coverage statistics per module. + + `outfile` is a text-mode file object to write the summary to. + + """ + self.outfile = outfile or sys.stdout + + self.coverage.get_data().set_query_contexts(self.config.report_contexts) + for fr, analysis in get_analysis_to_report(self.coverage, morfs): + self.report_one_file(fr, analysis) + + if not self.total.n_files and not self.skipped_count: + raise NoDataError("No data to report.") + + if self.output_format == "total": + self.write(self.total.pc_covered_str) + else: + self.tabular_report() + + return self.total.pc_covered + + def tabular_report(self) -> None: + """Writes tabular report formats.""" + # Prepare the header line and column sorting. + header = ["Name", "Stmts", "Miss"] + if self.branches: + header += ["Branch", "BrPart"] + header += ["Cover"] + if self.config.show_missing: + header += ["Missing"] + + column_order = dict(name=0, stmts=1, miss=2, cover=-1) + if self.branches: + column_order.update(dict(branch=3, brpart=4)) + + # `lines_values` is list of lists of sortable values. + lines_values = [] + + for (fr, analysis) in self.fr_analysis: + nums = analysis.numbers + + args = [fr.relative_filename(), nums.n_statements, nums.n_missing] + if self.branches: + args += [nums.n_branches, nums.n_partial_branches] + args += [nums.pc_covered_str] + if self.config.show_missing: + args += [analysis.missing_formatted(branches=True)] + args += [nums.pc_covered] + lines_values.append(args) + + # Line sorting. + sort_option = (self.config.sort or "name").lower() + reverse = False + if sort_option[0] == "-": + reverse = True + sort_option = sort_option[1:] + elif sort_option[0] == "+": + sort_option = sort_option[1:] + sort_idx = column_order.get(sort_option) + if sort_idx is None: + raise ConfigError(f"Invalid sorting option: {self.config.sort!r}") + if sort_option == "name": + lines_values = human_sorted_items(lines_values, reverse=reverse) + else: + lines_values.sort( + key=lambda line: (line[sort_idx], line[0]), + reverse=reverse, + ) + + # Calculate total if we had at least one file. + total_line = ["TOTAL", self.total.n_statements, self.total.n_missing] + if self.branches: + total_line += [self.total.n_branches, self.total.n_partial_branches] + total_line += [self.total.pc_covered_str] + if self.config.show_missing: + total_line += [""] + + # Create other final lines. + end_lines = [] + if self.config.skip_covered and self.skipped_count: + file_suffix = "s" if self.skipped_count>1 else "" + end_lines.append( + f"\n{self.skipped_count} file{file_suffix} skipped due to complete coverage.", + ) + if self.config.skip_empty and self.empty_count: + file_suffix = "s" if self.empty_count > 1 else "" + end_lines.append(f"\n{self.empty_count} empty file{file_suffix} skipped.") + + if self.output_format == "markdown": + formatter = self._report_markdown + else: + formatter = self._report_text + formatter(header, lines_values, total_line, end_lines) + + def report_one_file(self, fr: FileReporter, analysis: Analysis) -> None: + """Report on just one file, the callback from report().""" + nums = analysis.numbers + self.total += nums + + no_missing_lines = (nums.n_missing == 0) + no_missing_branches = (nums.n_partial_branches == 0) + if self.config.skip_covered and no_missing_lines and no_missing_branches: + # Don't report on 100% files. + self.skipped_count += 1 + elif self.config.skip_empty and nums.n_statements == 0: + # Don't report on empty files. + self.empty_count += 1 + else: + self.fr_analysis.append((fr, analysis)) diff --git a/.venv/Lib/site-packages/coverage/report_core.py b/.venv/Lib/site-packages/coverage/report_core.py new file mode 100644 index 00000000..477034ba --- /dev/null +++ b/.venv/Lib/site-packages/coverage/report_core.py @@ -0,0 +1,120 @@ +# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt + +"""Reporter foundation for coverage.py.""" + +from __future__ import annotations + +import sys + +from typing import ( + Callable, IO, Protocol, TYPE_CHECKING, +) +from collections.abc import Iterable, Iterator + +from coverage.exceptions import NoDataError, NotPython +from coverage.files import prep_patterns, GlobMatcher +from coverage.misc import ensure_dir_for_file, file_be_gone +from coverage.plugin import FileReporter +from coverage.results import Analysis +from coverage.types import TMorf + +if TYPE_CHECKING: + from coverage import Coverage + + +class Reporter(Protocol): + """What we expect of reporters.""" + + report_type: str + + def report(self, morfs: Iterable[TMorf] | None, outfile: IO[str]) -> float: + """Generate a report of `morfs`, written to `outfile`.""" + + +def render_report( + output_path: str, + reporter: Reporter, + morfs: Iterable[TMorf] | None, + msgfn: Callable[[str], None], +) -> float: + """Run a one-file report generator, managing the output file. + + This function ensures the output file is ready to be written to. Then writes + the report to it. Then closes the file and cleans up. + + """ + file_to_close = None + delete_file = False + + if output_path == "-": + outfile = sys.stdout + else: + # Ensure that the output directory is created; done here because this + # report pre-opens the output file. HtmlReporter does this on its own + # because its task is more complex, being multiple files. + ensure_dir_for_file(output_path) + outfile = open(output_path, "w", encoding="utf-8") + file_to_close = outfile + delete_file = True + + try: + ret = reporter.report(morfs, outfile=outfile) + if file_to_close is not None: + msgfn(f"Wrote {reporter.report_type} to {output_path}") + delete_file = False + return ret + finally: + if file_to_close is not None: + file_to_close.close() + if delete_file: + file_be_gone(output_path) # pragma: part covered (doesn't return) + + +def get_analysis_to_report( + coverage: Coverage, + morfs: Iterable[TMorf] | None, +) -> Iterator[tuple[FileReporter, Analysis]]: + """Get the files to report on. + + For each morf in `morfs`, if it should be reported on (based on the omit + and include configuration options), yield a pair, the `FileReporter` and + `Analysis` for the morf. + + """ + fr_morfs = coverage._get_file_reporters(morfs) + config = coverage.config + + if config.report_include: + matcher = GlobMatcher(prep_patterns(config.report_include), "report_include") + fr_morfs = [(fr, morf) for (fr, morf) in fr_morfs if matcher.match(fr.filename)] + + if config.report_omit: + matcher = GlobMatcher(prep_patterns(config.report_omit), "report_omit") + fr_morfs = [(fr, morf) for (fr, morf) in fr_morfs if not matcher.match(fr.filename)] + + if not fr_morfs: + raise NoDataError("No data to report.") + + for fr, morf in sorted(fr_morfs): + try: + analysis = coverage._analyze(morf) + except NotPython: + # Only report errors for .py files, and only if we didn't + # explicitly suppress those errors. + # NotPython is only raised by PythonFileReporter, which has a + # should_be_python() method. + if fr.should_be_python(): # type: ignore[attr-defined] + if config.ignore_errors: + msg = f"Couldn't parse Python file '{fr.filename}'" + coverage._warn(msg, slug="couldnt-parse") + else: + raise + except Exception as exc: + if config.ignore_errors: + msg = f"Couldn't parse '{fr.filename}': {exc}".rstrip() + coverage._warn(msg, slug="couldnt-parse") + else: + raise + else: + yield (fr, analysis) diff --git a/.venv/Lib/site-packages/coverage/results.py b/.venv/Lib/site-packages/coverage/results.py new file mode 100644 index 00000000..dd14c8a2 --- /dev/null +++ b/.venv/Lib/site-packages/coverage/results.py @@ -0,0 +1,419 @@ +# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt + +"""Results of coverage measurement.""" + +from __future__ import annotations + +import collections +import dataclasses + +from collections.abc import Container, Iterable +from typing import TYPE_CHECKING + +from coverage.exceptions import ConfigError +from coverage.misc import nice_pair +from coverage.types import TArc, TLineNo + +if TYPE_CHECKING: + from coverage.data import CoverageData + from coverage.plugin import FileReporter + + +def analysis_from_file_reporter( + data: CoverageData, + precision: int, + file_reporter: FileReporter, + filename: str, +) -> Analysis: + """Create an Analysis from a FileReporter.""" + has_arcs = data.has_arcs() + statements = file_reporter.lines() + excluded = file_reporter.excluded_lines() + executed = file_reporter.translate_lines(data.lines(filename) or []) + + if has_arcs: + arc_possibilities_set = file_reporter.arcs() + arcs = data.arcs(filename) or [] + + # Reduce the set of arcs to the ones that could be branches. + dests = collections.defaultdict(set) + for fromno, tono in arc_possibilities_set: + dests[fromno].add(tono) + single_dests = { + fromno: list(tonos)[0] + for fromno, tonos in dests.items() + if len(tonos) == 1 + } + new_arcs = set() + for fromno, tono in arcs: + if fromno != tono: + new_arcs.add((fromno, tono)) + else: + if fromno in single_dests: + new_arcs.add((fromno, single_dests[fromno])) + + arcs_executed_set = file_reporter.translate_arcs(new_arcs) + exit_counts = file_reporter.exit_counts() + no_branch = file_reporter.no_branch_lines() + else: + arc_possibilities_set = set() + arcs_executed_set = set() + exit_counts = {} + no_branch = set() + + return Analysis( + precision=precision, + filename=filename, + has_arcs=has_arcs, + statements=statements, + excluded=excluded, + executed=executed, + arc_possibilities_set=arc_possibilities_set, + arcs_executed_set=arcs_executed_set, + exit_counts=exit_counts, + no_branch=no_branch, + ) + + +@dataclasses.dataclass +class Analysis: + """The results of analyzing a FileReporter.""" + + precision: int + filename: str + has_arcs: bool + statements: set[TLineNo] + excluded: set[TLineNo] + executed: set[TLineNo] + arc_possibilities_set: set[TArc] + arcs_executed_set: set[TArc] + exit_counts: dict[TLineNo, int] + no_branch: set[TLineNo] + + def __post_init__(self) -> None: + self.arc_possibilities = sorted(self.arc_possibilities_set) + self.arcs_executed = sorted(self.arcs_executed_set) + self.missing = self.statements - self.executed + + if self.has_arcs: + n_branches = self._total_branches() + mba = self.missing_branch_arcs() + n_partial_branches = sum(len(v) for k,v in mba.items() if k not in self.missing) + n_missing_branches = sum(len(v) for k,v in mba.items()) + else: + n_branches = n_partial_branches = n_missing_branches = 0 + + self.numbers = Numbers( + precision=self.precision, + n_files=1, + n_statements=len(self.statements), + n_excluded=len(self.excluded), + n_missing=len(self.missing), + n_branches=n_branches, + n_partial_branches=n_partial_branches, + n_missing_branches=n_missing_branches, + ) + + def narrow(self, lines: Container[TLineNo]) -> Analysis: + """Create a narrowed Analysis. + + The current analysis is copied to make a new one that only considers + the lines in `lines`. + """ + + statements = {lno for lno in self.statements if lno in lines} + excluded = {lno for lno in self.excluded if lno in lines} + executed = {lno for lno in self.executed if lno in lines} + + if self.has_arcs: + arc_possibilities_set = { + (a, b) for a, b in self.arc_possibilities_set + if a in lines or b in lines + } + arcs_executed_set = { + (a, b) for a, b in self.arcs_executed_set + if a in lines or b in lines + } + exit_counts = { + lno: num for lno, num in self.exit_counts.items() + if lno in lines + } + no_branch = {lno for lno in self.no_branch if lno in lines} + else: + arc_possibilities_set = set() + arcs_executed_set = set() + exit_counts = {} + no_branch = set() + + return Analysis( + precision=self.precision, + filename=self.filename, + has_arcs=self.has_arcs, + statements=statements, + excluded=excluded, + executed=executed, + arc_possibilities_set=arc_possibilities_set, + arcs_executed_set=arcs_executed_set, + exit_counts=exit_counts, + no_branch=no_branch, + ) + + def missing_formatted(self, branches: bool = False) -> str: + """The missing line numbers, formatted nicely. + + Returns a string like "1-2, 5-11, 13-14". + + If `branches` is true, includes the missing branch arcs also. + + """ + if branches and self.has_arcs: + arcs = self.missing_branch_arcs().items() + else: + arcs = None + + return format_lines(self.statements, self.missing, arcs=arcs) + + def arcs_missing(self) -> list[TArc]: + """Returns a sorted list of the un-executed arcs in the code.""" + missing = ( + p for p in self.arc_possibilities + if p not in self.arcs_executed + and p[0] not in self.no_branch + and p[1] not in self.excluded + ) + return sorted(missing) + + def _branch_lines(self) -> list[TLineNo]: + """Returns a list of line numbers that have more than one exit.""" + return [l1 for l1,count in self.exit_counts.items() if count > 1] + + def _total_branches(self) -> int: + """How many total branches are there?""" + return sum(count for count in self.exit_counts.values() if count > 1) + + def missing_branch_arcs(self) -> dict[TLineNo, list[TLineNo]]: + """Return arcs that weren't executed from branch lines. + + Returns {l1:[l2a,l2b,...], ...} + + """ + missing = self.arcs_missing() + branch_lines = set(self._branch_lines()) + mba = collections.defaultdict(list) + for l1, l2 in missing: + if l1 == l2: + continue + if l1 in branch_lines: + mba[l1].append(l2) + return mba + + def executed_branch_arcs(self) -> dict[TLineNo, list[TLineNo]]: + """Return arcs that were executed from branch lines. + + Only include ones that we considered possible. + + Returns {l1:[l2a,l2b,...], ...} + + """ + branch_lines = set(self._branch_lines()) + eba = collections.defaultdict(list) + for l1, l2 in self.arcs_executed: + if l1 == l2: + continue + if (l1, l2) not in self.arc_possibilities_set: + continue + if l1 in branch_lines: + eba[l1].append(l2) + return eba + + def branch_stats(self) -> dict[TLineNo, tuple[int, int]]: + """Get stats about branches. + + Returns a dict mapping line numbers to a tuple: + (total_exits, taken_exits). + """ + + missing_arcs = self.missing_branch_arcs() + stats = {} + for lnum in self._branch_lines(): + exits = self.exit_counts[lnum] + missing = len(missing_arcs[lnum]) + stats[lnum] = (exits, exits - missing) + return stats + + +@dataclasses.dataclass +class Numbers: + """The numerical results of measuring coverage. + + This holds the basic statistics from `Analysis`, and is used to roll + up statistics across files. + + """ + + precision: int = 0 + n_files: int = 0 + n_statements: int = 0 + n_excluded: int = 0 + n_missing: int = 0 + n_branches: int = 0 + n_partial_branches: int = 0 + n_missing_branches: int = 0 + + @property + def n_executed(self) -> int: + """Returns the number of executed statements.""" + return self.n_statements - self.n_missing + + @property + def n_executed_branches(self) -> int: + """Returns the number of executed branches.""" + return self.n_branches - self.n_missing_branches + + @property + def pc_covered(self) -> float: + """Returns a single percentage value for coverage.""" + if self.n_statements > 0: + numerator, denominator = self.ratio_covered + pc_cov = (100.0 * numerator) / denominator + else: + pc_cov = 100.0 + return pc_cov + + @property + def pc_covered_str(self) -> str: + """Returns the percent covered, as a string, without a percent sign. + + Note that "0" is only returned when the value is truly zero, and "100" + is only returned when the value is truly 100. Rounding can never + result in either "0" or "100". + + """ + return display_covered(self.pc_covered, self.precision) + + @property + def ratio_covered(self) -> tuple[int, int]: + """Return a numerator and denominator for the coverage ratio.""" + numerator = self.n_executed + self.n_executed_branches + denominator = self.n_statements + self.n_branches + return numerator, denominator + + def __add__(self, other: Numbers) -> Numbers: + return Numbers( + self.precision, + self.n_files + other.n_files, + self.n_statements + other.n_statements, + self.n_excluded + other.n_excluded, + self.n_missing + other.n_missing, + self.n_branches + other.n_branches, + self.n_partial_branches + other.n_partial_branches, + self.n_missing_branches + other.n_missing_branches, + ) + + def __radd__(self, other: int) -> Numbers: + # Implementing 0+Numbers allows us to sum() a list of Numbers. + assert other == 0 # we only ever call it this way. + return self + + +def display_covered(pc: float, precision: int) -> str: + """Return a displayable total percentage, as a string. + + Note that "0" is only returned when the value is truly zero, and "100" + is only returned when the value is truly 100. Rounding can never + result in either "0" or "100". + + """ + near0 = 1.0 / 10 ** precision + if 0 < pc < near0: + pc = near0 + elif (100.0 - near0) < pc < 100: + pc = 100.0 - near0 + else: + pc = round(pc, precision) + return "%.*f" % (precision, pc) + + +def _line_ranges( + statements: Iterable[TLineNo], + lines: Iterable[TLineNo], +) -> list[tuple[TLineNo, TLineNo]]: + """Produce a list of ranges for `format_lines`.""" + statements = sorted(statements) + lines = sorted(lines) + + pairs = [] + start = None + lidx = 0 + for stmt in statements: + if lidx >= len(lines): + break + if stmt == lines[lidx]: + lidx += 1 + if not start: + start = stmt + end = stmt + elif start: + pairs.append((start, end)) + start = None + if start: + pairs.append((start, end)) + return pairs + + +def format_lines( + statements: Iterable[TLineNo], + lines: Iterable[TLineNo], + arcs: Iterable[tuple[TLineNo, list[TLineNo]]] | None = None, +) -> str: + """Nicely format a list of line numbers. + + Format a list of line numbers for printing by coalescing groups of lines as + long as the lines represent consecutive statements. This will coalesce + even if there are gaps between statements. + + For example, if `statements` is [1,2,3,4,5,10,11,12,13,14] and + `lines` is [1,2,5,10,11,13,14] then the result will be "1-2, 5-11, 13-14". + + Both `lines` and `statements` can be any iterable. All of the elements of + `lines` must be in `statements`, and all of the values must be positive + integers. + + If `arcs` is provided, they are (start,[end,end,end]) pairs that will be + included in the output as long as start isn't in `lines`. + + """ + line_items = [(pair[0], nice_pair(pair)) for pair in _line_ranges(statements, lines)] + if arcs is not None: + line_exits = sorted(arcs) + for line, exits in line_exits: + for ex in sorted(exits): + if line not in lines and ex not in lines: + dest = (ex if ex > 0 else "exit") + line_items.append((line, f"{line}->{dest}")) + + ret = ", ".join(t[-1] for t in sorted(line_items)) + return ret + + +def should_fail_under(total: float, fail_under: float, precision: int) -> bool: + """Determine if a total should fail due to fail-under. + + `total` is a float, the coverage measurement total. `fail_under` is the + fail_under setting to compare with. `precision` is the number of digits + to consider after the decimal point. + + Returns True if the total should fail. + + """ + # We can never achieve higher than 100% coverage, or less than zero. + if not (0 <= fail_under <= 100.0): + msg = f"fail_under={fail_under} is invalid. Must be between 0 and 100." + raise ConfigError(msg) + + # Special case for fail_under=100, it must really be 100. + if fail_under == 100.0 and total != 100.0: + return True + + return round(total, precision) < fail_under diff --git a/.venv/Lib/site-packages/coverage/sqldata.py b/.venv/Lib/site-packages/coverage/sqldata.py new file mode 100644 index 00000000..76b56928 --- /dev/null +++ b/.venv/Lib/site-packages/coverage/sqldata.py @@ -0,0 +1,1103 @@ +# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt + +"""SQLite coverage data.""" + +from __future__ import annotations + +import collections +import datetime +import functools +import glob +import itertools +import os +import random +import socket +import sqlite3 +import string +import sys +import textwrap +import threading +import zlib + +from typing import ( + cast, Any, Callable, +) +from collections.abc import Collection, Mapping, Sequence + +from coverage.debug import NoDebugging, auto_repr +from coverage.exceptions import CoverageException, DataError +from coverage.misc import file_be_gone, isolate_module +from coverage.numbits import numbits_to_nums, numbits_union, nums_to_numbits +from coverage.sqlitedb import SqliteDb +from coverage.types import AnyCallable, FilePath, TArc, TDebugCtl, TLineNo, TWarnFn +from coverage.version import __version__ + +os = isolate_module(os) + +# If you change the schema: increment the SCHEMA_VERSION and update the +# docs in docs/dbschema.rst by running "make cogdoc". + +SCHEMA_VERSION = 7 + +# Schema versions: +# 1: Released in 5.0a2 +# 2: Added contexts in 5.0a3. +# 3: Replaced line table with line_map table. +# 4: Changed line_map.bitmap to line_map.numbits. +# 5: Added foreign key declarations. +# 6: Key-value in meta. +# 7: line_map -> line_bits + +SCHEMA = """\ +CREATE TABLE coverage_schema ( + -- One row, to record the version of the schema in this db. + version integer +); + +CREATE TABLE meta ( + -- Key-value pairs, to record metadata about the data + key text, + value text, + unique (key) + -- Possible keys: + -- 'has_arcs' boolean -- Is this data recording branches? + -- 'sys_argv' text -- The coverage command line that recorded the data. + -- 'version' text -- The version of coverage.py that made the file. + -- 'when' text -- Datetime when the file was created. +); + +CREATE TABLE file ( + -- A row per file measured. + id integer primary key, + path text, + unique (path) +); + +CREATE TABLE context ( + -- A row per context measured. + id integer primary key, + context text, + unique (context) +); + +CREATE TABLE line_bits ( + -- If recording lines, a row per context per file executed. + -- All of the line numbers for that file/context are in one numbits. + file_id integer, -- foreign key to `file`. + context_id integer, -- foreign key to `context`. + numbits blob, -- see the numbits functions in coverage.numbits + foreign key (file_id) references file (id), + foreign key (context_id) references context (id), + unique (file_id, context_id) +); + +CREATE TABLE arc ( + -- If recording branches, a row per context per from/to line transition executed. + file_id integer, -- foreign key to `file`. + context_id integer, -- foreign key to `context`. + fromno integer, -- line number jumped from. + tono integer, -- line number jumped to. + foreign key (file_id) references file (id), + foreign key (context_id) references context (id), + unique (file_id, context_id, fromno, tono) +); + +CREATE TABLE tracer ( + -- A row per file indicating the tracer used for that file. + file_id integer primary key, + tracer text, + foreign key (file_id) references file (id) +); +""" + +def _locked(method: AnyCallable) -> AnyCallable: + """A decorator for methods that should hold self._lock.""" + @functools.wraps(method) + def _wrapped(self: CoverageData, *args: Any, **kwargs: Any) -> Any: + if self._debug.should("lock"): + self._debug.write(f"Locking {self._lock!r} for {method.__name__}") + with self._lock: + if self._debug.should("lock"): + self._debug.write(f"Locked {self._lock!r} for {method.__name__}") + return method(self, *args, **kwargs) + return _wrapped + + +class CoverageData: + """Manages collected coverage data, including file storage. + + This class is the public supported API to the data that coverage.py + collects during program execution. It includes information about what code + was executed. It does not include information from the analysis phase, to + determine what lines could have been executed, or what lines were not + executed. + + .. note:: + + The data file is currently a SQLite database file, with a + :ref:`documented schema `. The schema is subject to change + though, so be careful about querying it directly. Use this API if you + can to isolate yourself from changes. + + There are a number of kinds of data that can be collected: + + * **lines**: the line numbers of source lines that were executed. + These are always available. + + * **arcs**: pairs of source and destination line numbers for transitions + between source lines. These are only available if branch coverage was + used. + + * **file tracer names**: the module names of the file tracer plugins that + handled each file in the data. + + Lines, arcs, and file tracer names are stored for each source file. File + names in this API are case-sensitive, even on platforms with + case-insensitive file systems. + + A data file either stores lines, or arcs, but not both. + + A data file is associated with the data when the :class:`CoverageData` + is created, using the parameters `basename`, `suffix`, and `no_disk`. The + base name can be queried with :meth:`base_filename`, and the actual file + name being used is available from :meth:`data_filename`. + + To read an existing coverage.py data file, use :meth:`read`. You can then + access the line, arc, or file tracer data with :meth:`lines`, :meth:`arcs`, + or :meth:`file_tracer`. + + The :meth:`has_arcs` method indicates whether arc data is available. You + can get a set of the files in the data with :meth:`measured_files`. As + with most Python containers, you can determine if there is any data at all + by using this object as a boolean value. + + The contexts for each line in a file can be read with + :meth:`contexts_by_lineno`. + + To limit querying to certain contexts, use :meth:`set_query_context` or + :meth:`set_query_contexts`. These will narrow the focus of subsequent + :meth:`lines`, :meth:`arcs`, and :meth:`contexts_by_lineno` calls. The set + of all measured context names can be retrieved with + :meth:`measured_contexts`. + + Most data files will be created by coverage.py itself, but you can use + methods here to create data files if you like. The :meth:`add_lines`, + :meth:`add_arcs`, and :meth:`add_file_tracers` methods add data, in ways + that are convenient for coverage.py. + + To record data for contexts, use :meth:`set_context` to set a context to + be used for subsequent :meth:`add_lines` and :meth:`add_arcs` calls. + + To add a source file without any measured data, use :meth:`touch_file`, + or :meth:`touch_files` for a list of such files. + + Write the data to its file with :meth:`write`. + + You can clear the data in memory with :meth:`erase`. Data for specific + files can be removed from the database with :meth:`purge_files`. + + Two data collections can be combined by using :meth:`update` on one + :class:`CoverageData`, passing it the other. + + Data in a :class:`CoverageData` can be serialized and deserialized with + :meth:`dumps` and :meth:`loads`. + + The methods used during the coverage.py collection phase + (:meth:`add_lines`, :meth:`add_arcs`, :meth:`set_context`, and + :meth:`add_file_tracers`) are thread-safe. Other methods may not be. + + """ + + def __init__( + self, + basename: FilePath | None = None, + suffix: str | bool | None = None, + no_disk: bool = False, + warn: TWarnFn | None = None, + debug: TDebugCtl | None = None, + ) -> None: + """Create a :class:`CoverageData` object to hold coverage-measured data. + + Arguments: + basename (str): the base name of the data file, defaulting to + ".coverage". This can be a path to a file in another directory. + suffix (str or bool): has the same meaning as the `data_suffix` + argument to :class:`coverage.Coverage`. + no_disk (bool): if True, keep all data in memory, and don't + write any disk file. + warn: a warning callback function, accepting a warning message + argument. + debug: a `DebugControl` object (optional) + + """ + self._no_disk = no_disk + self._basename = os.path.abspath(basename or ".coverage") + self._suffix = suffix + self._warn = warn + self._debug = debug or NoDebugging() + + self._choose_filename() + # Maps filenames to row ids. + self._file_map: dict[str, int] = {} + # Maps thread ids to SqliteDb objects. + self._dbs: dict[int, SqliteDb] = {} + self._pid = os.getpid() + # Synchronize the operations used during collection. + self._lock = threading.RLock() + + # Are we in sync with the data file? + self._have_used = False + + self._has_lines = False + self._has_arcs = False + + self._current_context: str | None = None + self._current_context_id: int | None = None + self._query_context_ids: list[int] | None = None + + __repr__ = auto_repr + + def _choose_filename(self) -> None: + """Set self._filename based on inited attributes.""" + if self._no_disk: + self._filename = ":memory:" + else: + self._filename = self._basename + suffix = filename_suffix(self._suffix) + if suffix: + self._filename += "." + suffix + + def _reset(self) -> None: + """Reset our attributes.""" + if not self._no_disk: + for db in self._dbs.values(): + db.close() + self._dbs = {} + self._file_map = {} + self._have_used = False + self._current_context_id = None + + def _open_db(self) -> None: + """Open an existing db file, and read its metadata.""" + if self._debug.should("dataio"): + self._debug.write(f"Opening data file {self._filename!r}") + self._dbs[threading.get_ident()] = SqliteDb(self._filename, self._debug) + self._read_db() + + def _read_db(self) -> None: + """Read the metadata from a database so that we are ready to use it.""" + with self._dbs[threading.get_ident()] as db: + try: + row = db.execute_one("select version from coverage_schema") + assert row is not None + except Exception as exc: + if "no such table: coverage_schema" in str(exc): + self._init_db(db) + else: + raise DataError( + "Data file {!r} doesn't seem to be a coverage data file: {}".format( + self._filename, exc, + ), + ) from exc + else: + schema_version = row[0] + if schema_version != SCHEMA_VERSION: + raise DataError( + "Couldn't use data file {!r}: wrong schema: {} instead of {}".format( + self._filename, schema_version, SCHEMA_VERSION, + ), + ) + + row = db.execute_one("select value from meta where key = 'has_arcs'") + if row is not None: + self._has_arcs = bool(int(row[0])) + self._has_lines = not self._has_arcs + + with db.execute("select id, path from file") as cur: + for file_id, path in cur: + self._file_map[path] = file_id + + def _init_db(self, db: SqliteDb) -> None: + """Write the initial contents of the database.""" + if self._debug.should("dataio"): + self._debug.write(f"Initing data file {self._filename!r}") + db.executescript(SCHEMA) + db.execute_void("insert into coverage_schema (version) values (?)", (SCHEMA_VERSION,)) + + # When writing metadata, avoid information that will needlessly change + # the hash of the data file, unless we're debugging processes. + meta_data = [ + ("version", __version__), + ] + if self._debug.should("process"): + meta_data.extend([ + ("sys_argv", str(getattr(sys, "argv", None))), + ("when", datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")), + ]) + db.executemany_void("insert or ignore into meta (key, value) values (?, ?)", meta_data) + + def _connect(self) -> SqliteDb: + """Get the SqliteDb object to use.""" + if threading.get_ident() not in self._dbs: + self._open_db() + return self._dbs[threading.get_ident()] + + def __bool__(self) -> bool: + if (threading.get_ident() not in self._dbs and not os.path.exists(self._filename)): + return False + try: + with self._connect() as con: + with con.execute("select * from file limit 1") as cur: + return bool(list(cur)) + except CoverageException: + return False + + def dumps(self) -> bytes: + """Serialize the current data to a byte string. + + The format of the serialized data is not documented. It is only + suitable for use with :meth:`loads` in the same version of + coverage.py. + + Note that this serialization is not what gets stored in coverage data + files. This method is meant to produce bytes that can be transmitted + elsewhere and then deserialized with :meth:`loads`. + + Returns: + A byte string of serialized data. + + .. versionadded:: 5.0 + + """ + if self._debug.should("dataio"): + self._debug.write(f"Dumping data from data file {self._filename!r}") + with self._connect() as con: + script = con.dump() + return b"z" + zlib.compress(script.encode("utf-8")) + + def loads(self, data: bytes) -> None: + """Deserialize data from :meth:`dumps`. + + Use with a newly-created empty :class:`CoverageData` object. It's + undefined what happens if the object already has data in it. + + Note that this is not for reading data from a coverage data file. It + is only for use on data you produced with :meth:`dumps`. + + Arguments: + data: A byte string of serialized data produced by :meth:`dumps`. + + .. versionadded:: 5.0 + + """ + if self._debug.should("dataio"): + self._debug.write(f"Loading data into data file {self._filename!r}") + if data[:1] != b"z": + raise DataError( + f"Unrecognized serialization: {data[:40]!r} (head of {len(data)} bytes)", + ) + script = zlib.decompress(data[1:]).decode("utf-8") + self._dbs[threading.get_ident()] = db = SqliteDb(self._filename, self._debug) + with db: + db.executescript(script) + self._read_db() + self._have_used = True + + def _file_id(self, filename: str, add: bool = False) -> int | None: + """Get the file id for `filename`. + + If filename is not in the database yet, add it if `add` is True. + If `add` is not True, return None. + """ + if filename not in self._file_map: + if add: + with self._connect() as con: + self._file_map[filename] = con.execute_for_rowid( + "insert or replace into file (path) values (?)", + (filename,), + ) + return self._file_map.get(filename) + + def _context_id(self, context: str) -> int | None: + """Get the id for a context.""" + assert context is not None + self._start_using() + with self._connect() as con: + row = con.execute_one("select id from context where context = ?", (context,)) + if row is not None: + return cast(int, row[0]) + else: + return None + + @_locked + def set_context(self, context: str | None) -> None: + """Set the current context for future :meth:`add_lines` etc. + + `context` is a str, the name of the context to use for the next data + additions. The context persists until the next :meth:`set_context`. + + .. versionadded:: 5.0 + + """ + if self._debug.should("dataop"): + self._debug.write(f"Setting coverage context: {context!r}") + self._current_context = context + self._current_context_id = None + + def _set_context_id(self) -> None: + """Use the _current_context to set _current_context_id.""" + context = self._current_context or "" + context_id = self._context_id(context) + if context_id is not None: + self._current_context_id = context_id + else: + with self._connect() as con: + self._current_context_id = con.execute_for_rowid( + "insert into context (context) values (?)", + (context,), + ) + + def base_filename(self) -> str: + """The base filename for storing data. + + .. versionadded:: 5.0 + + """ + return self._basename + + def data_filename(self) -> str: + """Where is the data stored? + + .. versionadded:: 5.0 + + """ + return self._filename + + @_locked + def add_lines(self, line_data: Mapping[str, Collection[TLineNo]]) -> None: + """Add measured line data. + + `line_data` is a dictionary mapping file names to iterables of ints:: + + { filename: { line1, line2, ... }, ...} + + """ + if self._debug.should("dataop"): + self._debug.write("Adding lines: %d files, %d lines total" % ( + len(line_data), sum(len(lines) for lines in line_data.values()), + )) + if self._debug.should("dataop2"): + for filename, linenos in sorted(line_data.items()): + self._debug.write(f" {filename}: {linenos}") + self._start_using() + self._choose_lines_or_arcs(lines=True) + if not line_data: + return + with self._connect() as con: + self._set_context_id() + for filename, linenos in line_data.items(): + line_bits = nums_to_numbits(linenos) + file_id = self._file_id(filename, add=True) + query = "select numbits from line_bits where file_id = ? and context_id = ?" + with con.execute(query, (file_id, self._current_context_id)) as cur: + existing = list(cur) + if existing: + line_bits = numbits_union(line_bits, existing[0][0]) + + con.execute_void( + "insert or replace into line_bits " + + " (file_id, context_id, numbits) values (?, ?, ?)", + (file_id, self._current_context_id, line_bits), + ) + + @_locked + def add_arcs(self, arc_data: Mapping[str, Collection[TArc]]) -> None: + """Add measured arc data. + + `arc_data` is a dictionary mapping file names to iterables of pairs of + ints:: + + { filename: { (l1,l2), (l1,l2), ... }, ...} + + """ + if self._debug.should("dataop"): + self._debug.write("Adding arcs: %d files, %d arcs total" % ( + len(arc_data), sum(len(arcs) for arcs in arc_data.values()), + )) + if self._debug.should("dataop2"): + for filename, arcs in sorted(arc_data.items()): + self._debug.write(f" {filename}: {arcs}") + self._start_using() + self._choose_lines_or_arcs(arcs=True) + if not arc_data: + return + with self._connect() as con: + self._set_context_id() + for filename, arcs in arc_data.items(): + if not arcs: + continue + file_id = self._file_id(filename, add=True) + data = [(file_id, self._current_context_id, fromno, tono) for fromno, tono in arcs] + con.executemany_void( + "insert or ignore into arc " + + "(file_id, context_id, fromno, tono) values (?, ?, ?, ?)", + data, + ) + + def _choose_lines_or_arcs(self, lines: bool = False, arcs: bool = False) -> None: + """Force the data file to choose between lines and arcs.""" + assert lines or arcs + assert not (lines and arcs) + if lines and self._has_arcs: + if self._debug.should("dataop"): + self._debug.write("Error: Can't add line measurements to existing branch data") + raise DataError("Can't add line measurements to existing branch data") + if arcs and self._has_lines: + if self._debug.should("dataop"): + self._debug.write("Error: Can't add branch measurements to existing line data") + raise DataError("Can't add branch measurements to existing line data") + if not self._has_arcs and not self._has_lines: + self._has_lines = lines + self._has_arcs = arcs + with self._connect() as con: + con.execute_void( + "insert or ignore into meta (key, value) values (?, ?)", + ("has_arcs", str(int(arcs))), + ) + + @_locked + def add_file_tracers(self, file_tracers: Mapping[str, str]) -> None: + """Add per-file plugin information. + + `file_tracers` is { filename: plugin_name, ... } + + """ + if self._debug.should("dataop"): + self._debug.write("Adding file tracers: %d files" % (len(file_tracers),)) + if not file_tracers: + return + self._start_using() + with self._connect() as con: + for filename, plugin_name in file_tracers.items(): + file_id = self._file_id(filename, add=True) + existing_plugin = self.file_tracer(filename) + if existing_plugin: + if existing_plugin != plugin_name: + raise DataError( + "Conflicting file tracer name for '{}': {!r} vs {!r}".format( + filename, existing_plugin, plugin_name, + ), + ) + elif plugin_name: + con.execute_void( + "insert into tracer (file_id, tracer) values (?, ?)", + (file_id, plugin_name), + ) + + def touch_file(self, filename: str, plugin_name: str = "") -> None: + """Ensure that `filename` appears in the data, empty if needed. + + `plugin_name` is the name of the plugin responsible for this file. + It is used to associate the right filereporter, etc. + """ + self.touch_files([filename], plugin_name) + + def touch_files(self, filenames: Collection[str], plugin_name: str | None = None) -> None: + """Ensure that `filenames` appear in the data, empty if needed. + + `plugin_name` is the name of the plugin responsible for these files. + It is used to associate the right filereporter, etc. + """ + if self._debug.should("dataop"): + self._debug.write(f"Touching {filenames!r}") + self._start_using() + with self._connect(): # Use this to get one transaction. + if not self._has_arcs and not self._has_lines: + raise DataError("Can't touch files in an empty CoverageData") + + for filename in filenames: + self._file_id(filename, add=True) + if plugin_name: + # Set the tracer for this file + self.add_file_tracers({filename: plugin_name}) + + def purge_files(self, filenames: Collection[str]) -> None: + """Purge any existing coverage data for the given `filenames`. + + .. versionadded:: 7.2 + + """ + if self._debug.should("dataop"): + self._debug.write(f"Purging data for {filenames!r}") + self._start_using() + with self._connect() as con: + + if self._has_lines: + sql = "delete from line_bits where file_id=?" + elif self._has_arcs: + sql = "delete from arc where file_id=?" + else: + raise DataError("Can't purge files in an empty CoverageData") + + for filename in filenames: + file_id = self._file_id(filename, add=False) + if file_id is None: + continue + con.execute_void(sql, (file_id,)) + + def update( + self, + other_data: CoverageData, + map_path: Callable[[str], str] | None = None, + ) -> None: + """Update this data with data from another :class:`CoverageData`. + + If `map_path` is provided, it's a function that re-map paths to match + the local machine's. Note: `map_path` is None only when called + directly from the test suite. + + """ + if self._debug.should("dataop"): + self._debug.write("Updating with data from {!r}".format( + getattr(other_data, "_filename", "???"), + )) + if self._has_lines and other_data._has_arcs: + raise DataError("Can't combine branch coverage data with statement data") + if self._has_arcs and other_data._has_lines: + raise DataError("Can't combine statement coverage data with branch data") + + map_path = map_path or (lambda p: p) + + # Force the database we're writing to to exist before we start nesting contexts. + self._start_using() + + # Collector for all arcs, lines and tracers + other_data.read() + with other_data._connect() as con: + # Get files data. + with con.execute("select path from file") as cur: + files = {path: map_path(path) for (path,) in cur} + + # Get contexts data. + with con.execute("select context from context") as cur: + contexts = [context for (context,) in cur] + + # Get arc data. + with con.execute( + "select file.path, context.context, arc.fromno, arc.tono " + + "from arc " + + "inner join file on file.id = arc.file_id " + + "inner join context on context.id = arc.context_id", + ) as cur: + arcs = [ + (files[path], context, fromno, tono) + for (path, context, fromno, tono) in cur + ] + + # Get line data. + with con.execute( + "select file.path, context.context, line_bits.numbits " + + "from line_bits " + + "inner join file on file.id = line_bits.file_id " + + "inner join context on context.id = line_bits.context_id", + ) as cur: + lines: dict[tuple[str, str], bytes] = {} + for path, context, numbits in cur: + key = (files[path], context) + if key in lines: + numbits = numbits_union(lines[key], numbits) + lines[key] = numbits + + # Get tracer data. + with con.execute( + "select file.path, tracer " + + "from tracer " + + "inner join file on file.id = tracer.file_id", + ) as cur: + tracers = {files[path]: tracer for (path, tracer) in cur} + + with self._connect() as con: + assert con.con is not None + con.con.isolation_level = "IMMEDIATE" + + # Get all tracers in the DB. Files not in the tracers are assumed + # to have an empty string tracer. Since Sqlite does not support + # full outer joins, we have to make two queries to fill the + # dictionary. + with con.execute("select path from file") as cur: + this_tracers = {path: "" for path, in cur} + with con.execute( + "select file.path, tracer from tracer " + + "inner join file on file.id = tracer.file_id", + ) as cur: + this_tracers.update({ + map_path(path): tracer + for path, tracer in cur + }) + + # Create all file and context rows in the DB. + con.executemany_void( + "insert or ignore into file (path) values (?)", + ((file,) for file in files.values()), + ) + with con.execute("select id, path from file") as cur: + file_ids = {path: id for id, path in cur} + self._file_map.update(file_ids) + con.executemany_void( + "insert or ignore into context (context) values (?)", + ((context,) for context in contexts), + ) + with con.execute("select id, context from context") as cur: + context_ids = {context: id for id, context in cur} + + # Prepare tracers and fail, if a conflict is found. + # tracer_paths is used to ensure consistency over the tracer data + # and tracer_map tracks the tracers to be inserted. + tracer_map = {} + for path in files.values(): + this_tracer = this_tracers.get(path) + other_tracer = tracers.get(path, "") + # If there is no tracer, there is always the None tracer. + if this_tracer is not None and this_tracer != other_tracer: + raise DataError( + "Conflicting file tracer name for '{}': {!r} vs {!r}".format( + path, this_tracer, other_tracer, + ), + ) + tracer_map[path] = other_tracer + + # Prepare arc and line rows to be inserted by converting the file + # and context strings with integer ids. Then use the efficient + # `executemany()` to insert all rows at once. + + if arcs: + self._choose_lines_or_arcs(arcs=True) + + arc_rows = ( + (file_ids[file], context_ids[context], fromno, tono) + for file, context, fromno, tono in arcs + ) + + # Write the combined data. + con.executemany_void( + "insert or ignore into arc " + + "(file_id, context_id, fromno, tono) values (?, ?, ?, ?)", + arc_rows, + ) + + if lines: + self._choose_lines_or_arcs(lines=True) + + for (file, context), numbits in lines.items(): + with con.execute( + "select numbits from line_bits where file_id = ? and context_id = ?", + (file_ids[file], context_ids[context]), + ) as cur: + existing = list(cur) + if existing: + lines[(file, context)] = numbits_union(numbits, existing[0][0]) + + con.executemany_void( + "insert or replace into line_bits " + + "(file_id, context_id, numbits) values (?, ?, ?)", + [ + (file_ids[file], context_ids[context], numbits) + for (file, context), numbits in lines.items() + ], + ) + + con.executemany_void( + "insert or ignore into tracer (file_id, tracer) values (?, ?)", + ((file_ids[filename], tracer) for filename, tracer in tracer_map.items()), + ) + + if not self._no_disk: + # Update all internal cache data. + self._reset() + self.read() + + def erase(self, parallel: bool = False) -> None: + """Erase the data in this object. + + If `parallel` is true, then also deletes data files created from the + basename by parallel-mode. + + """ + self._reset() + if self._no_disk: + return + if self._debug.should("dataio"): + self._debug.write(f"Erasing data file {self._filename!r}") + file_be_gone(self._filename) + if parallel: + data_dir, local = os.path.split(self._filename) + local_abs_path = os.path.join(os.path.abspath(data_dir), local) + pattern = glob.escape(local_abs_path) + ".*" + for filename in glob.glob(pattern): + if self._debug.should("dataio"): + self._debug.write(f"Erasing parallel data file {filename!r}") + file_be_gone(filename) + + def read(self) -> None: + """Start using an existing data file.""" + if os.path.exists(self._filename): + with self._connect(): + self._have_used = True + + def write(self) -> None: + """Ensure the data is written to the data file.""" + pass + + def _start_using(self) -> None: + """Call this before using the database at all.""" + if self._pid != os.getpid(): + # Looks like we forked! Have to start a new data file. + self._reset() + self._choose_filename() + self._pid = os.getpid() + if not self._have_used: + self.erase() + self._have_used = True + + def has_arcs(self) -> bool: + """Does the database have arcs (True) or lines (False).""" + return bool(self._has_arcs) + + def measured_files(self) -> set[str]: + """A set of all files that have been measured. + + Note that a file may be mentioned as measured even though no lines or + arcs for that file are present in the data. + + """ + return set(self._file_map) + + def measured_contexts(self) -> set[str]: + """A set of all contexts that have been measured. + + .. versionadded:: 5.0 + + """ + self._start_using() + with self._connect() as con: + with con.execute("select distinct(context) from context") as cur: + contexts = {row[0] for row in cur} + return contexts + + def file_tracer(self, filename: str) -> str | None: + """Get the plugin name of the file tracer for a file. + + Returns the name of the plugin that handles this file. If the file was + measured, but didn't use a plugin, then "" is returned. If the file + was not measured, then None is returned. + + """ + self._start_using() + with self._connect() as con: + file_id = self._file_id(filename) + if file_id is None: + return None + row = con.execute_one("select tracer from tracer where file_id = ?", (file_id,)) + if row is not None: + return row[0] or "" + return "" # File was measured, but no tracer associated. + + def set_query_context(self, context: str) -> None: + """Set a context for subsequent querying. + + The next :meth:`lines`, :meth:`arcs`, or :meth:`contexts_by_lineno` + calls will be limited to only one context. `context` is a string which + must match a context exactly. If it does not, no exception is raised, + but queries will return no data. + + .. versionadded:: 5.0 + + """ + self._start_using() + with self._connect() as con: + with con.execute("select id from context where context = ?", (context,)) as cur: + self._query_context_ids = [row[0] for row in cur.fetchall()] + + def set_query_contexts(self, contexts: Sequence[str] | None) -> None: + """Set a number of contexts for subsequent querying. + + The next :meth:`lines`, :meth:`arcs`, or :meth:`contexts_by_lineno` + calls will be limited to the specified contexts. `contexts` is a list + of Python regular expressions. Contexts will be matched using + :func:`re.search `. Data will be included in query + results if they are part of any of the contexts matched. + + .. versionadded:: 5.0 + + """ + self._start_using() + if contexts: + with self._connect() as con: + context_clause = " or ".join(["context regexp ?"] * len(contexts)) + with con.execute("select id from context where " + context_clause, contexts) as cur: + self._query_context_ids = [row[0] for row in cur.fetchall()] + else: + self._query_context_ids = None + + def lines(self, filename: str) -> list[TLineNo] | None: + """Get the list of lines executed for a source file. + + If the file was not measured, returns None. A file might be measured, + and have no lines executed, in which case an empty list is returned. + + If the file was executed, returns a list of integers, the line numbers + executed in the file. The list is in no particular order. + + """ + self._start_using() + if self.has_arcs(): + arcs = self.arcs(filename) + if arcs is not None: + all_lines = itertools.chain.from_iterable(arcs) + return list({l for l in all_lines if l > 0}) + + with self._connect() as con: + file_id = self._file_id(filename) + if file_id is None: + return None + else: + query = "select numbits from line_bits where file_id = ?" + data = [file_id] + if self._query_context_ids is not None: + ids_array = ", ".join("?" * len(self._query_context_ids)) + query += " and context_id in (" + ids_array + ")" + data += self._query_context_ids + with con.execute(query, data) as cur: + bitmaps = list(cur) + nums = set() + for row in bitmaps: + nums.update(numbits_to_nums(row[0])) + return list(nums) + + def arcs(self, filename: str) -> list[TArc] | None: + """Get the list of arcs executed for a file. + + If the file was not measured, returns None. A file might be measured, + and have no arcs executed, in which case an empty list is returned. + + If the file was executed, returns a list of 2-tuples of integers. Each + pair is a starting line number and an ending line number for a + transition from one line to another. The list is in no particular + order. + + Negative numbers have special meaning. If the starting line number is + -N, it represents an entry to the code object that starts at line N. + If the ending ling number is -N, it's an exit from the code object that + starts at line N. + + """ + self._start_using() + with self._connect() as con: + file_id = self._file_id(filename) + if file_id is None: + return None + else: + query = "select distinct fromno, tono from arc where file_id = ?" + data = [file_id] + if self._query_context_ids is not None: + ids_array = ", ".join("?" * len(self._query_context_ids)) + query += " and context_id in (" + ids_array + ")" + data += self._query_context_ids + with con.execute(query, data) as cur: + return list(cur) + + def contexts_by_lineno(self, filename: str) -> dict[TLineNo, list[str]]: + """Get the contexts for each line in a file. + + Returns: + A dict mapping line numbers to a list of context names. + + .. versionadded:: 5.0 + + """ + self._start_using() + with self._connect() as con: + file_id = self._file_id(filename) + if file_id is None: + return {} + + lineno_contexts_map = collections.defaultdict(set) + if self.has_arcs(): + query = ( + "select arc.fromno, arc.tono, context.context " + + "from arc, context " + + "where arc.file_id = ? and arc.context_id = context.id" + ) + data = [file_id] + if self._query_context_ids is not None: + ids_array = ", ".join("?" * len(self._query_context_ids)) + query += " and arc.context_id in (" + ids_array + ")" + data += self._query_context_ids + with con.execute(query, data) as cur: + for fromno, tono, context in cur: + if fromno > 0: + lineno_contexts_map[fromno].add(context) + if tono > 0: + lineno_contexts_map[tono].add(context) + else: + query = ( + "select l.numbits, c.context from line_bits l, context c " + + "where l.context_id = c.id " + + "and file_id = ?" + ) + data = [file_id] + if self._query_context_ids is not None: + ids_array = ", ".join("?" * len(self._query_context_ids)) + query += " and l.context_id in (" + ids_array + ")" + data += self._query_context_ids + with con.execute(query, data) as cur: + for numbits, context in cur: + for lineno in numbits_to_nums(numbits): + lineno_contexts_map[lineno].add(context) + + return {lineno: list(contexts) for lineno, contexts in lineno_contexts_map.items()} + + @classmethod + def sys_info(cls) -> list[tuple[str, Any]]: + """Our information for `Coverage.sys_info`. + + Returns a list of (key, value) pairs. + + """ + with SqliteDb(":memory:", debug=NoDebugging()) as db: + with db.execute("pragma temp_store") as cur: + temp_store = [row[0] for row in cur] + with db.execute("pragma compile_options") as cur: + copts = [row[0] for row in cur] + copts = textwrap.wrap(", ".join(copts), width=75) + + return [ + ("sqlite3_sqlite_version", sqlite3.sqlite_version), + ("sqlite3_temp_store", temp_store), + ("sqlite3_compile_options", copts), + ] + + +def filename_suffix(suffix: str | bool | None) -> str | None: + """Compute a filename suffix for a data file. + + If `suffix` is a string or None, simply return it. If `suffix` is True, + then build a suffix incorporating the hostname, process id, and a random + number. + + Returns a string or None. + + """ + if suffix is True: + # If data_suffix was a simple true value, then make a suffix with + # plenty of distinguishing information. We do this here in + # `save()` at the last minute so that the pid will be correct even + # if the process forks. + die = random.Random(os.urandom(8)) + letters = string.ascii_uppercase + string.ascii_lowercase + rolls = "".join(die.choice(letters) for _ in range(6)) + suffix = f"{socket.gethostname()}.{os.getpid()}.X{rolls}x" + elif suffix is False: + suffix = None + return suffix diff --git a/.venv/Lib/site-packages/coverage/sqlitedb.py b/.venv/Lib/site-packages/coverage/sqlitedb.py new file mode 100644 index 00000000..1bbe7e1b --- /dev/null +++ b/.venv/Lib/site-packages/coverage/sqlitedb.py @@ -0,0 +1,231 @@ +# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt + +"""SQLite abstraction for coverage.py""" + +from __future__ import annotations + +import contextlib +import re +import sqlite3 + +from typing import cast, Any +from collections.abc import Iterable, Iterator + +from coverage.debug import auto_repr, clipped_repr, exc_one_line +from coverage.exceptions import DataError +from coverage.types import TDebugCtl + + +class SqliteDb: + """A simple abstraction over a SQLite database. + + Use as a context manager, then you can use it like a + :class:`python:sqlite3.Connection` object:: + + with SqliteDb(filename, debug_control) as db: + with db.execute("select a, b from some_table") as cur: + for a, b in cur: + etc(a, b) + + """ + def __init__(self, filename: str, debug: TDebugCtl) -> None: + self.debug = debug + self.filename = filename + self.nest = 0 + self.con: sqlite3.Connection | None = None + + __repr__ = auto_repr + + def _connect(self) -> None: + """Connect to the db and do universal initialization.""" + if self.con is not None: + return + + # It can happen that Python switches threads while the tracer writes + # data. The second thread will also try to write to the data, + # effectively causing a nested context. However, given the idempotent + # nature of the tracer operations, sharing a connection among threads + # is not a problem. + if self.debug.should("sql"): + self.debug.write(f"Connecting to {self.filename!r}") + try: + self.con = sqlite3.connect(self.filename, check_same_thread=False) + except sqlite3.Error as exc: + raise DataError(f"Couldn't use data file {self.filename!r}: {exc}") from exc + + if self.debug.should("sql"): + self.debug.write(f"Connected to {self.filename!r} as {self.con!r}") + + self.con.create_function("REGEXP", 2, lambda txt, pat: re.search(txt, pat) is not None) + + # Turning off journal_mode can speed up writing. It can't always be + # disabled, so we have to be prepared for *-journal files elsewhere. + # In Python 3.12+, we can change the config to allow journal_mode=off. + if hasattr(sqlite3, "SQLITE_DBCONFIG_DEFENSIVE"): + # Turn off defensive mode, so that journal_mode=off can succeed. + self.con.setconfig( # type: ignore[attr-defined, unused-ignore] + sqlite3.SQLITE_DBCONFIG_DEFENSIVE, False, + ) + + # This pragma makes writing faster. It disables rollbacks, but we never need them. + self.execute_void("pragma journal_mode=off") + + # This pragma makes writing faster. It can fail in unusual situations + # (https://github.com/nedbat/coveragepy/issues/1646), so use fail_ok=True + # to keep things going. + self.execute_void("pragma synchronous=off", fail_ok=True) + + def close(self) -> None: + """If needed, close the connection.""" + if self.con is not None and self.filename != ":memory:": + if self.debug.should("sql"): + self.debug.write(f"Closing {self.con!r} on {self.filename!r}") + self.con.close() + self.con = None + + def __enter__(self) -> SqliteDb: + if self.nest == 0: + self._connect() + assert self.con is not None + self.con.__enter__() + self.nest += 1 + return self + + def __exit__(self, exc_type, exc_value, traceback) -> None: # type: ignore[no-untyped-def] + self.nest -= 1 + if self.nest == 0: + try: + assert self.con is not None + self.con.__exit__(exc_type, exc_value, traceback) + self.close() + except Exception as exc: + if self.debug.should("sql"): + self.debug.write(f"EXCEPTION from __exit__: {exc_one_line(exc)}") + raise DataError(f"Couldn't end data file {self.filename!r}: {exc}") from exc + + def _execute(self, sql: str, parameters: Iterable[Any]) -> sqlite3.Cursor: + """Same as :meth:`python:sqlite3.Connection.execute`.""" + if self.debug.should("sql"): + tail = f" with {parameters!r}" if parameters else "" + self.debug.write(f"Executing {sql!r}{tail}") + try: + assert self.con is not None + try: + return self.con.execute(sql, parameters) # type: ignore[arg-type] + except Exception: + # In some cases, an error might happen that isn't really an + # error. Try again immediately. + # https://github.com/nedbat/coveragepy/issues/1010 + return self.con.execute(sql, parameters) # type: ignore[arg-type] + except sqlite3.Error as exc: + msg = str(exc) + if self.filename != ":memory:": + try: + # `execute` is the first thing we do with the database, so try + # hard to provide useful hints if something goes wrong now. + with open(self.filename, "rb") as bad_file: + cov4_sig = b"!coverage.py: This is a private format" + if bad_file.read(len(cov4_sig)) == cov4_sig: + msg = ( + "Looks like a coverage 4.x data file. " + + "Are you mixing versions of coverage?" + ) + except Exception: + pass + if self.debug.should("sql"): + self.debug.write(f"EXCEPTION from execute: {exc_one_line(exc)}") + raise DataError(f"Couldn't use data file {self.filename!r}: {msg}") from exc + + @contextlib.contextmanager + def execute( + self, + sql: str, + parameters: Iterable[Any] = (), + ) -> Iterator[sqlite3.Cursor]: + """Context managed :meth:`python:sqlite3.Connection.execute`. + + Use with a ``with`` statement to auto-close the returned cursor. + """ + cur = self._execute(sql, parameters) + try: + yield cur + finally: + cur.close() + + def execute_void(self, sql: str, parameters: Iterable[Any] = (), fail_ok: bool = False) -> None: + """Same as :meth:`python:sqlite3.Connection.execute` when you don't need the cursor. + + If `fail_ok` is True, then SQLite errors are ignored. + """ + try: + # PyPy needs the .close() calls here, or sqlite gets twisted up: + # https://bitbucket.org/pypy/pypy/issues/2872/default-isolation-mode-is-different-on + self._execute(sql, parameters).close() + except DataError: + if not fail_ok: + raise + + def execute_for_rowid(self, sql: str, parameters: Iterable[Any] = ()) -> int: + """Like execute, but returns the lastrowid.""" + with self.execute(sql, parameters) as cur: + assert cur.lastrowid is not None + rowid: int = cur.lastrowid + if self.debug.should("sqldata"): + self.debug.write(f"Row id result: {rowid!r}") + return rowid + + def execute_one(self, sql: str, parameters: Iterable[Any] = ()) -> tuple[Any, ...] | None: + """Execute a statement and return the one row that results. + + This is like execute(sql, parameters).fetchone(), except it is + correct in reading the entire result set. This will raise an + exception if more than one row results. + + Returns a row, or None if there were no rows. + """ + with self.execute(sql, parameters) as cur: + rows = list(cur) + if len(rows) == 0: + return None + elif len(rows) == 1: + return cast(tuple[Any, ...], rows[0]) + else: + raise AssertionError(f"SQL {sql!r} shouldn't return {len(rows)} rows") + + def _executemany(self, sql: str, data: list[Any]) -> sqlite3.Cursor: + """Same as :meth:`python:sqlite3.Connection.executemany`.""" + if self.debug.should("sql"): + final = ":" if self.debug.should("sqldata") else "" + self.debug.write(f"Executing many {sql!r} with {len(data)} rows{final}") + if self.debug.should("sqldata"): + for i, row in enumerate(data): + self.debug.write(f"{i:4d}: {row!r}") + assert self.con is not None + try: + return self.con.executemany(sql, data) + except Exception: + # In some cases, an error might happen that isn't really an + # error. Try again immediately. + # https://github.com/nedbat/coveragepy/issues/1010 + return self.con.executemany(sql, data) + + def executemany_void(self, sql: str, data: Iterable[Any]) -> None: + """Same as :meth:`python:sqlite3.Connection.executemany` when you don't need the cursor.""" + data = list(data) + if data: + self._executemany(sql, data).close() + + def executescript(self, script: str) -> None: + """Same as :meth:`python:sqlite3.Connection.executescript`.""" + if self.debug.should("sql"): + self.debug.write("Executing script with {} chars: {}".format( + len(script), clipped_repr(script, 100), + )) + assert self.con is not None + self.con.executescript(script).close() + + def dump(self) -> str: + """Return a multi-line string, the SQL dump of the database.""" + assert self.con is not None + return "\n".join(self.con.iterdump()) diff --git a/.venv/Lib/site-packages/coverage/sysmon.py b/.venv/Lib/site-packages/coverage/sysmon.py new file mode 100644 index 00000000..2252ae11 --- /dev/null +++ b/.venv/Lib/site-packages/coverage/sysmon.py @@ -0,0 +1,433 @@ +# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt + +"""Callback functions and support for sys.monitoring data collection.""" + +from __future__ import annotations + +import functools +import inspect +import os +import os.path +import sys +import threading +import traceback + +from dataclasses import dataclass +from types import CodeType, FrameType +from typing import ( + Any, + Callable, + TYPE_CHECKING, + cast, +) + +from coverage.debug import short_filename, short_stack +from coverage.types import ( + AnyCallable, + TArc, + TFileDisposition, + TLineNo, + TShouldStartContextFn, + TShouldTraceFn, + TTraceData, + TTraceFileData, + Tracer, + TWarnFn, +) + +# pylint: disable=unused-argument + +LOG = False + +# This module will be imported in all versions of Python, but only used in 3.12+ +# It will be type-checked for 3.12, but not for earlier versions. +sys_monitoring = getattr(sys, "monitoring", None) + +if TYPE_CHECKING: + assert sys_monitoring is not None + # I want to say this but it's not allowed: + # MonitorReturn = Literal[sys.monitoring.DISABLE] | None + MonitorReturn = Any + + +if LOG: # pragma: debugging + + class LoggingWrapper: + """Wrap a namespace to log all its functions.""" + + def __init__(self, wrapped: Any, namespace: str) -> None: + self.wrapped = wrapped + self.namespace = namespace + + def __getattr__(self, name: str) -> Callable[..., Any]: + def _wrapped(*args: Any, **kwargs: Any) -> Any: + log(f"{self.namespace}.{name}{args}{kwargs}") + return getattr(self.wrapped, name)(*args, **kwargs) + + return _wrapped + + sys_monitoring = LoggingWrapper(sys_monitoring, "sys.monitoring") + assert sys_monitoring is not None + + short_stack = functools.partial( + short_stack, full=True, short_filenames=True, frame_ids=True, + ) + seen_threads: set[int] = set() + + def log(msg: str) -> None: + """Write a message to our detailed debugging log(s).""" + # Thread ids are reused across processes? + # Make a shorter number more likely to be unique. + pid = os.getpid() + tid = cast(int, threading.current_thread().ident) + tslug = f"{(pid * tid) % 9_999_991:07d}" + if tid not in seen_threads: + seen_threads.add(tid) + log(f"New thread {tid} {tslug}:\n{short_stack()}") + # log_seq = int(os.getenv("PANSEQ", "0")) + # root = f"/tmp/pan.{log_seq:03d}" + for filename in [ + "/tmp/foo.out", + # f"{root}.out", + # f"{root}-{pid}.out", + # f"{root}-{pid}-{tslug}.out", + ]: + with open(filename, "a") as f: + print(f"{pid}:{tslug}: {msg}", file=f, flush=True) + + def arg_repr(arg: Any) -> str: + """Make a customized repr for logged values.""" + if isinstance(arg, CodeType): + return ( + f"" + ) + return repr(arg) + + def panopticon(*names: str | None) -> AnyCallable: + """Decorate a function to log its calls.""" + + def _decorator(method: AnyCallable) -> AnyCallable: + @functools.wraps(method) + def _wrapped(self: Any, *args: Any) -> Any: + try: + # log(f"{method.__name__}() stack:\n{short_stack()}") + args_reprs = [] + for name, arg in zip(names, args): + if name is None: + continue + args_reprs.append(f"{name}={arg_repr(arg)}") + log(f"{id(self):#x}:{method.__name__}({', '.join(args_reprs)})") + ret = method(self, *args) + # log(f" end {id(self):#x}:{method.__name__}({', '.join(args_reprs)})") + return ret + except Exception as exc: + log(f"!!{exc.__class__.__name__}: {exc}") + log("".join(traceback.format_exception(exc))) # pylint: disable=[no-value-for-parameter] + try: + assert sys_monitoring is not None + sys_monitoring.set_events(sys.monitoring.COVERAGE_ID, 0) + except ValueError: + # We might have already shut off monitoring. + log("oops, shutting off events with disabled tool id") + raise + + return _wrapped + + return _decorator + +else: + + def log(msg: str) -> None: + """Write a message to our detailed debugging log(s), but not really.""" + + def panopticon(*names: str | None) -> AnyCallable: + """Decorate a function to log its calls, but not really.""" + + def _decorator(meth: AnyCallable) -> AnyCallable: + return meth + + return _decorator + + +@dataclass +class CodeInfo: + """The information we want about each code object.""" + + tracing: bool + file_data: TTraceFileData | None + # TODO: what is byte_to_line for? + byte_to_line: dict[int, int] | None + + +def bytes_to_lines(code: CodeType) -> dict[int, int]: + """Make a dict mapping byte code offsets to line numbers.""" + b2l = {} + for bstart, bend, lineno in code.co_lines(): + if lineno is not None: + for boffset in range(bstart, bend, 2): + b2l[boffset] = lineno + return b2l + + +class SysMonitor(Tracer): + """Python implementation of the raw data tracer for PEP669 implementations.""" + + # One of these will be used across threads. Be careful. + + def __init__(self, tool_id: int) -> None: + # Attributes set from the collector: + self.data: TTraceData + self.trace_arcs = False + self.should_trace: TShouldTraceFn + self.should_trace_cache: dict[str, TFileDisposition | None] + # TODO: should_start_context and switch_context are unused! + # Change tests/testenv.py:DYN_CONTEXTS when this is updated. + self.should_start_context: TShouldStartContextFn | None = None + self.switch_context: Callable[[str | None], None] | None = None + self.lock_data: Callable[[], None] + self.unlock_data: Callable[[], None] + # TODO: warn is unused. + self.warn: TWarnFn + + self.myid = tool_id + + # Map id(code_object) -> CodeInfo + self.code_infos: dict[int, CodeInfo] = {} + # A list of code_objects, just to keep them alive so that id's are + # useful as identity. + self.code_objects: list[CodeType] = [] + self.last_lines: dict[FrameType, int] = {} + # Map id(code_object) -> code_object + self.local_event_codes: dict[int, CodeType] = {} + self.sysmon_on = False + self.lock = threading.Lock() + + self.stats = { + "starts": 0, + } + + self.stopped = False + self._activity = False + + def __repr__(self) -> str: + points = sum(len(v) for v in self.data.values()) + files = len(self.data) + return f"" + + @panopticon() + def start(self) -> None: + """Start this Tracer.""" + self.stopped = False + + assert sys_monitoring is not None + sys_monitoring.use_tool_id(self.myid, "coverage.py") + register = functools.partial(sys_monitoring.register_callback, self.myid) + events = sys_monitoring.events + if self.trace_arcs: + sys_monitoring.set_events( + self.myid, + events.PY_START | events.PY_UNWIND, + ) + register(events.PY_START, self.sysmon_py_start) + register(events.PY_RESUME, self.sysmon_py_resume_arcs) + register(events.PY_RETURN, self.sysmon_py_return_arcs) + register(events.PY_UNWIND, self.sysmon_py_unwind_arcs) + register(events.LINE, self.sysmon_line_arcs) + else: + sys_monitoring.set_events(self.myid, events.PY_START) + register(events.PY_START, self.sysmon_py_start) + register(events.LINE, self.sysmon_line_lines) + sys_monitoring.restart_events() + self.sysmon_on = True + + @panopticon() + def stop(self) -> None: + """Stop this Tracer.""" + if not self.sysmon_on: + # In forking situations, we might try to stop when we are not + # started. Do nothing in that case. + return + assert sys_monitoring is not None + sys_monitoring.set_events(self.myid, 0) + with self.lock: + self.sysmon_on = False + for code in self.local_event_codes.values(): + sys_monitoring.set_local_events(self.myid, code, 0) + self.local_event_codes = {} + sys_monitoring.free_tool_id(self.myid) + + @panopticon() + def post_fork(self) -> None: + """The process has forked, clean up as needed.""" + self.stop() + + def activity(self) -> bool: + """Has there been any activity?""" + return self._activity + + def reset_activity(self) -> None: + """Reset the activity() flag.""" + self._activity = False + + def get_stats(self) -> dict[str, int] | None: + """Return a dictionary of statistics, or None.""" + return None + + # The number of frames in callers_frame takes @panopticon into account. + if LOG: + + def callers_frame(self) -> FrameType: + """Get the frame of the Python code we're monitoring.""" + return ( + inspect.currentframe().f_back.f_back.f_back # type: ignore[union-attr,return-value] + ) + + else: + + def callers_frame(self) -> FrameType: + """Get the frame of the Python code we're monitoring.""" + return inspect.currentframe().f_back.f_back # type: ignore[union-attr,return-value] + + @panopticon("code", "@") + def sysmon_py_start(self, code: CodeType, instruction_offset: int) -> MonitorReturn: + """Handle sys.monitoring.events.PY_START events.""" + # Entering a new frame. Decide if we should trace in this file. + self._activity = True + self.stats["starts"] += 1 + + code_info = self.code_infos.get(id(code)) + tracing_code: bool | None = None + file_data: TTraceFileData | None = None + if code_info is not None: + tracing_code = code_info.tracing + file_data = code_info.file_data + + if tracing_code is None: + filename = code.co_filename + disp = self.should_trace_cache.get(filename) + if disp is None: + frame = inspect.currentframe().f_back # type: ignore[union-attr] + if LOG: + # @panopticon adds a frame. + frame = frame.f_back # type: ignore[union-attr] + disp = self.should_trace(filename, frame) # type: ignore[arg-type] + self.should_trace_cache[filename] = disp + + tracing_code = disp.trace + if tracing_code: + tracename = disp.source_filename + assert tracename is not None + self.lock_data() + try: + if tracename not in self.data: + self.data[tracename] = set() + finally: + self.unlock_data() + file_data = self.data[tracename] + b2l = bytes_to_lines(code) + else: + file_data = None + b2l = None + + self.code_infos[id(code)] = CodeInfo( + tracing=tracing_code, + file_data=file_data, + byte_to_line=b2l, + ) + self.code_objects.append(code) + + if tracing_code: + events = sys.monitoring.events + with self.lock: + if self.sysmon_on: + assert sys_monitoring is not None + sys_monitoring.set_local_events( + self.myid, + code, + events.PY_RETURN + # + | events.PY_RESUME + # | events.PY_YIELD + | events.LINE, + # | events.BRANCH + # | events.JUMP + ) + self.local_event_codes[id(code)] = code + + if tracing_code and self.trace_arcs: + frame = self.callers_frame() + self.last_lines[frame] = -code.co_firstlineno + return None + else: + return sys.monitoring.DISABLE + + @panopticon("code", "@") + def sysmon_py_resume_arcs( + self, code: CodeType, instruction_offset: int, + ) -> MonitorReturn: + """Handle sys.monitoring.events.PY_RESUME events for branch coverage.""" + frame = self.callers_frame() + self.last_lines[frame] = frame.f_lineno + + @panopticon("code", "@", None) + def sysmon_py_return_arcs( + self, code: CodeType, instruction_offset: int, retval: object, + ) -> MonitorReturn: + """Handle sys.monitoring.events.PY_RETURN events for branch coverage.""" + frame = self.callers_frame() + code_info = self.code_infos.get(id(code)) + if code_info is not None and code_info.file_data is not None: + last_line = self.last_lines.get(frame) + if last_line is not None: + arc = (last_line, -code.co_firstlineno) + # log(f"adding {arc=}") + cast(set[TArc], code_info.file_data).add(arc) + + # Leaving this function, no need for the frame any more. + self.last_lines.pop(frame, None) + + @panopticon("code", "@", "exc") + def sysmon_py_unwind_arcs( + self, code: CodeType, instruction_offset: int, exception: BaseException, + ) -> MonitorReturn: + """Handle sys.monitoring.events.PY_UNWIND events for branch coverage.""" + frame = self.callers_frame() + # Leaving this function. + last_line = self.last_lines.pop(frame, None) + if isinstance(exception, GeneratorExit): + # We don't want to count generator exits as arcs. + return + code_info = self.code_infos.get(id(code)) + if code_info is not None and code_info.file_data is not None: + if last_line is not None: + arc = (last_line, -code.co_firstlineno) + # log(f"adding {arc=}") + cast(set[TArc], code_info.file_data).add(arc) + + + @panopticon("code", "line") + def sysmon_line_lines(self, code: CodeType, line_number: int) -> MonitorReturn: + """Handle sys.monitoring.events.LINE events for line coverage.""" + code_info = self.code_infos[id(code)] + if code_info.file_data is not None: + cast(set[TLineNo], code_info.file_data).add(line_number) + # log(f"adding {line_number=}") + return sys.monitoring.DISABLE + + @panopticon("code", "line") + def sysmon_line_arcs(self, code: CodeType, line_number: int) -> MonitorReturn: + """Handle sys.monitoring.events.LINE events for branch coverage.""" + code_info = self.code_infos[id(code)] + ret = None + if code_info.file_data is not None: + frame = self.callers_frame() + last_line = self.last_lines.get(frame) + if last_line is not None: + arc = (last_line, line_number) + cast(set[TArc], code_info.file_data).add(arc) + # log(f"adding {arc=}") + self.last_lines[frame] = line_number + return ret diff --git a/.venv/Lib/site-packages/coverage/templite.py b/.venv/Lib/site-packages/coverage/templite.py new file mode 100644 index 00000000..4689f957 --- /dev/null +++ b/.venv/Lib/site-packages/coverage/templite.py @@ -0,0 +1,306 @@ +# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt + +"""A simple Python template renderer, for a nano-subset of Django syntax. + +For a detailed discussion of this code, see this chapter from 500 Lines: +http://aosabook.org/en/500L/a-template-engine.html + +""" + +# Coincidentally named the same as http://code.activestate.com/recipes/496702/ + +from __future__ import annotations + +import re + +from typing import ( + Any, Callable, NoReturn, cast, +) + + +class TempliteSyntaxError(ValueError): + """Raised when a template has a syntax error.""" + pass + + +class TempliteValueError(ValueError): + """Raised when an expression won't evaluate in a template.""" + pass + + +class CodeBuilder: + """Build source code conveniently.""" + + def __init__(self, indent: int = 0) -> None: + self.code: list[str | CodeBuilder] = [] + self.indent_level = indent + + def __str__(self) -> str: + return "".join(str(c) for c in self.code) + + def add_line(self, line: str) -> None: + """Add a line of source to the code. + + Indentation and newline will be added for you, don't provide them. + + """ + self.code.extend([" " * self.indent_level, line, "\n"]) + + def add_section(self) -> CodeBuilder: + """Add a section, a sub-CodeBuilder.""" + section = CodeBuilder(self.indent_level) + self.code.append(section) + return section + + INDENT_STEP = 4 # PEP8 says so! + + def indent(self) -> None: + """Increase the current indent for following lines.""" + self.indent_level += self.INDENT_STEP + + def dedent(self) -> None: + """Decrease the current indent for following lines.""" + self.indent_level -= self.INDENT_STEP + + def get_globals(self) -> dict[str, Any]: + """Execute the code, and return a dict of globals it defines.""" + # A check that the caller really finished all the blocks they started. + assert self.indent_level == 0 + # Get the Python source as a single string. + python_source = str(self) + # Execute the source, defining globals, and return them. + global_namespace: dict[str, Any] = {} + exec(python_source, global_namespace) + return global_namespace + + +class Templite: + """A simple template renderer, for a nano-subset of Django syntax. + + Supported constructs are extended variable access:: + + {{var.modifier.modifier|filter|filter}} + + loops:: + + {% for var in list %}...{% endfor %} + + and ifs:: + + {% if var %}...{% endif %} + + Comments are within curly-hash markers:: + + {# This will be ignored #} + + Lines between `{% joined %}` and `{% endjoined %}` will have lines stripped + and joined. Be careful, this could join words together! + + Any of these constructs can have a hyphen at the end (`-}}`, `-%}`, `-#}`), + which will collapse the white space following the tag. + + Construct a Templite with the template text, then use `render` against a + dictionary context to create a finished string:: + + templite = Templite(''' +

Hello {{name|upper}}!

+ {% for topic in topics %} +

You are interested in {{topic}}.

+ {% endif %} + ''', + {"upper": str.upper}, + ) + text = templite.render({ + "name": "Ned", + "topics": ["Python", "Geometry", "Juggling"], + }) + + """ + def __init__(self, text: str, *contexts: dict[str, Any]) -> None: + """Construct a Templite with the given `text`. + + `contexts` are dictionaries of values to use for future renderings. + These are good for filters and global values. + + """ + self.context = {} + for context in contexts: + self.context.update(context) + + self.all_vars: set[str] = set() + self.loop_vars: set[str] = set() + + # We construct a function in source form, then compile it and hold onto + # it, and execute it to render the template. + code = CodeBuilder() + + code.add_line("def render_function(context, do_dots):") + code.indent() + vars_code = code.add_section() + code.add_line("result = []") + code.add_line("append_result = result.append") + code.add_line("extend_result = result.extend") + code.add_line("to_str = str") + + buffered: list[str] = [] + + def flush_output() -> None: + """Force `buffered` to the code builder.""" + if len(buffered) == 1: + code.add_line("append_result(%s)" % buffered[0]) + elif len(buffered) > 1: + code.add_line("extend_result([%s])" % ", ".join(buffered)) + del buffered[:] + + ops_stack = [] + + # Split the text to form a list of tokens. + tokens = re.split(r"(?s)({{.*?}}|{%.*?%}|{#.*?#})", text) + + squash = in_joined = False + + for token in tokens: + if token.startswith("{"): + start, end = 2, -2 + squash = (token[-3] == "-") + if squash: + end = -3 + + if token.startswith("{#"): + # Comment: ignore it and move on. + continue + elif token.startswith("{{"): + # An expression to evaluate. + expr = self._expr_code(token[start:end].strip()) + buffered.append("to_str(%s)" % expr) + else: + # token.startswith("{%") + # Action tag: split into words and parse further. + flush_output() + + words = token[start:end].strip().split() + if words[0] == "if": + # An if statement: evaluate the expression to determine if. + if len(words) != 2: + self._syntax_error("Don't understand if", token) + ops_stack.append("if") + code.add_line("if %s:" % self._expr_code(words[1])) + code.indent() + elif words[0] == "for": + # A loop: iterate over expression result. + if len(words) != 4 or words[2] != "in": + self._syntax_error("Don't understand for", token) + ops_stack.append("for") + self._variable(words[1], self.loop_vars) + code.add_line( + f"for c_{words[1]} in {self._expr_code(words[3])}:", + ) + code.indent() + elif words[0] == "joined": + ops_stack.append("joined") + in_joined = True + elif words[0].startswith("end"): + # Endsomething. Pop the ops stack. + if len(words) != 1: + self._syntax_error("Don't understand end", token) + end_what = words[0][3:] + if not ops_stack: + self._syntax_error("Too many ends", token) + start_what = ops_stack.pop() + if start_what != end_what: + self._syntax_error("Mismatched end tag", end_what) + if end_what == "joined": + in_joined = False + else: + code.dedent() + else: + self._syntax_error("Don't understand tag", words[0]) + else: + # Literal content. If it isn't empty, output it. + if in_joined: + token = re.sub(r"\s*\n\s*", "", token.strip()) + elif squash: + token = token.lstrip() + if token: + buffered.append(repr(token)) + + if ops_stack: + self._syntax_error("Unmatched action tag", ops_stack[-1]) + + flush_output() + + for var_name in self.all_vars - self.loop_vars: + vars_code.add_line(f"c_{var_name} = context[{var_name!r}]") + + code.add_line("return ''.join(result)") + code.dedent() + self._render_function = cast( + Callable[ + [dict[str, Any], Callable[..., Any]], + str, + ], + code.get_globals()["render_function"], + ) + + def _expr_code(self, expr: str) -> str: + """Generate a Python expression for `expr`.""" + if "|" in expr: + pipes = expr.split("|") + code = self._expr_code(pipes[0]) + for func in pipes[1:]: + self._variable(func, self.all_vars) + code = f"c_{func}({code})" + elif "." in expr: + dots = expr.split(".") + code = self._expr_code(dots[0]) + args = ", ".join(repr(d) for d in dots[1:]) + code = f"do_dots({code}, {args})" + else: + self._variable(expr, self.all_vars) + code = "c_%s" % expr + return code + + def _syntax_error(self, msg: str, thing: Any) -> NoReturn: + """Raise a syntax error using `msg`, and showing `thing`.""" + raise TempliteSyntaxError(f"{msg}: {thing!r}") + + def _variable(self, name: str, vars_set: set[str]) -> None: + """Track that `name` is used as a variable. + + Adds the name to `vars_set`, a set of variable names. + + Raises an syntax error if `name` is not a valid name. + + """ + if not re.match(r"[_a-zA-Z][_a-zA-Z0-9]*$", name): + self._syntax_error("Not a valid name", name) + vars_set.add(name) + + def render(self, context: dict[str, Any] | None = None) -> str: + """Render this template by applying it to `context`. + + `context` is a dictionary of values to use in this rendering. + + """ + # Make the complete context we'll use. + render_context = dict(self.context) + if context: + render_context.update(context) + return self._render_function(render_context, self._do_dots) + + def _do_dots(self, value: Any, *dots: str) -> Any: + """Evaluate dotted expressions at run-time.""" + for dot in dots: + try: + value = getattr(value, dot) + except AttributeError: + try: + value = value[dot] + except (TypeError, KeyError) as exc: + raise TempliteValueError( + f"Couldn't evaluate {value!r}.{dot}", + ) from exc + if callable(value): + value = value() + return value diff --git a/.venv/Lib/site-packages/coverage/tomlconfig.py b/.venv/Lib/site-packages/coverage/tomlconfig.py new file mode 100644 index 00000000..1784f3f3 --- /dev/null +++ b/.venv/Lib/site-packages/coverage/tomlconfig.py @@ -0,0 +1,209 @@ +# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt + +"""TOML configuration support for coverage.py""" + +from __future__ import annotations + +import os +import re + +from typing import Any, Callable, TypeVar +from collections.abc import Iterable + +from coverage import env +from coverage.exceptions import ConfigError +from coverage.misc import import_third_party, substitute_variables +from coverage.types import TConfigSectionOut, TConfigValueOut + + +if env.PYVERSION >= (3, 11, 0, "alpha", 7): + import tomllib # pylint: disable=import-error + has_tomllib = True +else: + # TOML support on Python 3.10 and below is an install-time extra option. + tomllib, has_tomllib = import_third_party("tomli") + + +class TomlDecodeError(Exception): + """An exception class that exists even when toml isn't installed.""" + pass + + +TWant = TypeVar("TWant") + +class TomlConfigParser: + """TOML file reading with the interface of HandyConfigParser.""" + + # This class has the same interface as config.HandyConfigParser, no + # need for docstrings. + # pylint: disable=missing-function-docstring + + def __init__(self, our_file: bool) -> None: + self.our_file = our_file + self.data: dict[str, Any] = {} + + def read(self, filenames: Iterable[str]) -> list[str]: + # RawConfigParser takes a filename or list of filenames, but we only + # ever call this with a single filename. + assert isinstance(filenames, (bytes, str, os.PathLike)) + filename = os.fspath(filenames) + + try: + with open(filename, encoding='utf-8') as fp: + toml_text = fp.read() + except OSError: + return [] + if has_tomllib: + try: + self.data = tomllib.loads(toml_text) + except tomllib.TOMLDecodeError as err: + raise TomlDecodeError(str(err)) from err + return [filename] + else: + has_toml = re.search(r"^\[tool\.coverage(\.|])", toml_text, flags=re.MULTILINE) + if self.our_file or has_toml: + # Looks like they meant to read TOML, but we can't read it. + msg = "Can't read {!r} without TOML support. Install with [toml] extra" + raise ConfigError(msg.format(filename)) + return [] + + def _get_section(self, section: str) -> tuple[str | None, TConfigSectionOut | None]: + """Get a section from the data. + + Arguments: + section (str): A section name, which can be dotted. + + Returns: + name (str): the actual name of the section that was found, if any, + or None. + data (str): the dict of data in the section, or None if not found. + + """ + prefixes = ["tool.coverage."] + for prefix in prefixes: + real_section = prefix + section + parts = real_section.split(".") + try: + data = self.data[parts[0]] + for part in parts[1:]: + data = data[part] + except KeyError: + continue + break + else: + return None, None + return real_section, data + + def _get(self, section: str, option: str) -> tuple[str, TConfigValueOut]: + """Like .get, but returns the real section name and the value.""" + name, data = self._get_section(section) + if data is None: + raise ConfigError(f"No section: {section!r}") + assert name is not None + try: + value = data[option] + except KeyError: + raise ConfigError(f"No option {option!r} in section: {name!r}") from None + return name, value + + def _get_single(self, section: str, option: str) -> Any: + """Get a single-valued option. + + Performs environment substitution if the value is a string. Other types + will be converted later as needed. + """ + name, value = self._get(section, option) + if isinstance(value, str): + value = substitute_variables(value, os.environ) + return name, value + + def has_option(self, section: str, option: str) -> bool: + _, data = self._get_section(section) + if data is None: + return False + return option in data + + def real_section(self, section: str) -> str | None: + name, _ = self._get_section(section) + return name + + def has_section(self, section: str) -> bool: + name, _ = self._get_section(section) + return bool(name) + + def options(self, section: str) -> list[str]: + _, data = self._get_section(section) + if data is None: + raise ConfigError(f"No section: {section!r}") + return list(data.keys()) + + def get_section(self, section: str) -> TConfigSectionOut: + _, data = self._get_section(section) + return data or {} + + def get(self, section: str, option: str) -> Any: + _, value = self._get_single(section, option) + return value + + def _check_type( + self, + section: str, + option: str, + value: Any, + type_: type[TWant], + converter: Callable[[Any], TWant] | None, + type_desc: str, + ) -> TWant: + """Check that `value` has the type we want, converting if needed. + + Returns the resulting value of the desired type. + """ + if isinstance(value, type_): + return value + if isinstance(value, str) and converter is not None: + try: + return converter(value) + except Exception as e: + raise ValueError( + f"Option [{section}]{option} couldn't convert to {type_desc}: {value!r}", + ) from e + raise ValueError( + f"Option [{section}]{option} is not {type_desc}: {value!r}", + ) + + def getboolean(self, section: str, option: str) -> bool: + name, value = self._get_single(section, option) + bool_strings = {"true": True, "false": False} + return self._check_type(name, option, value, bool, bool_strings.__getitem__, "a boolean") + + def _get_list(self, section: str, option: str) -> tuple[str, list[str]]: + """Get a list of strings, substituting environment variables in the elements.""" + name, values = self._get(section, option) + values = self._check_type(name, option, values, list, None, "a list") + values = [substitute_variables(value, os.environ) for value in values] + return name, values + + def getlist(self, section: str, option: str) -> list[str]: + _, values = self._get_list(section, option) + return values + + def getregexlist(self, section: str, option: str) -> list[str]: + name, values = self._get_list(section, option) + for value in values: + value = value.strip() + try: + re.compile(value) + except re.error as e: + raise ConfigError(f"Invalid [{name}].{option} value {value!r}: {e}") from e + return values + + def getint(self, section: str, option: str) -> int: + name, value = self._get_single(section, option) + return self._check_type(name, option, value, int, int, "an integer") + + def getfloat(self, section: str, option: str) -> float: + name, value = self._get_single(section, option) + if isinstance(value, int): + value = float(value) + return self._check_type(name, option, value, float, float, "a float") diff --git a/.venv/Lib/site-packages/coverage/tracer.cp312-win_amd64.pyd b/.venv/Lib/site-packages/coverage/tracer.cp312-win_amd64.pyd new file mode 100644 index 00000000..7878535a Binary files /dev/null and b/.venv/Lib/site-packages/coverage/tracer.cp312-win_amd64.pyd differ diff --git a/.venv/Lib/site-packages/coverage/tracer.pyi b/.venv/Lib/site-packages/coverage/tracer.pyi new file mode 100644 index 00000000..d850493e --- /dev/null +++ b/.venv/Lib/site-packages/coverage/tracer.pyi @@ -0,0 +1,41 @@ +# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt + +"""Typing information for the constructs from our .c files.""" + +from typing import Any, Dict + +from coverage.types import TFileDisposition, TTraceData, TTraceFn, Tracer + +class CFileDisposition(TFileDisposition): + """CFileDisposition is in ctracer/filedisp.c""" + canonical_filename: Any + file_tracer: Any + has_dynamic_filename: Any + original_filename: Any + reason: Any + source_filename: Any + trace: Any + def __init__(self) -> None: ... + +class CTracer(Tracer): + """CTracer is in ctracer/tracer.c""" + check_include: Any + concur_id_func: Any + data: TTraceData + disable_plugin: Any + file_tracers: Any + should_start_context: Any + should_trace: Any + should_trace_cache: Any + switch_context: Any + lock_data: Any + unlock_data: Any + trace_arcs: Any + warn: Any + def __init__(self) -> None: ... + def activity(self) -> bool: ... + def get_stats(self) -> Dict[str, int]: ... + def reset_activity(self) -> Any: ... + def start(self) -> TTraceFn: ... + def stop(self) -> None: ... diff --git a/.venv/Lib/site-packages/coverage/types.py b/.venv/Lib/site-packages/coverage/types.py new file mode 100644 index 00000000..bcf8396d --- /dev/null +++ b/.venv/Lib/site-packages/coverage/types.py @@ -0,0 +1,203 @@ +# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt + +""" +Types for use throughout coverage.py. +""" + +from __future__ import annotations + +import os +import pathlib + +from collections.abc import Iterable, Mapping +from types import FrameType, ModuleType +from typing import ( + Any, Callable, Optional, Protocol, + Union, TYPE_CHECKING, +) + +if TYPE_CHECKING: + from coverage.plugin import FileTracer + + +AnyCallable = Callable[..., Any] + +## File paths + +# For arguments that are file paths: +if TYPE_CHECKING: + FilePath = Union[str, os.PathLike[str]] +else: + # PathLike < python3.9 doesn't support subscription + FilePath = Union[str, os.PathLike] +# For testing FilePath arguments +FilePathClasses = [str, pathlib.Path] +FilePathType = Union[type[str], type[pathlib.Path]] + +## Python tracing + +class TTraceFn(Protocol): + """A Python trace function.""" + def __call__( + self, + frame: FrameType, + event: str, + arg: Any, + lineno: TLineNo | None = None, # Our own twist, see collector.py + ) -> TTraceFn | None: + ... + +## Coverage.py tracing + +# Line numbers are pervasive enough that they deserve their own type. +TLineNo = int + +TArc = tuple[TLineNo, TLineNo] + +class TFileDisposition(Protocol): + """A simple value type for recording what to do with a file.""" + + original_filename: str + canonical_filename: str + source_filename: str | None + trace: bool + reason: str + file_tracer: FileTracer | None + has_dynamic_filename: bool + + +# When collecting data, we use a dictionary with a few possible shapes. The +# keys are always file names. +# - If measuring line coverage, the values are sets of line numbers. +# - If measuring arcs in the Python tracer, the values are sets of arcs (pairs +# of line numbers). +# - If measuring arcs in the C tracer, the values are sets of packed arcs (two +# line numbers combined into one integer). + +TTraceFileData = Union[set[TLineNo], set[TArc], set[int]] + +TTraceData = dict[str, TTraceFileData] + +# Functions passed into collectors. +TShouldTraceFn = Callable[[str, FrameType], TFileDisposition] +TCheckIncludeFn = Callable[[str, FrameType], bool] +TShouldStartContextFn = Callable[[FrameType], Union[str, None]] + +class Tracer(Protocol): + """Anything that can report on Python execution.""" + + data: TTraceData + trace_arcs: bool + should_trace: TShouldTraceFn + should_trace_cache: Mapping[str, TFileDisposition | None] + should_start_context: TShouldStartContextFn | None + switch_context: Callable[[str | None], None] | None + lock_data: Callable[[], None] + unlock_data: Callable[[], None] + warn: TWarnFn + + def __init__(self) -> None: + ... + + def start(self) -> TTraceFn | None: + """Start this tracer, return a trace function if based on sys.settrace.""" + + def stop(self) -> None: + """Stop this tracer.""" + + def activity(self) -> bool: + """Has there been any activity?""" + + def reset_activity(self) -> None: + """Reset the activity() flag.""" + + def get_stats(self) -> dict[str, int] | None: + """Return a dictionary of statistics, or None.""" + + +## Coverage + +# Many places use kwargs as Coverage kwargs. +TCovKwargs = Any + + +## Configuration + +# One value read from a config file. +TConfigValueIn = Optional[Union[bool, int, float, str, Iterable[str]]] +TConfigValueOut = Optional[Union[bool, int, float, str, list[str]]] +# An entire config section, mapping option names to values. +TConfigSectionIn = Mapping[str, TConfigValueIn] +TConfigSectionOut = Mapping[str, TConfigValueOut] + +class TConfigurable(Protocol): + """Something that can proxy to the coverage configuration settings.""" + + def get_option(self, option_name: str) -> TConfigValueOut | None: + """Get an option from the configuration. + + `option_name` is a colon-separated string indicating the section and + option name. For example, the ``branch`` option in the ``[run]`` + section of the config file would be indicated with `"run:branch"`. + + Returns the value of the option. + + """ + + def set_option(self, option_name: str, value: TConfigValueIn | TConfigSectionIn) -> None: + """Set an option in the configuration. + + `option_name` is a colon-separated string indicating the section and + option name. For example, the ``branch`` option in the ``[run]`` + section of the config file would be indicated with `"run:branch"`. + + `value` is the new value for the option. + + """ + +class TPluginConfig(Protocol): + """Something that can provide options to a plugin.""" + + def get_plugin_options(self, plugin: str) -> TConfigSectionOut: + """Get the options for a plugin.""" + + +## Parsing + +TMorf = Union[ModuleType, str] + +TSourceTokenLines = Iterable[list[tuple[str, str]]] + + +## Plugins + +class TPlugin(Protocol): + """What all plugins have in common.""" + _coverage_plugin_name: str + _coverage_enabled: bool + + +## Debugging + +class TWarnFn(Protocol): + """A callable warn() function.""" + def __call__(self, msg: str, slug: str | None = None, once: bool = False) -> None: + ... + + +class TDebugCtl(Protocol): + """A DebugControl object, or something like it.""" + + def should(self, option: str) -> bool: + """Decide whether to output debug information in category `option`.""" + + def write(self, msg: str) -> None: + """Write a line of debug output.""" + + +class TWritable(Protocol): + """Anything that can be written to.""" + + def write(self, msg: str) -> None: + """Write a message.""" diff --git a/.venv/Lib/site-packages/coverage/version.py b/.venv/Lib/site-packages/coverage/version.py new file mode 100644 index 00000000..43e6f8c3 --- /dev/null +++ b/.venv/Lib/site-packages/coverage/version.py @@ -0,0 +1,50 @@ +# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt + +"""The version and URL for coverage.py""" +# This file is exec'ed in setup.py, don't import anything! + +from __future__ import annotations + +# version_info: same semantics as sys.version_info. +# _dev: the .devN suffix if any. +version_info = (7, 6, 4, "final", 0) +_dev = 0 + + +def _make_version( + major: int, + minor: int, + micro: int, + releaselevel: str = "final", + serial: int = 0, + dev: int = 0, +) -> str: + """Create a readable version string from version_info tuple components.""" + assert releaselevel in ["alpha", "beta", "candidate", "final"] + version = "%d.%d.%d" % (major, minor, micro) + if releaselevel != "final": + short = {"alpha": "a", "beta": "b", "candidate": "rc"}[releaselevel] + version += f"{short}{serial}" + if dev != 0: + version += f".dev{dev}" + return version + + +def _make_url( + major: int, + minor: int, + micro: int, + releaselevel: str, + serial: int = 0, + dev: int = 0, +) -> str: + """Make the URL people should start at for this version of coverage.py.""" + return ( + "https://coverage.readthedocs.io/en/" + + _make_version(major, minor, micro, releaselevel, serial, dev) + ) + + +__version__ = _make_version(*version_info, _dev) +__url__ = _make_url(*version_info, _dev) diff --git a/.venv/Lib/site-packages/coverage/xmlreport.py b/.venv/Lib/site-packages/coverage/xmlreport.py new file mode 100644 index 00000000..487c2659 --- /dev/null +++ b/.venv/Lib/site-packages/coverage/xmlreport.py @@ -0,0 +1,261 @@ +# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 +# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt + +"""XML reporting for coverage.py""" + +from __future__ import annotations + +import os +import os.path +import sys +import time +import xml.dom.minidom + +from dataclasses import dataclass +from typing import Any, IO, TYPE_CHECKING +from collections.abc import Iterable + +from coverage import __version__, files +from coverage.misc import isolate_module, human_sorted, human_sorted_items +from coverage.plugin import FileReporter +from coverage.report_core import get_analysis_to_report +from coverage.results import Analysis +from coverage.types import TMorf +from coverage.version import __url__ + +if TYPE_CHECKING: + from coverage import Coverage + +os = isolate_module(os) + + +DTD_URL = "https://raw.githubusercontent.com/cobertura/web/master/htdocs/xml/coverage-04.dtd" + + +def rate(hit: int, num: int) -> str: + """Return the fraction of `hit`/`num`, as a string.""" + if num == 0: + return "1" + else: + return "%.4g" % (hit / num) + + +@dataclass +class PackageData: + """Data we keep about each "package" (in Java terms).""" + elements: dict[str, xml.dom.minidom.Element] + hits: int + lines: int + br_hits: int + branches: int + + +def appendChild(parent: Any, child: Any) -> None: + """Append a child to a parent, in a way mypy will shut up about.""" + parent.appendChild(child) + + +class XmlReporter: + """A reporter for writing Cobertura-style XML coverage results.""" + + report_type = "XML report" + + def __init__(self, coverage: Coverage) -> None: + self.coverage = coverage + self.config = self.coverage.config + + self.source_paths = set() + if self.config.source: + for src in self.config.source: + if os.path.exists(src): + if self.config.relative_files: + src = src.rstrip(r"\/") + else: + src = files.canonical_filename(src) + self.source_paths.add(src) + self.packages: dict[str, PackageData] = {} + self.xml_out: xml.dom.minidom.Document + + def report(self, morfs: Iterable[TMorf] | None, outfile: IO[str] | None = None) -> float: + """Generate a Cobertura-compatible XML report for `morfs`. + + `morfs` is a list of modules or file names. + + `outfile` is a file object to write the XML to. + + """ + # Initial setup. + outfile = outfile or sys.stdout + has_arcs = self.coverage.get_data().has_arcs() + + # Create the DOM that will store the data. + impl = xml.dom.minidom.getDOMImplementation() + assert impl is not None + self.xml_out = impl.createDocument(None, "coverage", None) + + # Write header stuff. + xcoverage = self.xml_out.documentElement + xcoverage.setAttribute("version", __version__) + xcoverage.setAttribute("timestamp", str(int(time.time()*1000))) + xcoverage.appendChild(self.xml_out.createComment( + f" Generated by coverage.py: {__url__} ", + )) + xcoverage.appendChild(self.xml_out.createComment(f" Based on {DTD_URL} ")) + + # Call xml_file for each file in the data. + for fr, analysis in get_analysis_to_report(self.coverage, morfs): + self.xml_file(fr, analysis, has_arcs) + + xsources = self.xml_out.createElement("sources") + xcoverage.appendChild(xsources) + + # Populate the XML DOM with the source info. + for path in human_sorted(self.source_paths): + xsource = self.xml_out.createElement("source") + appendChild(xsources, xsource) + txt = self.xml_out.createTextNode(path) + appendChild(xsource, txt) + + lnum_tot, lhits_tot = 0, 0 + bnum_tot, bhits_tot = 0, 0 + + xpackages = self.xml_out.createElement("packages") + xcoverage.appendChild(xpackages) + + # Populate the XML DOM with the package info. + for pkg_name, pkg_data in human_sorted_items(self.packages.items()): + xpackage = self.xml_out.createElement("package") + appendChild(xpackages, xpackage) + xclasses = self.xml_out.createElement("classes") + appendChild(xpackage, xclasses) + for _, class_elt in human_sorted_items(pkg_data.elements.items()): + appendChild(xclasses, class_elt) + xpackage.setAttribute("name", pkg_name.replace(os.sep, ".")) + xpackage.setAttribute("line-rate", rate(pkg_data.hits, pkg_data.lines)) + if has_arcs: + branch_rate = rate(pkg_data.br_hits, pkg_data.branches) + else: + branch_rate = "0" + xpackage.setAttribute("branch-rate", branch_rate) + xpackage.setAttribute("complexity", "0") + + lhits_tot += pkg_data.hits + lnum_tot += pkg_data.lines + bhits_tot += pkg_data.br_hits + bnum_tot += pkg_data.branches + + xcoverage.setAttribute("lines-valid", str(lnum_tot)) + xcoverage.setAttribute("lines-covered", str(lhits_tot)) + xcoverage.setAttribute("line-rate", rate(lhits_tot, lnum_tot)) + if has_arcs: + xcoverage.setAttribute("branches-valid", str(bnum_tot)) + xcoverage.setAttribute("branches-covered", str(bhits_tot)) + xcoverage.setAttribute("branch-rate", rate(bhits_tot, bnum_tot)) + else: + xcoverage.setAttribute("branches-covered", "0") + xcoverage.setAttribute("branches-valid", "0") + xcoverage.setAttribute("branch-rate", "0") + xcoverage.setAttribute("complexity", "0") + + # Write the output file. + outfile.write(serialize_xml(self.xml_out)) + + # Return the total percentage. + denom = lnum_tot + bnum_tot + if denom == 0: + pct = 0.0 + else: + pct = 100.0 * (lhits_tot + bhits_tot) / denom + return pct + + def xml_file(self, fr: FileReporter, analysis: Analysis, has_arcs: bool) -> None: + """Add to the XML report for a single file.""" + + if self.config.skip_empty: + if analysis.numbers.n_statements == 0: + return + + # Create the "lines" and "package" XML elements, which + # are populated later. Note that a package == a directory. + filename = fr.filename.replace("\\", "/") + for source_path in self.source_paths: + if not self.config.relative_files: + source_path = files.canonical_filename(source_path) + if filename.startswith(source_path.replace("\\", "/") + "/"): + rel_name = filename[len(source_path)+1:] + break + else: + rel_name = fr.relative_filename().replace("\\", "/") + self.source_paths.add(fr.filename[:-len(rel_name)].rstrip(r"\/")) + + dirname = os.path.dirname(rel_name) or "." + dirname = "/".join(dirname.split("/")[:self.config.xml_package_depth]) + package_name = dirname.replace("/", ".") + + package = self.packages.setdefault(package_name, PackageData({}, 0, 0, 0, 0)) + + xclass: xml.dom.minidom.Element = self.xml_out.createElement("class") + + appendChild(xclass, self.xml_out.createElement("methods")) + + xlines = self.xml_out.createElement("lines") + appendChild(xclass, xlines) + + xclass.setAttribute("name", os.path.relpath(rel_name, dirname)) + xclass.setAttribute("filename", rel_name.replace("\\", "/")) + xclass.setAttribute("complexity", "0") + + branch_stats = analysis.branch_stats() + missing_branch_arcs = analysis.missing_branch_arcs() + + # For each statement, create an XML "line" element. + for line in sorted(analysis.statements): + xline = self.xml_out.createElement("line") + xline.setAttribute("number", str(line)) + + # Q: can we get info about the number of times a statement is + # executed? If so, that should be recorded here. + xline.setAttribute("hits", str(int(line not in analysis.missing))) + + if has_arcs: + if line in branch_stats: + total, taken = branch_stats[line] + xline.setAttribute("branch", "true") + xline.setAttribute( + "condition-coverage", + "%d%% (%d/%d)" % (100*taken//total, taken, total), + ) + if line in missing_branch_arcs: + annlines = ["exit" if b < 0 else str(b) for b in missing_branch_arcs[line]] + xline.setAttribute("missing-branches", ",".join(annlines)) + appendChild(xlines, xline) + + class_lines = len(analysis.statements) + class_hits = class_lines - len(analysis.missing) + + if has_arcs: + class_branches = sum(t for t, k in branch_stats.values()) + missing_branches = sum(t - k for t, k in branch_stats.values()) + class_br_hits = class_branches - missing_branches + else: + class_branches = 0 + class_br_hits = 0 + + # Finalize the statistics that are collected in the XML DOM. + xclass.setAttribute("line-rate", rate(class_hits, class_lines)) + if has_arcs: + branch_rate = rate(class_br_hits, class_branches) + else: + branch_rate = "0" + xclass.setAttribute("branch-rate", branch_rate) + + package.elements[rel_name] = xclass + package.hits += class_hits + package.lines += class_lines + package.br_hits += class_br_hits + package.branches += class_branches + + +def serialize_xml(dom: xml.dom.minidom.Document) -> str: + """Serialize a minidom node to XML.""" + return dom.toprettyxml() diff --git a/.venv/Lib/site-packages/crispy_bootstrap4-2024.10.dist-info/INSTALLER b/.venv/Lib/site-packages/crispy_bootstrap4-2024.10.dist-info/INSTALLER new file mode 100644 index 00000000..a1b589e3 --- /dev/null +++ b/.venv/Lib/site-packages/crispy_bootstrap4-2024.10.dist-info/INSTALLER @@ -0,0 +1 @@ +pip diff --git a/.venv/Lib/site-packages/crispy_bootstrap4-2024.10.dist-info/LICENSE b/.venv/Lib/site-packages/crispy_bootstrap4-2024.10.dist-info/LICENSE new file mode 100644 index 00000000..c1404e2a --- /dev/null +++ b/.venv/Lib/site-packages/crispy_bootstrap4-2024.10.dist-info/LICENSE @@ -0,0 +1,22 @@ +Copyright (c) 2020 David Smith and contributors. + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/.venv/Lib/site-packages/crispy_bootstrap4-2024.10.dist-info/METADATA b/.venv/Lib/site-packages/crispy_bootstrap4-2024.10.dist-info/METADATA new file mode 100644 index 00000000..d78fc4eb --- /dev/null +++ b/.venv/Lib/site-packages/crispy_bootstrap4-2024.10.dist-info/METADATA @@ -0,0 +1,67 @@ +Metadata-Version: 2.1 +Name: crispy-bootstrap4 +Version: 2024.10 +Summary: Bootstrap4 template pack for django-crispy-forms +Home-page: https://github.com/django-crispy-forms/crispy-bootstrap4 +Author: David Smith +License: MIT +Project-URL: Issues, https://github.com/django-crispy-forms/crispy-bootstrap4/issues +Project-URL: CI, https://github.com/django-crispy-forms/crispy-bootstrap4/actions +Project-URL: Changelog, https://github.com/django-crispy-forms/crispy-bootstrap4/releases +Classifier: Environment :: Web Environment +Classifier: Development Status :: 5 - Production/Stable +Classifier: Framework :: Django +Classifier: Framework :: Django :: 4.2 +Classifier: Framework :: Django :: 5.0 +Classifier: Framework :: Django :: 5.1 +Classifier: License :: OSI Approved :: MIT License +Classifier: Operating System :: OS Independent +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: 3.8 +Classifier: Programming Language :: Python :: 3.9 +Classifier: Programming Language :: Python :: 3.10 +Classifier: Programming Language :: Python :: 3.11 +Classifier: Programming Language :: Python :: 3.12 +Classifier: Topic :: Internet :: WWW/HTTP +Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content +Classifier: Topic :: Software Development :: Libraries :: Python Modules +Requires-Python: >=3.8 +Description-Content-Type: text/markdown +License-File: LICENSE +Requires-Dist: django-crispy-forms>=2.3 +Requires-Dist: django>=4.2 + +# crispy-bootstrap4 + +[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smithdc1/crispy-bootstrap4/blob/main/LICENSE) + +Bootstrap4 template pack for django-crispy-forms. This template pack was +included with the core django-crispy-forms package until version 2.0. + +## Installation + +Install this plugin using `pip`: + +```bash + $ pip install crispy-bootstrap4 +``` + +## Usage + +You will need to update your project's settings file to add `crispy_forms` +and `crispy_bootstrap4` to your projects `INSTALLED_APPS`. Also set +`bootstrap4` as and allowed template pack and as the default template pack +for your project: + +```python + INSTALLED_APPS = ( + ... + "crispy_forms", + "crispy_bootstrap4", + ... + ) + + CRISPY_ALLOWED_TEMPLATE_PACKS = "bootstrap4" + + CRISPY_TEMPLATE_PACK = "bootstrap4" +``` diff --git a/.venv/Lib/site-packages/crispy_bootstrap4-2024.10.dist-info/RECORD b/.venv/Lib/site-packages/crispy_bootstrap4-2024.10.dist-info/RECORD new file mode 100644 index 00000000..48cd2750 --- /dev/null +++ b/.venv/Lib/site-packages/crispy_bootstrap4-2024.10.dist-info/RECORD @@ -0,0 +1,49 @@ +crispy_bootstrap4-2024.10.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +crispy_bootstrap4-2024.10.dist-info/LICENSE,sha256=9GRf5DJZqTaPbGeDJunlaPNZii4Bj8FuIQAP3wmsUE0,1072 +crispy_bootstrap4-2024.10.dist-info/METADATA,sha256=2dvMwn8DkBMyYz36QiKkYzgiMpUaAEVeWisVvbz33gg,2309 +crispy_bootstrap4-2024.10.dist-info/RECORD,, +crispy_bootstrap4-2024.10.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +crispy_bootstrap4-2024.10.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92 +crispy_bootstrap4-2024.10.dist-info/top_level.txt,sha256=-4L-ifH1Ci3nS9NG_6PEGH3nMXGrsxqGtx1uz-ef-pI,18 +crispy_bootstrap4/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +crispy_bootstrap4/__pycache__/__init__.cpython-312.pyc,, +crispy_bootstrap4/templates/bootstrap4/accordion-group.html,sha256=5lYpoJKAEgRHGJ-UvAwijWowiyKrFjWrk3r9q8xG_Gg,622 +crispy_bootstrap4/templates/bootstrap4/accordion.html,sha256=nlgzGn8lcHzXKJL77eGXO_iAKZSqWX0jn9IgOjVgXko,147 +crispy_bootstrap4/templates/bootstrap4/betterform.html,sha256=i9esRfFzRvbxGdL9shO7A0o9o0l2CcDq5K4L3mpcaL8,668 +crispy_bootstrap4/templates/bootstrap4/display_form.html,sha256=TvkvzrdgOJv_9FZ6mhl4W-QQBvFow8J1Y5Yi3Qtn0Gg,264 +crispy_bootstrap4/templates/bootstrap4/errors.html,sha256=983yW0fIrrTKhIJ5zNXaGa3zLON9h_ClkBLD5rBHqJU,295 +crispy_bootstrap4/templates/bootstrap4/errors_formset.html,sha256=IGCJBqbKPtnmDvQocMODLcKwFGYiNq_xlRZAU7aIU-4,306 +crispy_bootstrap4/templates/bootstrap4/field.html,sha256=Oy3AE8QrUhHIrx6jnzga_xEr3V-J2k5HXa2P1vrAgWk,4858 +crispy_bootstrap4/templates/bootstrap4/inputs.html,sha256=h3e2huPucCSoNXRL4e14mdVlmLv1OoBHgj63phXFs1M,410 +crispy_bootstrap4/templates/bootstrap4/layout/alert.html,sha256=bUX6HR3ueZyz0Kybzn2lKcvTsUeh4n1cWybvcrk9RUo,256 +crispy_bootstrap4/templates/bootstrap4/layout/attrs.html,sha256=LsLlfKenzHKl6n25m4Ers2NepLSA_RBy9AqezKZ7rH8,173 +crispy_bootstrap4/templates/bootstrap4/layout/baseinput.html,sha256=-HIv38UI4QRG117td3AW-1kJmX252IJt96C2i7RhbhU,335 +crispy_bootstrap4/templates/bootstrap4/layout/button.html,sha256=U0ydKyP1Ek0FiD9bVMGg0P10LQk6k9YPyP3AD4TbpaE,62 +crispy_bootstrap4/templates/bootstrap4/layout/buttonholder.html,sha256=4DK1B-uORsSSBwrDOuZvEfVEmmeOTpYx9ci57MJyRuE,207 +crispy_bootstrap4/templates/bootstrap4/layout/checkboxselectmultiple.html,sha256=utvUh97wFjX_DA3RbSOmYAz_Xh5uzCUYCLC4iumolJA,1887 +crispy_bootstrap4/templates/bootstrap4/layout/checkboxselectmultiple_inline.html,sha256=INR0jP5iGFi6Vp6t8C6NCGtQtekf4qYSCl_aDg74Kug,775 +crispy_bootstrap4/templates/bootstrap4/layout/column.html,sha256=loVfblfo22vrKDXTJb5x678qykT_wgB0JoeXTvIg3JQ,242 +crispy_bootstrap4/templates/bootstrap4/layout/div.html,sha256=4cHbtw0bO17Wi0HOYrQCl1l0EZT5F3RnMr_p_PAjvrc,173 +crispy_bootstrap4/templates/bootstrap4/layout/field_errors.html,sha256=pDtfFZMV70-zUPS-1J_fXvD-MCxkzD2RYcllUH1uSYU,236 +crispy_bootstrap4/templates/bootstrap4/layout/field_errors_block.html,sha256=Tkzqs0r7NVhIHYg9segv8cDaiyjD1KwsLRUOV4VdFf4,230 +crispy_bootstrap4/templates/bootstrap4/layout/field_file.html,sha256=fuqNGLkuxVWYeOcQF-0HTLmLnpS3_cVditXANWLuUqE,2710 +crispy_bootstrap4/templates/bootstrap4/layout/field_with_buttons.html,sha256=jZTjx25sKbF-r8rda8-7n6JgeMzwiskXfcfQq1ym1j4,1116 +crispy_bootstrap4/templates/bootstrap4/layout/fieldset.html,sha256=nUrqx5hxMDnVps_ku9dZ_YYdqyB5Y5QmsyRCVC0bVMo,268 +crispy_bootstrap4/templates/bootstrap4/layout/formactions.html,sha256=TaPA6bsBjedp-2iUwOXIFy_T9sTDfh3W_h4-OIICw2c,414 +crispy_bootstrap4/templates/bootstrap4/layout/help_text.html,sha256=qUcmtoQTA3l93dmL0g0HLrk0sQQQf4DnYuxHYIzv6ZE,304 +crispy_bootstrap4/templates/bootstrap4/layout/help_text_and_errors.html,sha256=u4QtqVkik0eNsY9XjmzLg2NVSKeWk_iX64clv5udt5w,382 +crispy_bootstrap4/templates/bootstrap4/layout/inline_field.html,sha256=R9eTUhC2nGCg2kMOsVMBaqBWM4D8DgiRSuSV7c1856Q,1317 +crispy_bootstrap4/templates/bootstrap4/layout/modal.html,sha256=2bxNzdpHgwjQRS7DVnn-WtKvgYVRuMX8k_iaqfT5pGc,674 +crispy_bootstrap4/templates/bootstrap4/layout/multifield.html,sha256=v9gWbmWAGVDkxsJCut0X7tZ6JjYyOOW0t8Q3FToJrY8,533 +crispy_bootstrap4/templates/bootstrap4/layout/prepended_appended_text.html,sha256=3jM4NUVCoaS6D-_1erCP4054iZrYyhWeEui89g23XVY,2515 +crispy_bootstrap4/templates/bootstrap4/layout/radioselect.html,sha256=2HkfdFJiy-qgGTHo6nWwlN2vYjaN-YFssOaUA4WxC1w,1879 +crispy_bootstrap4/templates/bootstrap4/layout/radioselect_inline.html,sha256=zOwYDXuGcWiInZ6_jL30Zu_YznpIcfyO62kk8iMIhMQ,763 +crispy_bootstrap4/templates/bootstrap4/layout/row.html,sha256=dEgfx1m1JIjRmKrTJxEv4bP7zXyzKoXkBXqjgETzp74,155 +crispy_bootstrap4/templates/bootstrap4/layout/tab-link.html,sha256=e1WmHEowFDBQFiP5nj8z6nzO8d7n08J3dpKjC0Oiapk,203 +crispy_bootstrap4/templates/bootstrap4/layout/tab.html,sha256=Zw_cDrp3AEgTFBlqHkyIJZ7xTMmi2FojraNHv05hBrA,218 +crispy_bootstrap4/templates/bootstrap4/layout/uneditable_input.html,sha256=yUcQgX46kb-0VOYwNUuC7ffgNoe7OGREeKf2Xriylkg,1009 +crispy_bootstrap4/templates/bootstrap4/table_inline_formset.html,sha256=ou-Kca77qatLRyT9DnM6JLrivjm5bUQysBOt6pporRc,2081 +crispy_bootstrap4/templates/bootstrap4/uni_form.html,sha256=80stb62gtnRD9JwFH-fh_HJAe4QiMOFv-Li8lWgxZ-U,309 +crispy_bootstrap4/templates/bootstrap4/uni_formset.html,sha256=FrHOTTxoMCWQ_i6cX4lbZ_zI9qGU-56ilL6urDd6mYQ,230 +crispy_bootstrap4/templates/bootstrap4/whole_uni_form.html,sha256=sIDkzp2PRqcP10m7okVnu-IxeYRyoqKhoB5dYTT9P3Y,461 +crispy_bootstrap4/templates/bootstrap4/whole_uni_formset.html,sha256=Yv57RaZFAe_f5mQ7muaXgKDDozWFk5L4jiyEHINqE5U,844 diff --git a/.venv/Lib/site-packages/crispy_bootstrap4-2024.10.dist-info/REQUESTED b/.venv/Lib/site-packages/crispy_bootstrap4-2024.10.dist-info/REQUESTED new file mode 100644 index 00000000..e69de29b diff --git a/.venv/Lib/site-packages/crispy_bootstrap4-2024.10.dist-info/WHEEL b/.venv/Lib/site-packages/crispy_bootstrap4-2024.10.dist-info/WHEEL new file mode 100644 index 00000000..08519a66 --- /dev/null +++ b/.venv/Lib/site-packages/crispy_bootstrap4-2024.10.dist-info/WHEEL @@ -0,0 +1,5 @@ +Wheel-Version: 1.0 +Generator: bdist_wheel (0.44.0) +Root-Is-Purelib: true +Tag: py3-none-any + diff --git a/.venv/Lib/site-packages/crispy_bootstrap4-2024.10.dist-info/top_level.txt b/.venv/Lib/site-packages/crispy_bootstrap4-2024.10.dist-info/top_level.txt new file mode 100644 index 00000000..e5e7aafe --- /dev/null +++ b/.venv/Lib/site-packages/crispy_bootstrap4-2024.10.dist-info/top_level.txt @@ -0,0 +1 @@ +crispy_bootstrap4 diff --git a/.venv/Lib/site-packages/crispy_bootstrap4/__init__.py b/.venv/Lib/site-packages/crispy_bootstrap4/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/accordion-group.html b/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/accordion-group.html new file mode 100644 index 00000000..0537e5a9 --- /dev/null +++ b/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/accordion-group.html @@ -0,0 +1,17 @@ +
+ + +
+
+ {{ fields }} +
+
+
diff --git a/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/accordion.html b/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/accordion.html new file mode 100644 index 00000000..c7fd6ddb --- /dev/null +++ b/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/accordion.html @@ -0,0 +1,3 @@ + + {{ content }} + diff --git a/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/betterform.html b/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/betterform.html new file mode 100644 index 00000000..847520e9 --- /dev/null +++ b/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/betterform.html @@ -0,0 +1,22 @@ +{% for fieldset in form.fieldsets %} +
+ {% if fieldset.legend %} + {{ fieldset.legend }} + {% endif %} + + {% if fieldset.description %} +

{{ fieldset.description }}

+ {% endif %} + + {% for field in fieldset %} + {% if field.is_hidden %} + {{ field }} + {% else %} + {% include "bootstrap4/field.html" %} + {% endif %} + {% endfor %} + {% if not forloop.last or not fieldset_open %} +
+ {% endif %} +{% endfor %} + diff --git a/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/display_form.html b/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/display_form.html new file mode 100644 index 00000000..76556446 --- /dev/null +++ b/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/display_form.html @@ -0,0 +1,9 @@ +{% if form.form_html %} + {% if include_media %}{{ form.media }}{% endif %} + {% if form_show_errors %} + {% include "bootstrap4/errors.html" %} + {% endif %} + {{ form.form_html }} +{% else %} + {% include "bootstrap4/uni_form.html" %} +{% endif %} diff --git a/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/errors.html b/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/errors.html new file mode 100644 index 00000000..3c2934c5 --- /dev/null +++ b/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/errors.html @@ -0,0 +1,8 @@ +{% if form.non_field_errors %} +
+ {% if form_error_title %}

{{ form_error_title }}

{% endif %} +
    + {{ form.non_field_errors|unordered_list }} +
+
+{% endif %} diff --git a/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/errors_formset.html b/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/errors_formset.html new file mode 100644 index 00000000..4b9564df --- /dev/null +++ b/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/errors_formset.html @@ -0,0 +1,9 @@ +{% if formset.non_form_errors %} +
+ {% if formset_error_title %}

{{ formset_error_title }}

{% endif %} +
    + {{ formset.non_form_errors|unordered_list }} +
+
+{% endif %} + diff --git a/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/field.html b/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/field.html new file mode 100644 index 00000000..56fe3263 --- /dev/null +++ b/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/field.html @@ -0,0 +1,92 @@ +{% load crispy_forms_field %} + +{% if field.is_hidden %} + {{ field }} +{% else %} + {% if field|is_checkbox %} +
+ {% if label_class %} +
+ {% endif %} + {% endif %} + <{% if tag %}{{ tag }}{% else %}div{% endif %} id="div_{{ field.auto_id }}" class="{% if not field|is_checkbox %}form-group{% if 'form-horizontal' in form_class %} row{% endif %}{% else %}{%if use_custom_control%}{% if tag != 'td' %}custom-control {%endif%} custom-checkbox{% else %}form-check{% endif %}{% endif %}{% if wrapper_class %} {{ wrapper_class }}{% endif %}{% if field.css_classes %} {{ field.css_classes }}{% endif %}"> + {% if field.label and not field|is_checkbox and form_show_labels %} + {# not field|is_radioselect in row below can be removed once Django 3.2 is no longer supported #} + + {% endif %} + + {% if field|is_checkboxselectmultiple %} + {% include 'bootstrap4/layout/checkboxselectmultiple.html' %} + {% endif %} + + {% if field|is_radioselect %} + {% include 'bootstrap4/layout/radioselect.html' %} + {% endif %} + + {% if not field|is_checkboxselectmultiple and not field|is_radioselect %} + {% if field|is_checkbox %} + {% if use_custom_control %} + {% if tag == 'td' %} +
+ {% endif %} + + {% if field.errors %} + {% crispy_field field 'class' 'custom-control-input is-invalid' %} + {% else %} + {% crispy_field field 'class' 'custom-control-input' %} + {% endif %} + {% else %} + {% if field.errors %} + {% crispy_field field 'class' 'form-check-input is-invalid' %} + {% else %} + {% crispy_field field 'class' 'form-check-input' %} + {% endif %} + {% endif %} + + {% include 'bootstrap4/layout/help_text_and_errors.html' %} + {% if use_custom_control and tag == 'td' %} +
+ {% endif %} + {% elif field|is_file and use_custom_control %} + {% include 'bootstrap4/layout/field_file.html' %} + {% else %} + + {% if field|is_select and use_custom_control %} + {% if field.errors %} + {% crispy_field field 'class' 'custom-select is-invalid' %} + {% else %} + {% crispy_field field 'class' 'custom-select' %} + {% endif %} + {% elif field|is_file %} + {% if field.errors %} + {% crispy_field field 'class' 'form-control-file is-invalid' %} + {% else %} + {% crispy_field field 'class' 'form-control-file' %} + {% endif %} + {% else %} + {% if field.errors %} + {% crispy_field field 'class' 'form-control is-invalid' %} + {% else %} + {% crispy_field field 'class' 'form-control' %} + {% endif %} + {% endif %} + {% include 'bootstrap4/layout/help_text_and_errors.html' %} +
+ {% endif %} + {% endif %} + + {% if field|is_checkbox %} + {% if label_class %} +
+ {% endif %} + + {% endif %} +{% endif %} diff --git a/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/inputs.html b/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/inputs.html new file mode 100644 index 00000000..ac3da3ad --- /dev/null +++ b/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/inputs.html @@ -0,0 +1,13 @@ +{% if inputs %} +
+ {% if label_class %} +
+ {% endif %} + +
+ {% for input in inputs %} + {% include "bootstrap4/layout/baseinput.html" %} + {% endfor %} +
+
+{% endif %} diff --git a/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/layout/alert.html b/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/layout/alert.html new file mode 100644 index 00000000..61307e0e --- /dev/null +++ b/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/layout/alert.html @@ -0,0 +1,4 @@ + + {% if dismiss %}{% endif %} + {{ content }} + \ No newline at end of file diff --git a/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/layout/attrs.html b/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/layout/attrs.html new file mode 100644 index 00000000..c52de9ee --- /dev/null +++ b/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/layout/attrs.html @@ -0,0 +1 @@ +{% for name, value in widget.attrs.items %}{% if value is not False %} {{ name }}{% if value is not True %}="{{ value|stringformat:'s' }}"{% endif %}{% endif %}{% endfor %} diff --git a/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/layout/baseinput.html b/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/layout/baseinput.html new file mode 100644 index 00000000..ffde6445 --- /dev/null +++ b/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/layout/baseinput.html @@ -0,0 +1,9 @@ + diff --git a/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/layout/button.html b/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/layout/button.html new file mode 100644 index 00000000..f41f9cff --- /dev/null +++ b/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/layout/button.html @@ -0,0 +1 @@ + diff --git a/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/layout/buttonholder.html b/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/layout/buttonholder.html new file mode 100644 index 00000000..e97ae46a --- /dev/null +++ b/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/layout/buttonholder.html @@ -0,0 +1,4 @@ +
+ {{ fields_output }} +
diff --git a/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/layout/checkboxselectmultiple.html b/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/layout/checkboxselectmultiple.html new file mode 100644 index 00000000..1bc6c855 --- /dev/null +++ b/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/layout/checkboxselectmultiple.html @@ -0,0 +1,29 @@ +{% load crispy_forms_filters %} +{% load l10n %} + +
+ + {% for group, options, index in field|optgroups %} + {% if group %}{{ group }}{% endif %} + {% for option in options %} +
+ + + {% if field.errors and forloop.last and not inline_class and forloop.parentloop.last %} + {% include 'bootstrap4/layout/field_errors_block.html' %} + {% endif %} +
+ {% endfor %} + {% endfor %} + {% if field.errors and inline_class %} +
+ {# the following input is only meant to allow boostrap to render the error message as it has to be after an invalid input. As the input has no name, no data will be sent. #} + + {% include 'bootstrap4/layout/field_errors_block.html' %} +
+ {% endif %} + + {% include 'bootstrap4/layout/help_text.html' %} +
diff --git a/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/layout/checkboxselectmultiple_inline.html b/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/layout/checkboxselectmultiple_inline.html new file mode 100644 index 00000000..9a282cc7 --- /dev/null +++ b/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/layout/checkboxselectmultiple_inline.html @@ -0,0 +1,14 @@ +{% if field.is_hidden %} + {{ field }} +{% else %} +
+ + {% if field.label %} + + {% endif %} + + {% include 'bootstrap4/layout/checkboxselectmultiple.html' %} +
+{% endif %} diff --git a/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/layout/column.html b/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/layout/column.html new file mode 100644 index 00000000..6b90c6eb --- /dev/null +++ b/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/layout/column.html @@ -0,0 +1,6 @@ +
+ {{ fields }} +
+ + diff --git a/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/layout/div.html b/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/layout/div.html new file mode 100644 index 00000000..c1af140e --- /dev/null +++ b/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/layout/div.html @@ -0,0 +1,4 @@ +
+ {{ fields }} +
diff --git a/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/layout/field_errors.html b/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/layout/field_errors.html new file mode 100644 index 00000000..f649872a --- /dev/null +++ b/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/layout/field_errors.html @@ -0,0 +1,5 @@ +{% if form_show_errors and field.errors %} + {% for error in field.errors %} + {{ error }} + {% endfor %} +{% endif %} diff --git a/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/layout/field_errors_block.html b/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/layout/field_errors_block.html new file mode 100644 index 00000000..e788b797 --- /dev/null +++ b/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/layout/field_errors_block.html @@ -0,0 +1,5 @@ +{% if form_show_errors and field.errors %} + {% for error in field.errors %} +

{{ error }}

+ {% endfor %} +{% endif %} diff --git a/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/layout/field_file.html b/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/layout/field_file.html new file mode 100644 index 00000000..a363f372 --- /dev/null +++ b/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/layout/field_file.html @@ -0,0 +1,52 @@ +{% load crispy_forms_field %} + +
+{% for widget in field.subwidgets %} +{% if widget.data.is_initial %} +
+
+ {{ widget.data.initial_text }} +
+
+ + {{ field.value }} + + {% if not widget.data.required %} + + + + + + + {% endif %} +
+
+
+
+ {{ widget.data.input_text }} +
+{% endif %} +
+ + + +
+ {% if not widget.data.is_initial %} + {% include 'bootstrap4/layout/help_text_and_errors.html' %} + {% endif %} +{% if widget.data.is_initial %} +
+
+{% include 'bootstrap4/layout/help_text_and_errors.html' %} +
+{% endif %} +{% endfor %} +
diff --git a/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/layout/field_with_buttons.html b/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/layout/field_with_buttons.html new file mode 100644 index 00000000..9cb23fb4 --- /dev/null +++ b/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/layout/field_with_buttons.html @@ -0,0 +1,17 @@ +{% load crispy_forms_field %} + + + {% if field.label and form_show_labels %} + + {% endif %} + +
+
+ {% crispy_field field 'class' 'form-control' %} + {{ buttons }} +
+ {% include 'bootstrap4/layout/help_text_and_errors.html' %} +
+ diff --git a/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/layout/fieldset.html b/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/layout/fieldset.html new file mode 100644 index 00000000..113887bd --- /dev/null +++ b/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/layout/fieldset.html @@ -0,0 +1,6 @@ +
+ {% if legend %}{{ legend }}{% endif %} + {{ fields }} +
diff --git a/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/layout/formactions.html b/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/layout/formactions.html new file mode 100644 index 00000000..04fed0b3 --- /dev/null +++ b/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/layout/formactions.html @@ -0,0 +1,9 @@ + + {% if label_class %} +
+ {% endif %} + +
+ {{ fields_output }} +
+ diff --git a/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/layout/help_text.html b/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/layout/help_text.html new file mode 100644 index 00000000..3b5695c9 --- /dev/null +++ b/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/layout/help_text.html @@ -0,0 +1,7 @@ +{% if field.help_text %} + {% if help_text_inline %} + {{ field.help_text|safe }} + {% else %} + {{ field.help_text|safe }} + {% endif %} +{% endif %} diff --git a/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/layout/help_text_and_errors.html b/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/layout/help_text_and_errors.html new file mode 100644 index 00000000..d21cd441 --- /dev/null +++ b/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/layout/help_text_and_errors.html @@ -0,0 +1,13 @@ +{% if help_text_inline and not error_text_inline %} + {% include 'bootstrap4/layout/help_text.html' %} +{% endif %} + +{% if error_text_inline %} + {% include 'bootstrap4/layout/field_errors.html' %} +{% else %} + {% include 'bootstrap4/layout/field_errors_block.html' %} +{% endif %} + +{% if not help_text_inline %} + {% include 'bootstrap4/layout/help_text.html' %} +{% endif %} diff --git a/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/layout/inline_field.html b/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/layout/inline_field.html new file mode 100644 index 00000000..aff23bbf --- /dev/null +++ b/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/layout/inline_field.html @@ -0,0 +1,29 @@ +{% load crispy_forms_field %} + +{% if field.is_hidden %} + {{ field }} +{% else %} + {% if field|is_checkbox %} +
+ +
+ {% else %} +
+ + {% if field.errors %} + {% crispy_field field 'placeholder' field.label 'class' 'form-control is-invalid' %} + {% else %} + {% crispy_field field 'placeholder' field.label 'class' 'form-control' %} + {% endif %} +
+ {% endif %} +{% endif %} diff --git a/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/layout/modal.html b/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/layout/modal.html new file mode 100644 index 00000000..ab181989 --- /dev/null +++ b/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/layout/modal.html @@ -0,0 +1,15 @@ + diff --git a/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/layout/multifield.html b/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/layout/multifield.html new file mode 100644 index 00000000..0a2c050a --- /dev/null +++ b/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/layout/multifield.html @@ -0,0 +1,27 @@ +{% load crispy_forms_field %} + +{% if field.is_hidden %} + {{ field }} +{% else %} + + {% if field.label %} + + {% endif %} + +{% endif %} diff --git a/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/layout/prepended_appended_text.html b/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/layout/prepended_appended_text.html new file mode 100644 index 00000000..879abf02 --- /dev/null +++ b/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/layout/prepended_appended_text.html @@ -0,0 +1,51 @@ +{% load crispy_forms_field %} + +{% if field.is_hidden %} + {{ field }} +{% else %} +
+ + {% if field.label and form_show_labels %} + + {% endif %} + +
+
+ {% if crispy_prepended_text %} +
+ {{ crispy_prepended_text }} +
+ {% endif %} + {% if field|is_select and use_custom_control %} + {% if field.errors %} + {% crispy_field field 'class' 'custom-select is-invalid' %} + {% else %} + {% crispy_field field 'class' 'custom-select' %} + {% endif %} + {% else %} + {% if field.errors %} + {% crispy_field field 'class' 'form-control is-invalid' %} + {% else %} + {% crispy_field field 'class' 'form-control' %} + {% endif %} + {% endif %} + {% if crispy_appended_text %} +
+ {{ crispy_appended_text }} +
+ {% endif %} + {% if error_text_inline %} + {% include 'bootstrap4/layout/field_errors.html' %} + {% else %} + {% include 'bootstrap4/layout/field_errors_block.html' %} + {% endif %} +
+ {% if not help_text_inline %} + {% include 'bootstrap4/layout/help_text.html' %} + {% endif %} +
+ +
+{% endif %} diff --git a/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/layout/radioselect.html b/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/layout/radioselect.html new file mode 100644 index 00000000..44bd0c2c --- /dev/null +++ b/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/layout/radioselect.html @@ -0,0 +1,29 @@ +{% load crispy_forms_filters %} +{% load l10n %} + +
+ + {% for group, options, index in field|optgroups %} + {% if group %}{{ group }}{% endif %} + {% for option in options %} +
+ + + {% if field.errors and forloop.last and not inline_class and forloop.parentloop.last %} + {% include 'bootstrap4/layout/field_errors_block.html' %} + {% endif %} +
+ {% endfor %} + {% endfor %} + {% if field.errors and inline_class %} +
+ {# the following input is only meant to allow boostrap to render the error message as it has to be after an invalid input. As the input has no name, no data will be sent. #} + + {% include 'bootstrap4/layout/field_errors_block.html' %} +
+ {% endif %} + + {% include 'bootstrap4/layout/help_text.html' %} +
diff --git a/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/layout/radioselect_inline.html b/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/layout/radioselect_inline.html new file mode 100644 index 00000000..112fc11f --- /dev/null +++ b/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/layout/radioselect_inline.html @@ -0,0 +1,14 @@ +{% if field.is_hidden %} + {{ field }} +{% else %} +
+ + {% if field.label %} + + {% endif %} + + {% include 'bootstrap4/layout/radioselect.html' %} +
+{% endif %} diff --git a/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/layout/row.html b/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/layout/row.html new file mode 100644 index 00000000..69226057 --- /dev/null +++ b/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/layout/row.html @@ -0,0 +1,3 @@ +
+ {{ fields }} +
diff --git a/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/layout/tab-link.html b/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/layout/tab-link.html new file mode 100644 index 00000000..8f68f7c2 --- /dev/null +++ b/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/layout/tab-link.html @@ -0,0 +1 @@ + diff --git a/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/layout/tab.html b/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/layout/tab.html new file mode 100644 index 00000000..38f31939 --- /dev/null +++ b/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/layout/tab.html @@ -0,0 +1,6 @@ + + {{ links }} + +
+ {{ content }} +
diff --git a/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/layout/uneditable_input.html b/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/layout/uneditable_input.html new file mode 100644 index 00000000..dfc80ad5 --- /dev/null +++ b/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/layout/uneditable_input.html @@ -0,0 +1,14 @@ +{% load crispy_forms_field %} +
+ +
+ {% if field|is_select and use_custom_control %} + {% crispy_field field 'class' 'custom-select' 'disabled' 'disabled' %} + {% elif field|is_file %} + {% crispy_field field 'class' 'form-control-file' 'disabled' 'disabled' %} + {% else %} + {% crispy_field field 'class' 'form-control' 'disabled' 'disabled' %} + {% endif %} + {% include 'bootstrap4/layout/help_text.html' %} +
+
diff --git a/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/table_inline_formset.html b/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/table_inline_formset.html new file mode 100644 index 00000000..752706ec --- /dev/null +++ b/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/table_inline_formset.html @@ -0,0 +1,57 @@ +{% load crispy_forms_tags %} +{% load crispy_forms_utils %} +{% load crispy_forms_field %} + +{% specialspaceless %} +{% if formset_tag %} +
+{% endif %} + {% if formset_method|lower == 'post' and not disable_csrf %} + {% csrf_token %} + {% endif %} + +
+ {{ formset.management_form|crispy }} +
+ + + + {% if formset.readonly and not formset.queryset.exists %} + {% else %} + + {% for field in formset.forms.0 %} + {% if field.label and not field.is_hidden %} + + {{ field.label }}{% if field.field.required and not field|is_checkbox %}*{% endif %} + + {% endif %} + {% endfor %} + + {% endif %} + + + + + {% for field in formset.empty_form %} + {% include 'bootstrap4/field.html' with tag="td" form_show_labels=False %} + {% endfor %} + + + {% for form in formset %} + {% if form_show_errors and not form.is_extra %} + {% include "bootstrap4/errors.html" %} + {% endif %} + + + {% for field in form %} + {% include 'bootstrap4/field.html' with tag="td" form_show_labels=False %} + {% endfor %} + + {% endfor %} + + + + {% include "bootstrap4/inputs.html" %} + +{% if formset_tag %}{% endif %} +{% endspecialspaceless %} diff --git a/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/uni_form.html b/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/uni_form.html new file mode 100644 index 00000000..e91d0af3 --- /dev/null +++ b/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/uni_form.html @@ -0,0 +1,11 @@ +{% load crispy_forms_utils %} + +{% specialspaceless %} + {% if include_media %}{{ form.media }}{% endif %} + {% if form_show_errors %} + {% include "bootstrap4/errors.html" %} + {% endif %} + {% for field in form %} + {% include field_template %} + {% endfor %} +{% endspecialspaceless %} diff --git a/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/uni_formset.html b/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/uni_formset.html new file mode 100644 index 00000000..a2a3c945 --- /dev/null +++ b/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/uni_formset.html @@ -0,0 +1,8 @@ +{% with formset.management_form as form %} + {% include 'bootstrap4/uni_form.html' %} +{% endwith %} +{% for form in formset %} +
+ {% include 'bootstrap4/uni_form.html' %} +
+{% endfor %} diff --git a/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/whole_uni_form.html b/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/whole_uni_form.html new file mode 100644 index 00000000..3f4f6bae --- /dev/null +++ b/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/whole_uni_form.html @@ -0,0 +1,14 @@ +{% load crispy_forms_utils %} + +{% specialspaceless %} +{% if form_tag %}
{% endif %} + {% if form_method|lower == 'post' and not disable_csrf %} + {% csrf_token %} + {% endif %} + + {% include "bootstrap4/display_form.html" %} + + {% include "bootstrap4/inputs.html" %} + +{% if form_tag %}
{% endif %} +{% endspecialspaceless %} diff --git a/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/whole_uni_formset.html b/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/whole_uni_formset.html new file mode 100644 index 00000000..86aad083 --- /dev/null +++ b/.venv/Lib/site-packages/crispy_bootstrap4/templates/bootstrap4/whole_uni_formset.html @@ -0,0 +1,30 @@ +{% load crispy_forms_tags %} +{% load crispy_forms_utils %} + +{% specialspaceless %} +{% if formset_tag %} +
+{% endif %} + {% if formset_method|lower == 'post' and not disable_csrf %} + {% csrf_token %} + {% endif %} + +
+ {{ formset.management_form|crispy }} +
+ + {% include "bootstrap4/errors_formset.html" %} + + {% for form in formset %} + {% include "bootstrap4/display_form.html" %} + {% endfor %} + + {% if inputs %} +
+ {% for input in inputs %} + {% include "bootstrap4/layout/baseinput.html" %} + {% endfor %} +
+ {% endif %} +{% if formset_tag %}
{% endif %} +{% endspecialspaceless %} diff --git a/.venv/Lib/site-packages/crispy_forms/LICENSE b/.venv/Lib/site-packages/crispy_forms/LICENSE new file mode 100644 index 00000000..c3b9ee50 --- /dev/null +++ b/.venv/Lib/site-packages/crispy_forms/LICENSE @@ -0,0 +1,22 @@ +Copyright (c) 2009 Daniel Greenfeld and contributors. + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/.venv/Lib/site-packages/crispy_forms/__init__.py b/.venv/Lib/site-packages/crispy_forms/__init__.py new file mode 100644 index 00000000..202075fc --- /dev/null +++ b/.venv/Lib/site-packages/crispy_forms/__init__.py @@ -0,0 +1 @@ +__version__ = "2.3" diff --git a/.venv/Lib/site-packages/crispy_forms/base.py b/.venv/Lib/site-packages/crispy_forms/base.py new file mode 100644 index 00000000..87c479ae --- /dev/null +++ b/.venv/Lib/site-packages/crispy_forms/base.py @@ -0,0 +1,22 @@ +class KeepContext: + """ + Context manager that receives a `django.template.Context` instance and a list of keys + + Once the context manager is exited, it removes `keys` from the context, to avoid + side effects in later layout objects that may use the same context variables. + + Layout objects should use `extra_context` to introduce context variables, never + touch context object themselves, that could introduce side effects. + """ + + def __init__(self, context, keys): + self.context = context + self.keys = keys + + def __enter__(self): + pass + + def __exit__(self, type, value, traceback): + for key in list(self.keys): + if key in self.context: + del self.context[key] diff --git a/.venv/Lib/site-packages/crispy_forms/bootstrap.py b/.venv/Lib/site-packages/crispy_forms/bootstrap.py new file mode 100644 index 00000000..0e5ebc4e --- /dev/null +++ b/.venv/Lib/site-packages/crispy_forms/bootstrap.py @@ -0,0 +1,1131 @@ +from random import randint + +from django.template import Template +from django.template.loader import render_to_string +from django.utils.safestring import SafeString +from django.utils.text import slugify + +from .layout import Div, Field, LayoutObject, TemplateNameMixin +from .utils import TEMPLATE_PACK, flatatt, render_field + + +class PrependedAppendedText(Field): + """ + Layout object for rendering a field with prepended and appended text. + + Attributes + ---------- + template : str + The default template which this Layout Object will be rendered + with. + attrs : dict + Attributes to be applied to the field. These are converted into html + attributes. e.g. ``data_id: 'test'`` in the attrs dict will become + ``data-id='test'`` on the field's ````. + + Parameters + ---------- + field : str + The name of the field to be rendered. + prepended_text : str, optional + The prepended text, can be HTML like, by default None + appended_text : str, optional + The appended text, can be HTML like, by default None + input_size : str, optional + For Bootstrap4+ additional classes to customise the input-group size + e.g. ``input-group-sm``. By default None + active : bool + For Bootstrap3, a boolean to render the text active. By default + ``False``. + css_class : str, optional + CSS classes to be applied to the field. These are added to any classes + included in the ``attrs`` dict. By default ``None``. + wrapper_class: str, optional + CSS classes to be used when rendering the Field. This class is usually + applied to the ``
`` which wraps the Field's ``