247 Commits

Author SHA1 Message Date
botantony
342d39e8a4
language: add php shebang module
Signed-off-by: botantony <antonsm21@gmail.com>
2025-03-30 03:24:24 +02:00
botantony
dac4b6fd56
shebangs: fix broken shebangs like #!python
Signed-off-by: botantony <antonsm21@gmail.com>
2025-03-21 00:34:14 +01:00
Douglas Eichelberger
a81239ec2d
Enable strict typing in Formula 2025-02-24 10:23:42 -08:00
Michael Cho
c2d3f126ed
language/python: link manpages by default 2024-11-05 11:24:13 -05:00
Michael Cho
fdabc2fd03
language/python: reduce dependencies added to pth file 2024-10-29 23:22:16 -04:00
Michael Cho
372e8fb4b7
language/java: document public API 2024-10-17 12:07:41 -04:00
Mike McQuaid
94416e82f0
Add new odeprecated, odisabled, remove disabled code.
Prepare the usual deprecation cycle for Homebrew 4.4.0.
2024-09-24 10:15:34 +01:00
Mike McQuaid
d1e0c078bc
Merge pull request #18128 from cho-m/python-avoid-modifying-all-links 2024-08-23 08:07:45 +01:00
Michael Cho
36dc83c9e4
language/python: reduce some differences between macOS and Linux venv 2024-08-22 21:09:58 -04:00
Michael Cho
0e8db0155a
language/python: avoid modifying all Python symlinks
Homebrew Python will always have a realpath in HOMEBREW_CELLAR. Instead,
check if the symlink target points to HOMEBREW_CELLAR.
2024-08-22 19:19:19 -04:00
Bo Anderson
6db4ed2793
Replace some include Kernel usages with requires_ancestor 2024-08-20 19:10:14 +01:00
Mike McQuaid
debdc30aa0
language/*: only check required deps in detected_*_shebang
Otherwise, we rewrite this even when we have a e.g. build or test
dependency on NodeJS.

See context in:
https://github.com/Homebrew/homebrew-core/issues/176257#issuecomment-2277602215
2024-08-09 14:08:29 +01:00
William Woodruff
575592d7f9
Update Library/Homebrew/language/python.rb
Co-authored-by: Bo Anderson <mail@boanderson.me>
2024-07-30 11:38:07 -04:00
William Woodruff
9804e58ceb
python: don't assume resources have URLs
Signed-off-by: William Woodruff <william@yossarian.net>
2024-07-30 09:51:33 -04:00
William Woodruff
c6ba4844b3
specialize wheel resource handling
Signed-off-by: William Woodruff <william@yossarian.net>
2024-07-30 08:38:58 -04:00
Mike McQuaid
222fe8ef0b
Homebrew 4.3.0 deprecation/disable/removals.
The usual pass of deprecating/disabling/removing code for the next
minor Homebrew release.
2024-05-07 12:18:04 +01:00
Markus Reiter
480e264d9a
Lint Ruby docs. 2024-05-01 11:35:21 +02:00
Markus Reiter
caf87c0336
Warn about undocumented non-private APIs. 2024-05-01 11:35:20 +02:00
Markus Reiter
0f0055ede4
Make documentation @api private by default. 2024-04-26 19:04:20 +02:00
Branch Vincent
4bf8fef5aa
Reapply "formula: configure git/npm to ignore .brew_home"
This reverts commit abf8df38661c4b60f122336d3db3a1a810d3a0e8.
2024-04-23 18:35:55 -07:00
Mike McQuaid
abf8df3866
Revert "formula: configure git/npm to ignore .brew_home" 2024-04-23 16:09:57 +01:00
Branch Vincent
46a3bbe3c5
formula: configure git/npm to ignore .brew_home 2024-04-19 11:45:25 -07:00
Michael Cho
ecb7daba58
language/python: order args for virtualenv_install_with_resources
Add `without`, `start_with`, and `end_with` to allow basic control over
the order that resources are installed so that the situations where we
have to split up `virtualenv_install_with_resources` is reduced.

Co-authored-by: Kevin <apainintheneck@gmail.com>
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
Signed-off-by: Michael Cho <michael@michaelcho.dev>
2024-04-14 22:21:32 -04:00
Michael Cho
f81dcd8c58
go_resource deprecation comments
Signed-off-by: Michael Cho <michael@michaelcho.dev>
2024-04-01 09:00:32 -04:00
Mike McQuaid
e600cc6fef
language/python: tweak Pathname syntax.
Co-authored-by: Markus Reiter <me@reitermark.us>
2024-04-01 08:09:42 +01:00
Michael Cho
7931b3cb12
language/python: enable typed: strict
Signed-off-by: Michael Cho <michael@michaelcho.dev>
2024-03-29 20:14:01 -04:00
Michael Cho
61f8ebc462
language/perl: enable typed: strict
Signed-off-by: Michael Cho <michael@michaelcho.dev>
2024-03-29 20:14:01 -04:00
Michael Cho
fb5306fc35
language/node: enable typed: strict
Signed-off-by: Michael Cho <michael@michaelcho.dev>
2024-03-29 20:13:52 -04:00
Michael Cho
3054b91e80
language/go: enable typed: strict
Also add comment to odeprecate in future. In homebrew/core, only
usage is in deprecated/disabled formulae.

Signed-off-by: Michael Cho <michael@michaelcho.dev>
2024-03-29 18:22:31 -04:00
Bo Anderson
28a80a6ebf
Avoid writable_real? 2024-03-27 06:26:32 +00:00
Mike McQuaid
ea2892f8ee
brew.rb: handle missing args. 2024-03-07 16:20:20 +00:00
Michael Cho
383d774ff7
language/python: add types
Also add `Virtualenv` getters to get `Pathname`s to
the virtualenv's `root` and `site_packages`.

Signed-off-by: Michael Cho <michael@michaelcho.dev>
2024-03-03 14:44:22 -05:00
Issy Long
f4218a6316
Fix RuboCop Performance/MapCompact offenses
- Rename an iterator variable since it would make the line too long.
2024-02-25 22:59:59 +00:00
Issy Long
f682147598
Fix RuboCop Style/RedundantFreeze offenses 2024-01-18 22:20:01 +00:00
Bo Anderson
5692c8ecbf
Fix style violations under newer RuboCop 2023-12-14 05:47:12 +00:00
Bo Anderson
b42256d286
Deprecate, disable & delete code for Homebrew 4.2.0 2023-12-07 23:42:13 +00:00
Douglas Eichelberger
0191af7899 resolve typecheck errors 2023-11-05 08:55:58 -08:00
Elan Ruusamäe
132b763242
Fix python: detected_python_shebang python pattern
"python@" is not a valid dependency, must include something after the "@"
2023-09-06 01:38:58 +03:00
Sam Ford
0b3e3b7270
python: refactor to align Shebang modules
This reworks `Language::Python::Shebang` to use constants for
the shebang regex and max length (like the previous Node commit).
Besides that, this also adds type signatures to the existing methods.
2023-08-15 00:53:41 -04:00
Sam Ford
370e61e504
perl: refactor to align Shebang modules
This primarily reworks `Language::Perl::Shebang` to use constants for
the shebang regex and max length (like the previous Node commit) and
to extract the `RewriteInfo` call into a separate method (like Python
and Node).

Besides that, this also adds type signatures to the methods.
2023-08-15 00:53:41 -04:00
Sam Ford
d1297c0974
node: add shebang rewriting
Formulae that depend on `node` sometimes contain files that use a
shebang like `#!/usr/bin/env node` and this can lead to issues when
the `node` in a user's environment isn't brewed `node`.

For example, some node modules are compiled when the formula is built
but if the user's `node` is a different major version than brew's
`node`, the differing `NODE_MODULE_VERSION` can produce an error when
certain parts of the application are used. The formula may build and
test fine and the issue may only become apparent when more of the
application is exercised.

This adds a `Language::Node::Shebang` module (borrowing from the
existing Perl and Python examples), which allows us to use
`rewrite_shebang detected_node_shebang, ...` in formulae to address
this type of issue.
2023-08-15 00:53:41 -04:00
Branch Vincent
98323cd7e6
python: create venv's --without-pip 2023-07-31 08:51:47 -07:00
Branch Vincent
9597f455aa
formula: add std_pip_args 2023-07-19 20:02:47 -07:00
Bo Anderson
d1b923f314
Introduce UsesFromMacOSDependency
Add Formula#declared_deps and SoftwareSpec#declared_deps
2023-07-04 13:40:55 +01:00
Markus Reiter
a1efaf1864
Merge HeadVersion and NullVersion into Version. 2023-05-09 01:13:54 +02:00
Douglas Eichelberger
24cf6076e8 brew style --fix 2023-04-24 20:42:39 -07:00
Douglas Eichelberger
d7d8f2cacb Revert language mixins back to module_function 2023-04-18 06:17:22 -07:00
Douglas Eichelberger
09c679e75f Refactor module_function to reduce rbi need 2023-04-17 10:37:59 -07:00
David Baumgold
a62543f304 forgot splat 2023-04-01 13:36:58 +02:00
David Baumgold
5f51e1549c unless 2023-04-01 12:36:58 +02:00