You will be required to declare any history of substance abuse on the medical application. Suggest that you read the penalties for making a false declaration.
Anyone stupid enough to indulge in illegal drug taking should NEVER be allowed anywhere near the controls of ANY aeroplane.
Kick your habit NOW or lose any hope of an aviation career.