-
-
Notifications
You must be signed in to change notification settings - Fork 389
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
simplify dev vs prod installs #3028
Comments
Have you thought about creating a new virtualenv for testing your production environment and not reusing the development environment? Afaik, pdm can handle multiple ones - you still would need the extra lock file to my understanding, so this could, indeed, be more streamlined. Nevertheless, for me, I am using an additional environment to test productive behavior. I am not even using pdm to create it, just using pip because I assume that's what most users will do. At the end, I have this automated as Gitlab pipeline that also does simple smoke tests (to see if the dependencies resolve ok etc.) |
Thanks @o-moe, I agree that this issue is fairly trivially solved. I simply find it a bit more convoluted than ideal, and I think new users would benefit from some additional recommendations for a typical development setup as I found the gotchas to be non-intuitive. Cheers. |
True, I’ll just have to put up with multiple lock files 😉 Thanks Sean.
Cheers,
Marcel
From: Xuan (Sean) Hu ***@***.***>
Date: Saturday, July 27, 2024 at 6:13 PM
To: pdm-project/pdm ***@***.***>
Cc: Goldschen, Marcel ***@***.***>, Author ***@***.***>
Subject: Re: [pdm-project/pdm] simplify dev vs prod installs (Issue #3028)
AFAIK, the dev dependencies are used for lint/docs and tests, so local editable may not be the desired user case. Since we can not lock two versions of the same package in one lockfile, at least two lockfiles are needed for that I think.
—
Reply to this email directly, view it on GitHub<#3028 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ABYB6KUALH4HU54HS7OMGIDZOQSP7AVCNFSM6AAAAABLA47FDOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENJUGI3TQMZZHE>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
I'm new to PDM, so I probably am not be considering everything. However, I find it both non-intuitive and overly convoluted to swap between development and production installs. For example, consider a
pyproject.toml
with:where
mypackage
is both available via pypi and installed locally atpath/to/mypackage
for development.For development only, things are simple. Running
pdm install
creates thepdm.lock
file that refers to the localpath/to/mypackage
file and installs it in editable mode. Great!However, as soon as I want to test the production version, things get tricky. I find it very non-intuitive that running
pdm install --prod
does not replace the local editablepath/to/mypackage
with themypackage
from pypi. I now understand thatpdm.lock
only refers topath/to/mypackage
and not themypackage
from pypi. However, it is annoying to have to manually create a new lock file such aspdm lock --prod -L pdm.prod.lock
and constantly refer to it with the extra flag-L pdm.prod.lock
. Even so, runningpdm install -L pdm.prod.lock
still does NOT overwrite the editablepath/to/mypackage
that was installed for development. The non-intuitive solution after some digging is to runpdm install -L pdm.prod.lock --no-editable
. Although this works, I find it both non-intuitive and overly complicated. Why can'tpdm install --dev
orpdm install --prod
handle all of this including creating any appropriate lock files as needed?I'm sure there is probably a good answer to this. However, as a new user I'd just say that I found this to be very frustrating.
Cheers
The text was updated successfully, but these errors were encountered: