I am an undergraduate student and I have been working with a computational physics group for three years.
Over the past three years, the code I used for our research has grown from one simple algorithm to a very complex and expansive suite of numerical tools for both simulations and investigating analytical solutions of the specific nonlinear partial differential equation we are interested in. This program has been vital to the two papers I've published during my junior year.
I am working with two professors, professor A and professor B. I showed professor A my program a couple of months ago and he was very impressed. He suggested that I submit it as an original software publication in the journal Computer Physics Communications which publishes such things. He said that I should be the sole author on the paper since I did all the work myself and no one else had any significant contribution. I discussed this with him again a few days ago, saying he and professor B should be my coauthor, but he said it would be dishonest since it's my own work and they didn't really contribute.
However, having known professor B for a few years, I know he likes to have his name on all papers published by our group/international collaboration, whether or not he had a sizable contribution (I don't mean to disrespect him in any way, just an observation, he even says so himself). I have no idea how I should tackle this issue. On the one hand, professor A refuses to be the coauthor and believes I deserve to be the sole author, which of course could be very beneficial for my PhD application. On the other hand, I do not want to upset professor B, and I will inevitably need their help in revising the paper (I'm sure A wouldn't mind revising it, however). I still haven't talked to professor B and I don't know how to bring it up.
Edit: I just emailed professor B, explained the situation and asked him for advice on which option would be best, he replied saying "it would be nice if you can publish a paper on your own." So I guess that's what I'll try to do. Thank you everybody for the advice, I've learned my lesson.