4561 Commits

Author SHA1 Message Date
Mike McQuaid
034d4ac82b
Merge pull request #11958 from Homebrew/remove_if_os_rubocop
rubocops/lines: remove OS.mac?/OS.linux? check.
2021-09-02 14:07:41 +01:00
Mike McQuaid
227a96fd7f
rubocops/lines: remove OS.mac?/OS.linux? check.
This will be reimplemented in https://github.com/Homebrew/brew/pull/11955
but this allows us to merge the homebrew-core changes before that PR is
merged.

Closes https://github.com/Homebrew/brew/pull/11946
2021-09-02 13:50:23 +01:00
Bo Anderson
9e42ddb011
sandbox: fallback to tput for winsize 2021-09-01 21:09:23 +01:00
Benjamin Bolton
632b96780f
Test for single-quote service wrapper 2021-09-01 11:54:38 -06:00
Rylan Polster
5d536d66fc
Rename HOMEBREW_JSON_CORE to HOMEBREW_INSTALL_FROM_API 2021-08-27 00:24:15 -04:00
Rylan Polster
8690d661fd
Merge pull request #11859 from Rylan12/cask-json
Allow casks to be installed using the `cask-source` API
2021-08-26 23:58:51 -04:00
Rylan Polster
e08d5f113c
Make Homebrew::API::Versions#latest_cask_version tests macOS-only 2021-08-26 23:35:33 -04:00
Rylan Polster
186c839525
Fix tests 2021-08-26 23:21:48 -04:00
FnControlOption
326321c1fd cli/parser: allow commands that look like options 2021-08-25 14:34:57 -07:00
Rylan Polster
c3a8b3841e
Only include differring versions
Move the resetting of `MacOS.version` to an `ensure` block.

Fix the tests by adding a test OS and new fixture that has a
different version for that test OS.
2021-08-25 10:30:38 -04:00
Sam Ford
e65c9d02ab
PageMatch: Expand #find_versions tests 2021-08-19 16:07:53 -04:00
Sam Ford
26821301e7
livecheck: move url/regex generation into methods 2021-08-17 18:03:40 -04:00
Sam Ford
13b349b4ae
Refactor #find_versions parameters in strategies 2021-08-16 12:01:32 -04:00
Rylan Polster
c32223a89c
Add cask-source API 2021-08-14 01:59:04 -04:00
Sam Ford
7e07010f06
Improve standardization of strategy tests 2021-08-11 19:05:59 -04:00
Sam Ford
56dd89114d
Standardize valid strategy block return types
Valid `strategy` block return types currently vary between
strategies. Some only accept a string whereas others accept a string
or array of strings. [`strategy` blocks also accept a `nil` return
(to simplify early returns) but this was already standardized across
strategies.]

While some strategies only identify one version by default (where a
string is an appropriate return type), it could be that a strategy
block identifies more than one version. In this situation, the
strategy would need to be modified to accept (and work with) an
array from a `strategy` block.

Rather than waiting for this to become a problem, this modifies all
strategies to standardize on allowing `strategy` blocks to return a
string or array of strings (even if only one of these is currently
used in practice). Standardizing valid return types helps to further
simplify the mental model for `strategy` blocks and reduce cognitive
load.

This commit extracts related logic from `#find_versions` into
methods like `#versions_from_content`, which is conceptually similar
to `PageMatch#page_matches` (renamed to `#versions_from_content`
for consistency). This allows us to write tests for the related code
without having to make network requests (or stub them) at this point.
In general, this also helps to better align the structure of
strategies and how the various `#find_versions` methods work with
versions.

There's still more planned work to be done here but this is a step
in the right direction.
2021-08-11 19:05:57 -04:00
Bo Anderson
9686ebe355
os/mac/diagnostic: prevent some double diagostic failures 2021-08-11 14:19:22 +01:00
Rylan Polster
90bbe8bb03
Merge pull request #11831 from Rylan12/api-cleanup
Refactor API methods
2021-08-09 12:32:55 -04:00
Rylan Polster
ab8aea0652
Fix tests 2021-08-09 11:00:00 -04:00
Connor Mann
ed7066c183
Style fix 2021-08-06 22:35:16 -04:00
Connor Mann
1581a29b28
Update tests 2021-08-06 22:34:30 -04:00
Rylan Polster
a8c03c1cc6
Restrict HOMEBREW_JSON_CORE use in tests 2021-08-06 11:52:21 -04:00
Rylan Polster
b1215800d4
Fix tests 2021-08-06 11:42:55 -04:00
Rylan Polster
2afbd38dde
Remove extra comment 2021-08-06 04:35:45 -04:00
Rylan Polster
737dd1654b
Refactor API methods 2021-08-06 04:31:27 -04:00
Connor Mann
3dde12c634
Handle only HEAD kegs in to_latest_kegs 2021-08-04 18:51:39 -04:00
Sam Ford
a970780851
livecheck: allow nil return from strategy blocks 2021-08-02 18:33:34 -04:00
Sam Ford
ddde0f7589
livecheck: allow inheriting from a formula/cask 2021-08-02 09:12:22 -04:00
Sean Molenaar
869b0ea519
Formula: use opt_prefix for service helpers 2021-07-26 11:11:34 +02:00
Rylan Polster
b18bbacced
Merge pull request #11714 from Rylan12/developer
Add `brew developer` command
2021-07-21 09:53:04 -04:00
Rylan Polster
27ba803bb5
Remove need for HOMEBREW_NO_DEV_CMD_MESSAGE 2021-07-20 11:47:31 -04:00
Adrian Ho
a14d8924de extract: ignore syntax errors during load 2021-07-20 09:57:04 +08:00
Rylan Polster
41b0bf7bbb
Add developer command 2021-07-14 01:55:00 -04:00
Rylan Polster
e344cb6aff
Merge pull request #11648 from Rylan12/homebrew-json
Install formulae from JSON files
2021-07-13 02:54:49 -04:00
Rylan Polster
1973e72015
BottleAPI: fix tests 2021-07-13 02:29:03 -04:00
Rylan Polster
68c2be5c17
BottleAPI: add tests 2021-07-12 03:03:29 -04:00
Mike McQuaid
5659d74ff5
Merge pull request #11646 from chenrui333/add-test-epub
fixtures: add test.epub
2021-07-09 17:15:25 +01:00
Rui Chen
b28f14aac2 fixtures: add test.epub
Signed-off-by: Rui Chen <rui@chenrui.dev>
2021-07-09 11:39:58 -04:00
Nanda H Krishna
5ccfbcd1d2
Autocorrect style issues with brew style --fix 2021-07-08 12:36:39 +05:30
Mike McQuaid
1680ddb267
utils/repology: temporarily disable functionality.
Doesn't work with system `curl` currently.
2021-06-30 09:20:56 +01:00
Mike McQuaid
a4c2e0e1b3
Tweak BuildPulse/rspec-retry logic
BuildPulse is trying to find flaky tests for us but, given the previous
model of using `rspec-retry`, it would rarely find them. Instead, let's
try to always rerun `brew tests` multiple times, report to BuildPulse
each time (by moving the reporting logic into `brew tests`) and disable
`rspec-retry` when using BuildPulse.

While we're here, let's enable `rspec-retry` locally so we don't have
flaky tests biting maintainers/contributors there.
2021-06-29 12:43:47 +01: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
Michael Cho
d304c84f2a
test/utils/github_spec: fix artifact number 2021-06-25 11:36:13 -07:00
Alexander Bayandin
d55cbeac78
github_spec: Update PR number with unexpired artifacts 2021-06-24 13:29:44 +01:00
Sam Ford
0752d25125
OS::Mac: Move version methods into ::Version 2021-06-23 09:03:46 -04:00
Mike McQuaid
08c96df947
release_notes: refactor/cleanup.
This was failing for me locally so I've made some fixes:
- remove the `markdown` flag (as it's the only path now)
- refactor the generation to not use intermediate variables
- discard more weird cases rather than erroring
- exclude @Homebrew changes (e.g. from bots) because we don't care about
  these in the release notes
2021-06-21 14:25:01 +01:00
Rylan Polster
46164a3054
Merge pull request #11555 from Rylan12/remove-homebrew-core
Allow for homebrew/core to be untapped
2021-06-18 16:05:24 -04:00
Alexander Bayandin
7c962c0aa8
audit_spec: simplify tests 2021-06-18 17:34:43 +01:00
Alexander Bayandin
43d67816ea
audit_conflicts: enable for third-party taps 2021-06-18 17:34:42 +01:00
Alexander Bayandin
1ddb6ef584
audit: do not allow aliases and renames in formula conflicts 2021-06-18 17:34:42 +01:00