Domen Kožar
    • Create new note
    • Create a note from template
      • 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
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee
    • 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
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • 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 Sharing URL Create Help
Create Create new note Create a note from template
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
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee
  • 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
    # Nix Python Packaging - 1-2 sentence description of the project - When was the project created? - Why was the project created? - What is the project's scope as relates to Python distribution/packaging? - Build Python interpreters? - Distribute Python interpreters? - Create Python packages? - Distribute Python packages? - Install Python packages? - What is the project specifically trying to excel at, generally? - What is the project specifically trying to excel at, as relates to Python distribution/packaging? - What are some key weak points of the project, as relates to Python distribution/packaging? ## 1-2 sentence description of the project Nix is a package manager with a focus on reproducible builds from the point of metadata/inputs. It also features a declarative language in which these builds are written in, the Nix language. Nixpkgs is a set of packages shipped by default when using Nix. NixOS is a declaratively configured Linux distrubtion built on top of Nixpkgs. ## When was the project created? Nix has been around for more than 20 years and Python support has been around since the very early days. ## Why was the project created? An experiment to make package management stateless by applying funtional programming paradigm ideas. Strong focus on reproducible builds, i.e. repeatable process of going from source to a working software. *Following is the motivation from the PhD thesis* To resolve issues with existing systems: - Dependency specifications are not validated, leading to incomplete deployment. - Dependency specifications are inexact (e.g., merely nominal). - It is not possible to deploy multiple versions or variants of a component side-by-side. - Components can interfere with each other. - It is not possible to roll back to previous configurations. - Upgrade actions are not atomic. - Applications must be monolithic, i.e., they must statically contain all their dependencies. - Deployment actions can only be performed by administrators, not by unprivileged users. - There is no link between binaries and the sources and build processes that built them. <!-- - The system supports either source deployment or binary deployment, but not both; or it supports both but in a non-unified way. --> <!-- - It is difficult to adapt components. --> <!-- - Component composition is manual. --> - The component framework is narrowly restricted to components written in a specific programming language or framework. - The system depends on non-portable techniques. <!-- - The objective of the research described in this thesis is to develop a deployment system that does not have these problems. --> ## What is the project's scope as relates to Python distribution/packaging? ### Build Python interpreters? - CPython multiple versions - PyPy multiple versions - Multiple OS: Linux, MacOS, no native Windows support - Multiple CPU architectures ### Distribute Python interpreters? - Recipes to build from source along with pre-built binaries ### Create Python packages? - Helper functions for packaging Python packages with Nix and composing environment - Outside Nixpkgs important tools such as `poetry2nix` ### Distribute Python packages? - All handled by the Nix package manager ### Install Python packages? - Any Python package shipped by Nixpkgs can be installed. - Where to draw the line what to package? ### What is the project specifically trying to excel at, generally? Reproducible builds with sandboxing at the package granurality. - Locking dependency trees all the way from your leaf package down to your `glibc` or even Linux kernel (on NixOS), and other tools and libraries used along the way. - Build time dependencies - Creating declarative/imperative developer environments ### What is the project specifically trying to excel at, as relates to Python distribution/packaging? Handles system dependencies - over 90 0000 packages in Nixpkgs. Relocatable - can be copied on any other machine with the same platform. Composition of Python environments - separate path per package <!-- Offering any Python package seamlessly as part the 90 000 packages in Nixpkgs. All that while providing first class customisation options. --> ### What are some key weak points of the project, as relates to Python distribution/packaging? - Nix requires a DAG and thus cannot handle cyclic dependencies, while Python allows it. - Dealing with native dependencies that are opened using e.g. `ctypes`. We need to patch all of these occurences. - On the flip side, once captured, native dependencies are locked and will guarantee exact reproducibility (from-source builds and cached binaries) on any supported platform. - In Nixpkgs only a single version of a Python package is provided. For example, there is no version constraint solver. However, `poetry2nix` can use `poetry` to lock Python dependencies on top of Nixpkgs providing the non-Python components. - Impure builds using e.g. `pip` directly on top of system-provided packages. Especially with NixOS there are no base system packages. ### Limitations of Python packaging for the project - Lack of standardized lock file format for applications - Mapping native dependencies into Nix dependencies is manual work, there's no pkgconfig support in Python. - Non-Python package managers invoked as part of the build, such as npm/yarn/cargo - Lack of test dependencies / runner specifications. - Automating conversion of Python packaging metadata into Nix packages using a single command (for example using poetry2nix). added by dream2nix maintainers: - dependencies are not full declarative: some packages require executing python code to resolve their dependencies, which in turn can require undeclared system dependencies.

    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