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

Deprecate PILLOW_VERSION and VERSION #3090

Merged
merged 8 commits into from
Apr 25, 2018

Conversation

hugovk
Copy link
Member

@hugovk hugovk commented Apr 11, 2018

For #3082.

Replaces PR #3085.

Changes proposed in this pull request:

  • Internally, use more conventional __version__ rather than PILLOW_VERSION
  • Mark PILLOW_VERSION and VERSION as deprecated, we'll remove them in the next major version.
    • It's been nearly a decade since the fork, and no end users will need to know the old PIL 1.1.7. It just causes confusion.
    • With that gone, no need for PILLOW_VERSION, use __version__ instead.

#3083 (comment):

Don't break the single version in c & python,

Check

don't break the world by removing the PIL 1.1.7 version until we do a major release

Check

@@ -13,6 +13,7 @@

from . import version

# PILLOW_VERSION and VERSION are deprecated and will be removed in Pillow 6.0.0. Use __version__ instead.
VERSION = '1.1.7' # PIL Version
PILLOW_VERSION = version.__version__
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you rebase on the current master to see the full picture?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rebased!

@@ -951,5 +951,5 @@ def versions():

return (
VERSION, core.littlecms_version,
sys.version.split()[0], Image.VERSION
sys.version.split()[0], Image.__version__
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It used to be 1.1.7 here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, reverted.

Deprecations
^^^^^^^^^^^^

Two version constants – ``VERSION`` (the old PIL version 1.1.7) and
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PIL.VERSION and so on

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added.

@wiredfool
Copy link
Member

You know, there's one other thing.

When we ask for a version number, we should be able to ask for one thing. And unfortunately, that's going to be PILLOW_VERSION for a good long time.

Otherwise, we're going to get this conversation:

What version are you running?

How do I do that?

Depends on what version you're running, either PIL.PILLOW_VERSION or PIL.__version__

@aclark4life
Copy link
Member

That conversation is probably OK because that’s what deprecation is for. PILLOW_VERSION was a hack we should probably fix…

@hugovk
Copy link
Member Author

hugovk commented Apr 11, 2018

PIL.__version__ has already been around for 2 years since 3.4.0, in 7 quarterly releases so far.

(Commit 7bfb252 in PR #2027.)

So I think we're fine asking for PIL.__version__.

* ``PIL.Image.VERSION``
* ``PIL.Image.PILLOW_VERSION``

Use ``__version__`` instead.
Copy link
Member

@homm homm Apr 15, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PIL.__version__ ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, updated.

@homm
Copy link
Member

homm commented Apr 15, 2018

You know, I'm for the depreciating VERSION and leaving PILLOW_VERSION as is. I don't think this is so terrible to have a fallback for code which works from the beginning of the library. This way, we are reducing the number of "version" constants from four to two in next release.

@homm
Copy link
Member

homm commented Apr 22, 2018

@hugovk Needs rebase

@hugovk
Copy link
Member Author

hugovk commented Apr 22, 2018

Thanks, will rebase.

And how about we keep both deprecations in place, with VERSION to be removed in the next major version, but just say PILLOW_VERSION will be removed in a future version?

That means we most importantly get rid of the confusing, different version numbers (1.1.7 vs. 5.1.0) and also discourages against PILLOW_VERSION for a bit longer.

@aclark4life
Copy link
Member

@hugovk Sounds good… I think saying we're going to get rid of PILLOW_VERSION at some point but not specifying which future version will allow folks plenty of time to comment if they care. As the person who probably added PILLOW_VERSION, I think it should eventually go…

@hugovk
Copy link
Member Author

hugovk commented Apr 22, 2018

Rebased and updated.

^^^^^^^^^^^^

These version constants have been deprecated. ``VERSION`` will be removed in
Pillow 6.0.0, and ``PILLOW_VERSION`` will be removed in a future release.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't it mean that PILLOW_VERSION will be removed in a future release i.e. in 5.3, before 6.0? For me, "and PILLOW_VERSION will be removed after that." looks more clear.

Copy link
Member Author

@hugovk hugovk Apr 25, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is ambiguous. Updated!

Edit: and rebased.

@hugovk hugovk merged commit 5e1a528 into python-pillow:master Apr 25, 2018
@hugovk hugovk deleted the deprecate-versions branch May 17, 2018 13:16
@jwilk
Copy link
Contributor

jwilk commented Jun 1, 2018

I was using PILLOW_VERSION to distinguish between the original PIL and Pillow.
Is there another way to distinguish between the two?

@radarhere
Copy link
Member

PIL doesn't have __version__, so you can use that as a direct continuation of your current check

@hugovk hugovk mentioned this pull request Jan 13, 2019
5 tasks
@hugovk hugovk added the Deprecation Feature that will be removed in the future label Jan 23, 2019
marcvinyals added a commit to marcvinyals/fofix that referenced this pull request Apr 21, 2019
PIL.VERSION always reports 1.1.7, it is deprecated since version 5.2.0
(see python-pillow/Pillow#3090), and removed
from version 6.0.0. The recommended way to access the version of
Pillow is PIL.__version__.
marcvinyals added a commit to marcvinyals/fofix that referenced this pull request Apr 21, 2019
Image.VERSION always reports 1.1.7, it is deprecated since version
5.2.0 (see python-pillow/Pillow#3090), and
removed from version 6.0.0. The recommended way to access the version
of Pillow is Image.__version__.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Deprecation Feature that will be removed in the future
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants