LSSTDESC / CLMM

A Python library for performing galaxy cluster mass reconstruction from weak lensing observables
BSD 3-Clause "New" or "Revised" License
24 stars 20 forks source link

Make CLMM conda instalable #648

Open eduardojsbarroso opened 3 hours ago

eduardojsbarroso commented 3 hours ago

I am trying to make CLMM conda instalable. I am currently using hatch to create the pyproject.toml file. However, after creating the pyproject.toml file and trying to publish the package to PypiTest to see if things run smoothly, I keep getting an error message saying that I cannot upload a package with a direct reference dependency. This is happening due to the qp-prob package used in CLMM.

Here is the error if I try to publish the package including qp-prob as a dependency:

INFO     Using configuration from /pbs/home/e/ebarroso/.pypirc                                                                                                                   
Uploading distributions to https://test.pypi.org/legacy/
INFO     dist/clmm-1.14.1-py3-none-any.whl (83.9 KB)                                                                                                                             
INFO     dist/clmm-1.14.1.tar.gz (68.1 KB)                                                                                                                                       
INFO     password set from config file                                                                                                                                           
INFO     username: __token__                                                                                                                                                     
INFO     password: <hidden>                                                                                                                                                      
Uploading clmm-1.14.1-py3-none-any.whl
100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 99.7/99.7 kB • 00:00 • 272.1 MB/s
INFO     Response from https://test.pypi.org/legacy/:                                                                                                                            
         400 Bad Request                                                                                                                                                         
INFO     <html>                                                                                                                                                                  
          <head>                                                                                                                                                                 
           <title>400 Can't have direct dependency: qp-prob@ git+https://github.com/LSSTDESC/qp.git. See https://packaging.python.org/specifications/core-metadata for more      
         information.</title>                                                                                                                                                    
          </head>                                                                                                                                                                
          <body>                                                                                                                                                                 
           <h1>400 Can't have direct dependency: qp-prob@ git+https://github.com/LSSTDESC/qp.git. See https://packaging.python.org/specifications/core-metadata for more         
         information.</h1>                                                                                                                                                       
           The server could not comply with the request since it is either malformed or otherwise incorrect.<br/><br/>                                                           
         Can&#x27;t have direct dependency: qp-prob@ git+https://github.com/LSSTDESC/qp.git. See https://packaging.python.org/specifications/core-metadata for more information. 

          </body>                                                                                                                                                                
         </html>                                                                                                                                                                 
ERROR    HTTPError: 400 Bad Request from https://test.pypi.org/legacy/                                                                                                           
         Bad Request   

If I remove the qp-prob dependency, I am able to publish it to Pypi (it is not there now because I remove it):

INFO     Using configuration from /pbs/home/e/ebarroso/.pypirc                                                                                                                   
Uploading distributions to https://test.pypi.org/legacy/
INFO     dist/clmm-1.14.2-py3-none-any.whl (83.9 KB)                                                                                                                             
INFO     dist/clmm-1.14.2.tar.gz (68.0 KB)                                                                                                                                       
INFO     password set from config file                                                                                                                                           
INFO     username: __token__                                                                                                                                                     
INFO     password: <hidden>                                                                                                                                                      
Uploading clmm-1.14.2-py3-none-any.whl
100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 99.6/99.6 kB • 00:00 • 264.6 MB/s
INFO     Response from https://test.pypi.org/legacy/:                                                                                                                            
         200 OK                                                                                                                                                                  
INFO     <html>                                                                                                                                                                  
          <head>                                                                                                                                                                 
           <title>200 OK</title>                                                                                                                                                 
          </head>                                                                                                                                                                
          <body>                                                                                                                                                                 
           <h1>200 OK</h1>                                                                                                                                                       
           <br/><br/>                                                                                                                                                            

          </body>                                                                                                                                                                
         </html>                                                                                                                                                                 
Uploading clmm-1.14.2.tar.gz
100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 83.3/83.3 kB • 00:00 • 283.0 MB/s
INFO     Response from https://test.pypi.org/legacy/:                                                                                                                            
         200 OK                                                                                                                                                                  
INFO     <html>                                                                                                                                                                  
          <head>                                                                                                                                                                 
           <title>200 OK</title>                                                                                                                                                 
          </head>                                                                                                                                                                
          <body>                                                                                                                                                                 
           <h1>200 OK</h1>                                                                                                                                                       
           <br/><br/>                                                                                                                                                            

          </body>                                                                                                                                                                
         </html>                                                                                                                                                                 

View at:
https://test.pypi.org/project/clmm/1.14.2/

Here are some ways around this problem (https://til.dchan.cc/posts/11-29-2022/), which I do not think are very good because we would have to mantain the code. If the qp-prob repository has no plans to be changes, I think I can try option 1.

Bottomline:

I appreciate any feedback @m-aguena @marina-ricci

eduardojsbarroso commented 3 hours ago

@caioolivv I think you said you planned to try to make CLMM conda instalable as well. Let me know if you have any feedback on this