
Phillip J. Eby wrote:
Only that I personally found editing the files directly to be an enormous pain. :)
Why? The only issue I see is that setup.py puts all that data in one place, where otherwise it's several separate files to work with. But anyway, I guess I'm thinking about tools to make that manipulation easier or more consistent, so I'm apt to consider them separately.
There are numerous ways to solve your problem, however. For example, you can create a command that runs egg_info and then rewrites the requires.txt file, and run it before commands that need egg_info. For example, you could create an alias like:
develop = egg_info strict_requires develop
that runs your "exact_requires" to rewrite the file before running develop.
I think I'd probably want something like:
strict_install = egg_info --tag-date strict_requires install
I feel like using a specific set of requirements means that the package itself is a new version, hence --tag-date. And the whole thing is best done as an entirely new command (strict_install) since this is something I'd only do for some installations (not during development, for instance), and I don't really want to override an existing command.
I'm a little wary of rewriting something that egg_info writes, because egg_info can rewrite it later. But I suppose the command alias makes it into a single operation, so it doesn't seem as fragile. Though one advantage of editing the files is that I could apply strict_requires to a tag and commit those changes, encapsulating the exact environment that was used when creating that tag.