Lecture hall $P$-partitions