Skip to content

Pass build options as environment variables (support pyproject.toml migration in CuPy)#414

Merged
kmaehashi merged 25 commits intocupy:mainfrom
EarlMilktea:envvars
May 23, 2025
Merged

Pass build options as environment variables (support pyproject.toml migration in CuPy)#414
kmaehashi merged 25 commits intocupy:mainfrom
EarlMilktea:envvars

Conversation

@EarlMilktea
Copy link
Member

Related to cupy/cupy#9079 .

builder/agent.py Outdated
Comment on lines +74 to +80
m = _KV_RE.match(kv)
if m is None:
raise ValueError(f'Malformed --env argument: {kv}')
k = str(m.group(1))
if k in env:
raise ValueError(f'Duplicate environment variable: {k}')
env[k] = str(m.group(2))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's better to keep it as simple as:

pair = kv.split('=', 2)
if len(pair) != 2:
    raise ...
env[pair[0]] = pair[1]

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merged in 77307f9 (len(...) check is further simplified as k, v unpacking) .

EarlMilktea and others added 4 commits May 20, 2025 20:52
Co-authored-by: Kenichi Maehashi <939877+kmaehashi@users.noreply.github.com>
Co-authored-by: Kenichi Maehashi <939877+kmaehashi@users.noreply.github.com>
Co-authored-by: Kenichi Maehashi <939877+kmaehashi@users.noreply.github.com>
@EarlMilktea EarlMilktea requested a review from kmaehashi May 20, 2025 12:01
kmaehashi
kmaehashi previously approved these changes May 21, 2025
@kmaehashi
Copy link
Member

/test mini

@kmaehashi
Copy link
Member

/test mini

@kmaehashi
Copy link
Member

/test mini

@kmaehashi kmaehashi changed the title Migrate to pyproject.toml Pass build options as environment variables (support pyproject.toml migration in CuPy) May 21, 2025
@kmaehashi
Copy link
Member

cupy/cupy#9079 has merged.

/test mini

@EarlMilktea
Copy link
Member Author

/test mini

@kmaehashi
Copy link
Member

/test mini

@kmaehashi
Copy link
Member

/test mini

@kmaehashi
Copy link
Member

/test mini

@kmaehashi kmaehashi merged commit 4d572d9 into cupy:main May 23, 2025
3 checks passed
@kmaehashi kmaehashi self-assigned this May 23, 2025
chainer-ci pushed a commit to chainer-ci/cupy-release-tools that referenced this pull request May 23, 2025
@EarlMilktea EarlMilktea deleted the envvars branch May 23, 2025 01:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants