Skip to content
This repository was archived by the owner on Jan 16, 2025. It is now read-only.

python: Framework style. Bug fixes. #12968

Closed
wants to merge 1 commit into from

Conversation

samueljohn
Copy link
Contributor


# The HOMEBREW_PREFIX location of site-packages.
def site_packages
HOMEBREW_PREFIX+"lib/python2.7/site-packages"
Copy link
Contributor

Choose a reason for hiding this comment

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

Would those 2.7 be easier to maintain as a variable?

Copy link
Contributor

Choose a reason for hiding this comment

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

One could use #{version.to_f}:

[irb(main)]$ "2.7.3".to_f
 ====> 2.7

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For Python 3.x I will use this suggestions.
However, there will be no Python 2.8. It's a dead end.

@jacknagel
Copy link
Contributor

Haven't looked at the python3 request yet, but feel free to apply my review comments there as well, if they are relevant.

@samueljohn
Copy link
Contributor Author

@jacknagel thanks very much for you helpful comments. I'll push a sqaushed new version with almost all of your suggestions except for the "? ?" stuff until you sudo me to do.

Most of them apply to python3, too. Will fix it.

@samueljohn
Copy link
Contributor Author

done.

@samueljohn
Copy link
Contributor Author

Updated this pull request and fixed minor things.
I think it's ready ;-)

@samueljohn
Copy link
Contributor Author

ping.

@2bits
Copy link
Contributor

2bits commented Jul 13, 2012

@jacknagel @adamv please review when you have time.

@2bits
Copy link
Contributor

2bits commented Jul 18, 2012

@jacknagel @adamv This PR turns out to fix compile errors on ML also. Please review.

@adamv
Copy link
Contributor

adamv commented Jul 18, 2012

I still don't want to make Framework the default, but I've also abdicated maintaining the Python formulae, so if another maintainer wants to pull, be my guest.

@samueljohn
Copy link
Contributor Author

A small typo fix and added the small suggestion @paxswill made for python3.

@adamv today there are many more reasons why one wants a framework build than not. Apple and python.org do a framework build on the Mac. Some GUI libs only work with the framework version. There may have been issues with the framework build in the past. That's past now :-)

@2bits
Copy link
Contributor

2bits commented Jul 18, 2012

I still don't want to make Framework the default. . .

Why?

@adamv
Copy link
Contributor

adamv commented Jul 18, 2012

/unsubscribe

@samueljohn
Copy link
Contributor Author

@2bits , I'd even go so far to remove the non framework option completely. But somehow @adamv loves the unix style :-)

@samueljohn
Copy link
Contributor Author

I'll "maintain" this formula by looking at the related issues and doing pull-requests. I swear.

Ok, perhaps @jacknagel or @mistydemeo want to pull the trigger?

@2bits
Copy link
Contributor

2bits commented Jul 18, 2012

@MikeMcQuaid @Sharpie this would be a significant change, making Python a framework by default. Thoughts?

@samueljohn
Copy link
Contributor Author

@mistydemeo @jacknagel, I removed the "--no-framework" option. Look how clean the formula looks again.

@2bits
Copy link
Contributor

2bits commented Aug 7, 2012

Coffee and pull request. My morning ritual.

@MikeMcQuaid
Copy link
Member

@samueljohn clean up the commit message a bit and I'll merge :)

@samueljohn
Copy link
Contributor Author

@MikeMcQuaid cleaned up commit message a bit (the duplicate mention of sqlite and Framework is not the default, its the only way we go now)

@samueljohn
Copy link
Contributor Author

👉 hint, there is a python3 formula waiting for some ❤️, too.

- Framework style build in order to support wxmac and other GUIs
  (Note: PySide (and pyqt?) seem to work even with non-framework builds).
- Fixed automatic installation of `*.app`s into `/Applications`.
- The caveats tell us now about `brew link apps`.
- Cleanup of the caveats.
- Resolve the issue of duplicate `2to3` can make the symlink phase
  to break because both python and python3 provide it. (Closes Homebrew#12581)
- Enable warnings, because python's configure needs it. (Closes Homebrew#12194)
- Add suppression of recommended warnings from the python docs.
- Add work-a-round for python bug: http://bugs.python.org/issue11445
- Add explicit test if sqlite3 built successful.
- Check against possible issue like Homebrew#12667.
- Add needed "depends_on :x11" because tk.h includes x11.
- Install the Demo into HOMEBREW_PREFIX/share/python2.7/Extras
- Ensure sqlite from homebrew is used and not the one from OS X.
- Removed unnecessary flags from configure
- Added --without-gcc to the configure flags (all clang now)
- Ensure that "man python2.7" works by setting --datadir and --datarootdir to share.
@samueljohn
Copy link
Contributor Author

Updated with last-minute review from @jacknagel. To be precise: added if ENV.compiler == :clang block around clang specific flags to suppress warnings.

@MikeMcQuaid
Copy link
Member

Great. I'll merge this tomorrow unless there's any final complaints.

@mxcl
Copy link
Contributor

mxcl commented Aug 7, 2012

Python3 goes in homebrew/versions init?

@paxswill
Copy link
Contributor

paxswill commented Aug 7, 2012

I don't think so. Python 3 is a major jump with a lot of changes to the language, breaking backwards compatibility. Code written for one won't run without modification for the other, and active development is only happening in Python 3.

@mxcl
Copy link
Contributor

mxcl commented Aug 8, 2012

I don't think so. Python 3 is a major jump with a lot of changes to the language, breaking backwards compatibility. Code written for one won't run without modification for the other, and active development is only happening in Python 3.

So yeah: homebrew/versions.

@samueljohn
Copy link
Contributor Author

As a Python user, I'd say this is not a candidate for versions. Both
are needed in parallel - at least for quite a while. Unfortunately.

Python3 does not provide an executable named "python" and even if it
would, it's no drop-in replacement.
Therefore, they are meant to be installed side by side. They don't
conflict. No fear :-)

