6060 Commits

Author SHA1 Message Date
Sean Molenaar
cb23433612
feat: only block cask install on Linux 2024-12-14 15:49:09 +01:00
apainintheneck
9c0987c71c cask/info: update tests 2024-12-12 00:01:30 -08:00
Douglas Eichelberger
69f2d3bf32
Merge branch 'master' into no-ostruct 2024-12-10 11:00:32 -08:00
Sam Ford
270313f649
Pypi: Restore regex support
We recently updated the `Pypi` strategy to use the PyPI JSON API and
the default strategy behavior no longer relies on a regex, so the initial implementation didn't include regex handling. This restores
support for a `livecheck` block regex by updating the `DEFAULT_BLOCK`
logic to handle an optional regex. This allows us to use a regex to
omit parts of the `info.version` value without having to duplicate
the default block logic in a `strategy` block only to use a regex.

This isn't currently necessary for any existing formulae using the
`Pypi` strategy but we have a few that needed a custom regex with
the previous strategy approach, so they may need this functionality
in the future. Besides that, restoring regex support to `Pypi`
ensures that `livecheck`/`strategy` blocks work in a fairly
consistent manner across strategies.
2024-12-08 14:29:44 -05:00
Sam Ford
08c927b6a1
Json: Allow nil regex block argument
This updates the block-handling logic in `Json::versions_from_content`
to naively pass the regex value when the block has two parameters. Up
to now, we have been ensuring that `regex` is not `nil` and this
makes sense with existing usage (the `Crate` strategy's default
block, formulae/cask `strategy` blocks). However, we need to allow a
`nil` `regex` value to make it possible to add an optional `regex`
parameter in the `Pypi::DEFAULT_BLOCK` Proc. This is necessary to
allow the `Pypi` strategy to work with an optional regex from a
`livecheck` block again [without creating an additional
`DEFAULT_BLOCK` variant with a regex parameter].
2024-12-08 14:29:44 -05:00
Douglas Eichelberger
3a4243742f Remove OpenStruct from CLI::Args 2024-12-08 10:27:49 -08:00
Sam Ford
ac4854ef9e
Pypi: Expand test coverage
Among other things, the previous commit added a `provided_content`
paramter to `Pypi::find_versions`, so this takes advantage of that to
expand `Pypi` test coverage to 100%.
2024-12-07 20:44:56 -05:00
Sam Ford
935eb89eca
Pypi: Rework to use Json::find_versions
This reworks the new `Pypi` JSON API implementation to use
`Json::find_versions` in `Pypi::find_versions`, borrowing some of the
approach from the `Crate` strategy.

Besides that, this pares down the fields in the
`::generate_input_values` return hash to only `:url`, as we're not
using a generated regex to match version information in this setup.

This adds a `provided_content` parameter to `::find_versions` as part
of this process and I will expand the `Pypi` tests to increase
coverage (like the `Crates` tests) in a later PR. 75% of `Pypi` checks
are failing at the moment (with some returning inaccurate version
information), so the current priority is getting this fix merged in
the short-term.
2024-12-07 20:40:55 -05:00
Rui Chen
d49e01b82b
fix(livecheck/pypi): update to use json endpoint to query version
Signed-off-by: Rui Chen <rui@chenrui.dev>
2024-12-07 02:00:18 -05:00
Ruoyu Zhong
64edbe6b79
os/mac/hardware/cpu: add M4 Pro/Max
Sources:
- https://github.com/AsahiLinux/docs/wiki/Codenames
- MacOSX15.2.sdk from Xcode 15.2 RC
2024-12-06 16:06:09 +08:00
William Woodruff
057a6c5f9b
add multi subject test
Signed-off-by: William Woodruff <william@yossarian.net>
2024-12-05 14:26:30 -05:00
Mike McQuaid
84225d0120
pkg_version: make typed: strict
This required:
- adding signatures/types where missing
- ensuring that we respect the signature of `Version.new`
- remove some non-Sorbet type checks
- fixing the exception in tests
- removing some tests now caught by Sorbet
- fixing `Formula#prefix` so it works as intended with correct type
  usage
2024-12-05 14:01:37 +00:00
Ruoyu Zhong
36d06c5075
Merge remote-tracking branch 'origin/master' into systemd-quote 2024-12-04 18:01:10 +08:00
Ruoyu Zhong
46fab4458a
test/service_spec: fix tests 2024-12-04 03:02:24 +08:00
Ruoyu Zhong
bba67ec02e
service: fix systemd command line quoting
Fixes #18802 (affected formulae still need rebuilding).
2024-12-04 02:57:11 +08:00
Ruoyu Zhong
15146b2b67
utils/service: add systemd_quote helper
We need a way to escape systemd command lines properly as systemd treats
unrecognised escape sequences as separate literal characters. This helper
function does that.
2024-12-04 02:57:08 +08:00
Sam Ford
79e20b3512
Standardize livecheck block language formatting 2024-12-02 10:13:04 -05:00
Sam Ford
01cb74e525
livecheck: clarify livecheckable language
Formulae, casks, and resources have a `#livecheckable?` method that
indicates whether they contain a `livecheck` block. This is intended
to be read as "has a livecheckable?", not "is livecheckable?" (as
livecheck can find versions for some packages/resources without a
`livecheck` block). Unfortunately, correct understanding of this
method's behavior [outside of documentation] relies on historical
knowledge that few people possess, so this is often confusing to
anyone who hasn't been working on livecheck since 2020.

In the olden days, a "livecheckable" was a Ruby file containing a
`livecheck` block (originally a hash) with a filename that
corresponded to a related formula. The `livecheck` blocks in
livecheckable files were integrated into their respective formulae in
August 2020, so [first-party] livecheckables ceased to exist at that
time. From that point forward, we simply referred to these as
`livecheck` blocks.

With that in mind, this clarifies the situation by replacing
"livecheckable" language. This includes renaming `#livecheckable?` to
`#livecheck_defined?`, replacing usage of "livecheckable" as a noun
with "`livecheck` block", replacing "livecheckable" as a boolean with
"livecheck_defined", and replacing incorrect usage of "livecheckable"
as an adjective with "checkable".
2024-12-02 10:13:03 -05:00
Bo Anderson
7308c105a4
cask: try fix a couple of permission edge cases under multi-user 2024-11-25 17:36:47 +00:00
Mike McQuaid
4a77cd1e2f
Merge pull request #18812 from Homebrew/bump-skip-pr-checking-when-up-to-date
bump: skip PR checking when up to date or livecheck fails
2024-11-25 08:55:08 +00:00
Mike McQuaid
56780f3355
Merge pull request #18806 from Homebrew/rm-uses-ostruct
Remove OpenStruct from Uses cmd
2024-11-25 08:51:07 +00:00
Mike McQuaid
cf75c48951
Merge pull request #18809 from reitermarkus/download-lock-interrupt
Fix incorrect download locking.
2024-11-25 08:36:58 +00:00
Sam Ford
918206e1fd
BumpVersionParser: expand tests
This expands test coverage for `BumpVersionParser`, bringing line
coverage to 100% and branch coverage to 95.45%. This is the best we
can do for branch coverage, as Sorbet will catch an invalid argument
type before the method is executed, so we can't exercise the method
in a test to get 100% coverage.
2024-11-24 20:50:38 -05:00
Sam Ford
a89457fcb9
bump: skip PR checking when up to date
`brew bump` will check for PRs related to a package even if the
package version and livecheck version are the same. We're presumably
only interested in related PRs when the livecheck version differs, so
we can reduce GitHub API requests by skipping the check(s) when the
versions are equal. We use `bump` in `autobump` workflows, so this
should help with recent rate limiting issues (e.g., 3203 out of 3426
autobumped formulae were up to date in a recent run).

This also reworks the output for duplicate PRs, making it clear when
`bump` skipped checking PRs (as printing "none" would suggest that
PRs were checked) and only printing the "Maybe duplicate" information
when checked. This makes it a little easier to understand what `bump`
has done internally from the output.
2024-11-24 20:50:37 -05:00
Douglas Eichelberger
ccfc8bfbe6 Remove :final from Requirement#satisfied? sig 2024-11-24 15:49:49 -08:00
Markus Reiter
4bd75d4235
Fix incorrect download locking. 2024-11-24 00:03:31 +01:00
Douglas Eichelberger
89e640c567 Remove OpenStruct from Uses cmd 2024-11-22 21:04:51 -08:00
Douglas Eichelberger
33d9267d7d Enforce finalized sorbet methods 2024-11-21 18:34:11 -08:00
Mike McQuaid
4d4531c19d
Revamp installed_on_request handling
- `reinstall` and `upgrade` no longer mark as installed on request,
  with or without names specified, but preserve the version from the
  tab instead
- default `install_on_request` to `false` rather than `true`
- only set installed in request in a tab if it's missing rather than
  false

Co-authored-by: Michael Cho <michael@michaelcho.dev>
2024-11-19 08:39:55 +00:00
Mike McQuaid
50cac383c7
Merge pull request #18784 from Homebrew/uninstall-unignore-deps
uninstall: don't ignore deps even for developers
2024-11-18 08:50:04 +00:00
Bevan Kay
597f5fa018
generate-cask-ci-matrix: fix incorrect error raised 2024-11-18 12:59:56 +11:00
Ruoyu Zhong
f2cb33011a
uninstall: don't ignore deps even for developers
This was discussed a while back on Slack. The idea behind this is that
ignoring dependencies during `brew uninstall` makes it too easy to break
things, even for developers. Those who know what they are doing can, and
IMO should, always use the `--ignore-dependencies` flag.
2024-11-18 00:13:12 +08:00
Mike McQuaid
22fd47b268
Merge pull request #18779 from kiracus/m4
Add M4 processor
2024-11-17 08:46:22 +00:00
Kiracus
46389dee24 cpu_spec.rb: add Apple M4 2024-11-16 16:27:11 -08:00
Bevan Kay
dd3ad5bb56
add generate-cask-ci-matrix command 2024-11-16 22:19:09 +11:00
Mike McQuaid
284035d624
Merge pull request #18733 from alebcay/deprecate-disable-replacement
deprecate_disable: support optional replacement parameter
2024-11-11 09:49:45 +00:00
Caleb Xu
33a9d24111
linux/hardware/cpu: add some missing AMD CPUs 2024-11-09 21:54:05 -05:00
Caleb Xu
215fc85579
deprecate_disable: support optional replacement parameter 2024-11-08 15:49:00 -05:00
Douglas Eichelberger
ba3f426726 clean up fixture 2024-11-07 13:00:38 -08:00
Douglas Eichelberger
ebe1e504da Change command output instead 2024-11-07 11:26:19 -08:00
Douglas Eichelberger
acb4eddaca Allow multiple JSON outputs 2024-11-07 11:08:13 -08:00
Michael Cho
c2d3f126ed
language/python: link manpages by default 2024-11-05 11:24:13 -05:00
Michael Cho
f18e1ea86a
Merge pull request #18614 from Homebrew/inreplace-non-global
utils/inreplace: allow non-global substitution
2024-10-31 14:05:27 -04:00
Carlo Cabrera
a7548f009e
Merge pull request #18674 from Homebrew/kernel-major-versions 2024-10-31 15:34:35 +08:00
Carlo Cabrera
42dd0acdc9
macos_version: define a method instead 2024-10-31 15:15:02 +08:00
hyuraku
c60e80f0a9 remove Cask::Config.explicit_s spec 2024-10-30 22:20:56 +09:00
Michael Cho
f82c58383c
utils/inreplace: allow non-global substitution
Also increase test coverage
2024-10-29 20:15:47 -04:00
Bo Anderson
91f3671b16
Merge pull request #18639 from Homebrew/improve_parallel_tests
spec_helper: improve parallel test handling.
2024-10-27 16:34:49 +00:00
Bo Anderson
46cb9ec947
spec_helper: clarify comment and scope to all OS 2024-10-27 15:45:46 +00:00
Mike McQuaid
e4fb33928f
Merge pull request #18613 from pkryger/allow_homebrew_prefix_in_external_patches
Allow HOMEBREW_PREFIX replacement in external patches
2024-10-27 07:11:17 -07:00