News for hackers. Stuff that matters.
Re:How to improve Python packaging, or why 14 tools are at l... by Denvercoder9 on Sunday January 15, 2023 @01:28PM (#34391687)
That repository doesn't seem to pin dependency versions. How do you integrate that in this workflow?
Re:How to improve Python packaging, or why 14 tools are at l... by woodruffw on Sunday January 15, 2023 @01:35PM (#34391752)
You could use `pip-compile` if you want full pinning. That's what we do on another project -- we use GitHub Actions with `pip-compile` to provide a fully frozen copy of the dependency tree for users who'd like that[1].

In the context of `pip-audit`, that makes a little less sense: most of our dependencies are semantically versioned, and we'd rather users receive patches and fixes to our subdependencies automatically, rather than having to wait for us to release a corresponding fix version. Similarly, we expect users to install `pip-audit` into pre-existing virtual environments, meaning that excessive pinning will produce overly conservative dependency conflict errors.

[1]: https://github.com/sigstore/sigstore-python/tree/main/instal...

Re:How to improve Python packaging, or why 14 tools are at l... by Izkata on Sunday January 15, 2023 @01:47PM (#34391864)
Or if you don't want to install something else and are willing to just use version numbers (instead of also hashes like pip-compile in that link), "pip freeze" is built in.
Re:How to improve Python packaging, or why 14 tools are at l... by woodruffw on Sunday January 15, 2023 @02:05PM (#34392067)
The tricky thing with `pip freeze` is that it dumps your environment, not your resolved set: your environment also contains things like your `pip` and `setuptools` versions, any developing tooling you have, and potentially your global environmental state (if the environment has global access and you forget to pass `--local` to `pip freeze`).

In other words, it's generally a superset of the resolutions collected by `pip-compile`. This may or may not be what you want, or what your users expect!

Re:How to improve Python packaging, or why 14 tools are at l... by Izkata on Sunday January 15, 2023 @02:16PM (#34392192)
By default (at least in python3 nowadays) it also excludes pip, setuptools, distribute, and wheel; you need "--all" to include them in the output.
Re:How to improve Python packaging, or why 14 tools are at l... by woodruffw on Sunday January 15, 2023 @02:19PM (#34392226)
Oh, that's news to me! I stand corrected.

(The point about other development tooling is, I believe, still accurate -- if you e.g. have `black` installed, `pip freeze` will show it.)

Re:How to improve Python packaging, or why 14 tools are at l... by fbdab103 on Sunday January 15, 2023 @05:08PM (#34394109)
Which is a huge limitation of many of the other tools. I have some beef with poetry, but it did at least get one thing correct: differentiating between the code required libraries and the development tooling (pytest, black, etc). There are hacky workarounds to accomplish this with other tools, but codifying this differentiation is incredibly valuable.
Re:How to improve Python packaging, or why 14 tools are at l... by vladvasiliu on Monday January 16, 2023 @01:28AM (#34397511)
With pip-tools you can use a requirements.txt for production and a requirements-dev.txt for your development environment. The latter imports the former.