<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <b id="internal-source-marker_0.7365174000151455" style="color:
      rgb(0, 0, 0); font-family: 'Times New Roman'; font-style: normal;
      font-variant: normal; letter-spacing: normal; line-height: normal;
      orphans: 2; text-align: -webkit-auto; text-indent: 0px;
      text-transform: none; white-space: normal; widows: 2;
      word-spacing: 0px; -webkit-text-size-adjust: auto;
      -webkit-text-stroke-width: 0px; font-size: medium; font-weight:
      normal; ">
      <p dir="ltr" style="text-align: justify; margin-top: 0pt;
        margin-bottom: 0pt; "><span style="font-size: 15px; font-family:
          Arial; color: rgb(0, 0, 0); background-color: transparent;
          font-weight: normal; font-style: normal; font-variant: normal;
          text-decoration: none; vertical-align: baseline; white-space:
          pre-wrap; ">Hello,</span></p>
      <span style="font-size: 15px; font-family: Arial; color: rgb(0, 0,
        0); background-color: transparent; font-weight: normal;
        font-style: normal; font-variant: normal; text-decoration: none;
        vertical-align: baseline; white-space: pre-wrap; "></span><br>
      <p dir="ltr" style="text-align: justify; margin-top: 0pt;
        margin-bottom: 0pt; "><span style="font-size: 15px; font-family:
          Arial; color: rgb(0, 0, 0); background-color: transparent;
          font-weight: normal; font-style: normal; font-variant: normal;
          text-decoration: none; vertical-align: baseline; white-space:
          pre-wrap; ">This is my first report on the work progress on a
          project PyPI to Debian Repository Converter[0] mentored by
          Piotr Ożarowski.</span></p>
      <p dir="ltr" style="text-align: justify; margin-top: 0pt;
        margin-bottom: 0pt; "><span style="font-size: 15px; font-family:
          Arial; color: rgb(0, 0, 0); background-color: transparent;
          font-weight: normal; font-style: normal; font-variant: normal;
          text-decoration: none; vertical-align: baseline; white-space:
          pre-wrap; "><br class="kix-line-break">
          ----------------<br class="kix-line-break">
          Work: I’ve worked mainly over issues related to the PyPI
          repository[1] and its XML-RPC interface[2]. My goal was to
          download sources of available Python 3 packages.<br
            class="kix-line-break">
          <br class="kix-line-break">
          In the course of work I’ve dealt with  the following tasks:</span></p>
      <p dir="ltr" style="text-align: justify; margin-top: 0pt;
        margin-bottom: 0pt; "><span style="font-size: 15px; font-family:
          Arial; color: rgb(0, 0, 0); background-color: transparent;
          font-weight: normal; font-style: normal; font-variant: normal;
          text-decoration: none; vertical-align: baseline; white-space:
          pre-wrap; ">----------------<br class="kix-line-break">
          1) Selection of packages intended for Python 3 (as agreed with
          my mentor, I will work on packages for Python 3 first - once
          ready, I’ll try to add support for Python 2 packages as well.)<br
            class="kix-line-break">
          <br class="kix-line-break">
          After reading Python Packaging chapter from “The Architecture
          of Open Source Applications” book[3], I’ve used browse method
          from PyPI's XML-RPC interface, which makes  it possible to
          search for packages matching classifiers[4]. Unfortunately, it
          is not possible to determine the minimum and/or maximum
          required version of Python. You can list specific versions or
          use "Programming Language :: Python :: 3" classifier,
          unfortunately “Python :: 3.2” does not imply “Python :: 3”.
          For this reason I have to call this method for each specific
          version, but finally I’m able to get a list of unique
          packages, with a list of their releases available for Python
          3.<br class="kix-line-break">
        </span></p>
      <p dir="ltr" style="text-align: justify; margin-top: 0pt;
        margin-bottom: 0pt; "><span style="font-size: 15px; font-family:
          Arial; color: rgb(0, 0, 0); background-color: transparent;
          font-weight: normal; font-style: normal; font-variant: normal;
          text-decoration: none; vertical-align: baseline; white-space:
          pre-wrap; ">From my point of view it would be helpful if the
          browse function has provided the ability to select packages
          using wildcard in these criteria or looking for packages not
          meeting given conditions. I have added this to my TODO and if
          time permits, I will prepare patches for PyPI’s rpc.py.</span></p>
      <p dir="ltr" style="text-align: justify; margin-top: 0pt;
        margin-bottom: 0pt; "><span style="font-size: 15px; font-family:
          Arial; color: rgb(0, 0, 0); background-color: transparent;
          font-weight: normal; font-style: normal; font-variant: normal;
          text-decoration: none; vertical-align: baseline; white-space:
          pre-wrap; "><br class="kix-line-break">
          I’ve decided to reject packages described in their classifiers
          as 'Development Status :: 1 - Planning', simply because they
          usually don’t have source files yet. Debian package for
          project in the planning phase is also not the best idea.<br
            class="kix-line-break">
          <br class="kix-line-break">
          I’ve acquainted with the standard pep-0386[5], but while
          sorting list of versions (harvested from real releases) using
          distutils library[6]  (in order to select the latest available
          version), I came across a problem which, by suggestion from my
          mentor, I reported to Python’s bug tracker[7]. The first time
          I’ve reported a bug there and I had enjoyed an immediate
          response. Moreover, my mentor suggested me to look in the
          library sources and propose appropriate patch, which I did:-)<br
            class="kix-line-break">
          <br class="kix-line-break">
          2) Download the relevant source files. In order to obtain
          links to sources I’ve decided to use release_urls method which
          returns a list of download urls for the given package release.
          Unfortunately, this method doesn't accept a list on the entry,
          so calling it successively for each package is relatively
          slow. While maintaining this shape the further optimization is
          difficult, so I consider an attempt to modify this method and
          send patches as well.</span></p>
      <p dir="ltr" style="text-align: justify; margin-top: 0pt;
        margin-bottom: 0pt; "><span style="font-size: 15px; font-family:
          Arial; color: rgb(0, 0, 0); background-color: transparent;
          font-weight: normal; font-style: normal; font-variant: normal;
          text-decoration: none; vertical-align: baseline; white-space:
          pre-wrap; "><br class="kix-line-break">
          From the list of files returned by relase_urls I’ve chosen
          those which have python_version set to source. In Python 3 it
          is possible to put archives in different formats so I set the
          download priority to tar.xz, then tar.bz2, tar.gz and zip.
          Python programmers have many unusual ideas to name their
          files, so it took me some time to make sure I'm downloading
          appropriate files. Eventually I've (hopefully) reached the
          state where only the right archive is dowloaded. My algorithm
          doesn’t  skip other sources (f.e. additional plugins like the
          ones in Pythomnic3k[a]) included in releases, but I had to add
          special cases for packages such as waferslim[b] or
          tuxmodule[c] (i.e. check comment_text field).</span></p>
      <span style="font-size: 15px; font-family: Arial; color: rgb(0, 0,
        0); background-color: transparent; font-weight: normal;
        font-style: normal; font-variant: normal; text-decoration: none;
        vertical-align: baseline; white-space: pre-wrap; "></span><br>
      <p dir="ltr" style="text-align: justify; margin-top: 0pt;
        margin-bottom: 0pt; "><span style="font-size: 15px; font-family:
          Arial; color: rgb(0, 0, 0); background-color: transparent;
          font-weight: normal; font-style: normal; font-variant: normal;
          text-decoration: none; vertical-align: baseline; white-space:
          pre-wrap; ">Statistics for downloaded packages at this moment
          are as follows:<br class="kix-line-break">
          <br class="kix-line-break">
          packages for Python 3:</span></p>
      <p dir="ltr" style="text-align: justify; margin-top: 0pt;
        margin-bottom: 0pt; "><span style="font-size: 15px; font-family:
          Arial; color: rgb(0, 0, 0); background-color: transparent;
          font-weight: normal; font-style: normal; font-variant: normal;
          text-decoration: none; vertical-align: baseline; white-space:
          pre-wrap; ">~~~~~~~~~~~~~~~~~</span></p>
      <p dir="ltr" style="text-align: justify; margin-top: 0pt;
        margin-bottom: 0pt; "><span style="font-size: 15px; font-family:
          Arial; color: rgb(0, 0, 0); background-color: transparent;
          font-weight: normal; font-style: normal; font-variant: normal;
          text-decoration: none; vertical-align: baseline; white-space:
          pre-wrap; ">unique packages: 1016<br class="kix-line-break">
          packages without source: 138</span></p>
      <p dir="ltr" style="text-align: justify; margin-top: 0pt;
        margin-bottom: 0pt; "><span style="font-size: 15px; font-family:
          Arial; color: rgb(0, 0, 0); background-color: transparent;
          font-weight: normal; font-style: normal; font-variant: normal;
          text-decoration: none; vertical-align: baseline; white-space:
          pre-wrap; "><br class="kix-line-break">
          packages for Python 2:</span></p>
      <p dir="ltr" style="text-align: justify; margin-top: 0pt;
        margin-bottom: 0pt; "><span style="font-size: 15px; font-family:
          Arial; color: rgb(0, 0, 0); background-color: transparent;
          font-weight: normal; font-style: normal; font-variant: normal;
          text-decoration: none; vertical-align: baseline; white-space:
          pre-wrap; ">~~~~~~~~~~~~~~~~~<br class="kix-line-break">
          unique packages: 2930<br class="kix-line-break">
          packages without source: 457<br class="kix-line-break">
          <br class="kix-line-break">
          NOTE: I’m aware that there are about 15k packages that match
          "Programming Language :: Python", but most of them don’t have
          any further version classifiers, so I’ll assume that they
          support Python 2 only.</span></p>
      <span style="font-size: 15px; font-family: Arial; color: rgb(0, 0,
        0); background-color: transparent; font-weight: normal;
        font-style: normal; font-variant: normal; text-decoration: none;
        vertical-align: baseline; white-space: pre-wrap; "></span><br>
      <p dir="ltr" style="text-align: justify; margin-top: 0pt;
        margin-bottom: 0pt; "><span style="font-size: 15px; font-family:
          Arial; color: rgb(0, 0, 0); background-color: transparent;
          font-weight: normal; font-style: normal; font-variant: normal;
          text-decoration: none; vertical-align: baseline; white-space:
          pre-wrap; ">NOTE: The packages described as “packages without
          source” are those for which the release_urls method doesn’t
          return links to the source. In the classifiers dictionary
          (obtained by the release_data method) there’s a download_url
          field available, but this link often redirects to 3rd party
          websites like sourceforge.net[8] which do not point to the
          archive directly.<br class="kix-line-break">
          <br class="kix-line-break">
          3) Update to the newest version of packages. To check if
           there are new versions of packages in PyPI or new packages
          were added, list of unique packages which meet my criteria is
          generated again and the list is checked against already
          downloaded files. It seemed unnecessary to use client_urls to
          check the exact file name again at this point - as I wrote
          earlier, calling it takes a lot of time. I realize that this
          is not optimal and will try to change it a bit soon.
          Developers usually stick to the package_name-version
          convention, but there are also situations such as e.g. Python
          Bytecode Verifier[d] or tmdb[e]. </span></p>
      <span style="font-size: 15px; font-family: Arial; color: rgb(0, 0,
        0); background-color: transparent; font-weight: normal;
        font-style: normal; font-variant: normal; text-decoration: none;
        vertical-align: baseline; white-space: pre-wrap; "></span><br>
      <p dir="ltr" style="text-align: justify; margin-top: 0pt;
        margin-bottom: 0pt; "><span style="font-size: 15px; font-family:
          Arial; color: rgb(0, 0, 0); background-color: transparent;
          font-weight: normal; font-style: normal; font-variant: normal;
          text-decoration: none; vertical-align: baseline; white-space:
          pre-wrap; ">With a help of my mentor, I located PyPI
          sources[9].  I’ve found over there updated_releases method
          which is not mentioned in the documentation, but seems to be
          useful - I compare my results with it.</span></p>
      <p dir="ltr" style="text-align: justify; margin-top: 0pt;
        margin-bottom: 0pt; "><span style="font-size: 15px; font-family:
          Arial; color: rgb(0, 0, 0); background-color: transparent;
          font-weight: normal; font-style: normal; font-variant: normal;
          text-decoration: none; vertical-align: baseline; white-space:
          pre-wrap; "><br class="kix-line-break">
          -----------------<br class="kix-line-break">
          Summary: My tool is able to find and download newest versions
          of Python 3 packages available in the PyPI. It was a fairly
          tedious part of the job and I’m glad that I have it behind me.
          Right now my code works as expected, I'll check how it behaves
          after another round of PyPI updates and make the necessary
          modifications if needed.</span></p>
      <p dir="ltr" style="text-align: justify; margin-top: 0pt;
        margin-bottom: 0pt; "><span style="font-size: 15px; font-family:
          Arial; color: rgb(0, 0, 0); background-color: transparent;
          font-weight: normal; font-style: normal; font-variant: normal;
          text-decoration: none; vertical-align: baseline; white-space:
          pre-wrap; "><br class="kix-line-break">
          -----------------</span></p>
      <p dir="ltr" style="text-align: justify; margin-top: 0pt;
        margin-bottom: 0pt; "><span style="font-size: 15px; font-family:
          Arial; color: rgb(0, 0, 0); background-color: transparent;
          font-weight: normal; font-style: normal; font-variant: normal;
          text-decoration: none; vertical-align: baseline; white-space:
          pre-wrap; ">Plans: In the next few days the most important
          task is to design detailed  API for plugins system, which will
          convert the packages to the repository for Debian. I have to
          think about how to integrate stdeb[10] and pkgme[11] (first
          two plugins) and to add Python 3 support to both of them. One
          of the biggest challenges will be to determine the build
          dependencies.</span></p>
      <p dir="ltr" style="text-align: justify; margin-top: 0pt;
        margin-bottom: 0pt; "><span style="font-size: 15px; font-family:
          Arial; color: rgb(0, 0, 0); background-color: transparent;
          font-weight: normal; font-style: normal; font-variant: normal;
          text-decoration: none; vertical-align: baseline; white-space:
          pre-wrap; "><br class="kix-line-break">
          I think that during last 2 weeks my knowledge about PyPI has
          increased dramatically and I can't wait until my knowledge
          about Debian packages also become a bit fuller:-)</span></p>
      <p dir="ltr" style="text-align: justify; margin-top: 0pt;
        margin-bottom: 0pt; "><span style="font-size: 15px; font-family:
          Arial; color: rgb(0, 0, 0); background-color: transparent;
          font-weight: normal; font-style: normal; font-variant: normal;
          text-decoration: none; vertical-align: baseline; white-space:
          pre-wrap;"><br class="kix-line-break">
          My repository can be followed at:
          <a class="moz-txt-link-freetext" href="https://gitorious.org/pypi2deb">https://gitorious.org/pypi2deb</a><br>
        </span><b id="internal-source-marker_0.7365174000151455"
          style="color: rgb(0, 0, 0); font-family: 'Times New Roman';
          font-style: normal; font-variant: normal; letter-spacing:
          normal; line-height: normal; orphans: 2; text-align:
          -webkit-auto; text-indent: 0px; text-transform: none;
          white-space: normal; widows: 2; word-spacing: 0px;
          -webkit-text-size-adjust: auto; -webkit-text-stroke-width:
          0px; font-size: medium; font-weight: normal; "><span
            style="font-size: 15px; font-family: Arial; color: rgb(0, 0,
            0); background-color: transparent; font-weight: normal;
            font-style: normal; font-variant: normal; text-decoration:
            none; vertical-align: baseline; white-space: pre-wrap; ">----<br>
            Natalia Frydrych<br>
          </span></b></p>
      <p dir="ltr" style="text-align: justify; margin-top: 0pt;
        margin-bottom: 0pt; "><span style="font-size: 15px; font-family:
          Arial; color: rgb(0, 0, 0); background-color: transparent;
          font-weight: normal; font-style: normal; font-variant: normal;
          text-decoration: none; vertical-align: baseline; white-space:
          pre-wrap; "><br class="kix-line-break">
          ----------------<br class="kix-line-break">
          [0]
