astropy / astropy-healpix

BSD-licensed HEALPix for Astropy - maintained by @astrofrog and @lpsinger
https://astropy-healpix.readthedocs.io
BSD 3-Clause "New" or "Revised" License
50 stars 22 forks source link

Importing `astropy_healpix` can generate a warning from setuptools_scm #211

Open taldcroft opened 6 months ago

taldcroft commented 6 months ago

If the file .git_archival.txt exists in the current directory, then importing astropy_healpix will generate a warning from setuptools_scm. For some reason the .git_archival.txt file is noticed by setuptools_scm in the import process. An example is shown below.

We have many packages using the same setuptools_scm machinery and they do not have this issue. The core astropy is another example, so it seems to be something in the way astropy-healpix is working.

$ conda create -n astropy-healpix python=3.10
$ conda activate astropy-healpix
$ pip install astropy-healpix setuptools_scm

$ mkdir test
$ cd test

$ python -c "import astropy_healpix"

$ touch .git_archival.txt
$ python -c "import astropy_healpix"
/Users/aldcroft/miniconda3/envs/astropy-healpix/lib/python3.10/site-packages/setuptools_scm/git.py:308: UserWarning: git archive did not support describe output
  warnings.warn("git archive did not support describe output")
lpsinger commented 6 months ago

This might be because we haven't fully transitioned away from setup.py in this project yet.

taldcroft commented 6 months ago

In our local packages we use setuptools_scm and setup.py without any issues.

But the point about moving away from setup.py and adopting the machinery for setuptools_scm that is used by astropy itself seems like it should fix this issue and be a good thing anyway.