82 Commits

Author SHA1 Message Date
Rylan Polster
4c4dcfa3bb
language/python: remove outdated "homebrew-" resource handling 2021-03-14 14:17:02 -04:00
Dustin Rodrigues
c8e99e5185
python: stop passing no-user flag on installation 2021-02-19 12:49:10 -05:00
Dustin Rodrigues
425535e32b python: add --no-user when doing pip install 2021-01-09 10:09:44 -05:00
Dustin Rodrigues
19a47d7c50 python: use built-in venv instead of virtualenv when installing formulae 2021-01-09 10:09:44 -05:00
Rylan Polster
7f260f92b9 language/python: update homebrew-virtualenv resource 2020-12-12 14:24:58 -05:00
Francois-Xavier Coudert
0670ec4d09 python: update virtualenv 2020-12-02 09:54:18 +01:00
Dustin Rodrigues
84de3c1eb6 python: allow multi-digit minor versions 2020-11-22 10:45:06 -05:00
Markus Reiter
0184e271d8 Fix RuboCop offenses. 2020-11-17 11:09:55 +01:00
Markus Reiter
da9289eff0 Add more type signatures. 2020-11-13 12:26:36 +01:00
EricFromCanada
3768b7a6e9 apidoc: update comment wording, punctuation, formatting 2020-11-06 00:21:02 -05:00
EricFromCanada
4f7719ac2e apidoc: update examples' syntax 2020-11-05 23:50:55 -05:00
FX Coudert
b4ad930b5d
python: update virtualenv 2020-10-30 18:04:54 +01:00
Markus Reiter
24ae318a3d Move type annotations into files. 2020-10-10 14:59:39 +02:00
Michka Popoff
ddc73ffa0c python: do not add main brewed Python site-package to virtualenv
If added, this makes the virtualenv read the main site-package from brewed Python,
and especially makes it read our sitecustomize.py file, which will
modify the sys.executable path.

See the full discussion at:
https://github.com/Homebrew/brew/pull/8873

I also took the opportunity to not include test deps, as these will
be not be installed, so the .pth file should not contains references
to site-packages from test deps.

Previous packages on Linux did already contain the wrong lines in the pth file,
for example:
cat /home/linuxbrew/.linuxbrew/Cellar/aws-google-auth/0.0.36_1/libexec/lib/python3.8/site-packages/homebrew_deps.pth
import site; site.addsitedir('/home/linuxbrew/.linuxbrew/opt/python@3.8/lib/python3.8/site-packages')
import site; site.addsitedir('/home/linuxbrew/.linuxbrew/opt/libxml2/lib/python3.8/site-packages')

This might have caused subtle bugs for some packages but not for others.
2020-10-08 19:03:51 +02:00
Rylan Polster
0109ce58be update references to homebrew-virtualenv resources 2020-10-06 23:39:52 -04:00
Rylan Polster
43648100b4 virtualenv: use version 20 to support Python 3.9 2020-10-06 22:27:52 -04:00
Mike McQuaid
f04b014210
language/python: build python binary names dynamically.
Co-authored-by: Alexander Bayandin <a.bayandin@gmail.com>
2020-09-16 12:47:20 +01:00
FX Coudert
57c136e848
python.rb: prepare for Python 3.9 2020-09-15 22:41:15 +02:00
Markus Reiter
da0ff4feb0 Remove PYTHON_VIRTUALENV_* constants. 2020-08-19 10:45:56 +02:00
Markus Reiter
e909ea2471 Refactor and document Language::Python. 2020-08-19 10:45:56 +02:00
Jonathan Chang
76709d82c5 Fix brew style. 2020-07-13 23:24:14 +10:00
Bo Anderson
1c73393b47 language/python: raise if we can't detect the Python to use for venv 2020-07-09 15:43:36 +01:00
Bo Anderson
f01d264c3c language/python: allow python@3.7 to be used for virtualenvs 2020-07-09 15:31:53 +01:00
Mike McQuaid
fa760a2f26
Fix brew style. 2020-07-07 13:12:37 +01:00
Rylan Polster
a7a9793f99 needs_python? separate formula name from tap name 2020-07-03 16:37:32 -04:00
Mike McQuaid
4f75a77b08
Update deprecations
Add more deprecations, disable deprecations and remove disabled code.
2020-05-18 13:50:46 +01:00
Bo Anderson
32ab83d055 language/python: move rewrite_python_shebang to compat 2020-03-27 22:27:06 +00:00
Bo Anderson
5d68856350 language/python: use rewrite_shebang, add detected_python_shebang 2020-03-27 19:18:23 +00:00
Michka Popoff
30c4383e86
Merge pull request #7141 from iMichka/regex
rewrite_python_shebang: make version part optional
2020-03-10 22:29:54 +01:00
Michka Popoff
cccd8d3655 rewrite_python_shebang: make version part optional
We forgot about the simplest case:
/usr/bin/env python
2020-03-10 22:11:45 +01:00
Bo Anderson
2594e7093e language/python: fix virtualenv symlinks for versioned Python 2020-03-10 14:17:30 +00:00
Alexander Bayandin
9bab086967 rewrite_python_shebang: move loop invariants out of loop 2020-03-05 23:20:16 +00:00
Peter Teixeira
7ccec0cdf0 Use literal "python" 2020-03-04 10:13:32 -05:00
Bo Anderson
f9481d4d35 python: Fix error in virtualenv_install_with_resources
Fixes #7115.
2020-03-04 14:13:41 +00:00
Mike McQuaid
f6631d6449
Merge pull request #7019 from iMichka/python2doc
brew: remove most traces of python@2
2020-03-04 11:21:07 +00:00
Michka Popoff
79a3d3568b python: add rewrite function for generic shebangs
From PEP 394
https://www.python.org/dev/peps/pep-0394/#for-python-script-publishers

