Toast the pumpkin seeds or walnuts in a frying pan over a low heat for 3–4 minutes, shaking frequently. Tip the seeds or nuts onto a plate and set aside.
Cook the penne in a pan of lightly salted boiling water for 11 minutes until tender, then drain.
Meanwhile, finely chop the cooled seeds or nuts in a food processor with the rocket, garlic and cheese. Add the oil, pouring it in a steady stream, until thick and almost smooth (or make the pesto using a pestle and mortar or chop the ingredients by hand as finely as possible, then stir in the oil). Scrape into a bowl, season to taste and stir into the drained pasta to serve.