@@ -15,6 +15,8 @@ Parameter PackageWithPythonDepsLocation = "package-with-python-deps";
1515
1616Parameter ExportPackageWithPythonDepsLocation = " export-package-with-python-deps" ;
1717
18+ Parameter PublishWithPythonDepsLocation = " publish-with-python-deps" ;
19+
1820/// The PythonWheel resource processor expects to install wheels from the dist directory, as opposed to source code
1921ClassMethod GenerateWheel ()
2022{
@@ -199,4 +201,45 @@ Method TestPackageWithPythonDeps() As %Status
199201 do $$$AssertStatusOK(sc , " Deleted local filesystem repo" )
200202}
201203
204+ /// Test publishing with the -export-python-deps flag
205+ Method TestPublishWithPythonDeps () As %Status
206+ {
207+ set moduleName = " publish-with-python-deps"
208+
209+ // Create a filesystem repository
210+ set dir = ..GetModuleDir (" python-deps-tests" , ..#PublishWithPythonDepsLocation)
211+ set sc = ##class (%IPM.Main ).Shell (" repo -fs -name localrepo -path " _dir )
212+ do $$$AssertStatusOK(sc , " Configured local filesystem repo" )
213+
214+ // Install module from local filesystem repo
215+ set sc = ##class (%IPM.Main ).Shell (" install -v localrepo/" _moduleName )
216+ do $$$AssertStatusOK(sc , " Installed module from local filesystem repo" )
217+
218+ // Create a remote repository for publishing
219+ set sc = ##class (%IPM.Main ).Shell (" repo -r -name remote -url http://registry:52773/registry -username admin -password SYS" )
220+ do $$$AssertStatusOK(sc , " Configured remote repo" )
221+
222+ // Publish module to remote repository
223+ set sc = ##class (%IPM.Main ).Shell (" publish -v " _moduleName _" -r remote -export-python-deps" )
224+ do $$$AssertStatusOK(sc , " Published module " _moduleName _" to remote repository" )
225+
226+ // Uninstall module that came from filesystem repository
227+ set sc = ##class (%IPM.Main ).Shell (" uninstall " _moduleName )
228+ do $$$AssertStatusOK(sc , " Uninstalled module successfully" )
229+
230+ // Install published module from remote repository
231+ set sc = ##class (%IPM.Main ).Shell (" install -v remote/" _moduleName )
232+ do $$$AssertStatusOK(sc , " Successfully installed published module " _moduleName _" from remote repository" )
233+
234+ // Uninstall the module used for this test
235+ set sc = ##class (%IPM.Main ).Shell (" uninstall " _moduleName )
236+ do $$$AssertStatusOK(sc , " Uninstalled module " _moduleName _" successfully" )
237+
238+ // Remove the repositories used for this test
239+ set sc = ##class (%IPM.Main ).Shell (" repo -delete -n localrepo" )
240+ do $$$AssertStatusOK(sc , " Removed local filesystem repo" )
241+ set sc = ##class (%IPM.Main ).Shell (" repo -delete -n remote" )
242+ do $$$AssertStatusOK(sc , " Removed remote repo" )
243+ }
244+
202245}
0 commit comments