In cases where the script is expected to be executed outside virtual environments,
developers will need to be aware of the following discrepancies across platforms and installation methods:

Older Linux distributions will provide a python command that refers to Python 2, and will likely not provide a python2 command.
Some newer Linux distributions will provide a python command that refers to Python 3.
Some Linux distributions will not provide a python command at all by default, but will provide a python3 command by default.

When potentially targeting these environments, developers may either use a Python package installation tool that rewrites shebang lines
for the installed environment, provide instructions on updating shebang lines interactively,
or else use more specific shebang lines that are tailored to the target environment.
2020-02-28 20:08:43 +01:00
Michka Popoff
c46a30b575 brew: remove most traces of python@2 2020-02-17 22:38:24 +01:00
Michka Popoff
38feac473c virtualenv: support mojave and high sierra system Python
On High Sierra and Mojave, virtualenv 16.x does not build when used with
system Python
Fall back to an older virtualenv version, which is known to work.
2019-12-30 20:18:55 +01:00
Alexander Bayandin
c92a3d3f84 virtualenv_install_with_resources: add python@3.8 handling 2019-12-19 17:23:15 +00:00
Mike McQuaid
36dbad3922
Add frozen_string_literal to all files. 2019-04-20 13:27:36 +09:00
EricFromCanada
fa6404e0f5 grammar fixes 2019-04-13 21:29:32 -04:00
Jonathan Chang
46af0260f0 python: support pypy3 2019-03-11 20:14:03 +11:00
EricFromCanada
20167e5f1b Adjust comments to tidy API docs output. 2018-10-18 21:42:43 -04:00
Jonathan Chang
0fe273be5f language/python: support pypy 2018-09-24 16:24:30 -04:00
Markus Reiter
e9b9ea49a1 Update to RuboCop 0.59.1. 2018-09-17 03:45:59 +02:00
Markus Reiter
7762ce32aa Use more descriptive heredoc names. 2018-07-11 18:15:30 +02:00
commitay
e3ec061a3a language/python: python 3.7 2018-07-05 10:16:04 +10:00
Mike McQuaid
9fca172d03 Fix HOMEBREW_RUBY_WARNINGS="-w"
Fix various circular requirements, method redefinitions, etc.
2018-04-07 20:28:56 +01:00
ilovezfs
776fec7f6b virtualenv_install_with_resources: invoke python with versioned name.
The unversioned python executable no longer refers to python3.
2018-03-09 14:01:52 -08:00
ilovezfs
34bd99af8d language/python: expect @ in python@2 Cellar paths
The realpath of the python@2 Cellar contains "python@2" not "python2" so
check for "python@2" when doing Cellar->opt robustifications.
2018-03-08 08:10:48 -08:00