<a class="moz-txt-link-freetext" href="http://wiki.debian.org/SummerOfCode2012/StudentApplications/NataliaFrydrych">http://wiki.debian.org/SummerOfCode2012/StudentApplications/NataliaFrydrych</a><br
            class="kix-line-break">
          [1] <a class="moz-txt-link-freetext" href="http://pypi.python.org/">http://pypi.python.org/</a><br class="kix-line-break">
          [2] <a class="moz-txt-link-freetext" href="http://wiki.python.org/moin/PyPiXmlRpc">http://wiki.python.org/moin/PyPiXmlRpc</a><br
            class="kix-line-break">
          [3] <a class="moz-txt-link-freetext" href="http://www.aosabook.org/en/packaging.html">http://www.aosabook.org/en/packaging.html</a><br
            class="kix-line-break">
          [4] <a class="moz-txt-link-freetext" href="http://pypi.python.org/pypi?%3Aaction=list_classifiers">http://pypi.python.org/pypi?%3Aaction=list_classifiers</a><br
            class="kix-line-break">
          [5] <a class="moz-txt-link-freetext" href="http://www.python.org/dev/peps/pep-0386/">http://www.python.org/dev/peps/pep-0386/</a><br
            class="kix-line-break">
          [6] <a class="moz-txt-link-freetext" href="http://docs.python.org/dev/distutils/introduction">http://docs.python.org/dev/distutils/introduction</a><br
            class="kix-line-break">
          [7] <a class="moz-txt-link-freetext" href="http://bugs.python.org/issue14894">http://bugs.python.org/issue14894</a><br
            class="kix-line-break">
          [8] <a class="moz-txt-link-freetext" href="http://sourceforge.net">http://sourceforge.net</a><br class="kix-line-break">
          [9] <a class="moz-txt-link-freetext" href="https://bitbucket.org/loewis/pypi/src/3d39a7bcfc26/rpc.py">https://bitbucket.org/loewis/pypi/src/3d39a7bcfc26/rpc.py</a><br
            class="kix-line-break">
          [10] <a class="moz-txt-link-freetext" href="https://github.com/astraw/stdeb">https://github.com/astraw/stdeb</a><br class="kix-line-break">
          [11] </span><a href="https://launchpad.net/pkgme"><span
            style="font-size: 15px; font-family: Arial; color: rgb(17,
            85, 204); background-color: transparent; font-weight:
            normal; font-style: normal; font-variant: normal;
            text-decoration: underline; vertical-align: baseline;
            white-space: pre-wrap; ">https://launchpad.net/pkgme</span></a><span
          style="font-size: 15px; font-family: Arial; color: rgb(0, 0,
          0); background-color: transparent; font-weight: normal;
          font-style: normal; font-variant: normal; text-decoration:
          none; vertical-align: baseline; white-space: pre-wrap; "></span></p>
      <span style="font-size: 15px; font-family: Arial; color: rgb(0, 0,
        0); background-color: transparent; font-weight: normal;
        font-style: normal; font-variant: normal; text-decoration: none;
        vertical-align: baseline; white-space: pre-wrap; "></span><br>
      <p dir="ltr" style="text-align: justify; margin-top: 0pt;
        margin-bottom: 0pt; "><span style="font-size: 15px; font-family:
          Arial; color: rgb(0, 0, 0); background-color: transparent;
          font-weight: normal; font-style: normal; font-variant: normal;
          text-decoration: none; vertical-align: baseline; white-space:
          pre-wrap; ">----------------</span></p>
      <p dir="ltr" style="text-align: justify; margin-top: 0pt;
        margin-bottom: 0pt; "><span style="font-size: 15px; font-family:
          Arial; color: rgb(0, 0, 0); background-color: transparent;
          font-weight: normal; font-style: normal; font-variant: normal;
          text-decoration: none; vertical-align: baseline; white-space:
          pre-wrap; ">[a] </span><a
          href="http://pypi.python.org/pypi/Pythomnic3k/1.2"><span
            style="font-size: 15px; font-family: Arial; color: rgb(17,
            85, 204); background-color: transparent; font-weight:
            normal; font-style: normal; font-variant: normal;
            text-decoration: underline; vertical-align: baseline;
            white-space: pre-wrap; ">http://pypi.python.org/pypi/Pythomnic3k/1.2</span></a><span
          style="font-size: 15px; font-family: Arial; color: rgb(0, 0,
          0); background-color: transparent; font-weight: normal;
          font-style: normal; font-variant: normal; text-decoration:
          none; vertical-align: baseline; white-space: pre-wrap; "></span></p>
      <p dir="ltr" style="text-align: justify; margin-top: 0pt;
        margin-bottom: 0pt; "><span style="font-size: 15px; font-family:
          Arial; color: rgb(0, 0, 0); background-color: transparent;
          font-weight: normal; font-style: normal; font-variant: normal;
          text-decoration: none; vertical-align: baseline; white-space:
          pre-wrap; ">[b] </span><a
          href="http://pypi.python.org/pypi/waferslim/1.0.2"><span
            style="font-size: 15px; font-family: Arial; color: rgb(17,
            85, 204); background-color: transparent; font-weight:
            normal; font-style: normal; font-variant: normal;
            text-decoration: underline; vertical-align: baseline;
            white-space: pre-wrap; ">http://pypi.python.org/pypi/waferslim/1.0.2</span></a><span
          style="font-size: 15px; font-family: Arial; color: rgb(0, 0,
          0); background-color: transparent; font-weight: normal;
          font-style: normal; font-variant: normal; text-decoration:
          none; vertical-align: baseline; white-space: pre-wrap; "></span></p>
      <p dir="ltr" style="text-align: justify; margin-top: 0pt;
        margin-bottom: 0pt; "><span style="font-size: 15px; font-family:
          Arial; color: rgb(0, 0, 0); background-color: transparent;
          font-weight: normal; font-style: normal; font-variant: normal;
          text-decoration: none; vertical-align: baseline; white-space:
          pre-wrap; ">[c] </span><a
          href="http://pypi.python.org/pypi/tuxmodule/1.0"><span
            style="font-size: 15px; font-family: Arial; color: rgb(17,
            85, 204); background-color: transparent; font-weight:
            normal; font-style: normal; font-variant: normal;
            text-decoration: underline; vertical-align: baseline;
            white-space: pre-wrap; ">http://pypi.python.org/pypi/tuxmodule/1.0</span></a><span
          style="font-size: 15px; font-family: Arial; color: rgb(0, 0,
          0); background-color: transparent; font-weight: normal;
          font-style: normal; font-variant: normal; text-decoration:
          none; vertical-align: baseline; white-space: pre-wrap; "> - </span><a
          href="http://paste.debian.net/172552/"><span style="font-size:
            15px; font-family: Arial; color: rgb(17, 85, 204);
            background-color: transparent; font-weight: normal;
            font-style: normal; font-variant: normal; text-decoration:
            underline; vertical-align: baseline; white-space: pre-wrap;
            ">http://paste.debian.net/172552/</span></a><span
          style="font-size: 15px; font-family: Arial; color: rgb(0, 0,
          0); background-color: transparent; font-weight: normal;
          font-style: normal; font-variant: normal; text-decoration:
          none; vertical-align: baseline; white-space: pre-wrap; "></span></p>
      <p dir="ltr" style="text-align: justify; margin-top: 0pt;
        margin-bottom: 0pt; "><span style="font-size: 15px; font-family:
          Arial; color: rgb(0, 0, 0); background-color: transparent;
          font-weight: normal; font-style: normal; font-variant: normal;
          text-decoration: none; vertical-align: baseline; white-space:
          pre-wrap; ">[d]
          <a class="moz-txt-link-freetext" href="http://pypi.python.org/pypi/Python%20Bytecode%20Verifier/0.1">http://pypi.python.org/pypi/Python%20Bytecode%20Verifier/0.1</a></span></p>
      <p dir="ltr" style="text-align: justify; margin-top: 0pt;
        margin-bottom: 0pt; "><span style="font-size: 15px; font-family:
          Arial; color: rgb(0, 0, 0); background-color: transparent;
          font-weight: normal; font-style: normal; font-variant: normal;
          text-decoration: none; vertical-align: baseline; white-space:
          pre-wrap; ">[e] <a class="moz-txt-link-freetext" href="http://pypi.python.org/pypi/tmdb/0.9">http://pypi.python.org/pypi/tmdb/0.9</a></span></p>
    </b>
  </body>
</html>