Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(pypi): rename config settings and improve docs #2556

Merged
merged 1 commit into from
Jan 12, 2025

Conversation

aignas
Copy link
Collaborator

@aignas aignas commented Jan 11, 2025

Before the PR the config_setting names where following an internal
logic and those names would be leaking into the error messages when no
match is found. I thought that the names thus should be improved and
maybe made more similar to the whl filename parts that they are
derived from.

As part of this change I have also added more docs and added them to
sphinxdocs in the hopes that this documentation helps maintainers and
users looking at error messages alike.

Summary:

  • Make names more similar to the whl filenames.
  • Instead of having osx_<cpu>_universal2 config settings for each
    cpu value, have a single osx_universal2 config setting.
  • Stop creating redundant/unused config settings
  • Refactor the _dist_config_setting code to be simpler and create
    fewer targets by using a clever trick for the whl config setting
    flag value usage.

The stats:

$ bazel query //tests/pypi/config_settings/... | rg ":(|_)is" | wc -l
2223
$ bazel query @dev_pip//_config/... | wc -l
1982

$ bazel query //tests/pypi/config_settings/... | rg ":(|_)is" | wc -l
1780
$ bazel query @dev_pip//_config/... | wc -l
1066

Work towards #260

Before the PR the `config_setting` names where following an internal
logic and those names would be leaking into the error messages when no
match is found. I thought that the names thus should be improved and
maybe made more similar to the `whl` filename parts that they are
derived from.

As part of this change I have also added more docs and added them to
sphinxdocs in the hopes that this documentation helps maintainers and
users looking at error messages alike.

Summary:
* Make names more similar to the whl filenames.
* Instead of having `osx_<cpu>_universal2` config settings for each
  `cpu` value, have a single `osx_universal2` config setting.
* Stop creating redundant/unused config settings
* Refactor the `_dist_config_setting` code to be simpler and create
  fewer targets by using a clever trick for the `whl` config setting
  flag value usage.

The stats:
```
$ bazel query //tests/pypi/config_settings/... | rg ":(|_)is" | wc -l
2223
$ bazel query @dev_pip//_config/... | wc -l
1982

$ bazel query //tests/pypi/config_settings/... | rg ":(|_)is" | wc -l
1780
$ bazel query @dev_pip//_config/... | wc -l
1066
```

Work towards bazelbuild#260
@aignas aignas added this pull request to the merge queue Jan 12, 2025
Merged via the queue into bazelbuild:main with commit 51f1047 Jan 12, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants