Python-maint
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Write
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Note Insights Sharing URL Help
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Write
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       owned this note    owned this note      
    Published Linked with GitHub
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    # Distutils ## Links * CPython code: https://github.com/python/cpython/blob/master/Lib/distutils/command/install.py * Fedora patch: https://github.com/fedora-python/cpython/commit/acba1a24b6ad5b894b4d6ef3223c2d174e225d21 * Debian patch: https://salsa.debian.org/cpython-team/python3-stdlib/blob/master/debian/patches/3.8/distutils-install-layout.diff * PyPy patch: https://github.com/pypa/distutils/commit/2f1fae1bfceb88cf812a45c44cd18ce604b69c69#diff-6742915ffa9375e1830aa1e69016d3cf * PR: https://github.com/pypa/distutils/pull/1 * Initial discussion: https://discuss.python.org/t/how-can-we-keep-pip-from-updating-uninstalling-system-libraries-in-usr-lib-python/5059 * PEP 632 discussion: https://discuss.python.org/t/pep-632-deprecate-distutils-module/5134/97 * PEP 632: https://www.python.org/dev/peps/pep-0632/ * Distutils issue: https://github.com/pypa/distutils/issues/12 * Debian-specific: https://github.com/pypa/distutils/issues/2 * Patch: https://github.com/pypa/distutils/pull/4/files * Setuptools history: https://setuptools.readthedocs.io/en/latest/history.html * Setuptools must support Python 3.5+ (maybe 3.6+) * [bpo-43976: Allow Python distributors to add custom site install schemes](https://bugs.python.org/issue43976) ------------- ## Meeting notes from 2020-09-24 meet.jit.si/distutils ### Status * [Miro] Proposed text completed (today). \o/ Nice work! * [jaraco] Setuptools docs revamp merged (with minor issues). Ready to merge distutils docs (imminent). ### Discussion [Petr] Use-case not covered: older distros that aren't updated. [jaraco] Mentioned concern about Python version in egg-info. Defer until Mathias has more information. ------------- ## Proposed text for PEP 632 discussion https://discuss.python.org/t/pep-632-deprecate-distutils-module/5134/104 ------------------ ## Meeting notes from 2020-09-17 [mathias] Two issues mainly (Debian): * Headers support * Location support * Python version in metadata (egg-info) ----- Fedora (and most likely Debian): * root user installs Python packages to `/usr/local/lib64/pythonX.Y` by default * option to install Python packages to `/usr/lib64/pythonX.Y` (used when building RPM/DEB packages) * (Fedora has) `/usr/local/lib64/pythonX.Y/site-packages` in `sys.path` first, but not with `-s` ----- * (recent -- pip >=10.0) pip refuses to remove `PKG-INFO`-less installations * but that makes `sudo pip install -U ...` fail anyway * metadata missing in that case? ---- Issue: `sudo pip install -U setuptools` loses patches pip: Long plan to move to [sysconfig](https://docs.python.org/3/library/sysconfig.html) from distutils.sysconfig. [Miro] Proposal: platforms can patch sysconfig and distutils can rely on that to load install schemes. That means setuptools can only switch to its distutils for Python 3.10+ (assuming we do this in 3.10). [Jason] Problem: Old Python versions. Setuptools would like to be able to change distutils. [Jason] Define schemes in setuptools...distutils that "work good enough" for both Debian and Fedora. [Mathias] Sysconfig is a mess; exposes too much. Need vision first. [Pradyun] distutils would need a stopgap solution until 3.9 goes EOL. [Jason] Short term, let's have a "hook" the distributors can put to the standard library... For long term, define better defaults. [Miro] Defaults that satisfy everybody may not be possible. ---- Design (install schemes): 1. pypa/distutils keeps `INSTALL_SCHEMES` defined for compatibility with Python `< 3.10` 2. distutils in Python 3.10+ moves `INSTALL_SCHEMES` to sysconfig and imports them to distutils for backwards compatibility TODO: Miro to look into the implications of "moving"; how would that work? since we already have a definition in sysconfig. 3. distributors would backport (2) to older Pythons 4. pypa/distutils uses `INSTALL_SCHEMES` from sysconfig if found, fallbacks to its own definition if not 5. pypa/distutils fallbacks will honor distributors intentions to the greatest extent possible Problem: `INSTALL_SCHEMES` don't contain logic of picking the appropriate scheme. Possible solution: See `sysconfig._get_default_scheme()` https://github.com/python/cpython/blob/master/Lib/sysconfig.py#L179 - distros would patch (or patch-add) this. Debian has `--install-layout` for distutils, we can keep that in pypa/distutils and make it override `sysconfig._get_default_scheme()` value. Next steps: 1. Publish draft design (over email) 2. Put that up on discourse or github/pypa/distutils issue 3. Share with Steve 4. Follow up next week to include Steve Dower (zooba) 5. Fun and profit!? :moneybag: Well, that didn't make anyone's day worse, I think. :) - Pradyun # 2021-03-12 Notes ## FFY00 and jaraco brainstorming dist install Python to `/usr` as user build from source to `/usr/local` How to avoid: both installations pull libraries from `/usr/local/lib/python/site-packages`? Proposal: We should disallow `/usr` loading any packages from `/usr/local`. Issue - still need multiple package directories for each Python installation. Why? To avoid conflicting pip-installed packages with package manager-installed packages. Package managers can elect an install scheme for this need. Goal: Uniform behavior (including bugfixes and improvements in pypa/distutils) on all Pythons supported by Setuptools (3.6+). How to use new distutils with old CPythons? - Users can fallback to stdlib distutils patches with `SETUPTOOLS_USE_DISTUTILS=stdlib`. (discouraged) - Distributions could patch sysconfig.INSTALL_SCHEMES on older Pythons. - distutils will detect no INSTALL_SCHEMES (or other patch) to `sysconfig` and fallback to default behavior (breaks when expecting custom behavior). - Use older Setuptools. Why not just use INSTALL_SCHEMES from sysconfig? That's a good plan to aim for. Proposal: Solicit flag from sysconfig to signal that it was patched to be compatible with new scheme. Currently, `sysconfig.INSTALL_SCHEMES` does not exist. Could that serve as the flag? When it exists on older Pythons (any), use it. If not, detect patch distutils (Debian, Fedora), warn that behavior may not be compatible with Distribution-patched distutils. How important is this use-case? Proposal: Remove 'unix-local' scheme. It's just a footgun. Let's explore the possibility. # 2021-04-03 Notes - Allowing packagers to customize/patch sysconfig. - Distutils will use sysconfig. - What about integration with site module. Making aliases for site modules. - Schemes in sysconfig, but will also be imported in site module. - Prefer for distributions to supply a file instead of patching. - How viable is that? - Single file, underscore-prefixed. - sysconfig and site would load this module - Just a dictionary with the schemes. - Special module for configuration. - Extend the schemes. Add/override. - Maybe delete if needed, but probably not needed. Will assume not needed until we identify a need. - Opportunity to make things correct. How does `site` use install schemes: - Looks up default scheme. - Uses that to set up default paths. Is a PEP needed? - For now, no. - Piggyback on existing distutils PEP. Next steps: - FFY00 working on configuration design and opening pull request in CPython. - Command line argument support in distutils to allow installer to specify install scheme.

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully