It happened at about 12.30am on Saturday, May 20 outside The Woolpack apartments on Lockwood Road, Huddersfield.
A 34-year-old man was found with an injury to his shoulder.
Police said the injury was not life threatening.
He was treated in hospital.
DCI Emma Winfield of the Homicide and Major Enquiry Team who is leading the investigation said: "This has clearly been a serious incident in which a man has been injured following the discharge of a weapon on a residential street.
"Firearms incidents are treated exceptionally seriously by West Yorkshire Police and investigated by specialist officers. I can assure residents we will leave no stone unturned to find those responsible.
"A number of enquiries are ongoing in the Lockwood Road area today and colleagues from the Huddersfield NPT are conducting reassurance patrols.
"I would appeal to anyone who saw suspicious persons or cars in the area at the time of the shooting or who has any information at all about what took place to contact us as we continue to investigate."
Information can be given to the Homicide and Major Enquiry Team on 101 referencing crime number 131200269162 or online at www.westyorkshire.police.uk/101livechat
Reports can also be made anonymously to the independent Crimestoppers charity on 0800 555 111