When I chatted with one of the core devs, he told me it's better to
think of two different script languages than a new major "version"
(concerning the C interface).

As has been said before, python 2.x does not get new features. So in
maybe five years (that's my personal guess) if everybody (especially
the C bindings/wrappings) all switched over to the python3.x line, we
can indeed remove python 2.x! But please not yet.

When 3.3 will be released, 3.2 could be a candidate for versions since
both provide binaries with the same name.

I hope I am able to convince you @mxcl.
Btw.: Great to see you back here being actively involved 🍺!

@mxcl
Copy link
Contributor

mxcl commented Aug 8, 2012

We keep one in mxcl/master and the rest in homebrew/versions. Why is everyone being so weird about this?

@adamv
Copy link
Contributor

adamv commented Aug 8, 2012

@mxcl because running Python 2 and 3 side-by-side is way more common than running Grails 1.3.4 and Grails 2.0 side-by-side, for instance.

@adamv
Copy link
Contributor

adamv commented Aug 8, 2012

That said, I don't care, do whatever.

@samueljohn
Copy link
Contributor Author

I do care :-(

@paxswill
Copy link
Contributor

paxswill commented Aug 8, 2012

It's akin to the early days of the OS 9 to OS X jump. Both are needed for different tasks, and while you can see that one is descended from the other, they're also different things that are needed at the same time. Here's why both are needed at the same time. Ideally, Python 3 only would be great, but Python 2 is needed for too many things.

@mxcl
Copy link
Contributor

mxcl commented Aug 8, 2012

I don't get the complaints. Putting it in the versions tap doesn't change anything. Just where the formula lives. brew search still finds it etc. You can still install and use both simultaneously.

Is it a prestige thing or something? Nobody wants their favorite formula moved to a tap?

@samueljohn
Copy link
Contributor Author

brew install python3 would not work any more and not tell anything about taps.

brew search would just print out this:
homebrew/versions/python3.

If the user concludes to type brew install homebrew/versions/python3, finally a helpful message is shown:

Error: No available formula for python3
Please tap it and then try again: brew tap homebrew/versions

But I'll stop arguing, you decide.

@paxswill
Copy link
Contributor

paxswill commented Aug 8, 2012

One issue I think of is how will upgrades work? If Python 3 is moved to versions, and then the next release comes out, how will people who currently have Python 3 and do not have versions tapped be upgraded? Also, this might be an area for improvement, but search finds it but install does not unless versions is tapped. Unless this was decided against earlier, I think it would be better to automatically tap versions if a user tries to install a formula that's in there.

As an aside, I think this Python 3 discussion might be better located in #12969.

@MikeMcQuaid
Copy link
Member

I think there's an argument that python3 should be in core and python should not (as Lion and above ship with Python 2.7).

@samueljohn
Copy link
Contributor Author

@MikeMcQuaid please note that there are several issues with Apple's python 2.7 e.g. you need sudo to install packages and bindings.

@mxcl
Copy link
Contributor

mxcl commented Aug 8, 2012

I was thinking about making install do a search if it finds nothing.

But let's think about how people use brew for a second. Who tries to install things by typing hopeful-strings in to install? Nobody I hope.

The upgrade issue is true.

@MikeMcQuaid
Copy link
Member

I'm maybe a minority but that's what I always tend to do. Hear about new thing, type string into brew install and then brew search that fails (or brew create more often).

I'm just testing this and about to merge this. Regardless of the future of python or python3 this pull request should be merged; it's a definite improvement on what's in the tree currently and fixes bugs.

@MikeMcQuaid
Copy link
Member

Merged as a97c817. Thanks @samueljohn for all the hard work.

@samueljohn
Copy link
Contributor Author

Thanks for pulling. ❤️

I often do brew install some<TAB> to install something.

@samueljohn samueljohn closed this Aug 8, 2012
@Homebrew Homebrew locked and limited conversation to collaborators Feb 16, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
8 participants