Preheat the oven to 375 F.
Roll out and line the pastry into a deep-dish pie pan. Line the pastry with parchment paper, fill it with dry beans and then bake it for 15 minutes. Remove the pan from the oven and allow it to cool for 10 minutes. Remove and place the beans to one side to store and use again once cooled.
In a large skillet set over low heat, melt the butter and cook the onions in it for 20 minutes, until they're tender but not browned and taking care to make sure they do not burn. Turn the heat up to medium-high and sprinkle the sugar over the onions. Sauté the onions and sugar until the mixture turns golden brown. Remove the onions from the pan and leave to cool slightly.
Layer the caramelized onions and crumbled Roquefort cheese onto the bottom layer of the pastry. Beat together the eggs, half and half, thyme, salt, and pepper (be careful not to use too much dried herb or it will overpower the dish).
Pour the egg mixture over the onions and cheese. Bake the tart for 35-40 minutes, until the eggs are set in the middle. Cool slightly and serve.