Skip to content
This repository has been archived by the owner on Nov 11, 2024. It is now read-only.

Astropy-helpers installation fails with setuptools 42.0 #501

Closed
athornton opened this issue Nov 25, 2019 · 9 comments · Fixed by #504
Closed

Astropy-helpers installation fails with setuptools 42.0 #501

athornton opened this issue Nov 25, 2019 · 9 comments · Fixed by #504

Comments

@athornton
Copy link

See pypa/setuptools#1919

Basically, if you don't also explicitly install the wheel package, the astropy-helpers build fails with something along the lines of:

    ERROR: Command errored out with exit status 1:

     command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-xtxao4pu/astroquery/setup.py'"'"'; __file__='"'"'/tmp/pip-install-xtxao4pu/astroquery/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-xtxao4pu/astroquery/pip-egg-info

         cwd: /tmp/pip-install-xtxao4pu/astroquery/

    Complete output (59 lines):

      ERROR: Command errored out with exit status 1:

       command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-wheel-c3_zcfv_/astropy-helpers/setup.py'"'"'; __file__='"'"'/tmp/pip-wheel-c3_zcfv_/astropy-helpers/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-p_66m4e6

           cwd: /tmp/pip-wheel-c3_zcfv_/astropy-helpers/

      Complete output (6 lines):

      usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]

         or: setup.py --help [cmd1 cmd2 ...]

         or: setup.py --help-commands

         or: setup.py cmd --help

    

      error: invalid command 'bdist_wheel'

      ----------------------------------------

      ERROR: Failed building wheel for astropy-helpers

    ERROR: Failed to build one or more wheels

    Traceback (most recent call last):

      File "/usr/local/lib/python3.6/site-packages/setuptools/installer.py", line 119, in fetch_build_egg

        subprocess.check_call(cmd)

      File "/usr/lib64/python3.6/subprocess.py", line 311, in check_call

        raise CalledProcessError(retcode, cmd)

    subprocess.CalledProcessError: Command '['/usr/bin/python3', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', '/tmp/tmpxb9soxnb', '--quiet', '--index-url', 'https://pypi.python.org/simple', 'astropy-helpers==2.0.11']' returned non-zero exit status 1.

"Be-PEP-517 Compliant" seems to be the recommended fix, although I don't know what that entails. See https://stackoverflow.com/questions/58753970/how-to-build-a-source-distribution-without-using-setup-py-file/58756491#58756491 .

@pllim
Copy link
Member

pllim commented Nov 25, 2019

@athornton , astropy-helpers is meant to be a Git submodule, not a separate installable package.

@athornton
Copy link
Author

I wasn't installing it directly. It was being installed in the context of a pyvo installation.

Here's a minimal Dockerfile to replicate.

FROM centos:7
RUN yum -y install python3
# Get newer setuptools before Python packages
RUN  pip3 install --upgrade pip setuptools
# And now the installation fails when you have setuptools 42.0 or later.
# If you install wheel directly it works fine.
#RUN  pip3 install --upgrade pip setuptools wheel
RUN  pip3 install pyvo

@astrofrog
Copy link
Member

The tests are failing with setuptools 42 so it may be related.

@astrofrog
Copy link
Member

Bisecting leads to pypa/setuptools#1830

@astrofrog
Copy link
Member

Yeah this is going to be a tough one to fix because indeed the right approach is to define build-time dependencies in pyproject.toml or to ask users to install the wheel package if it isn't already installed. I think this is not going to be an issue for users who use conda or who use the python.org installers but might be a problem for linux distributions where wheel is not included by default.

Fixing this in astropy-helpers might be hard because we'd have to figure out a way to auto-install wheel from ah_bootstrap.py, and might not be worth the effort given astropy/astropy-APEs#52

@pllim
Copy link
Member

pllim commented Dec 2, 2019

So... is this what we gonna do?

  1. Pin setuptools
  2. Fast-track A roadmap for package infrastructure without astropy-helpers astropy-APEs#52 acceptance and implementation

@astrofrog
Copy link
Member

For 1. we can't easily pin it since it's already installed. To be honest the main workaround at the moment is to simply install wheel as indicated by the error message. So I personally think option 2 is the only real action we can take :)

mihaic added a commit to mihaic/brainiak that referenced this issue Dec 2, 2019
Required by a change in Setuptools 42. See also:
astropy/astropy-helpers#501
mihaic added a commit to brainiak/brainiak that referenced this issue Dec 2, 2019
Required by a change in Setuptools 42. See also:
astropy/astropy-helpers#501
@pllim
Copy link
Member

pllim commented Dec 19, 2019

I am running into this over at spacetelescope/stsynphot_refactor#96 . stsynphot needs to be compatible with at least the latest release of synphot, which uses astropy-helpers 3.x, which does not have the fix for this problem. What are my options -- release a bugfix version for synphot with updated astropy-helpers, upload a wheel (how do I do that?), or ...?

@bsipocz
Copy link
Member

bsipocz commented Dec 19, 2019

the issue with the wheel that it won't solve the issue for anyone who is using a version you don't provide the wheel for.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants