Skip to content

Commit

Permalink
fix: swap default for macos-max-compat
Browse files Browse the repository at this point in the history
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
  • Loading branch information
henryiii committed May 1, 2024
1 parent 2ec422c commit 7d1d3c5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion backend/src/hatchling/builders/wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ def strict_naming(self) -> bool:
@property
def macos_max_compat(self) -> bool:
if self.__macos_max_compat is None:
macos_max_compat = self.target_config.get('macos-max-compat', True)
macos_max_compat = self.target_config.get('macos-max-compat', False)
if not isinstance(macos_max_compat, bool):
message = f'Field `tool.hatch.build.targets.{self.plugin_name}.macos-max-compat` must be a boolean'
raise TypeError(message)
Expand Down
2 changes: 1 addition & 1 deletion docs/plugins/builder/wheel.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The builder plugin name is `wheel`.
| `shared-scripts` | | A mapping similar to the [forced inclusion](../../config/build.md#forced-inclusion) option corresponding to the `scripts` subdirectory within the standard [data directory](https://packaging.python.org/en/latest/specifications/binary-distribution-format/#the-data-directory) that will be installed in a given Python environment, usually under `Scripts` on Windows or `bin` otherwise, and would normally be available on PATH |
| `extra-metadata` | | A mapping similar to the [forced inclusion](../../config/build.md#forced-inclusion) option corresponding to extra [metadata](https://peps.python.org/pep-0427/#the-dist-info-directory) that will be shipped in a directory named `extra_metadata` |
| `strict-naming` | `true` | Whether or not file names should contain the normalized version of the project name |
| `macos-max-compat` | `true` | Whether or not on macOS, when build hooks have set the `infer_tag` [build data](#build-data), the wheel name should signal broad support rather than specific versions for newer SDK versions.<br><br>Note: The default will become `false`, and this option eventually removed, sometime after consumers like pip start supporting these newer SDK versions. |
| `macos-max-compat` | `false` | Whether or not on macOS, when build hooks have set the `infer_tag` [build data](#build-data), the wheel name should signal broad support rather than specific versions for newer SDK versions.<br><br>Note: This option will eventually be removed. |
| `bypass-selection` | `false` | Whether or not to suppress the error when one has not defined any file selection options and all heuristics have failed to determine what to ship |

## Versions
Expand Down
6 changes: 3 additions & 3 deletions tests/backend/builders/test_wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -602,13 +602,13 @@ class TestMacOSMaxCompat:
def test_default(self, isolation):
builder = WheelBuilder(str(isolation))

assert builder.config.macos_max_compat is builder.config.macos_max_compat is True
assert builder.config.macos_max_compat is builder.config.macos_max_compat is False

def test_correct(self, isolation):
config = {'tool': {'hatch': {'build': {'targets': {'wheel': {'macos-max-compat': False}}}}}}
config = {'tool': {'hatch': {'build': {'targets': {'wheel': {'macos-max-compat': True}}}}}}
builder = WheelBuilder(str(isolation), config=config)

assert builder.config.macos_max_compat is False
assert builder.config.macos_max_compat is True

def test_not_boolean(self, isolation):
config = {'tool': {'hatch': {'build': {'targets': {'wheel': {'macos-max-compat': 9000}}}}}}
Expand Down

0 comments on commit 7d1d3c5

Please sign in to comment.