Linuxbrew-core: Formulae `depends_on`/`uses_from_macos` "python@2"

Created on 6 Dec 2019  路  14Comments  路  Source: Homebrew/linuxbrew-core

The Python 2 EOL is fast approaching. There's ongoing work in https://github.com/Homebrew/homebrew-core/issues/47050 to track the macOS repo's response. That work will get here via merges.

As of 2019-12-06, in Homebrew/linuxbrew-core:

$ ack "uses_from_macos \"python@2" | wc -l
21

$ ack "depends_on \"python@2" | wc -l
93

for a total of 114 formulae, and in Homebrew/homebrew-core:

$ ack "uses_from_macos \"python@2" | wc -l
6

$ ack "depends_on \"python@2" | wc -l
51

for a total of 57 formulae with explicitly declared Python dependencies. But macOS ships with Python 2 by default. (Which doesn't really help us. I've not got the hang of brew uses quite yet. But this is a good starter!)

That's a large difference on the uses_from_macos side of things. We should fix that up too.


To track the formulae that we should worry about - that is, the ones with a dependency on Python 2 not tracked in the linked Homebrew/homebrew-core issue - here's an alphabetically sorted, de-duplicated list:


in progress python

All 14 comments

Looks like you missed node@10 for example.

Ah, node@10 was mentioned in the upstream issue.

Are we bumping the revision for those formulae that we modify to drop the python2 dependency?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

I finished the cleanup in homebrew-core.

On mac, we have:
30 formulae have uses_from_macos "python@2"
12 Do not support Python3 (the others, I do not know ...)

I will start annotating the remaining formulae that do not support Python3 on mac, so that we know for sure that we can not migrate them. I will then also try to migrate some more to Python3.

Meanwhile, we should add uses_from_macos "python@2" or migrate formulae to Python 3 in linuxbrew-core. The list above needs to be updated.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

Seems that gsettings-desktop-schemas actually depends on Python 3 (see here), so the formula file should just drop the dependency on Python 2. Can't install GTK+ 3 on Linux otherwise :crying_cat_face:

@woopla Thanks for the note! It did work with Python 3. If you brew update you'll be able to install it.

Thanks for the quick fix @issyl0 !

@issy i think you can :heavy_check_mark: spades now

Yeah, I really need to regenerate this list!

Hi, just some idea of mine, but do you already have thought about trying to use pypy instead of python@2 for formulae which still depend on it / uses_from_macos "python@2", but don't work with Python 3? It should be at least sufficient for formulae where python@2 is just a simple build dependency (like v8, deno, ...) and PyPy2.7 will be supported 'as long as PyPy itself is around'.

In my test I was able to build deno just fine using only pypy inside the homebrew/brew docker container with this patch https://github.com/chrmoritz/linuxbrew-core/commit/349e9b207db148f97fd882b36a29ac32f4eef665 (after upgrading it to deno 0.35). (Yes I know, shimming pypy as python is a bit hacky, but it works.)

We could do it, but not sure we want to do it.

I have been phasing Python 2 things out since beginning of December. We have around 49 formulae still using Python 2 right now. I touched around 64 formulae since the beginning: they were either deleted or migrated to Python 3.8.

I am fine to keep pypy around as long as upstream supports that 2.7 version. But most of the formulae we still have running are mostly dead/deprecated/unused, and were ment to be built with Python 2, not Pypy 2. I do not want to throw more energy at these. Also, using pypy may be surprising to some of our users.

Triaging these 64 formulae had a cost for me of around 50 to 60 hours of work. We need to end this Python 2 madness, the overall cost on the open source community over the last 11 years has been huge.

So sorry, but we won't do that.

The list has been reduced to 36 formulae in linuxbrew-core (git grep "Due to Python 2"). The rest will slowly die with time, and the formulae are clearly identified and disabled on Linux. I'll just close this as we are not actively migrating the remaining ones.

Was this page helpful?
0 / 5 - 0 ratings