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

Pythonでのパッケージング: エコシステムの理解と現場での活用 PyCon APAC2023

Pythonでのパッケージング: エコシステムの理解と現場での活用 PyCon APAC2023

Higuchi kokoro

October 27, 2023
Tweet

More Decks by Higuchi kokoro

Other Decks in Programming

Transcript

  1. ©2021 Wantedly, Inc. ࿩͢͜ͱɾ࿩͞ͳ͍͜ͱ w ฉ͍ͯ΋Β͍͍ͨਓ👨💻👩💻 w 1Z5PSDIͳͲύοέʔδͷΠϯετʔϧͰ٧·ͬͨ͜ͱ͕͋Δਓ w ͳͥ٧·ͬͨͷ͔ɺύοέʔδϯάͷΤίγεςϜͷશମ૾͔Βཧղ͍ͨ͠ਓ

    w ࿩͢͜ͱ📣 w ύοέʔδϯάͷΤίγεςϜͷશମ૾ w ύοέʔδΛΠϯετʔϧ͢Δਓ޲͚ͷ5JQT w ͋·Γ࿩͞ͳ͍͜ͱ🙊 w ύοέʔδ࡞੒ɾӡ༻ଆͷ5JQT w ݸผͷٕज़ʹਂ͘য఺Λ౰ͯͨ࿩
  2. ©2021 Wantedly, Inc. ໊લ: Ṥޱ ৺ (Higuchi Kokoro) ॴଐ: Wantedly,

    inc. X: @zerebom_3 σʔλαΠΤϯςΟετͱͯ͠ɺਪનγεςϜͷਫ਼౓վળɾධՁɾ 
 ػցֶशج൫ͷ։ൃΛ͍ͯ͠·͢ ਖ਼͘͠πʔϧ΍ϓϩάϥϛϯάݴޠΛ࢖͍ɺϩόετʹϓϩμΫτ։ൃ͢Δ͜ͱʹ 
 ؔ৺͕͋Γ·͢ ࣗݾ঺հ
  3. ©2023 Wantedly, Inc. Create A World Where Work Drives Passion.

    γΰτͰίίϩΦυϧͻͱΛ;΍͢ ձࣾ঺հ ࢲͨͪͷϛογϣϯ ©2023 Wantedly, Inc.
  4. ©2021 Wantedly, Inc. w ύοέʔδ͕Ξοϓϩʔυ͞ΕΔϦϙδτϦ ޙड़ ͔ΒΠϯετʔϧ w QJQJOTUBMMTPNF@QBDLBHF w

    ࣮͸ ॴ๬ͷύοέʔδΛΠϯετʔϧ͢Δʹ͸ଟ͘ͷม਺͕ؔ༩ w Ծ૝؀ڥ w 1ZUIPOόʔδϣϯ w ύοέʔδ͕ґଘ͍ͯ͠ΔଞͷϥΠϒϥϦ w Ϛγϯͷ04 MJOVY XJOEPXTʜ ύοέʔδར༻ऀͷࢹ఺
  5. ©2021 Wantedly, Inc. w ύοέʔδ͕ूΊΒΕ͍ͯΔΦϯϥΠϯͷϦϙδτϦ w 1Z1* w ࠷΋޿͘࢖ΘΕ͍ͯΔ w

    QJQͷσϑΥϧτΠϯετʔϧݩ 
 1Z1"ʹΑͬͯӡӦ w ଞʹ΋͍͔ͭ͋͘Δ w "OBDPOEB$MPVE w DPOEBGPSHF w (JU)VC ύοέʔδϦϙδτϦ Ҿ༻: https://pypi.org/ https://anaconda.cloud/
  6. ©2021 Wantedly, Inc. w ύοέʔδϦϙδτϦ͔ΒύοέʔδΛΠϯετʔϧ͢Δπʔϧ w ߴػೳԽʹ͖ͭɺෳ਺ͷػೳΛ͍࣋ͬͯΔ w QJQ w

    1ZUIPOʹඪ४૷උͷύοέʔδΠϯετʔϥʔ w 1PFUSZ w ઃఆϑΝΠϧͰ͋ΔQZQSPKFDUUPNMΛݩʹґଘؔ܎Λղফ͠ͳ͕ΒΠϯετʔϧ͢Δ w ύοέʔδͷϏϧυ΋Ͱ͖Δ w ґଘؔ܎ͷάϧʔϓԽ΍ιʔεͷมߋ΋Մೳ ύοέʔδΠϯετʔϥʔ
  7. ©2021 Wantedly, Inc. w ύοέʔδϦϙδτϦʹΞοϓϩʔυ͞Ε͍ͯΔύοέʔδͷܗࣜ w #VJMU%JTUSJCVUJPO CEJTU  w

    ಺༰෺ϏϧυࡁΈͷόΠφϦϑΝΠϧ w ಛੑΠϯετʔϧ͕ૣ͍͕04΍1ZUOPOͷόʔδϣϯʹґଘ w ֦ுࢠXIFFM XIM σΟετϦϏϡʔγϣϯ ύοέʔδϯάܗࣜ
  8. ©2021 Wantedly, Inc. w ύοέʔδϦϙδτϦʹΞοϓϩʔυ͞Ε͍ͯΔύοέʔδͷܗࣜ w 4PVSDF%JTUSJCVUJPO TEJTU  w

    ಺༰෺ιʔείʔυͱηοτΞοϓεΫϦϓτ QZQSPKFDUUPNM ͳͲ w ಛੑखݩͷϚγϯͰϏϧυ͕ߦΘΕΔͷͰ஗͍͕ॊೈ w ֦ுࢠUBSH[ w $POEB$MPVEͳͲ͸ಠࣗͷܗࣜ σΟετϦϏϡʔγϣϯ ύοέʔδϯάܗࣜ
  9. ©2021 Wantedly, Inc. w #VJMU%JTUSJCVUJPO CEJTU  w Ξφϩδʔ͓ห౰ w

    ͙͢৯΂ΒΕΔຯ͸ௐ੔Ͱ͖ͳ͍ w 4PVSDF%JTUSJCVUJPO TEJTU  w Ξφϩδʔ৯ࡐͱϨγϐ w ͙͢৯΂ΒΕͳ͍ຯ͸ޙ͔ΒௐઅͰ͖Δ σΟετϦϏϡʔγϣϯ ύοέʔδϯάܗࣜ
  10. ©2021 Wantedly, Inc. w /VNQZͷ1Z1*ΛΈΔͱʜ w ଟ਺ͷ#EJTU XIM ͱҰͭͷ4EJTU UBSH[

    ͕ଘࡏ͢Δ w #EJTU͸1ZUIPOόʔδϣϯͱ04͝ͱʹଘࡏ͢Δ w ʮ͓ห౰༻ҙ͔ͨ͠Βɺ޷Έ ؀ڥ߹கͨ͠ ͕ 
 ͋Ε͹ͦΕΛɺͳ͚Ε͹Ϩγϐ QZQSPKFDUUPNM 
 ͔Β࡞ͬͯͶ Ϗϧυ ʯ σΟετϦϏϡʔγϣϯ ύοέʔδϯάܗࣜ Ҿ༻: https://pypi.org/project/numpy/#files
  11. ©2021 Wantedly, Inc. ύοέʔδͱύοέʔδϯά w ઃఆϑΝΠϧ QZQSPKFDUUPNM  w ύοέʔδΛύοέʔδϯά͢ΔͨΊͷ

    
 ৘ใ͕٧·ͬͨϑΝΠϧ w ύοέʔδ͕ͲΜͳϥΠϒϥϦʹґଘ͍ͯ͠Δ͔ w ͲΜͳόʔδϣϯͰಈ͔͘ w ͲΜͳϥΠηϯεͷݩར༻Ͱ͖Δͷ͔ w ͲΜͳϏϧυπʔϧΛ࢖ͬͯϏϧυ͢Δͷ͔
  12. ©2021 Wantedly, Inc. 14'ͱ1&1 w 14' 1ZUIPO4PGUXBSF'PVOEBUJPO  w 1ZUIPOͱؔ࿈ٕज़Λࢧԉɺอޢ͢Δ૊৫

    w 1&1ͷ؅ཧ΍ঝೝʹؔ༩ w 1&1 1ZUIPO&OIBODFNFOU1SPQPTBMT  w 1ZUIPOʹର͢ΔػೳͷఏҊɾमਖ਼ɾվળʹؔ͢Δઃܭจॻ w ύοέʔδϯάʹؔ͢Δ1&1΋ෳ਺͋Δ w 1&1ύοέʔδͷόʔδϣϯ൪߸ͷܗࣜͱґଘੑࢦఆΛඪ४Խ w 1&1ϏϧυγεςϜʹґଘ͠ͳ͍ιʔείʔυπϦʔͷϑΥʔϚοτͷఏҊ w 1&1QZQSPKFDUUPNMͰϏϧυγεςϜͷཁ݅Λࢦఆ
  13. ©2021 Wantedly, Inc. 1Z5PSDIͷΠϯετʔϧ͕ࣦഊ͢Δཧ༝ w 1Z1*ͷσΟετϦϏϡʔγϣϯ TEJTU CEJTU Ͱ͸(16ͷґଘؔ܎·Ͱ؅ཧ͠ͳ͍ w

    (16ར༻ʹඞཁͳϥΠϒϥϦ $6%" ͸1Z1"ͷ؅ཧ͢ΔπʔϧͰ͸ͳ͍ͨΊ w ௨ৗͷϥΠϒϥϦʹ͸ඞཁͳ͍ͨΊ w ैͬͯɺ1Z1*Ҏ֎ͷύοέʔδϦϙδτϦ͔ΒΠϯετʔϧ͕ඞཁͳέʔε΋ w 1Z1*ʹσΟετϦϏϡʔγϣϯ͸$16ͷΈ w (16ͷυϥΠόʔ΍ͦΕʹԊͬͨ$6%"ͷόʔδϣϯΛखಈͰΠϯετʔϧ͢Δඞཁ΋ w खಈΏ͑ʹϛε͕ੜ͡΍͍͢
  14. ©2021 Wantedly, Inc. GBTU5FYUͷΠϯετʔϧ͕ࣦഊ͢Δཧ༝ w 1ZCJOE w $ ͷΫϥε΍ؔ਺Λ1ZUIPOͰར༻Ͱ͖ΔΑ͏ʹͳΔϥΠϒϥϦ w

    QZCJOEͰϥοϓ͞Εͨ$ ίʔυ͸ɺ1ZUIPO͔Βར༻͢ΔલʹίϯύΠϧ͕ඞཁ w 1&1 w QZQSPKFDUUPNMͰϏϧυ͢ΔπʔϧΛબ΂ΔΑ͏ʹ͢Δن໿ w 1&1 w QZQSPKFDUUPNMʹϏϧυͷϓϩηεͰඞཁͳπʔϧΛ໌ه͢Δن໿ w 1PFUSZ w 1&1 ʹ४ڌͯ͠ϥΠϒϥϦΛΠϯετʔϧ͢Δ
  15. ©2021 Wantedly, Inc. GBTU5FYUͷΠϯετʔϧ͕ࣦഊ͢Δཧ༝ w GBTU5FYU w 1&1 ʹະରԠ w

    QZQSPKFDUUPNMͷCVJMETZTUFNʹQZCJOEؚ͕·Ε͍ͯͳ͍ Ҿ༻: https://github.com/facebookresearch/fastText/pull/1270/files
  16. ©2021 Wantedly, Inc. GBTU5FYUͷΠϯετʔϧΤϥʔରࡦ w QZQSPKFDUUPNMΛ࢖ͬͨCVJMEʹରԠ͢ΔΑ͏13Λ࡞੒ɾϚʔδΛґཔ w ͨͩ͠ϝϯςφϯε͞Εͯͳ͍Α͏ͳͷͰϚʔδ͞Ε͍ͯͳ͍  w

    ৽͍͠ඪ४ 1&1 ʹԊΘͳ͍ϥΠϒϥϦ͸ͳΔ΂͘։ൃʹ༻͍ͳ͍ w ϫʔΫΞϥ΢ϯυͱͯ͠͸XIFFMϑΝΠϧΛΠϯετʔϧ͠ɺQBUIΛ௚઀ࢦఆ
  17. ©2021 Wantedly, Inc. 1ZUIPOͷྺ࢙͕௕͘ɺπʔϧͷ౷ഇ߹͕ଟ͍ w ྫ͑͹͜Μͳײ͡🫠 w ઃఆϑΝΠϧSFRVJSFNFOUUYU 1JQ fi

    MF QZQSPKFDUUPNM w όʔδϣϯϚωʔδϟʔQZFOW SZF w Ծ૝؀ڥWFOW WJSUVBMFOW QPFUSZ SZF w ϏϧυπʔϧTFUVQUPPMT EJTUVUJMT QPFUSZ w ύοέʔδΠϯετʔϥʔFBTZ@JOTUBMM QJQ QPFUSZ QJQFOWCDPOEB SZF w σΟετϦϏϡʔγϣϯFHH XIFFM UBSH[
  18. ©2021 Wantedly, Inc. 1ZUIPOϥΠϒϥϦͷґଘ͸ෳࡶʹͳΓ΍͍͢ w ਂ૚ֶशɾػցֶशͷ։ൃʹ༻͍ΒΕΔϥΠϒϥϦ͸ґଘ͕ෳࡶʹͳΓ΍͍͢ w ͦͷΑ͏ͳϥΠϒϥϦ͸ߴ଎ͳԋࢉ͕ඞཁ w ߴ଎ͳίϯύΠϥݴޠ

    $ ΍(16ʹґଘ w 04΍(16υϥΠόʔʹґଘ͕͔͔Δ w ϥΠϒϥϦͷϏϧυ࣌ʹґଘؔ܎ΛؚΊΔඞཁ͕͋Δ w 1Z1*Ͱ؅ཧ͠ͳ͍ϨΠϠʔͰͷґଘ͕͔͔Δ "#*  w ϋʔυଆͷਐԽ΋ૣ͘ɺ௠෗Խ͠΍͍͢ w "QQMFTJMJDPOͷొ৔ w (16ͷυϥΠόΞοϓσʔτ
  19. ©2021 Wantedly, Inc. ඪ४͕߹ٞͰܾ·ΔͷͰఆ·Δͷʹ͕͔͔࣌ؒΔ w ύοέʔδΠϯετʔϧͷඪ४͸1&1Λ௨ͯ͡ίϛϡχςΟͰߦΘΕΔ w σΟετϦϏϡʔγϣϯ΍QZQSPKFDUUPNMͷܗࣜͳͲ w 1&1ͷঝೝɾධՁɾվળʹ͸ଟ͘ͷਓͷ߹ҙܗ੒͕ඞཁͰ͕͔͔࣌ؒΔ

    w ϦʔυλΠϜʹΑΓଟ͘ͷπʔϧ΍࢓༷ͷ౷ഇ߹ɾڞଘ͕ى͖Δ w ΋ͪΖΜɺಛఆͷ૊৫ɾاۀͷҙ޲Ͱ࢓༷͕ࡦఆ͞ΕΔ͜ͱͳ͘Φʔϓϯͳϓϩηε Ͱվળ͕ਐΊΒΕΔূڌͰ΋͋Δ
  20. ©2021 Wantedly, Inc. ࠷৽ͷಈ޲Λ௥͏ɾ৽͍͠πʔϧΛ࢖͏ w ෳࡶͰ͋Δ͜ͱ͸ίϛϡχςΟ΋ཧղ͓ͯ͠ΓɾվળΛਐΊ͍ͯΔ w ৽͍͠πʔϧ΄ͲɺҰͭͷπʔϧͰଟ͘ͷ͜ͱ͕Ͱ͖ΔΑ͏ʹͳ͍ͬͯΔ w 1PFUSZύοέʔδͷ։ൃɾϏϧυɾґଘؔ܎ͷ؅ཧɾύϒϦογϡ

    w SZF1ZUIPOόʔδϣϯ΋؅ཧ w (16؀ڥʹ͓͍ͯ΋/7*%*"͕1Z1*্ͷαϙʔτΛਐΊ͍ͯΔ w $5,ʢ$6%"5PPMLJUʣͷ͍͔ͭ͘ͷϥΠϒϥϦίϯϙʔωϯτΛ 
 XIFFMͱͯ͠ύοέʔδԽɻOWJEJBDVCMBTDVͳͲΛ1Z1*Ͱ഑෍
  21. ©2021 Wantedly, Inc. ࠷৽ͷಈ޲Λ௥͏ɾ৽͍͠πʔϧΛ࢖͏ w ෳࡶͰ͋Δ͜ͱ͸ίϛϡχςΟ΋ཧղ͓ͯ͠ΓɾվળΛਐΊ͍ͯΔ w 1PFUSZ͸͜͜೥Ͱେ͖ͳΞοϓσʔτΛճ΋͍ͯ͠Δ w ωΠςΟϒґଘͷαϙʔτɾґଘؔ܎ͷάϧʔϓԽ

    w ΩϟογϡͷഁଛճආɾϩοΫܗࣜͷมߋ w Πϯετʔϧ଎౓޲্ w ιʔεͷࢦఆʹ༏ઌॱҐΛࢦఆՄೳ w ΤοδέʔεͰͷΠϯετʔϧ଎౓޲্ w IUUQTQZUIPOQPFUSZPSHIJTUPSZɹ
  22. ©2021 Wantedly, Inc. ݸਓతͳ͓͢͢Ί؀ڥߏங w ௨ৗͷ؀ڥ w 1PFUSZ QZFOWϥΠϒϥϦґଘؔ܎ͷ؅ཧ1ZUIPOόʔδϣϯͷ؅ཧ w

    SZFશ෦؅ཧ w (16؀ڥ w յͯ͠΋໰୊ͳ͍7JSUVBM.BDIJOF HDQ ΍(PPHMF$PMBCͰࢼߦࡨޡ w TIFMMTDSJQU%PDLFS fi MFͰ(16υϥΠόपΓ΋ίʔυͰ؅ཧ
  23. ©2021 Wantedly, Inc. ·ͱΊ w ύοέʔδΠϯετʔϧ͸ଟ͘ͷ࢓૊Έɾن໿ʹࢧ͑ΒΕͯͰ͖͍ͯΔ w ϦϙδτϦɾΠϯετʔϥʔɾ1&1ɾσΟετϦϏϡʔγϣϯͳͲ w 1ZUIPOͷύοέʔδΠϯετʔϧ͸ҎԼͷཁҼͰ೉͍͠

    w ྺ࢙͕௕͘ɺଟ͘ͷπʔϧ͕౷ഇ߹ w ύοέʔδ΁ͷґଘؔ܎͕ෳࡶʹͳΓ΍͍͢ w ͦ΋ͦ΋ҰൠతʹύοέʔδΠϯετʔϧ͸ม਺͕ଟ͕͘೉͍͠ w ߹ٞʹΑΓඪ४ͷࡦఆʹ͕͔͔࣌ؒΔ w ΤίγεςϜͷվળ͸ਐΜͰ͍ΔͷͰΩϟονΞοϓͰ͖ΔͱΠϯετʔϧ͠΍͍͢ w ৽͍͠πʔϧ΄ͲɺҰͭͷπʔϧͰଟ͘ͷ͜ͱ͕Ͱ͖Δ w ৽͍͠πʔϧ΍ಈ޲Λ௥͏͜ͱͰָʹΠϯετʔϧͰ͖Δํ๏Λ͠ΕΔ
  24. ©2021 Wantedly, Inc. ࢀߟจݙ w 1Z1* w IUUQTQZQJPSH w 1PFUSZ

    w IUUQTQZUIPOQPFUSZPSH w 1ZUIPOͷ1BDLBHF.BOBHFSΛਂ͘஌ΔͨΊͷϦϯΫू w IUUQTHJTUHJUIVCDPNWBBBBBORVJTI BEEFBGFGCFGCD fi MFQZUIPOQBDLBHFNBOBHFSNE w 1ZUIPO1BDLBHJOH6TFS(VJEF w IUUQTQBDLBHJOHQZUIPOPSHFOMBUFTU w QZQBDLBHJOHOBUJWF w IUUQTQZQBDLBHJOHOBUJWFHJUIVCJP