74 Commits

Author SHA1 Message Date
Bo Anderson
5692c8ecbf
Fix style violations under newer RuboCop 2023-12-14 05:47:12 +00:00
Sam Ford
4314daa2cf
python: expand and refactor tests
This brings coverage of `Language::Python::Shebang` to 100%.
2023-08-15 00:53:41 -04:00
Sam Ford
87935f8d0f
perl: expand and refactor tests
This brings coverage of `Language::Perl::Shebang` to 100%.
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
Douglas Eichelberger
9075cbae62 brew style --fix 2023-04-21 09:58:50 -07:00
Douglas Eichelberger
ac1e6ded9a git grep -l '# typed: false' | xargs gsed -i 's|# typed: false||g' 2023-04-21 09:57:47 -07:00
Douglas Eichelberger
df5c5842cc Fix tests 2023-04-17 11:30:12 -07:00
Issy Long
5aa24832df
brew style --fix 2023-04-11 21:12:13 +01:00
David Baumgold
64ff386744 fix tests 2023-04-01 14:32:27 +02:00
David Baumgold
38a2703aa7 Python: allow --no-build-isolation for pip install 2023-04-01 11:31:29 +02:00
Douglas Eichelberger
21b4251a67 Resolve language/python/virtualenv_spec violation 2023-01-22 17:26:44 -08:00
Branch Vincent
db6d3156f2
python: reinstate pip's --no-binary 2022-12-19 23:25:53 -08:00
Tom Forbes
173e6bf1d3 Fix tests 2022-12-10 15:02:18 +00:00
Michael Cho
776d6b934d
language/python: optionally link manpages 2022-12-08 17:03:59 -08:00
Mike McQuaid
59f4b5226a
tests: test on Ubuntu 18.04. 2022-11-09 14:45:43 +00:00
Carlo Cabrera
98a53e4781
language/python: support python3 from PATH in #detected_python_shebang
Some formulae are flexible about the version of Python3 that they use.
However, when we use `#detected_python_shebang` on these formulae, they
become coupled to the specific version of Python3 declared in the
formula.

This is harmful because
1. it prevents us from using `uses_from_macos "python"` even in formulae
   where we should be able to
2. it forces us to rebuild the formula whenever we make changes to the
   Python dependency when nothing but the shebang would have changed as
   a consequence of the rebuild

For an example of this, see Homebrew/homebrew-core#107905.

I'd also like to do this to get rid of some really terrible hacks we
have in `glib-utils` as a means of decoupling `glib` from the specific
versioned Python dependency it used to have.

See Homebrew/homebrew-core#103916, or Homebrew/homebrew-core#106045 for
a proposal to give the same treatment to `gobject-introspection`.
2022-08-13 01:11:09 +08:00
Carlo Cabrera
6d07c6eaa0
tests: update language/python/shebang spec 2022-08-09 22:38:05 +08:00
Issy Long
72e48024f0
Fix (auto-correct) RuboCop Rspec/BeEq offenses 2022-03-01 00:10:14 +00:00
Carlo Cabrera
3d3b9874f9
language/python: create venvs with access to system site packages
A user may wish to use two use two brew-installed Python packages
together. For example, one might want to `import numpy` when using
`jupyterlab` or `ptpython`.

Currently, the only ways to do this I'm aware of is with some hacking of
`PYTHONPATH` or the creation of `.pth` files in a formula's prefix.

A better solution is to allow the virtualenvs that `brew` creates to
have access to system site-packages by default, so that `import numpy`
inside `ptpython` or `jupyterlab` just works.

