Skip to content

Commit 25e9950

Browse files
committed
🏗️ Splits PSM1, Removes #Requires from PSM1
Tests were failing because the module was not importable. The `#Requires` syntax being used in the root PSM1 prevented dependencies from being fully resolved before the module loading could complete, making the module unusable.
1 parent ed986b9 commit 25e9950

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

src/_python3.ps1 renamed to src/poshy-wrap-python.ps1

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/env pwsh
22
$ErrorActionPreference = "Stop"
33
Set-StrictMode -Version Latest
4+
#Requires -Modules @{ ModuleName = "poshy-lucidity"; RequiredVersion = "0.4.1" }
45

56

67
function _python3() {
@@ -20,3 +21,11 @@ function pyserver {
2021
Set-Alias -Name python3 -Value _python3
2122
Set-Alias -Name py -Value _python3
2223
Set-Alias -Name python -Value _python3
24+
25+
26+
if ((Test-Command ipython3) -or (Get-Variable -Name PWSHRC_FORCE_MODULES_EXPORT_UNSUPPORTED -Scope Global -ValueOnly -ErrorAction SilentlyContinue)) {
27+
Set-Alias -Name ipy -Value ipython3
28+
Set-Alias -Name ipython -Value ipython3
29+
}
30+
31+
Export-ModuleMember -Function * -Alias *

src/poshy-wrap-python.psm1

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,6 @@
11
#!/usr/bin/env pwsh
22
$ErrorActionPreference = "Stop"
33
Set-StrictMode -Version Latest
4-
#Requires -Modules @{ ModuleName = "poshy-lucidity"; RequiredVersion = "0.4.1" }
54

65

7-
Get-ChildItem -Path "$PSScriptRoot/*.ps1" | ForEach-Object {
8-
. $_.FullName
9-
}
10-
11-
if ((Test-Command ipython3) -or (Get-Variable -Name PWSHRC_FORCE_MODULES_EXPORT_UNSUPPORTED -Scope Global -ValueOnly -ErrorAction SilentlyContinue)) {
12-
Set-Alias -Name ipy -Value ipython3
13-
Set-Alias -Name ipython -Value ipython3
14-
}
15-
16-
Export-ModuleMember -Function * -Alias *
6+
. "$PSScriptRoot/poshy-wrap-python.ps1"

0 commit comments

Comments
 (0)