wiki/packages.python.html
2022-07-29 15:41:17 +00:00

20 lines
11 KiB
HTML

<!DOCTYPE html><html><head><meta name="viewport" content="width=device-width"/><meta charSet="utf-8"/><title>Python packages</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: [ [&#x27;$&#x27;,&#x27;$&#x27;], [&#x27;\(&#x27;,&#x27;\)&#x27;] ],
displayMath: [ [&#x27;$$&#x27;,&#x27;$$&#x27;], [&#x27;[&#x27;,&#x27;]&#x27;] ]
},
options = {
processHtmlClass = &quot;math&quot;
}
}
</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 packages</h1><section class="post-metadata"><span>Date: <!-- -->2021-07-17 21:59:04 +08:00</span><span>Date modified: <!-- -->2021-07-17 21:59:04 +08:00</span></section><nav class="toc"><ol class="toc-level toc-level-1"></ol></nav><ul><li><p>the most common distribution tool as of 2021-07-17 is <code class="inline-verbatim">setuptools</code> which uses <code class="inline-verbatim">setup.py</code> which is a script telling how to build the Python module;
it is <a href="https://docs.python.org/3/distributing/index.html">documented from the official documentation</a></p></li><li><p>some projects replaces the <code class="inline-verbatim">setup.py</code> with <code class="inline-verbatim">pyproject.toml</code> which solves the dependency problem;
it is specified from <a href="https://www.python.org/dev/peps/pep-0518/">PEP-0518</a></p></li><li><p>some projects replaced the official Python package manager (<code class="inline-verbatim">pip</code>) with <a href="https://python-poetry.org/">poetry</a> which requires a new setup;
it can use <code class="inline-verbatim">pyproject.toml</code> which makes it easy to install with either the official setup or Poetry;
projects may have a <code class="inline-verbatim">poetry.toml</code> to configure the module similarly to <code class="inline-verbatim">package.json</code> in NodeJS packages;
Poetry packages may also has a lockfile at <code class="inline-verbatim">poetry.lock</code></p></li><li><p>examples:
</p><ul><li><p>the <a href="https://github.com/python-poetry/poetry">source of Poetry itself</a> uses the Poetry package manager
</p></li><li><p><a href="/wiki/tools.cookiecutter">Cookiecutter</a> (at commit <code class="inline-verbatim">d6037b7dee5756e35a6ecd5b522899a9061c2c79</code>) uses <code class="inline-verbatim">pyproject.toml</code> with a shim for the <code class="inline-verbatim">setuptools</code></p></li><li><p><a href="https://github.com/cruft/cruft">Cruft</a> uses Poetry (which in turn can use the official distribution setup)
</p></li><li><p><a href="https://github.com/rschroll/rmfuse">rmfuse</a> uses <code class="inline-verbatim">pyproject.toml</code> that can be installed either with Pip or Poetry
</p></li></ul></li></ul></main></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"metadata":{"date":"2021-07-17 21:59:04 +08:00","date_modified":"2021-07-17 21:59:04 +08:00","language":"en","source":""},"title":"Python packages","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":"ul","properties":{},"children":[{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"the most common distribution tool as of 2021-07-17 is "},{"type":"element","tagName":"code","properties":{"className":["inline-verbatim"]},"children":[{"type":"text","value":"setuptools"}]},{"type":"text","value":" which uses "},{"type":"element","tagName":"code","properties":{"className":["inline-verbatim"]},"children":[{"type":"text","value":"setup.py"}]},{"type":"text","value":" which is a script telling how to build the Python module;\n it is "},{"type":"element","tagName":"a","properties":{"href":"https://docs.python.org/3/distributing/index.html"},"children":[{"type":"text","value":"documented from the official documentation"}]}]}]},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"some projects replaces the "},{"type":"element","tagName":"code","properties":{"className":["inline-verbatim"]},"children":[{"type":"text","value":"setup.py"}]},{"type":"text","value":" with "},{"type":"element","tagName":"code","properties":{"className":["inline-verbatim"]},"children":[{"type":"text","value":"pyproject.toml"}]},{"type":"text","value":" which solves the dependency problem;\n it is specified from "},{"type":"element","tagName":"a","properties":{"href":"https://www.python.org/dev/peps/pep-0518/"},"children":[{"type":"text","value":"PEP-0518"}]}]}]},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"some projects replaced the official Python package manager ("},{"type":"element","tagName":"code","properties":{"className":["inline-verbatim"]},"children":[{"type":"text","value":"pip"}]},{"type":"text","value":") with "},{"type":"element","tagName":"a","properties":{"href":"https://python-poetry.org/"},"children":[{"type":"text","value":"poetry"}]},{"type":"text","value":" which requires a new setup;\n it can use "},{"type":"element","tagName":"code","properties":{"className":["inline-verbatim"]},"children":[{"type":"text","value":"pyproject.toml"}]},{"type":"text","value":" which makes it easy to install with either the official setup or Poetry;\n projects may have a "},{"type":"element","tagName":"code","properties":{"className":["inline-verbatim"]},"children":[{"type":"text","value":"poetry.toml"}]},{"type":"text","value":" to configure the module similarly to "},{"type":"element","tagName":"code","properties":{"className":["inline-verbatim"]},"children":[{"type":"text","value":"package.json"}]},{"type":"text","value":" in NodeJS packages;\n Poetry packages may also has a lockfile at "},{"type":"element","tagName":"code","properties":{"className":["inline-verbatim"]},"children":[{"type":"text","value":"poetry.lock"}]}]}]},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"examples:\n"}]},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"the "},{"type":"element","tagName":"a","properties":{"href":"https://github.com/python-poetry/poetry"},"children":[{"type":"text","value":"source of Poetry itself"}]},{"type":"text","value":" uses the Poetry package manager\n"}]}]},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"a","properties":{"href":"/tools.cookiecutter"},"children":[{"type":"text","value":"Cookiecutter"}]},{"type":"text","value":" (at commit "},{"type":"element","tagName":"code","properties":{"className":["inline-verbatim"]},"children":[{"type":"text","value":"d6037b7dee5756e35a6ecd5b522899a9061c2c79"}]},{"type":"text","value":") uses "},{"type":"element","tagName":"code","properties":{"className":["inline-verbatim"]},"children":[{"type":"text","value":"pyproject.toml"}]},{"type":"text","value":" with a shim for the "},{"type":"element","tagName":"code","properties":{"className":["inline-verbatim"]},"children":[{"type":"text","value":"setuptools"}]}]}]},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"a","properties":{"href":"https://github.com/cruft/cruft"},"children":[{"type":"text","value":"Cruft"}]},{"type":"text","value":" uses Poetry (which in turn can use the official distribution setup)\n"}]}]},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"a","properties":{"href":"https://github.com/rschroll/rmfuse"},"children":[{"type":"text","value":"rmfuse"}]},{"type":"text","value":" uses "},{"type":"element","tagName":"code","properties":{"className":["inline-verbatim"]},"children":[{"type":"text","value":"pyproject.toml"}]},{"type":"text","value":" that can be installed either with Pip or Poetry\n"}]}]}]}]}]}]},"backlinks":[]},"__N_SSG":true},"page":"/[[...slug]]","query":{"slug":["packages.python"]},"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>