--- title: "Comparison of Packaging Tools in 2023 - Peacock" tags: PyConTW2023, 2023-organize, 2023-共筆 --- # Comparison of Packaging Tools in 2023 - Peacock {%hackmd H6-2BguNT8iE7ZUrnoG1Tg %} <iframe src=https://app.sli.do/event/9rb2547H5Lr5jJ955K8Thz height=450 width=100%></iframe> > Collaborative writing start from below > 從這裡開始共筆 Slide: https://slides.p3ac0ck.net/pycontw2023/index.html * PEPs: [517](https://peps.python.org/pep-0517/), [621](https://peps.python.org/pep-0621/), and [660](https://peps.python.org/pep-0660/) * `pyproject.toml` format was defined pyproject.toml https://pip.pypa.io/en/stable/reference/build-system/pyproject-toml/ ## pyproject.toml format * build-system * project * dependencies ## Pipenv - Pros - supports lock-file - easy to add/ upgrade pacakges - wraps vitualenv - Cons - slow dependency resolver - limited support for pep 621 style `pyproject.toml` ## Poetry - Pros - Dependency management with lock-file - Wrapper virtual env - Include Task-runner poetry run - Helper for the building wheels - Cons - Not support PEP621 style `pyproject.toml` ## PDM - Pros - Fast dependency resolver (you can choose another resolver) - Support PEP 621 - Include Task runner (pdm run) - Cons - Not include wheel building helper ## pip-tools - Pros - Simple, only 2 commands - Support PEP 621 - Combine-able with pip or hatch - Maintained by the jazzband community - Cons - does not included task runner or wheel building tools ## Hatch - Pros - Configurable to a backend for builing project - Maintained acitvely by PyPA nearly official - Support PEP 621 - Cons ## pip - Pros - Build-in in Python, very simple - Support PEP 621 - Cons - cannot wrap virtualenv - does not support file-managed dependencies - does not include task-runnder and wheel builder # Summary ## Case 1: Library developing - Hatch (with pip-tools): Very configurable and flexible ## Case 2: Application Developing - PDM: All-in-one tool and easy to use - resaons: - fast dependency resolver - supports PEP 621 style `pyproject.toml` ## Case 3: Automation Script Developing - pip Simple to use, not built-in in Python) - reasons: - Lightweight, non-dep - Simple to use # Appendix ## Rye - pros - single-binary, easy to install and use - works with `pyproject.toml` spec PEP 621 style - wraps virtualenv, including package builder and publisher - inlcude python version manager - cons - experimental, not stable # Q & A 1. is requirement.txt dead? - no, but it has some problems Below is the part that speaker updated the talk/tutorial after speech 講者於演講後有更新或勘誤投影片的部份