question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Install for production

See original GitHub issue

Is your feature request related to a problem? Please describe.

Most dependency managers have a --production (or similar) flag to only install for production. A normal install without that flag install all dependencies (production + development).

Looking at https://pdm.fming.dev/usage/dependency/#install-the-packages-pinned-in-lock-file this is confusing.

Describe the solution you’d like

I would like it to mimic how other tools does this and believe this tool incorrectly took the approach of pipenv. See https://github.com/pypa/pipenv/issues/3093#issuecomment-432718562 for more reference of tools (the entire thread is interesting).

The reason is that developers are bound to want to install all (production + dev) dependencies in their daily work. A pdm install is thus quicker to write. It also mimics most (all?) other package managers out there.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:22 (5 by maintainers)

github_iconTop GitHub Comments

6reactions
frostmingcommented, Apr 15, 2021

In fact, it is likely that I would switch to CalVer at some point 🤣 https://hynek.me/articles/semver-will-not-save-you/

2reactions
pawamoycommented, Apr 15, 2021
command what it does
1- pdm install installs prod and dev deps (not optional prod deps)
2- pdm install -s hello installs prod and dev deps, as well as hello optional prod group
3- pdm install -d installs prod and dev deps (not optional deps), redundant with °1
4- pdm install -ds hello installs prod deps and hello group of dev deps
5- pdm install --production installs only prod deps
6- pdm install --production -s hello installs prod deps and hello optional prod group
7- pdm install --production -d does not make sense
8- pdm install --production -ds hello does not make sense

Seeing these, I feel like if we go for a --production flag, the -d flag should be removed. Sections should have different names between prod groups and dev groups, allowing -s to match prod groups and/or dev groups.

Lets shorten --production to -p in this example. This would give us this:

command what it does useful…
1- pdm install installs prod and dev deps (no prod groups) locally/in CI
2- pdm install -s prodgroup1 installs prod deps, dev deps, and “prodgroup1” prod group locally/in CI
3- pdm install -s devgroup1 installs prod deps and only “devgroup1” dev group in CI
4- pdm install -s prodgroup1 -s devgroup1 installs prod deps, “prodgroup1” prod group and “devgroup1” dev group in CI
5- pdm install -p installs only prod deps in CD
6- pdm install -p -s hello installs prod deps and “hello” prod group. if “hello” is a dev group, fails in CD

Additionally there’s the --no-default flag that could be used in the first 4 cases to prevent installing the prod deps (those that are not optional), useful in CI.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do you prevent install of "devDependencies" NPM ...
The npm install command will install the devDependencies along other dependencies when run inside a package directory, in a development environment (the ...
Read more >
npm-install - npm Docs
This command installs a package and any packages that it depends on. If the package has a package-lock, or an npm shrinkwrap file,...
Read more >
Installing the Site on a Production Server with Composer
Installing the Site on a Production Server with Composer · Clone the repo · Run Composer Install --no-dev · Configure Database · Install...
Read more >
yarn install
yarn install is used to install all dependencies for a project. This is most commonly used when you have just checked out code...
Read more >
How to Install Node.js Dependencies for Production ...
When running a node app in production you want it to install as quick as possible. Pushing new code into the app repository...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found