Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: rename prompt_toolkit to prompt_toolkit2 or not? (during a transition period). #568

Closed
jonathanslenders opened this issue Dec 21, 2017 · 30 comments
Labels

Comments

@jonathanslenders
Copy link
Member

jonathanslenders commented Dec 21, 2017

Hi everyone,

I'm opening this issue to discuss whether or not we should rename prompt_toolkit to prompt_toolkit2.

The problem that we are facing right now is that we want to release version 2.0, but it's backwards incompatible with 1.0. This would normally not be an issue, because the best practices tell you to install Python applications in a virtualenv. However, most prompt_toolkit applications are system tools, which are often installed with the system wide Python installation, and very often these are distributed through other channels like the repositories of Linux distributions. We don't want to break those.

As I understand it, setuptools can install multiple versions of a package alongside each other. There is a __requires__ variable that is inspected by pkg_resources to make sure the right version of the package is loaded. (See, e.g.: https://stackoverflow.com/questions/13720065/what-does-requires-mean-in-python ). However, I'm not sure how well this works in practice.

While I don't like it, if renaming this library to prompt_toolkit2 during a transition period is the only way to solve certain issues, then I'm in favor of doing it. The intend is to rename it back to prompt_toolkit when most applications are transitioned. (At that point, prompt_toolkit2 could remain an alias for prompt_toolkit.)

I don't have much personal experience with issues like this, so all feedback is welcome.

@goodboy
Copy link

goodboy commented Dec 22, 2017

I personally would be a fan of this __requires__ approach but am also not experienced with it.

@j-bennet
Copy link
Contributor

From this discussion in SO, it looks like installing 2 versions side-by-side is quite a pain:

https://stackoverflow.com/questions/6570635/installing-multiple-versions-of-a-package-with-pip

Are we assuming that during the transition period, only the users who want to try out the latest and greatest (beta testers) will be using 2.0? Those users should be ok with going an extra step and creating a venv. Then, there's no need to rename the package.

@jonathanslenders
Copy link
Member Author

No, the idea is that all applications will slowly transition to 2.0. So, not just the beta testers. The idea is that during this transition period, there won't be any collisions between both versions in whatever environment. Only when most packages are using 2.0, I'd push another release with the name "prompt_toolkit" instead of "prompt_toolkit2". The only thing which remains at that point is to remove the 2 suffix in these applications.

@j-bennet
Copy link
Contributor

How about we react with 👍 to your initial comment in this issue for "rename", and with 👎 for "do not rename"? I added my 👍 .

@amjith
Copy link
Contributor

amjith commented Dec 22, 2017

I like the idea of using prompt_toolkit2. It provides a safe transition phase and there is nothing wrong with adding the digit 2 to the library name.

@fperez
Copy link

fperez commented Dec 22, 2017

If you decide to rename it, I strongly suggest not planning on doing a name reversion in the future. The time when "most packages are using 2.0" is a fuzzy, hard to specify point: there will be stragglers who you only find out about if they accidentally get pulled into the 'new' prompt-toolkit name after the rename.

Either bite the bullet with a 2 on the long name and live with it for the long run, or find another name you like as you move forward. But doing pt -> pt2 -> pt as names is only going to create chaos and grief, I suspect (and you'll be the one dealing with the ugly side of that grief :)

Just a thought... Thanks again for the great tool!

@asmeurer
Copy link
Contributor

My vote is to not rename. Packages with numbers in their names tend to be confusing. And version pinning isn't that hard. Conda at least will prevent 2.0 from being installed if an installed package requires 1.0. Linux package managers should work that way too (pip might not be as smart, but maybe it's better these days?).

I have a question though: how hard will it be for things like ipython to support both versions in the short term?

@ionelmc
Copy link
Contributor

ionelmc commented Dec 22, 2017

This may seem like an silly question but why would anyone want two versions of PT installed in the same place at the same time? PT2 either works or it doesn't. If it doesn't then why have PT2 around?

My gut tells me that if you do a PT2 package (instead of an PT version 2.0a1, 2.0b1 etc) you'll have to live forever with the reality that people will depend and keep using the PT2 package, and complain if you suddenly not release PT2 anymore and go back to PT.

@j-bennet
Copy link
Contributor

j-bennet commented Dec 22, 2017

@ionelmc's comment about "you'll have to live forever with the reality that people will depend and keep using the PT2 package, and complain if you suddenly not release PT2 anymore and go back to PT" makes me change my vote. 🤔

@njsmith
Copy link

njsmith commented Dec 23, 2017

I can't make a recommendation without a lot more details about what the changes are, but I agree that the two realistic options are: (1) keep the name, tell people to pin-or-not, (2) change the name and treat it as a permanent name change. The first is reasonable if you expect everyone to be able to transition pretty easily; the second is good if you have a more fundamental API change and expect the two versions to coexist in a substantial way.

The problem with changing back from PT2 → PT is now instead of one hard breaking transition, you have two, and the second is totally gratuitous for most people.

@Carreau
Copy link
Contributor

Carreau commented Dec 23, 2017

I just want to point out that even if pip can install 2 versions of the same package, other packages managers may not be able to. So this hing for a renaming.

One other possibility that has not been mentioned it to back-publish a prompt_toolkit_legacy or prompt_toolkit_1, which is strictly identical to already released version(s) and is a simple search-and -replace away for software that will adopt version 2.

Keep in mind that now applications have many dependencies, and even if prompt toolkit have 2 versions, some other packages may conflict as well and 2 CL tools may still not be installable at the same time.

@melund
Copy link
Contributor

melund commented Dec 23, 2017

I am for "biting the bullet" and just switch. But I do support @Carreau's idea of creating a prompt_toolkit_legacy package and encouraging the most important packages that use ptk to update with that first before switching to 2.0....

@meeuw
Copy link

meeuw commented Dec 24, 2017

Renaming the old version of prompt_toolkit will break all projects that depend on it, that will be as destructive as just releasing prompt_toolkit 2 with the same name.

I'd prefer python_toolkit2 and stick with that name.

@melund
Copy link
Contributor

melund commented Dec 24, 2017

Renaming the old version of prompt_toolkit will break all projects that depend on it, that will be as destructive as just releasing prompt_toolkit 2 with the same name.

@meeuw... Yes. But it could be done right now. Giving all projects a little more time to adapt until ptk2 is released. It, of course, depends on how far the PTK2 release is away. I think it would be a shame to rename the PTK project. I have always thought the python/python3 scheme on Linux was very silly.

@takluyver
Copy link

takluyver commented Dec 24, 2017 via email

@jonathanslenders
Copy link
Member Author

Thanks, everyone! I really appreciate all the feedback.

I think this means we should not rename, but I'm giving it some more time.
In the coming weeks, I'll try to find some time to upgrade a couple of other applications, to see how much it takes. For pgcli, it took me about 2 hours, to get most of this to work. That's not too bad.

Here is some more info about why we have these breaking changes and what's new: https://github.com/jonathanslenders/python-prompt-toolkit/blob/2.0/docs/pages/upgrading.rst
I'm sure the upgrade will work somehow.

Have a merry Christmas and good end of year!

@eliangcs
Copy link
Contributor

eliangcs commented Dec 25, 2017

I also vote not to rename. Even though applications can break if two apps depend on different versions of prompt_toolkit, users should be able to fix it by creating two separate virtualenvs. People using these apps are developers, they should be able to do that without too much effort.

@meeuw
Copy link

meeuw commented Dec 25, 2017

@Fale I believe you're the Red Hat / Fedora package maintainer for prompt_toolkit, could you please give your opinion about this?

@Carreau
Copy link
Contributor

Carreau commented Dec 25, 2017

Renaming the old version of prompt_toolkit will break all projects that depend on it, that will be as destructive as just releasing prompt_toolkit 2 with the same name.

No I was not suggesting renaming the old version. I was suggesting re-releasing prompt_toolkit version 1 under another name, so that packages that packages that do not want to spend time upgrading can just require this new version and a do a search an replace.

Same a readline which is also available a gnureadline but is otherwise identical.

That does not need to be decided now as it is relatively easy to do.

@return42
Copy link

return42 commented Dec 25, 2017

I was interested in reading all the the contributions to this topic. But now I can't hold on ;)

Using Semantic Versioning scheme, changed APIs are released with major versions. This is what PT v2.0.0 means (see here). If a project needs API from major release v1.m.p it has to stick such dependencies (see Compatible Releases).

The question I miss; are there any patch-levels (branches) are planed for v1, or will it be a version tag?

.. these are my 2 cents, hope it helps to clarify

@jonathanslenders
Copy link
Member Author

@return42: it is possible that certain bug fixes will still be applied to the 1.0 branch, but I'd like to move as much as possible to the 2.0 branch. Maintaining two branches takes a lot of time.

@Carreau
Copy link
Contributor

Carreau commented Dec 30, 2017 via email

@windelbouwman
Copy link

Stick with the current name. Package managers should deal with this issue by setting a proper version range.

@randy3k
Copy link
Contributor

randy3k commented Jan 29, 2018

I'd vote for renaming it. As a large number of users are ipython users which do not know how to install two versions of a package. Restricting themselves to 1.0 means that they will not be able to install tools which uses prompt-toolkit 2.0.

@takluyver
Copy link

takluyver commented Jan 29, 2018 via email

@windelbouwman
Copy link

Maybe a third option might be to create a deprecated adapter for the version 1 style API. When user use this API, a deprecation warning is given.

@ahundt
Copy link

ahundt commented Feb 2, 2018

How difficult would it be to just add legacy API adaptors which include a warning and a transition date a year from release?

Then there is no breakage, no rename. :-)

A great example of this is in Keras https://github.com/keras-team/keras/tree/master/keras/legacy

@windelbouwman
Copy link

Another example is in the django project where api's are deprecated for several versions.

@jonathanslenders
Copy link
Member Author

Hi everyone,

I just released prompt_toolkit 2.0.1.
Check the changelog: https://github.com/jonathanslenders/python-prompt-toolkit/blob/master/CHANGELOG
and the docs: https://python-prompt-toolkit.readthedocs.io/ .

Please let me know if you have any issues upgrading your applications!

Cheers,
Jonathan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests