Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "--only-deps" flag to install command #546

Merged
merged 17 commits into from
Nov 5, 2022

Conversation

dciborow
Copy link
Contributor

@dciborow dciborow commented Apr 26, 2022

tl;dr We added --only-deps to flit install

The final implementation is slightly different than originally proposed. The final implementation enables the following command.
flit install --only-deps

Proposal

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 added 13 commits April 25, 2022 23:58
This extends the CLI, and provides a command to an additional public function, `install_requirements()`. This will skip installing the user's code, but will still install all required dependencies.

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`

`flit install-reqs --deps test`
@dciborow
Copy link
Contributor Author

dciborow commented Apr 26, 2022

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
Copy link
Contributor Author

dciborow commented Aug 2, 2022

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

@svartkanin
Copy link

Is anything blocking this from getting included?

@takluyver
Copy link
Member

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

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 takluyver added this to the 3.8 milestone Nov 5, 2022
@takluyver
Copy link
Member

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

@takluyver takluyver merged commit 5b30163 into pypa:main Nov 5, 2022
@dciborow dciborow deleted the dciborow/install-reqs branch November 8, 2022 18:39
@dciborow dciborow changed the title Add "install-reqs" command to CLI Add "--only-deps" flag to install command Mar 11, 2023
@dciborow
Copy link
Contributor Author

changing the title so it accurate reflects the implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants