@@ -19,27 +19,30 @@ func (p *Preparer) BuildPythonProgram(ctx context.Context) (sdkbuild.Program, er
1919
2020 // Get version from pyproject.toml if not present
2121 version := p .config .Version
22+ versionFromPyProj := ""
2223 if version == "" {
2324 b , err := os .ReadFile (filepath .Join (p .rootDir , "pyproject.toml" ))
2425 if err != nil {
2526 return nil , fmt .Errorf ("failed reading pyproject.toml: %w" , err )
2627 }
2728 for _ , line := range strings .Split (string (b ), "\n " ) {
2829 line = strings .TrimSpace (line )
29- if strings .HasPrefix (line , "temporalio = " ) {
30+ if strings .Contains (line , "temporalio" ) {
3031 version = line [strings .Index (line , `"` )+ 1 : strings .LastIndex (line , `"` )]
3132 break
3233 }
3334 }
3435 if version == "" {
3536 return nil , fmt .Errorf ("version not found in pyproject.toml" )
3637 }
38+ versionFromPyProj = version
3739 }
3840
3941 prog , err := sdkbuild .BuildPythonProgram (ctx , sdkbuild.BuildPythonProgramOptions {
40- BaseDir : p .rootDir ,
41- DirName : p .config .DirName ,
42- Version : version ,
42+ BaseDir : p .rootDir ,
43+ DirName : p .config .DirName ,
44+ Version : version ,
45+ VersionFromPyProj : versionFromPyProj ,
4346 })
4447 if err != nil {
4548 return nil , fmt .Errorf ("failed preparing: %w" , err )
0 commit comments