Put a large pan of salted water on to boil. Chop the aubergine into small 1cm cubes. Warm 1 tbsp olive oil in a deep frying pan over a medium heat. Add the aubergine. Fry for around 5 mins, stirring often, till the aubergine is browned all over. Lift out of the pan. Drain on kitchen paper.
While the aubergine fries, peel and finely chop the onion. When the aubergine is on the side plate, add 1 tbsp more oil to the pan. Turn the heat down a little. Add the onion. Season with a pinch of salt and pepper. Cover. Sweat the onion for around 10 mins, stirring now and then, till the onion is soft and glossy. While the onion sweats, peel and grate or crush the garlic. Dice the tomatoes.
When the onion is soft and just slightly coloured, add the garlic and a pinch of chilli flakes (they’re spicy, so add as much or as little as you like). Stir round the pan a few times to flavour the onion.
Stir in the chopped tomatoes. Stir the aubergine back in, too. Cover. Simmer for 10-15 mins till the tomatoes have broken down and formed a chunky sauce. Stir now and then and if it looks too dry or if it is sticking, add 1-2 tbsp water.
While the sauce cooks, add the penne to the boiling water with a pinch of salt. Pop on a lid. Simmer for about 10-12 mins. When the pasta is cooked but still a bit chewy, drain.
Meanwhile, put a dry frying pan on a low heat and add the pine nuts. Toast for 2-3 mins, shaking the pan often, till the pine nuts are toasted. Tip into a bowl and set aside. Whisk the juice of half the lemon with 1/2 tbsp olive oil and a pinch of salt and pepper to make a dressing, set aside.
The pasta should be cooked by now, so check it and, if it is ready, drain it. Taste the sauce and add a pinch more salt or pepper if you think it needs it. Add the penne and gently toss to coat in the sauce.
Divide the pasta between 2 warm bowls. Top with the pine nuts and spoonfuls of the ricotta. Garnish with chopped parsley leaves. Toss the salad with the dressing and serve on the side.