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

Refactor and document Language::Python. #8379

Merged
merged 2 commits into from
Aug 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions Library/Homebrew/language/python.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# frozen_string_literal: true

require "language/python_virtualenv_constants"

module Language
# Helper functions for Python formulae.
#
# @api public
module Python
def self.major_minor_version(python)
version = /\d\.\d/.match `#{python} --version 2>&1`
Expand Down Expand Up @@ -115,13 +116,9 @@ module Virtualenv
def self.included(base)
base.class_eval do
resource "homebrew-virtualenv" do
if MacOS.version > :mojave
url PYTHON_VIRTUALENV_URL
sha256 PYTHON_VIRTUALENV_SHA256
else
url PYTHON_VIRTUALENV_URL_MOJAVE
sha256 PYTHON_VIRTUALENV_SHA256_MOJAVE
end
url "https://files.pythonhosted.org/packages/11/74" \
"/2c151a13ef41ab9fb43b3c4ff9e788e0496ed7923b2078d42cab30622bdf/virtualenv-16.7.4.tar.gz"
sha256 "94a6898293d07f84a98add34c4df900f8ec64a570292279f6d91c781d37fd305"
Copy link
Member

Choose a reason for hiding this comment

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

Probably not in this PR, but we need to consider using a newer version of virtualenv.
Versions prior to v20.0.0 belong to the "legacy" branch (the latest one being 16.7.10 -- maybe we could use it here even now) and the latest stable is: v20.0.31

https://virtualenv.pypa.io/en/latest/changelog.html

Copy link
Member

Choose a reason for hiding this comment

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

Using v20 is complicated as it requires a bunch of dependencies.

16.7.10 should be trivial to update to however.

end
end
end
Expand Down
15 changes: 0 additions & 15 deletions Library/Homebrew/language/python_virtualenv_constants.rb

This file was deleted.

1 change: 0 additions & 1 deletion Library/Homebrew/sorbet/files.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -951,7 +951,6 @@ strict:
- ./extend/os/tap.rb
- ./extend/os/utils/analytics.rb
- ./language/haskell.rb
- ./language/python_virtualenv_constants.rb
- ./os/global.rb
- ./os/linux/diagnostic.rb
- ./requirements.rb
Expand Down
4 changes: 0 additions & 4 deletions Library/Homebrew/sorbet/rbi/hidden-definitions/hidden.rbi
Original file line number Diff line number Diff line change
Expand Up @@ -13394,10 +13394,6 @@ class Object
OFFICIAL_CASK_TAPS = ::T.let(nil, ::T.untyped)
OFFICIAL_CMD_TAPS = ::T.let(nil, ::T.untyped)
OS_VERSION = ::T.let(nil, ::T.untyped)
PYTHON_VIRTUALENV_SHA256 = ::T.let(nil, ::T.untyped)
PYTHON_VIRTUALENV_SHA256_MOJAVE = ::T.let(nil, ::T.untyped)
PYTHON_VIRTUALENV_URL = ::T.let(nil, ::T.untyped)
PYTHON_VIRTUALENV_URL_MOJAVE = ::T.let(nil, ::T.untyped)
RUBY_COPYRIGHT = ::T.let(nil, ::T.untyped)
RUBY_DESCRIPTION = ::T.let(nil, ::T.untyped)
RUBY_ENGINE = ::T.let(nil, ::T.untyped)
Expand Down