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

Python 3.9 Migration #62201

Closed
Rylan12 opened this issue Oct 6, 2020 · 31 comments
Closed

Python 3.9 Migration #62201

Rylan12 opened this issue Oct 6, 2020 · 31 comments
Labels
in progress Stale bot should stay away outdated PR was locked due to age python-3.9-migration

Comments

@Rylan12
Copy link
Member

Rylan12 commented Oct 6, 2020

Python 3.9 has been released and added to homebrew-core!

Currently, there are 42 formulae in homebrew-core that depend on python@3.8. The next step in the migration process is to switch as many formulae as possible to depend on the new python@3.9 formula.

See #62201 (comment) for a list of formulae to be upgraded.

No need to ask before working on this. If there's a formula that you can update, go ahead and open a PR and we'll get to it as soon as we can!


This is a great first issue to work on if you're new to Homebrew and if you're participating in Hacktoberfest, this is a great way to knock out some genuine PRs that will be greatly appreciated!

Here are the basic steps to migrate a formula to Python 3.9:

  1. Change depends_on "python@3.8" to depends_on "python@3.9"
  2. Change any other occurrences of python@3.8 to python@3.9
  3. Add a line with revision 1 (if the formula already has a revision, increment the number by one)
  4. Test the change locally by running brew install -s <formula>, brew test <formula> and brew audit --strict <formula>
    • Try to fix any failures locally first. If you need help, feel free to open a PR, but please be prepared to continue to work on it.
  5. Open a PR with the name: <formula>: migrate to python@3.9
  6. Done!

If you're a new contributor and want to help out, make sure to read our countributing guidelines and check out How To Open a Homebrew Pull Request in our documentation

@Rylan12 Rylan12 added help wanted Task(s) needing PRs from the community or maintainers in progress Stale bot should stay away good first issue A good candidate for your first contribution to Homebrew/homebrew-core python-3.9-migration hacktoberfest labels Oct 6, 2020
@Rylan12 Rylan12 added this to Help Wanted in Homebrew TODO via automation Oct 6, 2020
@mayank
Copy link

mayank commented Oct 6, 2020

@Rylan12 can I pick this one? Please assign to me!

@Rylan12
Copy link
Member Author

Rylan12 commented Oct 6, 2020

@mayank thanks for your interest! Please feel free to work on this!

This is too big of a project for one person to tackle on their own, but feel free to open a PR to update one or a few formulae.

@ghost
Copy link

ghost commented Oct 6, 2020

@mayank and @Rylan12 I would like to help if at all possible since this could be quite an undertaking.
Feel free to assign me if that's ok!

@mayank
Copy link

mayank commented Oct 6, 2020

@Rylan12 I need to install all the formulas on mac? Is there anything like docker for this?
I can write some testing script which will run all at once.

@fxcoudert
Copy link
Member

There are 234 formulas that are independent: they depend on python@3.8 only directly, they have not reverse dependencies. I will deal with those first.

@Rylan12
Copy link
Member Author

Rylan12 commented Oct 6, 2020

@LSmith-Zenoscave and @mayank, this is not an issue that will be closed with one PR that updates all 400 formulae. The best way to do it is just to make a few PRs, each with one formula. Take a look at some of the PRs that have been made so far if you need a model for what we're looking for.

If you're not already a Homebrew user this probably isn't a great issue for you. If you want to get more involved, though, feel free to check out some of the links I've added above for information about how to get set up.

@Rylan12
Copy link
Member Author

Rylan12 commented Oct 6, 2020

@fxcoudert: can you post the list of independent formulae (maybe link a gist?) so others can help out with those?

@Rylan12
Copy link
Member Author

Rylan12 commented Oct 6, 2020

FYI to anyone looking to help out here: The current virtualenv version we're using doesn't seem to support Python 3.9 so we should hold off on updating lots of formulae until that issue's been resolved.

Edit: I've started a fix in Homebrew/brew#8873

@fxcoudert
Copy link
Member

The list of independent formulas is below. If you don't mind, I'm happy to open PRs for all of them once virtualenv is fixed: it will literally take 2 minutes, the script is in place, and is already tracking locally which ones I have submitted or not.

There are plenty of other small "clusters" of formulas that can be migrated and where crowd-sourcing will be necessary.

airshare
ansible-lint
asciinema
atdtool
athenacli
auditbeat
austin
autopep8
aws-elasticbeanstalk
aws-google-auth
aws-shell
awscli@1
awscurl
awslogs
awsume
azure-cli
b2-tools
bagit
bandcamp-dl
beancount
bedtools
bento4
binwalk
black
borgmatic
buku
bumpversion
c7n
ccm
certbot
cfn-lint
charm-tools
choose
cloudformation-cli
coconut
codemod
codespell
commitizen
conan
cookiecutter
cppcheck
cppman
credstash
csvkit
csvtomd
ctemplate
datasette
ddgr
deheader
diceware
distcc
dnstwist
docker-compose
docker-squash
doitlive
dxpy
eg-examples
esptool
euler-py
eye-d3
fabric
fades
fava
fbi-servefiles
flake8
flawfinder
flintrock
flit
fonttools
fpp
gandi.cli
gcovr
gimme-aws-creds
ginac
git-filter-repo
git-plus
git-remote-codecommit
git-review
git-revise
gitup
glances
global
googler
goolabs
grc
grip
hashpump
heartbeat
homeassistant-cli
honcho
howdoi
hsd
httpie
hy
i386-elf-gdb
instalooter
internetarchive
iproute2mac
jailkit
jc
jenkins-job-builder
jinja2-cli
jrnl
keepassc
keepkey-agent
khal
khard
legit
liblouis
liblouis
libtcod
link-grammar
liquidctl
litecli
livestreamer
lizard-analyzer
localstack
mackup
macvim
magic-wormhole
mdv
metricbeat
micropython
mitie
mkdocs
mongo-orchestration
mps-youtube
mycli
nbdime
nicovideo-dl
node@12
notifiers
nyx
oci-cli
openstackclient
osc
packetbeat
pass-git-helper
passpie
pastebinit
percol
peru
pgcli
pipgrip
pipx
pius
platformio
poetry
ponysay
pre-commit
proselint
pssh
pwncat
pwntools
pygitup
pygments
pyinstaller
pyinvoke
pylint
python-markdown
python-yq
pyvim
q
rabbitmq
rbtools
recon-ng
redo
remarshal
reorder-python-imports
restview
robot-framework
rom-tools
rst-lint
rtv
s3ql
sceptre
scour
shallow-backup
shyaml
singular
snakemake
spoof-mac
sqlite-utils
sqlparse
ssh-audit
sshuttle
sslmate
statik
stone-soup
stormssh
streamlink
subliminal
supervisor
svtplay-dl
sync_gateway
tarsnapper
termius
termtosvg
thefuck
theharvester
todoman
toot
tox
trailscraper
translate-toolkit
trash-cli
trezor-agent
tvnamer
twarc
twine-pypi
twoping
twtxt
txt2tags
unoconv
vdirsyncer
vim
vpn-slice
vsts-cli
wakatime-cli
watchman
watson
weboob
whatmp3
x86_64-elf-gdb
xonsh
xxh
yapf
ydcv
ydiff
yle-dl
yosys
you-get
zabbix-cli
znc

@ghost
Copy link

ghost commented Oct 7, 2020

There are 234 formulas that are independent: they depend on python@3.8 only directly, they have not reverse dependencies. I will deal with those first.

Can you share how you came up with those numbers? I found a similar list but with 144.
I just looked for any files that depends_on "python@3.8" with no other deps; call it deps_on_py
Then found any files that were in a depends_on; call it any_deps_on
If there are 144 files that have a depends on python3.8 and only python3.8 are not depended on from my findings.

Perhaps I had some missed?
I can add my script to generate these if needed


edit made to adjust correction in my findings (forgot quote in a grep)

@fxcoudert
Copy link
Member

  • Start with the list of formulas that directly depend on python@3.8
  • Remove those that are a dependency in another formula
  • For each remaining formula, use brew deps --tree --include-build --include-test to remove those that if they also depend indirectly on python@3.8

@NicoHaase
Copy link
Contributor

I'm not really sure if this is connected, but could you have a look at Homebrew/discussions#37 and check whether upgrading to Python 3.9 broke docker-compose?

SMillerDev referenced this issue Oct 8, 2020
Closes #62458.

Signed-off-by: Rylan Polster <rslpolster@gmail.com>
Signed-off-by: BrewTestBot <1589480+BrewTestBot@users.noreply.github.com>
@fxcoudert
Copy link
Member

There's a label, and help is welcome on any relevant PR. I don't think there is much use for this meta-issue, maybe we should close it?

@cclauss
Copy link
Contributor

cclauss commented Oct 15, 2020

I missed the label... Thanks!

@Rylan12
Copy link
Member Author

Rylan12 commented Oct 15, 2020

There's a label, and help is welcome on any relevant PR. I don't think there is much use for this meta-issue, maybe we should close it?

Are we definitely going to do the mass migration in #62560? If so, yeah I think this can be closed. If that's not going to work, there are still almost 200 formulae to be migrated so it might be worth keeping open in that case.

@alexchandel
Copy link
Contributor

alexchandel commented Oct 18, 2020

Sounds like some of glib gobject-introspection pyqt protobuf bazel libtorch vtk@8.2 gdal vtk ansible emscripten gnuradio kibana libtensorflow libtensorflow@1 mame nest nwchem opencv opencv@3 semgrep wxpython will be done separately.

This may be controversial, but I hope this is complete before 3.10 is released.

@xxyzz
Copy link
Contributor

xxyzz commented Oct 21, 2020

I wanna ask a dumb question: is it OK to upgrade python, python3 and python@3 aliases to python@3.9? I guess it won't affect other formulas.

@iMichka
Copy link
Member

iMichka commented Oct 21, 2020

This question is best asked on https://github.com/Homebrew/discussions/discussions, but yes you can update your own alias if you want to.

@fxcoudert
Copy link
Member

fxcoudert commented Oct 23, 2020

This is the list of formulas that remain to be migrated to Python 3.9. Almost all of them are independent, and should already have a PR open to which volunteers can contribute:

@fxcoudert
Copy link
Member

Also part of the migration are test and audit failures that should be investigated and fixed:

10.15

brew audit vapoursynth --online --git --skip-style
brew audit gtk-doc --online --git --skip-style
brew audit uhd --online --git --skip-style
brew audit cryptominisat --online --git --skip-style
brew audit csound --online --git --skip-style
brew audit cxxtest --online --git --skip-style
brew audit dnsviz --online --git --skip-style
brew test --verbose gnuradio
brew audit mitmproxy --online --git --skip-style
brew audit mkvtomp4 --online --git --skip-style
brew install --verbose --build-bottle redex

10.14

brew audit vapoursynth --online --git --skip-style
brew audit gtk-doc --online --git --skip-style
brew audit uhd --online --git --skip-style
brew audit anime-downloader --online --git --skip-style
brew audit cmark-gfm --online --git --skip-style
brew audit cmark --online --git --skip-style
brew audit code-server --online --git --skip-style
brew audit cryptominisat --online --git --skip-style
brew audit csound --online --git --skip-style
brew audit gnuradio --online --git --skip-style
brew test --verbose gnuradio
brew audit gprof2dot --online --git --skip-style
brew audit rdiff-backup --online --git --skip-style
brew install --verbose --build-bottle redex
brew audit redex --online --git --skip-style

10.13

brew audit vapoursynth --online --git --skip-style
brew audit gtk-doc --online --git --skip-style
brew audit uhd --online --git --skip-style
brew audit cryptominisat --online --git --skip-style
brew audit genometools --online --git --skip-style
brew audit git-cola --online --git --skip-style
brew audit gitfs --online --git --skip-style
brew audit gitless --online --git --skip-style
brew test --verbose gnuradio
brew audit libproxy --online --git --skip-style
brew fetch --retry pytouhou --build-bottle --force
brew install --verbose --build-bottle pytouhou
brew install --verbose --build-bottle redex

@tieugene
Copy link

I don't know what is the source of problem (migrating to py39, brew bug/feature or something else), but as for newly (from scratch) installed homebrew and python@3.9 on it:

  1. In RTFM:

Unversioned symlinks for python, python-config, pip etc. are installed here:
$(brew --prefix)/opt/python/libexec/bin

There is no $(brew --prefix)/opt/python/ directory

  1. brew info python@3.9:
    ...
    Python has been installed as
    /usr/local/bin/python3

No, there is no /usr/local/bin/python3

  1. brew switch is useless

I don't know how to work with this "python3".
To call it as "/usr/local/Cellar/python@3.9/3.9.0/Frameworks/Python.framework/Versions/3.9/bin/python3.9" is too complex.

@fxcoudert
Copy link
Member

@tieugene the python@3.9 binary currently resides in /usr/local/opt/python@3.9/bin. We'll be migrating to that as our primary formula soon, and then it will be in /usr/local/bin/python3 (which means our documentation is currently wrong, indeed).

@shinysuittheory
Copy link

I've been trying to reinstall mpv from source so as to get the app bundle for macOS, similarly to the closed and now locked "Missing mpv.app bundle #46532", but keep getting an error which I believe has something to do with python but I can't figure out what. Can anyone shed some light? Wasn't sure if to create a separate issue

link to error text from terminal - https://pastebin.pl/view/a5a1e0d0

Screenshot 2020-10-26 at 3 13 37 PM

@SMillerDev
Copy link
Member

You should ask the mpv developers, homebrew doesn't provide support for modified builds.

@fxcoudert
Copy link
Member

@hjmallon please open a new issue and provide all information requested, so we can help you

@fxcoudert
Copy link
Member

@Raptoaaah please open a new issue and provide all information requested, so we can help you

@Homebrew Homebrew deleted a comment from hjmallon Oct 27, 2020
@Homebrew Homebrew deleted a comment from ScalyDragon Oct 27, 2020
@fxcoudert
Copy link
Member

At this point we have migrated all the main Python formula to python 3.9.
425 of our Python-related formulas have been migrated to Python 3.9, and 22 are still using Python 3.8, due to incompatibilities with Python 3.9

I am closing this tracking issue, as it mostly attracts bug reports (for which we prefer people to file new issues). Any help with the remaining PRs is welcome, at least in reporting bugs to upstream so they get fixed at some point.

Homebrew TODO automation moved this from Work In Progress to Done Oct 28, 2020
@BrewTestBot BrewTestBot added the outdated PR was locked due to age label Dec 1, 2020
@Homebrew Homebrew locked as resolved and limited conversation to collaborators Dec 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
in progress Stale bot should stay away outdated PR was locked due to age python-3.9-migration
Projects
Homebrew TODO
  
Done
Development

No branches or pull requests