On 14 June 2016, as it does once a month, the entire Calgary city council – including mayor Naheed Nenshi – spent nearly the whole day reviewing individual applications for “secondary suites”. If it sounds like a tedious grind, that’s because it is. Secondary suites are minor house alterations – for example, converting a basement into a separate rental unit. The council debates and votes on each one, one by one. It can be a rancorous process, and it’s inevitably far too microscopic in scaleto occupy so much of the time of council of a city of more than a million people.

But Calgary is no ordinary city. As the corporate home of Canada’s oil and gas industry, it has long been particularly friendly to the car. Secondary suites, however, present a challenge to the automobile’s supremacy: they increase housing density, and ease the push to expand ever further into the suburbs.

So when Nenshi came into office in 2010 on a progressive pledge to fight urban sprawl and bring in city-wide secondary suite legislation, a fight was indeed what he found. Twice, city councillors representing the suburban wards have voted down his secondary suite proposal. And so the interminable monthly approval discussions drone on – a routine reminder that Calgary still has a long way to go in its transformation from a city of expansive suburbs and broad, multi-lane expressways into the denser, more emphatically urban place so powerfully symbolised by Nenshi’s ascent to mayor.

Mayor Naheed Nenshi at the annual Stampede parade in Calgary. Photograph: Todd Korol/Reuters

Calgary’s battle against sprawl is duplicated in one way or another in every Canadian city. Blessed with abundant space and cheap fuel, the country’s cities grew mostly outwards instead of upwards as they prospered in the decades after the second world war. The aspirational Canadian lifestyle that emerged in those years was a wholly suburban one – a detached home surrounded by a tidy putting-green lawn on a wide curving avenue, with two cars in the garage to drive down fast-moving freeways to work, school and the mall.

Every Canadian city now wrestles with the outsized cost of providing access to those increasingly distant suburbs. Freeways grow ever-more clogged with traffic, and infrastructure bends and cracks under the strain. In Toronto, a pitched battle has been fought over the future of an elevated waterfront highway, leading to a compromise that pleases almost no one. The city council in nearby Hamilton spent the spring arguing whether or not to accept C$1bn (£600m) in funding from the provincial government for light-rail transit (LRT). Last summer, voters in proudly green Vancouver rejected a proposed tax aimed at expanding the region’s transit system. The progressive new federal government led by Justin Trudeau has promised to invest in urban infrastructure with a zeal not seen in decades, but it seems no Canadian city has quite settled on what’s needed to combat the sprawl that so vexes them.

The battle can seem particularly pitched – and urgent – in Calgary. Its traditional image in the collective Canadian consciousness is as a swaggering city of oil riches, outsized cowboy hats and extra-large pickup trucks. It occupies wide, flat prairie, meaning a visitor landing at the airport sees the full extent of the city’s sprawl as nowhere else. (Few visitors to beautiful, densely built downtown Vancouver see much of sprawling suburban enclaves like Maple Ridge and Port Coquitlam, hidden behind picturesque mountains.) And now there is the collapse in global oil prices, a direct threat to the engine of Calgary’s explosive growth.

The Peace Bridge over the Bow River: a network of cycle tracks is helping change Calgary’s car-oriented image. Photograph: Witold Skrypczak/Getty/Lonely Planet

For all these reasons, Nenshi has come to occupy a larger patch of the nation’s political landscape than might be expected for the mayor of its fourth-largest city. If Calgary can beat back urban sprawl – so the line of thinking goes – surely any city can. This outsized spotlight has shone on Nenshi since the day he was elected. How had those yahoos in Calgary – “a frigid Dallas”, as the New Republic’s Jeet Heer put it, home to a mammoth rodeo, and the corporate capital of Canada’s oil and gas business – somehow managed to elect the western world’s only Muslim mayor? The election five years later of a leftwing provincial government – now the only legislature in Canada controlled by the New Democratic Party – has amplified the sense of surprise.

Nenshi’s 2010 election victory was a shock to many of us who knew him – not because he was a Muslim, but because he was an outsider who wrested victory from hand-picked candidates of the city’s elite. And what really excited us about his victory was not that he was a progressive new face for the city, but that he was a genuine, unabashed policy wonk.

Calgary’s traditional image is a swaggering city of oil riches, outsized cowboy hats and extra-large pickup trucks. Photograph: Keystone USA-Zuma/Rex Features

His appetite for wading into the trenches of municipal legislation has made Calgary a surprising pacesetter in Canada’s battle against sprawl. A year ago this month, the city created a downtown network of separated cycle tracks. The three-mile system is a poor cousin of Copenhagen’s or Amsterdam’s, and not yet equal to Montreal’s, but it’s as significant a commitment to cycling as in any other Canadian city – and it was the product of a vicious political battle that went Nenshi’s way. While the leftwing provincial government commits to completing the city’s ring road (at astronomical costs), Nenshi pushes forward with pragmatic centrist plans for new LRT and Bus Rapid Transit (BRT) lines. The battle over the latter has grown so divisive that the mayor had to suspend public meetings to protect city staff from abuse. But Nenshi shows no sign of being averse to a fight. Rather the opposite: in 2013 he was sued for comparing a prominent homebuilder to The Godfather.

Inner-city neighbourhoods, meanwhile, are densifying at a rate not seen in decades. And if too much of the city’s new housing is still built on curvilinear suburban streets at the city’s rim, the centre of gravity has shifted substantially away from business as usual.

Earlier this year, Nenshi did his best to anchor that shift with the weight of law. Declaring he was going to end the “sprawl subsidy”, Nenshi pushed city council to change its “off-site levy bylaw”. Previously, developers of new subdivisions in Calgary had always been required to pay for the roads, street lights and sewers. But city taxpayers were on the hook for the cost of upgrades and expansions of existing infrastructure, such as a new off-ramp on the freeway or the upgrading of sewers to meet the greater demand. For decades, the city had quietly subsidised growth at its perimeter this way, to the tune of tens of millions of dollars.

There was no acrimonious public debate about the off-site levy changes, no grandstanding about ending sprawl. Instead, Nenshi quietly built support among city councillors, officials and developers over many months. The new bylaw was passed with little fanfare. Nenshi himself, however, has described it as “one of the most important decisions of our term”. It’s only a small step away from the wasteful, energy-intensive status quo, but taken together with everything else Calgary is doing, it’s a substantial leap for a city whose name was long seen as a synonym for sprawl.

Guardian Cities is devoting a week to exploring all things Canada. Get involved onTwitter and Facebook and share your thoughts with #GuardianCanada