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

Small Improvements #5

Merged
merged 6 commits into from
Jun 17, 2024
Merged

Small Improvements #5

merged 6 commits into from
Jun 17, 2024

Conversation

mbway
Copy link
Collaborator

@mbway mbway commented Jun 16, 2024

Miscellaneous maintenance and small features. I can split these out into separate PRs if you prefer.

Medium

  • site installation
    • handle installation into usercustomize.py
    • provide presets so the most common use cases (debug and release with default features) is handled by the automatic installation. Let me know if you have ideas for any other presets that may be useful. The user can of course go and edit sitecustomize.py directly, and site info helps them find it.
    • option to force/overwrite when using site install (more useful now that there are presets to choose from)
    • the default site installation handles when maturin_import_hook cannot be imported (previously if the user uninstalls the import hook an error would be printed)

Small

  • use uv in tests instead of pip when available (replacing virtualenv command)
  • update pre-commit hook versions
  • capitalisation and spelling and wording fixes
  • added link to maturin.rs documentation in the README
  • replaced some documentation with a link to the maturin.rs hosted version
  • handle FileNotFoundError in maturin_import_hook version command
  • functions to check if the hook is installed

Usercustomize.py

Reading the site module documentation, the difference between usercustomize and sitecustomize isn't totally clear.

The distinction is more important when using the system python installation, because site-packages is not user-writable without root. usercustomize.py can be found at ~/.local/pythonX.Y/site-packages/usercustomize.py (by default) so it's shared between interpreters. By default, virtualenvs do not look here and usually the virtualenv is user-writable so using sitecustomize.py is not a problem. It still makes sense to have sitecustomize.py as the default location I think but it's nice to have the option of using either.

@mbway mbway requested a review from messense June 16, 2024 15:30
@mbway mbway self-assigned this Jun 16, 2024
@mbway mbway force-pushed the small_improvements branch 2 times, most recently from 51e6b3f to efd473a Compare June 16, 2024 16:27
@mbway mbway mentioned this pull request Jun 16, 2024
@messense messense merged commit ee6fce6 into PyO3:main Jun 17, 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