Preheat your oven to 350°F (175°C) and grease the loaf pan with cooking spray or butter.
In a mixing bowl, whisk together the flour, baking powder, baking soda, salt, cinnamon, nutmeg, and ginger until well combined.
In another bowl, mix the vegetable oil, granulated sugar, brown sugar, and eggs until smooth.
Stir in the pumpkin puree and vanilla extract into the wet ingredients until fully incorporated.
Gradually add the dry ingredients to the wet mixture, stirring gently with a rubber spatula until just combined. Be careful not to overmix. If using, fold in the chopped walnuts.
Pour the batter into the prepared loaf pan, smoothing the top with the spatula.
Bake in the preheated oven for 60-65 minutes or until a toothpick inserted into the center comes out clean.
Once baked, remove from the oven and let the loaf cool in the pan for about 10 minutes. Then, transfer it to a wire rack to cool completely.
For serving, slice the loaf and enjoy it plain or with butter.