It is up to you! Both ways have pros and cons.
If you paint before we arrive, you don't have to worry about dripping on the new floor. However, the backing on carpet is very abrasive and sometimes in a tight corner or with a large, unwieldy piece of carpet, it may touch the walls. If that happens, minor paint scuffing can occur. So, you may have to do some touch up painting when we leave. The same type of scuffing can occur on baseboards. Another issue with paint can arise if the surface was not properly prepared before you painted. This usually happens with baseboards and trim that were painted over stained wood without being sanded first. Remember, if you can scrape the paint off with a fingernail, it will likely scrape off during a flooring installation.
If you wait to paint until we leave, you will not have to worry about any scuffing of the new paint. However, you will have to take precautions not to get paint on the new floor. Warranties do not cover paint drips!