anjakefala commented on PR #41041:
URL: https://github.com/apache/arrow/pull/41041#issuecomment-2050653995

   This is the current challenge for this PR.
   
   To migrate the static metadata to the pyproject.toml, we need to set a 
`version`. In PyArrow, the version is set dynamically using setuptools_scm.
   
   Setuptools_scm will only let you [configure Callables in the 
setup.py](https://setuptools-scm.readthedocs.io/en/stable/config/). There are 
two callables we set, one for `parse` and one for `version_scheme`.
   
   ```
    429 def parse_git(root, **kwargs):                                          
                                                                                
                                                                      
    430     """                                                                 
                                                                                
                                                                      
    431     Parse function for setuptools_scm that ignores tags for non-C++     
                                                                                
                                                                      
    432     subprojects, e.g. apache-arrow-js-XXX tags.                         
                                                                                
                                                                      
    433     """                                                                 
                                                                                
                                                                      
    434     from setuptools_scm.git import parse                                
                                                                                
                                                                      
    435     kwargs['describe_command'] =\                                       
                                                                                
                                                                      
    436         'git describe --dirty --tags --long --match 
"apache-arrow-[0-9]*.*"'                                                        
                                                                                
          
    437     return parse(root, **kwargs)                                        
                                                                                
                                                                      
    438                                          
   ```
   
   ```
    440 def guess_next_dev_version(version):                                    
                                                                                
                                                                      
    441     if version.exact:                                                   
                                                                                
                                                                      
    442         return version.format_with('{tag}')                             
                                                                                
                                                                      
    443     else:                                                               
                                                                                
                                                                      
    444         def guess_next_version(tag_version):                            
                                                                                
                                                                      
    445             return default_version.replace('-SNAPSHOT', '')             
                                                                                
                                                                      
    446         return version.format_next_version(guess_next_version)          
                                                                                
                                                                      
    447                                                                
   ```
   
   As they currently are, we cannot configure these in the pyproject.toml, it 
will not accept a Python callable.
   
   The next part of the challenge is that if you move the version metadata to 
pyproject.toml, none of the configurations in `setup.py` will be picked up. 
That is why the build is failing. So you cannot put the static variables in 
pyproject.toml, and pass the Python callables into setup.py via 
`use_scm_version`. It is an all-or-nothing migration.
   
   I'm thinking that the next step is to contact the maintainers of 
setuptools_scm, and see if they have any advice. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to