timothycrosley / deprecated.pies

The simplest (and tastiest) way to write one program that runs on both Python 2 and Python 3.
MIT License
148 stars 7 forks source link

Breaking pyflakes! #28

Closed mgrbyte closed 10 years ago

mgrbyte commented 10 years ago

Hi, Just a head's up on a related issue: https://bugs.launchpad.net/pyflakes/+bug/1277606#4?comments=all

I've recently started using isort from emacs, which depends on pies. Unfortunately, pyflakes uses:

try:
    builtin_vars = dir(__import__('builtins'))
    PY2 = False
except ImportError:
    builtin_vars = dir(__import__('__builtin__'))
    PY2 = True

to determine python version, thus pyflakes is broken for me as long as I've got pies installed on my path.

While I think pyflakes could/should use sys.version/platform to make the switch, yet I suspect that's not the last of these kinds of assumptions that pies will end up breaking.

Perhaps pyflakes could be fixed by using pies? :+1:

mgrbyte commented 10 years ago

@timothycrosley pyflakes has been fixed some time ago on github, so I think it's just a case of waiting for a release.

Great work with this and isort btw, thanks!

timothycrosley commented 10 years ago

Hi Matthew,

Thanks for your concern and pointing out this issue! Just to give you some more back story on it: pyflakes is indeed the only widely used package that breaks with pies - and it is solely because it was using an extremely non-standard approach to determine the version of Python running. I, and several others quickly wrote patches and forwarded them to the project to no avail, as at the time the maintainers did not have any time to devote to the project, even to accept pull requests. The problem was actually manually fixed in the redhat repos, well before any patch got accepted into the pyflakes repository: https://bugzilla.redhat.com/show_bug.cgi?id=1039706. Because of this, I forked pyflakes as frosted which fixes this issue as well as several others - while making pyflakes configurable: https://github.com/timothycrosley/frosted. Pyflakes now indeed does seem to be receiving active maintenance, but there are now 2 good options to choose from.

Thanks again!

Timothy

mgrbyte commented 10 years ago

@timothycrosley no probs. I solved my issues by switching to flycheck, which seems to work smoothly in emacs. Thanks for your reply - will hope to find the time to look more closely at pies and isort soon.