ericmandel / pyds9

Python connection to SAOimage DS9 via XPA
76 stars 41 forks source link

Error installing pyds9 due to astropy_helpers #107

Open ysBach opened 1 year ago

ysBach commented 1 year ago
# cd github-cloned-repo
❯ pip install -e .
Obtaining file:///Users/github/pyds9
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [6 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/Users/github/pyds9/setup.py", line 45, in <module>
          cmdclassd = register_commands()
      TypeError: register_commands() missing 3 required positional arguments: 'package', 'version', and 'release'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

Using MBP 14" [2021, macOS 13.1, M1Pro(6P+2E/G16c/N16c/32G)], python 3.10 with Anaconda.

As astropy_helpers is deprecated, I wish the setup files to remove astropy_helpers eventually. (I really want to contribute but I have virtually no knowledge about setup files, especially on astropy_helpers...)

jbrinchmann commented 1 year ago

As a work-around for now, the following works for me on python 3.10.9, numpy 1.23.5, astropy 5.1:

In setup.py add

VERSION = metadata.get('version', '')
RELEASE = False  # To indicate it is a devel version    

after URL = metadata.get('url', '') and modify the

cmdclassd = register_commands()

# Freeze build information in version.py
generate_version_py(debug=get_debug_option(PACKAGENAME))

to

cmdclassd = register_commands(PACKAGENAME, VERSION, RELEASE)

# Freeze build information in version.py
generate_version_py(PACKAGENAME, VERSION, RELEASE, debug=get_debug_option(PACKAGENAME))

I did not submit a push request for this since, as @ysBach says, astropy_helpers is not at all the way forwards but it is an easy enough fix.