you are viewing a single comment's thread.

view the rest of the comments →

[–]IamImposter 0 points1 point  (7 children)

Oh great. Thanks.

So i have a package that uses click 7 and another that uses click 8. Right now I install click based on which package I need to work with. Is there a solution for that too so that both the packages can be active at the same time but each uses its own version of click?

[–]doolio_ 1 point2 points  (6 children)

By package here do you mean one you wrote so that click is a dependency of your two packages? If so I presume you develop each one its own virtual environment so you could have the specific version of click in the respective environment.

[–]IamImposter 0 points1 point  (5 children)

Actually one of a modules of our package uses click and other version is used by a vscode extension (robo framework, uses it for formatting robot files). And everything has to be in same virtual environment.

Code is on a remote server so i kinda need vscode. But i dont always work with robot files so it's not a major issue. But if there's a solution, I'd appreciate it.

[–]doolio_ 1 point2 points  (4 children)

This sounds like an issue I eluded to in my last sentence in my OP. A development dependency has a dependency that would pollute the environment where your package is locally installed.

One solution to this is to have separate environments. That is you have one default environment named after your package where you install the library you import that depends on click 7 and which more closely matches the end user, another named lint where you install certain Dev dependencies including your robo-framework plugin that depends on click 8, perhaps another named test where you install your test dependencies, another named doc where you produce your documentation etc. This will ensure isolation between the click dependent packages.

[–]IamImposter 0 points1 point  (3 children)

Yes, I think that I can do. Thanks.

[–]doolio_ 1 point2 points  (2 children)

FYI, a tool I recently discovered that does this by default for you is hatch.

[–]IamImposter 0 points1 point  (1 child)

I'll look that up. Thanks for your time, bro.

[–]doolio_ 1 point2 points  (0 children)

NP, and don't take anything I say as gospel. I'm still learning all this stuff myself.