astropy: [4.1RC2] Astropy module may return the wrong version

Description

When I have a PKG-INFO file in the current working dir, astropy shows the version number from this file instead of its hown one. This is something what I observed while packaging the new “photutils” version, where the wrong path is taken during pytest.

Expected behavior

Astropy should show its own version number under all circumstances

Actual behavior

The version number is wrong if a PKG-INFO file is present.

Steps to Reproduce

Shell script:

$ python3 -c "import astropy; print(astropy.__version__)"
4.1-rc2
$ echo Version: 1.2.3 > PKG-INFO
$ python3 -c "import astropy; print(astropy.__version__)"
1.2.3

System Details

Linux-5.8.0-1-amd64-x86_64-with-glibc2.29 Python 3.8.5 (default, Aug 2 2020, 15:09:07) Numpy 1.19.1 astropy 1.2.3 😁 😁 😁 Scipy 1.5.2 Matplotlib 3.3.2

I didn’t observe this with 4.0.1.post1.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 33 (33 by maintainers)

Commits related to this issue

Most upvoted comments

@eteq I can confirm (locally tested) that this is fixed.

I think I have a solution–working on it now.

Okay, thanks for the info. I noted in the RC wiki that this is a blocker.

I think this should be fixed before final 4.1 release, if possible.