Search Results: "paultag"

2 March 2013

Paul Tagliamonte: Firehose - wanna hack?

As folks know, I ve been hacking on Firehose. I ve been debating doing some work to modify / extend / replace DACA, and I could use some help writing new wrappers around static check code, so, who wants to hack? Any UI folks? I could use a UI to view Firehose data, something spiffy and colorful. Hackers? Send in some wrappers for your favorite static checking code. Send in pull requests or email me with a pointer to the repo :) Hack on, folks!

23 February 2013

Paul Tagliamonte: Here was a talk I gave at Boston Python a few weeks ago. Check...

<iframe allowfullscreen="allowfullscreen" frameborder="0" height="225" src="http://www.youtube.com/embed/ulekCWvDFVI?wmode=transparent&amp;autohide=1&amp;egm=0&amp;hd=1&amp;iv_load_policy=3&amp;modestbranding=1&amp;rel=0&amp;showinfo=0&amp;showsearch=0" width="400"></iframe>

Here was a talk I gave at Boston Python a few weeks ago. Check it out, and feel free to follow along with the slides, and take a look at the source. Sorry about the major futzup at 40 minutes in, and small mistakes throughout first time giving this talk! (link to the video for those on the planets)

18 February 2013

Paul Tagliamonte: GSoC Project Idea: Debian Android app

Hello, World! There are details coming out soon with regards to GSoC:2013, so all this is without any official hat of any sort on. However, I had an idea, and I was wondering if there were people interested in mentoring it. For a long time, I ve wanted a Debian android application one that will use API calls to fetch PTS info, BTS info, and intercept bug URLs to display Debian related information on the native interface. It d also be neat to set a profile (e.g. my emails) and get notifications when things happen that I care about. Anyone know how to code for android and interested in GSoC?

16 February 2013

Paul Tagliamonte: My #dplgame 4

In no particular order, here are my 4 picks for the DPL thunderdome: I hope they all run. Really.

13 February 2013

Paul Tagliamonte: Linting with Firehose

Hey y all, As some may have seen, I ve taken a shine to a project called Firehose, and plan on helping this format support Debian. I really enjoy how it s looking so far, and plan on slowly building out scripts to output this format. The idea here is I d use it to help with debuild.me, and eventually support larger archive runs. More to come.

5 February 2013

Paul Tagliamonte: Hy: The Next Generation

As many of you know, I ve been spending some time hacking on a Lisp variant that s fully hosted in Python. If you want to read more about it, check out the slides I prepared for Boston Python s meetup in particular, pay attention to the magic REPL . I ve been pondering what to do next, and the natural instinct is for me to take a step back, and properly implement a few things I ve forgotten. Namely: Macros. Yes. Macros. It s a Lisp without Macros. I ve hit a few stumbling blocks in it s implementation, and it s been holding me up. I m mostly concerned with how Hy should treat quoted forms, in particular I m concerned about loosing the distinction between a vector and a list, since both convert into Python lists. There is of course the option to encode Lists as:
 (list foo bar baz)
but that seems wrong. I ve also got some concerns about derefing values in a quoted form I think this is just going to result in a lot of special casing for Macros. More to come soon.

30 January 2013

Paul Tagliamonte: dput-ng/1.4 in unstable

