I had a terrible time with them the first year and I remember being frustrated when I read that in Mexico small farmers don't plant them, they just let a few volunteers grow.
Every year since our first successful crop we've had volunteers the next year not only near where we had plants before but in other beds -- probably because a seed survived composting.
When the plants have about six leaves we transplant a couple to the right spot and dig out the rest.
I have a moderate to hot dry summer climate and once the plants are established they produce like crazy. Don't let them dry out but don't give them a lot of water either -- they don't seem to need much. I think that more water will make the fruit bigger though.