Preheat your oven to 350°F (175°C).
Grease and flour a loaf pan or cake pan.
In a large bowl, combine flour, sugar, baking powder, baking soda, salt, cinnamon, and nutmeg.
In another bowl, whisk together the oil, eggs, pumpkin puree, and vanilla extract.
Gradually add the wet ingredients to the dry ingredients and mix until just combined.
Fold in the chopped walnuts if using.
Pour the batter into the prepared pan, smoothing the top.
Bake for 45-50 minutes or until a toothpick inserted comes out clean.
Allow the cake to cool in the pan for 10 minutes, then transfer to a wire rack to cool completely.
Frost with cream cheese icing or serve plain.