Partially resolves Homebrew/homebrew-core#76950.
2021-06-28 03:20:03 +01:00
Misty De Meo
c0a02442d9
Revert "language/java: use shortened brew paths"
This reverts commits 318175cfe2b23328f1b5f13812fd59cfd45fe1dc,
e7ab760392b9691a6c730b7e0d660b7874969e70 and
3b35af63f608438b1882756feca94a6ebdd0d6a3 (PR #11537).
2021-06-17 20:29:43 -07:00
Caleb Xu
e7ab760392
extend/pathname: use shortened brew paths 2021-06-15 09:58:46 -04:00
Bo Anderson
8db3c6bfd0
language/perl: use versioned shebang 2021-05-10 05:50:08 +01:00
Bo Anderson
20ff68a425
Fix brew style. 2021-03-17 20:45:44 +00:00
Dustin Rodrigues
c8e99e5185
python: stop passing no-user flag on installation 2021-02-19 12:49:10 -05:00
Carlo Cabrera
d3507d9899
test/language/java_spec: test both Mac and Linux 2021-02-02 15:05:29 +00:00
Rylan Polster
3b8fa5a7af
Merge pull request #10466 from Rylan12/rubocop-reduce-todo
Reduce rubocop violations in tests
2021-02-02 08:23:36 -05:00
Carlo Cabrera
234c1f14b8
java_spec: fix tests
The tests need to match the changes reverted in d6bba1c4938ea9c9a9d58ba2f209775dd71a8537.
2021-02-02 12:15:15 +00:00
Rylan Polster
d5d7b6c3db
style: remove RSpec/MultipleDescribes violations
Co-authored-by: Nanda H Krishna <nanda.harishankar@gmail.com>
2021-02-01 20:30:51 -05:00
Rylan Polster
af40e072b0
style: remove RSpec/NamedSubject violations 2021-02-01 20:30:51 -05:00
Mike McQuaid
d6957a3acb
Homebrew 3.0.0 deprecations/disables 2021-01-29 19:50:24 +00: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
Mike McQuaid
d496f5c121
Deprecations for Homebrew 2.6.0
Do the usual deprecate/disable dance for the Homebrew 2.6.0 release.

Not to be merged until the next release will definitely be 2.6.0.
2020-11-24 16:44:02 +00:00
Mike McQuaid
35db40fe25
Disable Java requirement versions on Big Sur
It would be possible to work around this but I'm not convinced it's
worth it given https://github.com/Homebrew/homebrew-core/issues/63290

Fixes #9194
2020-11-19 14:03:57 +00:00
Markus Reiter
549763d594 Don't create package.json in current directory. 2020-11-18 08:40:59 +01:00
Dustin Rodrigues
027419effe test/language/node: add test for prepare/prepack removal 2020-11-05 21:12:41 -05:00
Diogo Azevedo
35a7e336be
node: add support for npm 7
Co-Authored-By: Mike McQuaid <mike@mikemcquaid.com>
2020-10-24 15:26:36 +02:00
Markus Reiter
24ae318a3d Move type annotations into files. 2020-10-10 14:59:39 +02:00
miccal
86a838c03f test/language/java_spec: drop version to 1.6+ 2020-09-17 14:12:22 +08:00
Bo Anderson
3955e7e13b language/test: add shebang tests 2020-03-27 19:18:25 +00:00
EricFromCanada
b681d64e59 version: handle -stable in tag 2020-02-28 14:57:28 -05:00
Mike McQuaid
36dbad3922
Add frozen_string_literal to all files. 2019-04-20 13:27:36 +09:00
Shaun Jackman
e8b22690a0 Fix Language::Java::java_home_env for Linux
/usr/libexec/java_home is specific to macOS.
Language::Java::java_home_cmd is not implemented on Linux and raises
NotImplementedError.

Add private Language::Java::java_home_shell and use it instead of java_home_cmd.
Add public Language::Java::java_home for use by formulae.
2018-11-29 12:50:31 -08:00
Jonathan Chang
3ce4caeb1a Add tests for language/python 2018-09-24 17:13:51 -04:00
Mike McQuaid
5e1806e796 test: rubocop-rspec style auto-corrects.
There’s too many warnings to start enabling `rubocop-rspec` by default
but let’s at least apply the cleanups it does automatically.
2018-03-25 13:30:37 +01:00
Markus Reiter
9bee9ca575 Use “squiggly” heredocs. 2017-10-18 14:39:09 +02:00
Markus Reiter
2ad3a87045 Silence all specs by default. 2017-07-29 20:25:37 +02:00
Mike McQuaid
9f6762d958 language/node: general cleanup.
- Avoid using a temporary variable where not necessary
- Use fewer, better stubs in the tests to avoid warnings and better
  test the implemented functionality.
2017-07-07 15:11:41 +01:00