“A major medical association is pulling its annual convention out of the city — saying its members no longer feel safe,” reports the San Francisco Chronicle. It’s a loss of approximately $40 million for the city and a warning to other cities with similar policies, like New York: You could be next.

Beautiful, hilly San Francisco has become known as the city where 20 pounds of poop was dumped on a sidewalk last week in a clear bag and remained there for hours. As The Post noted, “human waste-related complaints in San Francisco have skyrocketed 400 percent from 2008 to 2018,” and “In 2017 alone, more than 21,000 reports were received.”

What happened in San Francisco is obvious. It stopped prosecuting quality-of-life offenses and, unsurprisingly, the quality of life for the city’s residents and visitors decreased sharply.

In 2015, San Francisco courts stopped enforcing bench warrants for such offenses. Police continued writing up tickets for public drunkenness or sleeping in parks, but when the accused failed to show up to their court appearance, a judge simply dismissed the outstanding warrant.

New York started following San Francisco’s lead in 2016 when Manhattan DA Cyrus Vance Jr. announced his office would no longer be prosecuting offenses such as public urination. Both cities have accepted that they’ll continue to have a large number of people living on their streets and inevitably using their sidewalks as a toilet.

New York has tried Band-Aids, not real solutions. The city now spends half a million dollars a day housing homeless people in hotels. One particular night in 2017, the city spent $648,000, booking the homeless into $549 hotel rooms near Times Square. The temporary solution is wildly expensive and doesn’t produce any lasting reduction in the homeless population.

New York also seems to be following San Francisco’s lead regarding drug use in public.

A BuzzFeed story in May noted that the city’s explosion of public drug use has “tested San Francisco’s image as a liberal, compassionate urban oasis” and that, according to the city’s Department of Public Health, “there are about 22,000 intravenous drug users in the city, or about 470 per square mile.” Few want to live in a place where you risk stepping on a discarded needle, as San Francisco Mayor Mark Farrell actually did.

Yet, also in May, Mayor Bill de Blasio told police to stop arresting people for smoking marijuana in public starting Aug. 1, and the city plans to open four “safe injection sites” where heroin users can shoot up under the supervision of a doctor.

The concern about both of these policies is that, like in San Francisco, there will be a slide in what’s permissible. I’ve written before in support of decriminalizing marijuana use, but permitting public drug use is something else entirely.

The two cities also line up closely on affordable housing: Neither has much nor has extensive plans to build any.

At CityLab, Gabriel Metcalf wrote that he specifically moved to San Francisco for its progressive policies but that those policies have caused a housing shortage of epic proportions. “San Francisco progressives chose to stick with their familiar stance of opposing new development, positioning themselves as defenders of the city’s physical character,” he wrote.

And: “Over the years, these anti-development sentiments were translated into restrictive zoning, the most cumbersome planning and building approval process in the country, and all kinds of laws and rules that make it uniquely difficult, time-consuming, and expensive to add housing in San Francisco.”

Likewise, New York’s commitment to rent stabilization and rent control means a lack of the necessary housing development. And in many cases, instead of building more housing, the city is simply “rezoning” areas to produce more affordable homes.

Both San Francisco and New York City are one-party towns. They’re incubators of uber-liberal policies. Both cities have produced astonishing inequality, an ever-shrinking middle class and a deepening homeless problem. Both cities are throwing money at the issue and hoping something works out.

But people generally will only tolerate human poop on sidewalks for so long. New York needs to stop following San Francisco down its poop-filled road before conventions start thinking twice about visiting.