mirror of
https://github.com/foo-dogsquared/wiki.git
synced 2025-02-12 06:19:06 +00:00
30 lines
11 KiB
HTML
30 lines
11 KiB
HTML
<!DOCTYPE html><html><head><meta name="viewport" content="width=device-width"/><meta charSet="utf-8"/><title>Python Packaging: Why don't you just?</title><script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script><script id="MathJax-script" async="" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script><script type="text/x-mathjax-config">
|
|
MathJax = {
|
|
tex: {
|
|
inlineMath: [ ['$','$'], ['\(','\)'] ],
|
|
displayMath: [ ['$$','$$'], ['[',']'] ]
|
|
},
|
|
options = {
|
|
processHtmlClass = "math"
|
|
}
|
|
}
|
|
</script><meta name="next-head-count" content="6"/><link rel="preload" href="/wiki/_next/static/css/52fc2ba29703df73922c.css" as="style"/><link rel="stylesheet" href="/wiki/_next/static/css/52fc2ba29703df73922c.css" data-n-g=""/><noscript data-n-css=""></noscript><link rel="preload" href="/wiki/_next/static/chunks/main-ae4733327bd95c4ac325.js" as="script"/><link rel="preload" href="/wiki/_next/static/chunks/webpack-50bee04d1dc61f8adf5b.js" as="script"/><link rel="preload" href="/wiki/_next/static/chunks/framework.9d524150d48315f49e80.js" as="script"/><link rel="preload" href="/wiki/_next/static/chunks/commons.0e1c3f9aa780c2dfe9f0.js" as="script"/><link rel="preload" href="/wiki/_next/static/chunks/pages/_app-8e3d0c58a60ec788aa69.js" as="script"/><link rel="preload" href="/wiki/_next/static/chunks/940643274e605e7596ecea1f2ff8d83317a3fb76.4841a16762f602a59f00.js" as="script"/><link rel="preload" href="/wiki/_next/static/chunks/pages/%5B%5B...slug%5D%5D-1aa198f87ede1cd0e1dc.js" as="script"/></head><body><div id="__next"><main><h1>Python Packaging: Why don't you just?</h1><section class="post-metadata"><span>Date: <!-- -->2021-12-21 17:31:18 +08:00</span><span>Date modified: <!-- -->2022-06-21 12:05:30 +08:00></span></section><nav class="toc"><ol class="toc-level toc-level-1"><li class="toc-item toc-item-h1"><a href="/wiki/literature.chungPythonPackagingWhy2021#the-state-of-python-packaging" class="toc-link toc-link-h1">The state of Python packaging</a></li><li class="toc-item toc-item-h1"><a href="/wiki/literature.chungPythonPackagingWhy2021#the-answer-to-the-question" class="toc-link toc-link-h1">The answer to the question</a></li></ol></nav><p>:properties:
|
|
:id: 2ba59995-1fc7-46a7-aa0b-cceca4134a7f
|
|
:roam<sub>refs</sub>: [<a href="cite:@chungPythonPackagingWhy2021">cite:@chungPythonPackagingWhy2021</a>]
|
|
:end:
|
|
</p><h1 id="the-state-of-python-packaging">The state of Python packaging</h1><ul><li><p>Python predates the common packaging ecosystem we all interact today thus it has some artifacts from history
|
|
</p></li><li><p>back in the day, for someone to use a dependency, they have to download the source;
|
|
in Python's case, they chose with the most common way to download a file: simple tarballs
|
|
</p></li><li><p>as more platforms grow and being supported, there are more incentives to make delivering dependencies faster but each output may contain different metadata;
|
|
this results in big packages to <a href="https://pypi.org/project/Pillow/#files">create huge lists of possible outputs</a></p></li><li><p>for the package manager to know the metadata, it has to download the whole package and run the build script
|
|
</p></li><li><p>however, this simplicity also brings advantage that you can simply create a Python package repository by simply building the wheels and dropping them along with the source in a directory
|
|
</p></li><li><p>another artifact to consider is Python supports a lot of platforms;
|
|
it is considered supported when Python is confirmed to run on a platform;
|
|
it cannot support building all wheels for all platforms so at some point when doing a <code class="inline-verbatim">pip install</code> of a big package, it has to build the package from source
|
|
</p></li><li><p>metadata are just placed in files which is a good thing since they can be placed next to the sources
|
|
</p></li></ul><h1 id="the-answer-to-the-question">The answer to the question</h1><ul><li><p>third system effect;
|
|
the first few efforts went well but some people want to create a better system with more ambitious goals and a grander vision;
|
|
except it didn't work out and the attempts will inspire another group to try a better version
|
|
</p></li><li><p>the quick succession of attempts at standardizing Python packaging fragmented the packaging process by offering multiple ways to do the goal;
|
|
as more attempts have made, there's lesser central driving force
|
|
</p></li></ul></main></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"metadata":{"date":"2021-12-21 17:31:18 +08:00","date_modified":"2022-06-21 12:05:30 +08:00\u003e","language":"en","source":""},"title":"Python Packaging: Why don't you just?","hast":{"type":"root","children":[{"type":"element","tagName":"nav","properties":{"className":"toc"},"children":[{"type":"element","tagName":"ol","properties":{"className":"toc-level toc-level-1"},"children":[{"type":"element","tagName":"li","data":{"hookArgs":[{"type":"element","tagName":"h1","properties":{"id":"the-state-of-python-packaging"},"children":[{"type":"text","value":"The state of Python packaging"}]}]},"properties":{"className":"toc-item toc-item-h1"},"children":[{"type":"element","tagName":"a","properties":{"className":"toc-link toc-link-h1","href":"/literature.chungPythonPackagingWhy2021#the-state-of-python-packaging"},"children":[{"type":"text","value":"The state of Python packaging"}]}]},{"type":"element","tagName":"li","data":{"hookArgs":[{"type":"element","tagName":"h1","properties":{"id":"the-answer-to-the-question"},"children":[{"type":"text","value":"The answer to the question"}]}]},"properties":{"className":"toc-item toc-item-h1"},"children":[{"type":"element","tagName":"a","properties":{"className":"toc-link toc-link-h1","href":"/literature.chungPythonPackagingWhy2021#the-answer-to-the-question"},"children":[{"type":"text","value":"The answer to the question"}]}]}]}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":":properties:\n:id: 2ba59995-1fc7-46a7-aa0b-cceca4134a7f\n:roam"},{"type":"element","tagName":"sub","properties":{},"children":[{"type":"text","value":"refs"}]},{"type":"text","value":": ["},{"type":"element","tagName":"a","properties":{"href":"cite:@chungPythonPackagingWhy2021"},"children":[{"type":"text","value":"cite:@chungPythonPackagingWhy2021"}]},{"type":"text","value":"]\n:end:\n"}]},{"type":"element","tagName":"h1","properties":{"id":"the-state-of-python-packaging"},"children":[{"type":"text","value":"The state of Python packaging"}]},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Python predates the common packaging ecosystem we all interact today thus it has some artifacts from history\n"}]}]},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"back in the day, for someone to use a dependency, they have to download the source;\n in Python's case, they chose with the most common way to download a file: simple tarballs\n"}]}]},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"as more platforms grow and being supported, there are more incentives to make delivering dependencies faster but each output may contain different metadata;\n this results in big packages to "},{"type":"element","tagName":"a","properties":{"href":"https://pypi.org/project/Pillow/#files"},"children":[{"type":"text","value":"create huge lists of possible outputs"}]}]}]},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"for the package manager to know the metadata, it has to download the whole package and run the build script\n"}]}]},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"however, this simplicity also brings advantage that you can simply create a Python package repository by simply building the wheels and dropping them along with the source in a directory\n"}]}]},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"another artifact to consider is Python supports a lot of platforms;\n it is considered supported when Python is confirmed to run on a platform;\n it cannot support building all wheels for all platforms so at some point when doing a "},{"type":"element","tagName":"code","properties":{"className":["inline-verbatim"]},"children":[{"type":"text","value":"pip install"}]},{"type":"text","value":" of a big package, it has to build the package from source\n"}]}]},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"metadata are just placed in files which is a good thing since they can be placed next to the sources\n"}]}]}]},{"type":"element","tagName":"h1","properties":{"id":"the-answer-to-the-question"},"children":[{"type":"text","value":"The answer to the question"}]},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"third system effect;\n the first few efforts went well but some people want to create a better system with more ambitious goals and a grander vision;\n except it didn't work out and the attempts will inspire another group to try a better version\n"}]}]},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"the quick succession of attempts at standardizing Python packaging fragmented the packaging process by offering multiple ways to do the goal;\n as more attempts have made, there's lesser central driving force\n"}]}]}]}]},"backlinks":[]},"__N_SSG":true},"page":"/[[...slug]]","query":{"slug":["literature.chungPythonPackagingWhy2021"]},"buildId":"Ie9t5zutrXP6Of75Cb5xF","assetPrefix":"/wiki","nextExport":false,"isFallback":false,"gsp":true}</script><script nomodule="" src="/wiki/_next/static/chunks/polyfills-99d808df29361cf7ffb1.js"></script><script src="/wiki/_next/static/chunks/main-ae4733327bd95c4ac325.js" async=""></script><script src="/wiki/_next/static/chunks/webpack-50bee04d1dc61f8adf5b.js" async=""></script><script src="/wiki/_next/static/chunks/framework.9d524150d48315f49e80.js" async=""></script><script src="/wiki/_next/static/chunks/commons.0e1c3f9aa780c2dfe9f0.js" async=""></script><script src="/wiki/_next/static/chunks/pages/_app-8e3d0c58a60ec788aa69.js" async=""></script><script src="/wiki/_next/static/chunks/940643274e605e7596ecea1f2ff8d83317a3fb76.4841a16762f602a59f00.js" async=""></script><script src="/wiki/_next/static/chunks/pages/%5B%5B...slug%5D%5D-1aa198f87ede1cd0e1dc.js" async=""></script><script src="/wiki/_next/static/Ie9t5zutrXP6Of75Cb5xF/_buildManifest.js" async=""></script><script src="/wiki/_next/static/Ie9t5zutrXP6Of75Cb5xF/_ssgManifest.js" async=""></script></body></html> |