Changes:
dput-ng (1.4) unstable; urgency=low
   [ Arno T ll ]
   * Really fix #696659 by making sure the command line tool uses the most recent
     version of the library.
   * Mark several fields to be required in profiles (incoming, method)
   * Fix broken tests.
   * Do not run the check-debs hook in our mentors.d.n profile
   * Fix "[dcut] dm bombed out" by using the profile key only when defined
     (Closes: #698232)
   * Parse the gecos field to obtain the user name / email address from the local
     system when DEBFULLNAME and DEBEMAIL are not set.
   * Fix "dcut reschedule sends "None-day" to ftp-master if the delay is
     not specified" by forcing the corresponding parameter (Closes: #698719)
 .
   [ Luca Falavigna ]
   * Implement default_keyid option. This is particularly useful with multiple
     GPG keys, so dcut is aware of which one to use.
   * Make scp uploader aware of "port" configuration option.
 .
   [ Paul Tagliamonte ]
   * Hack around Launchpad's SFTP implementation. We musn't stat *anything*.
     "Be vewy vewy quiet, I'm hunting wabbits" (Closes: #696558).
   * Rewrote the test suite to actually test the majority of the codepaths we
     take during an upload. Back up to 60%.
   * Added a README for the twitter hook, Thanks to Sandro Tosi for the bug,
     and Gergely Nagy for poking me about it. (Closes: #697768).
   * Added a doc for helping folks install hooks into dput-ng (Closes: #697862).
   * Properly remove DEFAULT from loadable config blocks. (Closes: #698157).
   * Allow upload of more then one file. Thanks to Iain Lane for the
     suggestion. (Closes: #698855).
 .
   [ Bernhard R. Link ]
   * allow empty incoming dir to upload directly to the home directory
 .
   [ Sandro Tosi ]
   * Install example hooks (Closes: #697767).
Thanks to all the contributors! For anyone who doesn t know, you should check out the docs.

24 January 2013

Paul Tagliamonte: Debian BSP this weekend; Cambridge, MA (MIT/SIPB)

If anyone s in the area, there will be a Debian BSP this weekend at SIPB s MIT office. Hope to see everyone there! Check out details @ http://sipb.mit.edu/iap/#7

18 January 2013

Paul Tagliamonte: adventures in hy, part III

Over the last few days, I ve made some incremental improvements to Hy, but I ve been mostly preparing it for a small talk later on this next week. I am, however, already considering a bit of a rewrite there is a lot of code sitting in the Hy tree that was intended to use the old modfaker method of Python module generation (which sucked) I m most interested (I think) in bootstrapping Hy in Hy (no small task) and getting macros in early (really really needed), so, dear lazyweb: Has anyone split rpython out of PyPy yet? Are there any sort of docs on this? The idea of rHy is pretty intriguing, I d like to make it happen. More to come soon (including the slides!)

8 January 2013

Paul Tagliamonte: I don't care how meaningless this is, I'm proud of it

I don t care how silly it is, but the fact that I, for 62 days in a row, I pushed something, closed something or did something worth $EFFORT on GitHub is pretty great. I m pretty happy with that.

5 January 2013

Paul Tagliamonte: Updates to dput-ng since version 1.0

Big release notes since 1.0: We ve got a new list dput-ng-maint@lists.alioth.debian.org feel free to subscribe!
1.3:
  * Avoid failing on upload if a pre/post upload hook is missing from the
    Filesystem.
  * Fix "dcut raises FtpUploadException" by correctly initializing the uploader
    classes from dcut (Closes: #696467)
1.2:
  * Add bash completions for dput-ng (Closes: #695412).
  * Add in a script to set the default profile depending on the building
    distro (Ubuntu support)
  * Fix a bug where meta-class info won't be loaded if the config file has the
    same name.
  * Add an Ubuntu upload target.
  * Added .udeb detection to the check debs hook.
  * Catch the correct exception falling out of bin/dcut
  * Fix the dput manpages to use --uid rather then the old --dm flag.
  * Fix the CLI flag registration by setting required=True
    in cancel and upload.
  * Move make_delayed_upload above the logging call for sanity's sake.
  * Fix "connects to the host even with -s" (Closes: #695347)
Thanks to everone who s contributed!
     7  Bernhard R. Link
     4  Ansgar Burchardt
     3  Luca Falavigna
     2  Michael Gilbert
     2  Salvatore Bonaccorso
     1  Benjamin Drung
     1  Gergely Nagy
     1  Jakub Wilk
     1  Jimmy Kaplowitz
     1  Luke Faraone
     1  Sandro Tosi
This has been your every-once-in-a-while dput-ng update. We re looking for more code contributions (to make sure everyone s happy), doc updates (etc) or ideas.

29 December 2012

Paul Tagliamonte: Updates on Hy

After a quick rename, hy s back, and better then ever. I ve taken a slightly different approach, and I m now doing Python AST generation out of Lisp. I got things working so well, stack traces even make sense:
(defn foo []
    (raise (Exception "This isn't great")))
(foo)
And, when run:
(hy)[tag@leliel:~][01:28 PM]$ ~/dev/local/hy/bin/hython foo.hy 
Traceback (most recent call last):
  File "foo.hy", line 5, in <module>
    (foo)
  File "foo.hy", line 3, in foo
    (raise (Exception "This isn't great")))
Exception
In addition, I ve added a few new syntax bits, and did some speed tests. Check out the gist it turns out Hy is on-par with Python (whereas Clojure-Py (although much more featureful) is quite a bit slower) To just show off a few things, here s a small script to scrape NEW packages off the website
; NEW scraper
(import "lxml.html"
        "urllib2")
(def xpath "//tr[contains(@class, 'sourceNEW')]//td[@class='package']")
(def url "http://ftp-master.debian.org/new.html")
(def page (lxml.html.fromstring (.read (urllib2.urlopen url))))
(for [row (page.xpath xpath)]
  (print "NEW:" (row.text_content)))
More to come, methinks!

19 December 2012

Paul Tagliamonte: The most horrifying thing i've done -- or: hy

Hang tight folks, this is a trippy one: As many have noted in my most recent post, I ve taken a shine to lisps hosted in Python. While clojure-py is badass, it s not fit for using from python. I hit some problems in the way it handles atomic variable access (well atomic , it s actually not ;) ), so I ve decided to give it a shot myself. That s right. I wrote a Lisp. A very basic, unmacroed lisp, but a lisp. So, let s take a look a trivial hy file pair The first file (really_lisp.hy), is as follows:
; vim: tabstop=2 expandtab shiftwidth=2 softtabstop=2 filetype=lisp
; Copyright (c) Paul Tagliamonte, in sofar as any of this is at all
;  copyrightable.
(def hello "World!")
(def square (fn [arg]
  (* arg arg)))
(def factorial (fn [n]
  (if (<= n 1)
   1
   (* n (factorial (- n 1))))))
(def fib (fn [n]
  (if (< n 2)
    n
    (+ (fib (- n 1)) (fib (- n 2))))))
And, the example Python script example.py is as follows:
import hy.lang.importer
import really_lisp
print really_lisp.hello
# "World!"
print really_lisp.square(4)
# 16
print really_lisp.factorial(10)
# 3628800
print [really_lisp.fib(x) for x in range(1, 20)]
# [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144,
#        233, 377, 610, 987, 1597, 2584, 4181]
Please note two awesome things firstly, we re importing a non-python script into a Python module. Awesome. Secondly, we re able to access symbols natively, as well as functions. Let s also demonstrate the other way (just hython this time):
; vim: tabstop=2 expandtab shiftwidth=2 softtabstop=2 filetype=lisp
; Copyright (c) Paul Tagliamonte, in sofar as any of this is at all
;  copyrightable.
(puts "Hello, World!")
; "Hello, World!"
(import ["os"
         "sys"])
(puts (os.path.abspath "."))
; "/home/tag/tmp"
(puts sys.argv)
; ['/home/tag/.virtualenvs/hy/bin/hython', 'test.hy']
(sys.stdout.write "Fuggn' test\n")
; "Fuggn' test"
Naturally, not to be outdone, I decided to amp it up. Django in Lisp While insane, the big stuff looks like this: I ve replaced urls.py with urls.hy:
; vim: tabstop=2 expandtab shiftwidth=2 softtabstop=2 filetype=lisp
(import ["django.conf.urls"])
(def urlpatterns (django.conf.urls.patterns ""
  (django.conf.urls.url "^$" "djlisp.hellisp.views.home")
))
And, views.py with views.hy:
; vim: tabstop=2 expandtab shiftwidth=2 softtabstop=2 filetype=lisp
(import ["django.shortcuts"])
(def home (fn [request]
  (django.shortcuts.render_to_response "home.html"  )))
And lastly, the settings.hy file. I m not going to paste it because it s huge. But, it works!

14 December 2012

Paul Tagliamonte: Scripting Python in Clojure

Yeah, wait, what? No, really! I took a look through clojure-py, and found out something pretty rad. In order to get clojurepy scripts to load other clojurepy, it had to shim out and add a new importer for clojure scripts. What this really means, is that you can import Clojure from Python, which is pretty sweet. I abused the internals here, and added it to dput-ng as a quick hack. Basically, I just had to import clojure.main, and let the main function set up the sys shim. I would set it up in dput, but I d have to import that module anyway. Remember, when doing this, the namespace ((ns ...)) needs to match the filename. So, I present the first Clojure hook for dput-ng:
; Copyright (c) Paul R. Tagliamonte <paultag@debian.org>, 2012, under the
; terms of dput-ng itsself.
(ns clojtest
  (:require dput.core
            dput.exceptions))
(defn log [x]  ; for debug output
  (.debug dput.core/logger x))
(defn dput-checker [changes profile interface]
  (cond (>= (-> changes (.get "maintainer") (.find "arno@debian.org")) 0)
    (throw (dput.exceptions/HookException. "Maintainer's Arno. Aborting upload"))
  :else
    (log "Nah, it's not arno, we're good")))
This, of course, checks if the maintainer is Arno, and throws a fit if it is. Gist is over on gist.github. After, Algernon added his own checker, which throws a fit if you have a package in the B-Ds that you aught to not use (such as dpatch)
; Copyright (c) Gergely Nagy <algernon@debian.org>, 2012, under the
; terms of dput-ng itself.
(ns bd-blacklist
  (:require dput.core
            dput.exceptions
            dput.dsc))
(defn prune-build-deps
  "Prune a string representation of the build-depends so that only a
  list of packages remain."
  [bd-string]
  (map #(first (-> % (.strip) (.split " "))) (.. bd-string (split ","))))
(defn has-blacklisted?
  "Given a dsc file and a blacklist, check if any of the
  build-depencencies are in that list. Throws an error if there are
  matches."
  [dsc-file blacklist]
  (let [dsc (dput.dsc/parse_dsc_file dsc-file)
        build-deps (prune-build-deps (.. dsc (get "build-depends")))]
    (if-let [bad-bd (some blacklist build-deps)]
      (throw (dput.exceptions/HookException. (str "Blacklisted build-dependency found: " bad-bd)))
      (-> dput.core/logger (.trace "Build-Dependencies do not have anything on the blacklist")))))
(defn blacklist-checker
  "Checks whether the dsc has blacklisted build-dependencies, ignores
  the check when no dsc is to be found."
  [changes profile interface]
  (if-let [dsc-file (.. changes (get_dsc))]
    (has-blacklisted? dsc-file (set (get profile "bd-blacklist")))
    (-> dput.core/logger (.trace "No .dsc found, build-dependencies cannot be checked"))))
You can check that out in the git tree Hacks welcome!

7 December 2012

Paul Tagliamonte: converting kml to csv (for consumption of google latitude)

Google Latitude history dumps come in KML, and KML isn t super compatible with existing GIS tools. I wrote a quick snippit to output CSV from a KML dump on google latitude.
from lxml import etree
import sys
root = etree.fromstring(open(sys.argv[1], 'r').read())
track = root.xpath("//*[local-name()='Track']")[0]
coord = None
when = None
print "time,lat,lon"
for node in track.iter():
    name = node.xpath("local-name()")
    if name == 'coord':
        lon, lat, z = node.xpath("text()")[0].split()
        coord =  
            "lat": lat,
            "lon": lon,
            "zee": z
         
    elif name == 'when':
        when = node.xpath("text()")[0]
    if coord and when:
        print "%s,%s,%s" % (
            when,
            coord['lat'],
            coord['lon']
        )
        coord, when = None, None
P.S. namespaces in lxml is nasty.

28 November 2012

Paul Tagliamonte: debuild.me update

It s working! (ish) Here are some snapshots (and fully automated as much as I could) This comprises a lot of work, so I m fairly proud of it. Feel free to browse over at debuild.me. Patches & feedback welcome!

22 November 2012

Paul Tagliamonte: update on dput-ng & debuild.me

I ve been working (although; slowly) on dput-ng. I need to finish dirt (a tool to modify the config files, sorta like how git works at times), but it s otherwise mostly in the state it will be in upon our upload to unstable. good-intentioned co-maintainers and contributors are welcome. Code s in collab-maint, be sure to run big changes through us over in #torabora on irc.oftc.net. I ve also spent some time on debuild.me, and I ve written out most of the krufty bits, more changes to come. If anyone has ARM hardware suggestions, I m open to them, but I m thinking (from some debian-arm advice) that it d be best to wait for the v8 goodies to drop. Godspeed!

16 November 2012

Paul Tagliamonte: pathfinding debian's social connections

As a followup to my toy over at debtree, I ve taken some suggestions from my buddy Arno and found some time in the hotel during a visit for work up to Canada with the Open North folks hacking on open13. The hack is called debfriends (I need to purge personal details from the source tree before I can push it to VCS, since it uses the nm.d.o dump. Sorry, I should have been better about that.) I ve posted a cute front-end on my staging machine to play with over at graph.lucifer.pault.ag There s also an API, but it has all the data in the NM dump exposed. If you re a DD who will treat this data right, I can add a key (it s not secure, like, at all). I m going to publish the source ASAP so that others can stand up an instance if they d like. It s a cute toy, though! In the tradition of using nhandler for my examples, here s an example path from pabs to Nathan: pabs > nhandler Also, we re a shockingly well connected bunch. Well done :) Feel free to play with it!

8 November 2012

Paul Tagliamonte: an update on debuild.me

Between working on dput-ng, I ve been working more on debuild.me s infrastructure for the last month or so (slowly). In the end, this should support some pretty exotic setups, including a mixed AWS node farm (which scales with the package load) and physical nodes (for stuff like ARM, etc), AWS only, or real host only. I need to finish up a lot, but this shot looks like it s going to be a lot more viable. After I get back from a trip, I ll be working on this more. Soon. Soon.

31 October 2012

Paul Tagliamonte: dput-ng -- the next generation of your friendly upload tool

Hello, World! Arno and I have been in the middle of a 3 week long quest to rewrite dput. We feature tons of improvements over the old dput, such as: Support for even core features are treated as plugins, so derivative distributions should be able to add features without maintaining a patch against dput (current situation). In addition, I ve implemented some show-ey post-upload hooks, such as a Twitter plugin. Here s how it s defined:
import twitter
import json
import os
def tweet(changes, profile, interface):
    tweet = "I've just uploaded %s/%s to %s's %s suite #debian" % (
        changes['Source'],
        changes['Version'],
        profile['name'],
        changes['Distribution']
    )
    if len(tweet) > 140:
        tweet = tweet[:140]
    obj = json.load(open(os.path.expanduser("~/.twitter.json"), 'r'))
    t = twitter.Api(
        consumer_key=obj['consumer_key'],
        consumer_secret=obj['consumer_secret'],
        access_token_key=obj['oath_token'],
        access_token_secret=obj['oath_secret']
    )
    t.PostUpdates(tweet)
This file is placed in ~/.dput.d/scripts, as tweet.py, and the plugin def file is placed in ~/.dput.d/processors (since it s a post-upload processor), which looks like:
 
    "name": "Tweet after an upload.",
    "path": "tweet.tweet"
 
I know this sounds confusing, but it s actually quite nice. Check out the plugin in action Feedback, and contributors more then welcome! Documentation is at dput.rtfd.org. It s all a bit pre-beta at the moment, but the authors are using it for all their uploads, and should be stable for users who don t mind a bit of breakage. We ve filed the ITP, and updates on it & and upload will follow shortly. We re just weeding out some final major issues. Should be stable enough for general use in the next 30 days or so.

Next.

Previous.