TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Python Practical Package Packing 2024

35 点作者 kr0bat10 个月前

16 条评论

lbhdc10 个月前
While the author enumerates the things they think you should do, I think it was very light on the _why_ you would want this setup. I think the argument of &quot;you are doing it the old way&quot; have been really ineffective at convincing people to do anything different, particularly around python tooling.<p>The official docs recommend doing many of the things the author cautions against or calls bad. <a href="https:&#x2F;&#x2F;packaging.python.org&#x2F;en&#x2F;latest&#x2F;guides&#x2F;distributing-packages-using-setuptools&#x2F;" rel="nofollow">https:&#x2F;&#x2F;packaging.python.org&#x2F;en&#x2F;latest&#x2F;guides&#x2F;distributing-p...</a>
评论 #40988411 未加载
评论 #40988303 未加载
Arch-TK10 个月前
Matt needs to stop this &quot;I know better than you&quot; attitude.<p>Seriously, first C and now Python.<p>I can&#x27;t wait for the 20th revised version of this blog post where Matt has slowly realises he doesn&#x27;t know half as much as he claims to and has added 50 side notes explaining all the cases where his blanket statement is not quite as broadly applicable as he ignorantly assumed.
chad1n10 个月前
Poetry is so slow, please use uv, for some of my projects, poetry takes 20-30 seconds to update&#x2F;add new packages while uv completes it in seconds. But I can agree that&#x27;s better to use a package manager than plain old `requirements.txt` file since you can pin the version you want to use for development or production.
评论 #40988274 未加载
PollardsRho10 个月前
Given how much the author talks about professional standards, one would think they would write professionally.<p>Also, is the author aware of why people use Anaconda? Conda environments can make it significantly easier to link CUDA or Fortran libraries properly, which are quite prevalent in scientific computing. Many people who use such code bases are professional scientists and not professional programmers, so I understand seeing that generally conda-based packages are poorly architected.<p>It&#x27;s almost like other people sometimes do things differently because they have different needs or have thought of things you haven&#x27;t, not just because they&#x27;re too stupid or uneducated to know better.
akoumjian10 个月前
I&#x27;ve been liking pdm as opposed to poetry, as poetry uses some non-standard syntax in the pyproject.toml file. I had a lot of trouble getting hatch environments to handle changes to default python versions and the like. I like how pdm played nicely out of the box with pyenv if you&#x27;re using it, otherwise manages environments directly.
niux10 个月前
Nothing I have used so far in the Python ecosystem comes even close to Rye. Everything is incredibly fast, environments work across multiple operating systems, etc. For me, Poetry has been a massive headache (try installing PyQt6 Windows).
whywhywhywhy10 个月前
Just feel this needs to be solved higher up the pipeline than where they&#x27;re trying to solve it. The fact multiple versions of the same library can&#x27;t coexist in a project meaning you end up having to find this plateaux where every dependency is within range if they cross over. Node&#x2F;NPM can do this, don&#x27;t really see why Python couldn&#x27;t eventually and read dependencies from within the project folder rather than this whole fake idea that it exists at a system level which just hasn&#x27;t been the reality of how people are using this language for a long time.
pqdbr10 个月前
For someone that is from the Ruby world and uses rbenv &#x2F; bundler confortably, what would be the canonical way of using &#x2F; managing Python in MacOS?<p>There seems to be a sea of alternatives and I see every tutorial mention `pip install` while I don&#x27;t even have that running in my CLI (only pip3). Do people assume an alias here of I have somehow messed up my environment?
评论 #40992073 未加载
评论 #40989067 未加载
评论 #40988949 未加载
评论 #40989315 未加载
d_burfoot10 个月前
I think it&#x27;s fine to have high-concept dependency management for the Serious Python Professionals, but what about for people who just want to put a project together and not have their life taken over by figuring out YAML syntax, new-hotness build tools, and dependency graph structures?
评论 #40988616 未加载
OutOfHere10 个月前
Due to supply-chain attacks, for your cybersecurity, I strongly encourage everyone to use a container for each project for development purposes. I do this using devcontainer.json in VSCode which is free. PyCharm too offers devcontainer integration but not for free, so I moved away from PyCharm. You can alternatively use a plain docker container if your IDE integrates with it, but devcontainer is more suited for this purpose. All this is assuming that you don&#x27;t use a web IDE which already offers project isolation.
smitty1e10 个月前
Please let the magical pi version of py, 3.14, get python to a suitable, standardized vessel for packaging.<p>I realize the Venn of packaging has copious disjoint functionality slices.<p>Too, what one does for a bit of one-off, non-typed cloud manipulation is different than for a full-on, re-usable library.<p>But the fabulous disaster that is the python packaging landscape was tiresome a decade ago.<p>Maybe the PSF can sponsor a kickstarter so that peanut gallery mouths like mine can contribute funds where our skills are tapering off.
kh_hk10 个月前
I will change my projects to use pyproject.toml and remove all the requirements.txt. Looking forward to changing it again for py_requirements.yatxml in 5 years
jwilber10 个月前
Enjoyed the article, I think it mentions some good practices, although it’s missing some topics that may or may not be worth including, depending on your view of what constitutes ‘packaging’ in python.<p>This bit towards the end certainly came out of left field, but made me laugh:<p>dawn your peepers on some of these fun adventures in hiring i’ve had recently:<p>rejected in interviews by a 25 year old senior hiring manager rejected in interviews by a 28-something who had worked at google for 5 years and had a PhD from stanford rejected for arguing, akshually, i made more 10 years ago than what your scale is rated at rejected by some founders who got rich by selling an ios fart app to apple ten years ago rejected via HR&#x2F;email&#x2F;auto-reject a couple places at least nobody has ever accused me of not being sufficiently candid.
评论 #40988298 未加载
odie553310 个月前
&gt; BAD: you use the built-in python logging module. It is a complete disaster of an API. You should use loguru everywhere instead.<p>???
avhception10 个月前
Isn&#x27;t `src`, as in `src&#x2F;packagename&#x2F;__init__.py`, a thing any more?
评论 #40991723 未加载
focom10 个月前
tl;dr use poetry and write decent code
评论 #40988061 未加载