flit icon indicating copy to clipboard operation
flit copied to clipboard

Add "install-reqs" command to CLI

Open dciborow opened this issue 3 years ago • 3 comments

This extends the CLI, and provides a command wrapper for an additional public function, install_requirements(). This will skip installing the user's code, but will still install all required dependencies. This is particularly useful for preparing building images or containers by enabling users to pre-install dependencies, without installing the source code directly.

This enables installation of dependencies without the need for separate requirements.txt files

flit install-reqs

The following command can be used instead of pip install -r requirements.test.txt or pip install .[test]

flit install-reqs --deps test

Open Issues The following issues are present, because they are required for normal package installation, but are unnecessarily when installing the dependencies.

  • User is required to have "README.md"
  • User is required to have package directory

dciborow avatar Apr 26 '22 17:04 dciborow

I have been working with @brettcannon on a template for Python Projects using pyproject.toml. When converting, I removed my requirements.txt and requirements.test.txt, which would previously be parsed in my setup.py. This leaves me a bit stuck on how to install just my dependencies. Before I went and created some crazy TOML parser, i discovered all the needed code was already located in a public method within 'flit', but had not been exposed.

dciborow avatar Apr 26 '22 17:04 dciborow

@takluyver do you have an feedback for this requested feature?

dciborow avatar Aug 02 '22 23:08 dciborow

Is anything blocking this from getting included?

svartkanin avatar Sep 19 '22 12:09 svartkanin

Hi, sorry it's taken me so long to look at this - life has been getting in the way. :slightly_smiling_face:

I'm happy with the idea of exposing this, but I think I'd prefer to do so as an option for flit install rather than a separate subcommand. How about --only-deps, to mirror pip's --no-deps option?

Poetry has the same thing as --no-root, which I understand - your local project is the root of the dependency ~~tree~~ graph it's dealing with - but I don't find it a particularly clear name.

takluyver avatar Oct 31 '22 15:10 takluyver

I've gone with --only-deps - thanks!

takluyver avatar Nov 05 '22 12:11 takluyver

changing the title so it accurate reflects the implementation.

dciborow avatar Mar 11 '23 21:03 dciborow