I think the main topic of this week is preparation, and it’s very important for a newbie as me before actual coding for a project with more than thousands of lines of code. During this week, all we need is the patience to read the source code of old distutils module if wanting to know the mechanism of the commands, and it also takes a bit of our carefulness to get the right working copy of current distutils2. Though problems are sometimes occured to me in this week, it’s worth mentioning that I still had some important finds and got some achivements in this difficult time.
The following sentences talk about my work/problems/finds in a more detail way:
1 Things I did
1) read the source code of distutils to get to know what the ‘develop’ command actually does
I have already read the source code of Cmd.py, dist.py, Develop.py, install.py, install_lib.py, and all the code corresponding with ‘develop’ and ‘install’ commands, which I can get the leason from to fulfil ‘develop’ command for future distutils2. Actually, it takes amount of time and work, but it did help me know more about what I should do in future and learn more from previous contributors’ excellent code.
Red herring here. I’ve also set up a good environment to read and write the python code for current project- read the souce code by Source Insight, write the source code within Ulipad, which is a wonderful Python editor written by a Chinese guy.
2) tried to get the right working copy of distutils2
It maybe not worth mentioning here, and one may think it’s just easy to clone the repository from a specific url. But when I updated my working version to the default CPython 3.3 – hg.python.org/cpython#default, it’s strange that I could not find the ‘distutils2’ or ‘packaging’ directory in the /Lib of my copy, then I could not start my future work.
Then I tried to look for other clues talking about the right repository path which I may miss, by searching the mails, asking questions in irc, looking into repository information on distutils2 online documents. And as said in my previous emails, there are three urls about distutils2 or packaging repository, or even more, then my question here is which is the right one for me to clone, since that I can not find the ‘packaging’ directory by cloning from http://hg.python.org/cpython.
3) restudying the tutorials of Mercurial on hginit.com
Thanks to my mentor Eric, it’s really a good place for me to prepare Mercurial knowledge. More reading makes me understand more better.
In the process of trial work of distutils commands, I found a bug of setuptools about the case problem of ‘egg-path’ option, which I have talked about on my last post. I’m not sure it’s worth fixing this bug, because it seems that the setuptools is not maintained now.
setuptools features should be implemented basing on current latest apis which distutils2 offers, while distutils2 is implemented in a totoal completed way, so previous discussing in MLs and bug tracker should be considered carefully. You know, our current thought in a very big extent still stays at such kind of position: use ‘install_lib’ kind of commands with ‘skip-build’ kind of opitions of old distutils module, to implment ‘develop’ feature for complete new packaging module- distutils2, and you may show me a smile which means we did trap in a wrong place.
So, I think more important things we should focus are the following two aspects:
a) how setuptools implement ‘develop’ feature by using old distutils apis
b) how to implement such feature by using new apis instead of old apis
At last, I still want to make a plan of next week here:
1) get the right working copy of distutils ASAP, thus I can start actual coding work
2) get myself familiar with distutils current apis and its framework
3) write empty functions and tests against them
4) start actual coding
Hey, MR. NEXTWEEK, see you tomorrow! 🙂