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

Customize install #11

Merged
merged 1 commit into from
Dec 7, 2024
Merged

Customize install #11

merged 1 commit into from
Dec 7, 2024

Conversation

mbway
Copy link
Collaborator

@mbway mbway commented Dec 6, 2024

  • Replaces the limited site install --preset options with full parsing of maturin commands
  • automatic detection of when --uv is required (site install --no-detect-uv to disable).
  • automatic --color always when not specified
  • enable/disable project or rs file importer with --project-importer/--no-project-importer and --rs-file-importer/--no-rs-file-importer

eg:

python -m maturin_import_hook site install \
    --force --no-rs-file-importer --args="--release --uv --features feature1,feature2 -- --cfg foo"

writes the following:

...
    maturin_import_hook.install(
        settings=MaturinSettings(
            release=True,
            features=['feature1', 'feature2'],
            color=True,
            rustc_flags=['--cfg', 'foo'],
            uv=True
        ),
        enable_project_importer=True,
        enable_rs_file_importer=False,
    )

the MaturinDevelopSettings and MaturinBuildSettings are merged with MaturinSettings as inheritance was not really the correct tool. With the inheritance approach it was impossible to set both maturin build and maturin develop settings simultaneously.

@mbway mbway force-pushed the customize_install branch from 98f15fc to 672e072 Compare December 6, 2024 23:41
@mbway mbway self-assigned this Dec 6, 2024
@mbway mbway requested a review from messense December 6, 2024 23:45
@mbway mbway force-pushed the customize_install branch from 672e072 to 598f536 Compare December 7, 2024 00:54
@mbway mbway marked this pull request as ready for review December 7, 2024 00:54
@mbway mbway mentioned this pull request Dec 7, 2024
@messense messense merged commit f5ae65c into PyO3:main Dec 7, 2024
5 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