|
![]() |
|
I worked on Vellum today after waking up from jetlag and Poland. I feel like it’s near ready for actual use by people. I even managed to polish it off with a nice little command line option for dumping the commands a build spec uses including their documentation. Check out this Pastie clip that shows it off. What you see here is first the vellum/commands.py file with the commands that you can use. This file is actually loaded the same way your own commands could be loaded, by just saying what to import as a regular Python module. What Vellum does is look in this file for anything that is a function and then makes those into commands. Next is the actual build.vel file that makes those commands active in the modules section. Now, the nice part is right after that you see the results of the vellum -C command line option. It literally just pulls out the documentation for each function and prints it as the command’s documentation. If you give -C any command names it just prints those out. This means you can write Python functions for commands you want, then put them in a module in ~/.vellum/modules or even just make a regular Python project out of them and install in the normal way. Once you do that you can use those in your build specs. Check out the project page for information on getting this and using it. I’ll have more extensive documentation on it soon. 620 Lines Of PythonUsing this awesome CLOC program I figured out that Vellum is only 733 lines of code, but 620 if you take out the parser.py file generated from parser.g. That’s pretty fucking amazing considering all the shit this thing can do already. Think about this for a second: In less than a month I managed to create a build tool that parses it’s own build format with dynamic scoped imports, loads additional Python modules to give you a command structure, and then runs arbitrarily sized shell or Python code according to the dependency structure. It’s also got a decent test suite, is fully self-documenting, and has comments on almost every function. That says a lot for Python. Combine my efficiency working on Vellum with how quickly I cranked out Idiopidae and Python is really proving itself as a great workhorse language. I also really enjoyed the interplay between people who wanted a Python only syntax and those who liked YAML syntax. What I got out of that exchange was what I consider a very nice setup for Vellum where users have a nice simple format for the build file that’s high-level, but can easily write new commands in regular Python modules for more complex work. I don’t think I could have made that leap if it weren’t for the people who were talking to me about the benefits of both needs. Next up for Vellum is a more extensive set of documentation for it so everyone else can learn to use it, and then a way to distribute recipes. I’ll probably use the Launchpad project for the recipes. Let me know if you grab Vellum and start getting it working. It should just take a simple sudo easy_install vellum to get it now. |