Upgrade to Pro — share decks privately, control downloads, hide ads and more …

パッケージ管理ツール Ryeへの旅路

パッケージ管理ツール Ryeへの旅路

# pycon apac 2023で話をしてきました

glassmonenkey

October 27, 2023
Tweet

More Decks by glassmonenkey

Other Decks in Technology

Transcript

  1. © 2012-2023 BASE, Inc. 1 PyCon APAC 2023 BASE株式会社 永野

    峻輔 ( @glassmonekey ) パッケージ管理ツール Ryeへの旅路
  2. © 2012-2023 BASE, Inc. 3 自己紹介 所属 BASE 株式会社 BASE

    BANKチーム Engineering Program Manager 資金調達プロダクト「YELL BANK」の開発責任者やってます。 Go, PHP, Pythonを書きつつ時々データエンジニアも。 趣味 個人開発 最近は日帰り温泉とかも  SNS X(Twitter): @glassmonekey  Github: https://github.com/glassmonkey 永野 峻輔 (ながの しゅんすけ) PHPでWasm触ったりしてます
  3. © 2012-2023 BASE, Inc. 7 1 2 3 Built in

    Rust (not depend on python) Management pyproject.toml Management virtualenvs behind the scenes Key Point
  4. © 2012-2023 BASE, Inc. 9 Q: Why is it beneficial

    that Package Manager is built in Rust?
  5. © 2012-2023 BASE, Inc. 12 pip + venv c Determine

    the Python version To fix version, using pyenv?
  6. © 2012-2023 BASE, Inc. 13 pip + venv Activate venv

    every time we want to use it. c
  7. © 2012-2023 BASE, Inc. 14 pip + venv dump dependencies,

    it’s not lock. so makes it difficult for us to reproduce the same.
  8. © 2012-2023 BASE, Inc. 16 Poetry In Poetry, a lock

    file(poetry.lock) is generated automatically with add.
  9. © 2012-2023 BASE, Inc. 17 Rye Setting up Rye does

    not require the installation of Python.
  10. © 2012-2023 BASE, Inc. 18 Rye Dependencies are added to

    the 'project' in the pyproject.toml file.
  11. © 2012-2023 BASE, Inc. 19 Rye Install and create two

    "lockfiles" . • requirements.lock and • requirements-dev.lock
  12. © 2012-2023 BASE, Inc. 20 Simple Set up 🥰 Simple

    setup reduces the potential for troubles arising from differences in CPU architecture(e.g. arm64 vs x86)
  13. © 2012-2023 BASE, Inc. 22 pyproject.toml File contains build system

    requirements and information - PEP 517: A build-system independent format for source trees - PEP 518: Specifying Minimum Build System Requirements for Python Projects - PEP 621: Storing project metadata in pyproject.toml - PEP 660: Editable installs for pyproject.toml based builds (wheel based)
  14. © 2012-2023 BASE, Inc. 24 e.g. pyproject.toml for Poetry Poetry

    is based config (PEP 517 and extension for poetry)
  15. © 2012-2023 BASE, Inc. 27 Idea, Using a requirements.txt 1.

    dump requirements.txt 2. init project
  16. © 2012-2023 BASE, Inc. 30 1 2 3 Simply setup

    Based simply config on pyproject.toml Transparent virtual environments Rye features
  17. © 2012-2023 BASE, Inc. 31 If we feel something is

    missing, chance to contribute! 💪💪