Proper "notice period" for resigning a tenure track position? My apologies in advance if this is a duplicate. I did search a bit about this before posting here. 

This is related to my previous posts so, briefly: I want to leave my current position and I have another offer that I will eventually accept (not finished negotiating). I won't be able to "officially" drop the hammer for at least 1-2 weeks (negotiating, getting the offer, signing it, etc.). I teach one absolutely essential course in the fall (a core course in a graduate program) and no one else is qualified to teach it but me. 

My question: In a tenure track position, what is the minimal notice period for leaving? This is not a question about "what my department would like" or how to optimize my standing with the department after leaving. This is a question about professionalism-- specifically what is the minimal notice period where the department members couldn't justifiably go around calling my conduct unprofessional. (I couldn't create a "professionalism" tag, so I tagged this with "etiquette")

Clearly, leaving one week before the semester is too late. Giving 2 years notice is probably more than enough. The answer must be somewhere in between. In my own case, I am contemplating delivering the news in around two weeks (so, over three months before classes begin). 

Edit: (1) This is related to a previous question I asked

I want to leave my tenure track position before fall. I have great prospects but no new position &quot;locked up&quot;: when should I break the news?

But I think it is still distinct. That question raised the issue of whether to inform my department before having a definite offer, in the interest of giving them enough time to plan. This question is about the standards of professionalism in resignation notice (analogous to the conventional two weeks in many non-academic jobs). 

(2) Our contracts are year-to-year (August through April) with guaranteed renewal before tenure review. There are no specific terms written there about resignation periods. I could just fail to renew my contract (this issue would arise in about two months) but, still, the question is whether this is meets the standards of professionalism in academia, not whether it's "legal".
Hiring an adjunct or borrowing someone from another department for one course is about the least bad thing that can happen in this world. Giving the kind of notice (9 months?) that would have allowed them to do a full candidate search is impossible for folks who move laterally out of a department. This is pretty common and departments simply have to manage it. Everyone knows that offers are being locked in during the April-May time frame, and sometimes you lose someone key. It would not be unprofessional if you chose to avoid delaying your career by staying for an extra semester in order to make your current department's process painless. 

Nobody wants to see you go, but you're working within the system to the best of your abilities. You're not screwing them, and it's not unprofessional to wait to give notice until the new offer is accepted.