File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -603,17 +603,19 @@ def read_pep621_metadata(proj, path) -> LoadedConfig:
603603 raise ConfigError (
604604 "[project.license] should specify file or text, not both"
605605 )
606- license_f = license_tbl ['file' ]
606+ license_f = osp . normpath ( license_tbl ['file' ])
607607 if isabs_ish (license_f ):
608608 raise ConfigError (
609- f"License file path ({ license_f } ) cannot be an absolute path"
609+ f"License file path ({ license_tbl [ 'file' ] } ) cannot be an absolute path"
610610 )
611- if ".." in license_f :
611+ if license_f . startswith ( '..' + os . sep ) :
612612 raise ConfigError (
613- f"License file path ({ license_f } ) cannot contain '..'"
613+ f"License file path ({ license_tbl [ 'file' ] } ) cannot contain '..'"
614614 )
615- if not (path .parent / license_f ).is_file ():
616- raise ConfigError (f"License file { license_f } does not exist" )
615+ license_p = path .parent / license_f
616+ if not license_p .is_file ():
617+ raise ConfigError (f"License file { license_tbl ['file' ]} does not exist" )
618+ license_f = str (license_p .relative_to (path .parent )).replace (osp .sep , "/" )
617619 license_files .add (license_f )
618620 elif 'text' in license_tbl :
619621 pass
You can’t perform that action at this time.
0 commit comments