In the latest development in a soured relationship with the Kenney administration, former chief information officer Charles Brennan has sued the city, Mayor Kenney, and other officials alleging that he was fired for speaking out about what he called illegal race-based hiring practices and "whistle-blowing as to expenditures, waste, and improper contracting."

Like his falling-out with the Kenney administration, the lawsuit, filed in federal court, illustrates a culture clash — but it also deals with hot-button issues of race, gender, and how norms have changed when it comes to what's acceptable in the workplace, especially in light of #MeToo.

Brennan, 67, a former street cop who became the Police Department's first tech chief in the 1990s, alleges that city officials pressured him to hire unqualified African American and Hispanic staffers, and sometimes women, in an effort to diversify his department, which he says he was told was "too white."

The city's hiring practices "were so blatant, bold, and brazen," the lawsuit alleges, that Brennan's boss, chief administrative officer Christine Derenick-Lopez, would sometimes tell Brennan that it was a "shame that best candidate is white but [that they] needed to hire an African American for the position."

After his firing in January, multiple sources described Brennan as making sexist and off-color jokes in the office, which resulted in Derenick-Lopez's suggesting he go to sensitivity training.

In the lawsuit, Brennan says he complained to human resources that it was only white male managers who were being asked to go to sensitivity training.

He added that the allegedly insensitive comments he had made were "taken out of context, innocuous, not offensive, and were clearly an effort to punish [him] and/or set the foundation or paper trail for a potential (or eventual) termination."

Brennan did not return a message left with a woman who answered the phone at his home.

Mayoral spokesman Mike Dunn said in a statement: "We can tell you that this mayor and this administration are extremely proud of our commitment to improving the diversity of the city's workforce so that it is representative of Philadelphia as a whole, and to improving overall workplace climate. As the mayor has said repeatedly — both as a candidate and since taking office — this is a priority not only because it is the right thing to do, but because studies show that more diverse workplaces perform better. And that benefits all of Philadelphia.

"Separately, this administration is extremely judicious and cost-conscious when procuring goods and services with taxpayer dollars from outside vendors and closely adheres to all applicable laws and the terms of the city's contracts.

"While we cannot comment specifically on the allegations in pending litigation, we are confident that all actions taken by the city were lawful. We also note that issues concerning Mr. Brennan's leadership while chief innovation officer have been reported publicly. We will aggressively defend our record on these matters as this litigation moves forward."

Brennan's time in the Kenney administration was marked by pushback from the city's active community of civic-minded technologists, starting from the very beginning, when Kenney hired him to replace Adel Ebeid, Mayor Michael Nutter's chief innovation officer, who was largely credited with building a top-notch tech team and raising the city's civic technology profile. The Kenney administration defended its hire, saying Brennan would prioritize the "back-office" functions of city IT — something it suggested Ebeid did not pay enough attention to.

Brennan continued to rankle local technologists, like when he explained to City Council that it was hard to hire staffers because he could not compete with startups offering perks like nap rooms, free food, and massages. Several technologists, including some who used to work in his office, said he was out of touch: His stereotypical depiction didn't acknowledge that many technologists had come to work for the city out of a sense of civic duty.