Skip to content

Fail to install the dev version following the install instructions #856

Closed

Description

@seisman

Description of the problem

The install instructions say users can install the development version using:

pip install https://github.com/GenericMappingTools/pygmt/archive/master.zip

However, the command doesn't work and gives me the following error:

...
    LookupError: setuptools-scm was unable to detect version for '/private/var/folders/mz/d3wtwjtx4fg8qlds5lgt1c240000gn/T/pip-req-build-85cqz2ok'.

    Make sure you're either building from a fully intact git repository or PyPI tarballs. Most other sources (such as GitHub's tarballs, a git checkout without the .git folder) don't contain the necessary metadata and will not work.

    For example, if you're using pip, instead of https://github.com/user/proj/archive/master.zip use git+https://github.com/user/proj.git#egg=proj
...

Possibly related to #695.

Activity

  1. added
    bug
    on Feb 8, 2021
  2. added this to the 0.3.0 milestone on Feb 8, 2021
  3. weiji14 commented on Feb 9, 2021

    @weiji14
    Member

    We might need to have setuptools_scm as an install only dependency. I remember reading about it somewhere but need to check.

  4. seisman commented on Feb 9, 2021

    @seisman
    MemberAuthor

    Does the error message mean that

    pip install https://github.com/GenericMappingTools/pygmt/archive/master.zip
    

    doesn't work because it doesn't contain git information, thus setuptools_scm can't determine the version?

  5. willschlitzer commented on Feb 10, 2021

    @willschlitzer
    Contributor

    I'm not sure how to go about fixing this, but I assume we want this fixed before v0.3 release. Should we consider this a big enough issue to delay the release if it's not fixed in time? I'm not sure how much of an impact this will cause if it is not corrected.

  6. seisman commented on Feb 10, 2021

    @seisman
    MemberAuthor

    we want this fixed before v0.3 release

    Yes to me.

    As I understand it, the easiest fix is changing it to

    pip install git+https://github.com/GenericMappingTools/pygmt.git#egg=pygmt
    

    or we can encourage users to clone the repository:

    git clone https://github.com/GenericMappingTools/pygmt.git
    cd pygmt
    make install
    
  7. weiji14 commented on Feb 11, 2021

    @weiji14
    Member

    As I understand it, the easiest fix is changing it to

    pip install git+https://github.com/GenericMappingTools/pygmt.git#egg=pygmt
    

    Yeah, this one-liner seems to be the easiest, though it does require git to be installed I think?

  8. seisman commented on Feb 11, 2021

    @seisman
    MemberAuthor

    though it does require git to be installed I think?

    Yes, it clones the whole git repository, so much slower.

    Another workaround is setting the parameter fallback_version to something like 0.0.0+untagged (https://github.com/pypa/setuptools_scm/#configuration-parameters).

  9. weiji14 commented on Feb 11, 2021

    @weiji14
    Member

    though it does require git to be installed I think?

    Yes, it clones the whole git repository, so much slower.

    Right. I just read the thread at pypa/pip#2432 (don't), and it seems that pip doesn't support shallow clones for philosophical reasons.

    Another workaround is setting the parameter fallback_version to something like 0.0.0+untagged (https://github.com/pypa/setuptools_scm/#configuration-parameters).

    This looks good. I suppose we could reset the fallback version every release (e.g. users will get 0.3.0+untagged, 0.4.0+untagged)?

    Alternatively (or in addition), we could just make use of the TestPyPI uploads and let people do pip install --pre --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple pygmt. Based on https://stackoverflow.com/questions/34514703/pip-install-from-pypi-works-but-from-testpypi-fails-cannot-find-requirements.

  10. seisman commented on Feb 11, 2021

    @seisman
    MemberAuthor

    Another workaround is setting the parameter fallback_version to something like 0.0.0+untagged (https://github.com/pypa/setuptools_scm/#configuration-parameters).

    This looks good. I suppose we could reset the fallback version every release (e.g. users will get 0.3.0+untagged, 0.4.0+untagged)?

    Sounds good to me.

    Alternatively (or in addition), we could just make use of the TestPyPI uploads and let people do pip install --pre --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple pygmt. Based on https://stackoverflow.com/questions/34514703/pip-install-from-pypi-works-but-from-testpypi-fails-cannot-find-requirements.

    It sounds a good addition to me.

    I'm wondering if we want to use the tabbed directive in the sphinx-panels extension, to show different ways to install pygmt.

    image

  11. weiji14 commented on Feb 11, 2021

    @weiji14
    Member

    This looks good. I suppose we could reset the fallback version every release (e.g. users will get 0.3.0+untagged, 0.4.0+untagged)?

    Sounds good to me.

    Ok, I'll start a PR for this.

    Alternatively (or in addition), we could just make use of the TestPyPI uploads and let people do pip install --pre --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple pygmt. Based on https://stackoverflow.com/questions/34514703/pip-install-from-pypi-works-but-from-testpypi-fails-cannot-find-requirements.

    It sounds a good addition to me.

    I'm wondering if we want to use the tabbed directive in the sphinx-panels extension, to show different ways to install pygmt.

    image

    A bit hesitant with adding another extension. Maybe if it's used in more than one or two places, then we can start thinking about using sphinx-panels.

  12. seisman commented on Feb 11, 2021

    @seisman
    MemberAuthor

    A bit hesitant with adding another extension. Maybe if it's used in more than one or two places, then we can start thinking about using sphinx-panels.

    I agree.

  13. seisman commented on Feb 12, 2021

    @seisman
    MemberAuthor

    Although #865 can fix the issue, I'm afraid users may still use

    pip install https://github.com/GenericMappingTools/pygmt/archive/master.zip
    

    to install PyGMT, because it was a common way to install dev codes.

    Perhaps we should still set the parameter fallback_version? To avoid updating the parameter in each release, maybe setting fallback_version to unknown, 0+unknown (default version returned by versioneer: https://github.com/python-versioneer/python-versioneer#debugging) , or 0+untagged?

  14. weiji14 commented on Feb 12, 2021

    @weiji14
    Member

    I can add the fallback version to PR #685 if that helps.

  15. seisman commented on Feb 12, 2021

    @seisman
    MemberAuthor

    Good. I prefer 0+unknown, although it makes little difference for most users.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions