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

Update dependencies #21

Open
HP41 opened this issue Feb 11, 2021 · 0 comments
Open

Update dependencies #21

HP41 opened this issue Feb 11, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@HP41
Copy link
Contributor

HP41 commented Feb 11, 2021

Description

  • Update dependencies/requirements in both the module and template itself.
  • The Build/Test steps are failing due to a mismatch in PowerShellBuild version in psake task FromModule and the one defined in requirements.psd1

Describe the solution you'd like

PR incoming!

Describe any alternatives you've considered

Updating them in my generated module but where's the fun in that ;)

Additional context

I also wanted to start a discussion in general about dependency management in PowerShell development:

  • What's the best practice around this?
  • I find it hard to consolidate the following features without complex code/Build processes:
    • Module requirements
    • Development only requirements
    • Auto install/import modules when this module is required
      • I do know there's RequiredModules in the Module Manifest but it only downloads the dependencies when installing it for the first time.
      • It doesn't have any more smarts like npm.
    • Dependency hell/version management/virtualenv
      • I wonder how conflicting dependencies are managed in a shared shell environment. As in, when module x and y require different incompatible version of module z.
      • Also while developing how can one do a form of virtualenv without polluting their shell? (I think PSDepend has something like this as long as all dependency management goes through it)

Elsewhere I've tried this:

  • Use PSDepend with requirements.psd1 and requirements.dev.psd1 for their respective dependencies.
  • Get-Dependency -Path requirements.psd1 and set the Module Manifest's RequiredModules (requirements.dev is not included)
    • if Version is latest do not set a version for the dependency in Manifest.
    • If Version is compatible with [Version] type then set that.
    • RequiredModules only works with [Version] type. PSDepend and PSGallery works with SemVer.
  • Use a build.ps1 file to install dependencies, just like Stucco.
  • Therefore when developing the module, one can download/install both requirements and requirements.dev
  • When installing the module from a repository as an end user, the injected details into RequiredModules should install the necessary modules.
  • I also toyed with the idea of just invoking PSDepend in the module thus all dependency management going through PSDepend at all levels. However it didn't seem right to bypass PowerShell's packagemanagement and also hinders general metadata/discoverability as the Module Manifest isn't fully descriptive of what the Module is doing/needs.

What do you think?

@HP41 HP41 mentioned this issue Feb 11, 2021
9 tasks
@devblackops devblackops reopened this Feb 27, 2021
@devblackops devblackops reopened this Feb 27, 2021
@devblackops devblackops added the bug Something isn't working label Nov 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants