-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Allow env vars to specify custom extensions to build #1910
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
Allow env vars to specify custom extensions to build #1910
Conversation
This would be the first step to support build backends other than setuptools and make setup.py a little bit independent of the backend Signed-off-by: Masaki Kozuki <[email protected]>
4edc2f9
to
7d80b19
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds environment-variable support for enabling Apex extensions under PEP 517 and allows configuring parallel build jobs via APEX_PARALLEL
.
- Introduce
ENV_TO_FLAG
,FLAG_TO_ENV
, andhas_flag
to drive extension modules from env vars. - Replace hardcoded
sys.argv
checks withhas_flag
for each extension flag. - Add
APEX_PARALLEL
environment variable handling for the--parallel
build option.
Comments suppressed due to low confidence (3)
setup.py:49
- The new environment-variable to flag mapping and
has_flag
logic should have accompanying tests to verify that flags are correctly appended or skipped based on env settings.
for env_var, flag in ENV_TO_FLAG.items():
setup.py:85
- Add a docstring for
has_flag
to explain that it checks bothsys.argv
, the specific environment variable, andAPEX_ALL_CONTRIB_EXT
for contrib flags.
def has_flag(flag, env_var):
setup.py:1006
- The annotation
int | None
requires Python 3.10+ syntax and will fail to parse on earlier versions; useOptional[int]
fromtyping
for broader compatibility.
parallel: int | None = None
Signed-off-by: Masaki Kozuki <[email protected]>
Signed-off-by: Masaki Kozuki <[email protected]>
Signed-off-by: Masaki Kozuki <[email protected]>
LGTM! With this PR in, what is the default/recommended installation command? |
Env vars would be more modern than the apex's conventional install command. |
This would be the first step to support build backends other than setuptools and make setup.py a little bit independent of the backend, i.e., better compatibility with PEP517 and relevant PEPs.
With this we would be able to support some commands that have not been functioning well e.g.