desihub / speclite

Lightweight utilities for working with spectroscopic data
14 stars 19 forks source link

speclite v0.9 pip install failure #60

Closed sbailey closed 4 years ago

sbailey commented 4 years ago

The new speclite pypi v0.9 tag is failing pip installs with:

(desi) [travis*] surveysim $ pip install speclite==v0.9
Collecting speclite==v0.9
  Using cached speclite-0.9.tar.gz (627 kB)
    ERROR: Command errored out with exit status 1:
     command: /Users/sbailey/anaconda3/envs/desi/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/lt/w2k_kx011kd7s2g9rk27xgzc0000gr/T/pip-install-9b8rh66q/speclite/setup.py'"'"'; __file__='"'"'/private/var/folders/lt/w2k_kx011kd7s2g9rk27xgzc0000gr/T/pip-install-9b8rh66q/speclite/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 /private/var/folders/lt/w2k_kx011kd7s2g9rk27xgzc0000gr/T/pip-pip-egg-info-agkb5u4k
         cwd: /private/var/folders/lt/w2k_kx011kd7s2g9rk27xgzc0000gr/T/pip-install-9b8rh66q/speclite/
    Complete output (5 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/lt/w2k_kx011kd7s2g9rk27xgzc0000gr/T/pip-install-9b8rh66q/speclite/setup.py", line 83, in <module>
        generate_version_py()
    TypeError: generate_version_py() missing 2 required positional arguments: 'packagename' and 'version'
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

@dkirkby please check and fix. Thanks.

@schlafly this is current blocking factor for desihub/surveysim#73 travis failures, though I may try downgrading to v0.8 which previously worked. Mentioning @dmargala as recently wanting this v0.9 tag on pypi.

dkirkby commented 4 years ago

@sbailey can you test with:

pip install git+https://github.com/desihub/speclite.git

If that works, then I can tag v0.10 and upload to pypi.

The longer term fix is probably to abandon the astropy affiliated package infrastructure used by speclite (and specsim) since it has changed substantially and seems to cause more problems than it solves these days.

sbailey commented 4 years ago

Yes, that works for me. Please tag v0.10 and upload to pypi. Thanks.

sbailey commented 4 years ago

@dkirkby could you make this v0.10 tag and upload to pypi for use in our next software release? Thanks.

ntessore commented 4 years ago

@dkirkby Our project also needs this fixed. Installing from git works for me as well.

dkirkby commented 4 years ago

@sbailey @ntessore I just tagged v0.10 and uploaded to pypi. Sorry for the delay.

For the record, these are the steps I used:

  1. Remove "dev" from the version in setup.cfg
  2. Set the release date in CHANGES.rst
  3. Commit these changes and git tag new version.
  4. Increment version and append "dev" in setup.cfg
  5. Start a new entry for the new version in CHANGES.rst
  6. git checkout the tagged version (detached head).
  7. upload to pypi using python setup.py register build sdist --format=gztar upload
  8. checkout master and git push --tags upstream master
ntessore commented 4 years ago

@dkirkby We're still getting the same error on our CI runs:

40  Collecting speclite!=0.9; extra == "all"
41  Downloading speclite-0.10.tar.gz (627 kB)
42    ERROR: Command errored out with exit status 1:
43     command: /home/runner/work/skypy/skypy/.tox/py38-test-all-latest-cov/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-wfo81myr/speclite/setup.py'"'"'; __file__='"'"'/tmp/pip-install-wfo81myr/speclite/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-pip-egg-info-r7lwutm0
44         cwd: /tmp/pip-install-wfo81myr/speclite/
45    Complete output (5 lines):
46    Traceback (most recent call last):
47      File "<string>", line 1, in <module>
48      File "/tmp/pip-install-wfo81myr/speclite/setup.py", line 83, in <module>
49        generate_version_py()
50    TypeError: generate_version_py() missing 2 required positional arguments: 'packagename' and 'version'

Also, I should say, thanks for looking into this so quickly.

dkirkby commented 4 years ago

@ntessore Ok, thanks for checking. Are you seeing the same thing @sbailey?

I can reproduce this now, but I am not sure what is causing it. The generate_version_py function is defined in astropy-helpers here and does not require any arguments. Any ideas??

weaverba137 commented 4 years ago

Are you using a version of Astropy-helpers that is compatible with Astropy 4?

dkirkby commented 4 years ago

The pypi release bundles astropy-helpers 4.0.1. Do you know if that is compatible?

ntessore commented 4 years ago

@dkirkby The sdist bundles astropy_helpers 1.0.2 actually. Edit: see this tarball

dkirkby commented 4 years ago

@ntessore I did check the tarball earlier but only looked at astropy_helpers/CHANGES.rst which refers to 4.0.1, and that matches what I have in my local version. I am not really familiar with how git submodules work, but it looks like I need to get things back in synch somehow.

dkirkby commented 4 years ago

It looks like a fresh git clone gives you an empty astropy_helpers dir that setup.py fills using:

git submodule update --init -- astropy_helpers

which picks up the latest (4.0.1) version. I just checked that if I create an sdist now, the created tarfile has the current astropy_helpers.

dkirkby commented 4 years ago

Ok, I just tagged and uploaded v0.11 which really does use astropy_helpers 4.0.1 in its tarfile.

@ntessore Can you check this when you get a chance?

ntessore commented 4 years ago

Works for us now! 👍 Thank you!

sbailey commented 4 years ago

I confirm that pip install speclite==v0.11 works for me too. Thanks.

ntessore commented 4 years ago

You might want to consider removing or yanking the 0.9 and 0.10 releases on PyPI.

dkirkby commented 4 years ago

@ntessore I just yanked 0.9 and 0.10 from PyPI.