Ravel composed his Pièce en Forme de Habanera in 1907 for the Amédée-Louis Hettich. Hettich was a singing teacher at the the Conservatoire de Paris who wanted composers to write vocal excercises.
The work was premiered at the Société nationale de musiqueon on February 22, 1919.
Here is an arrangement for violin and string orchestra