Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
seisman opened this issue Feb 8, 2021 · 13 comments · Fixed by #865
Closed

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

seisman opened this issue Feb 8, 2021 · 13 comments · Fixed by #865
Labels
bug Something isn't working
Milestone

Comments

@seisman
Copy link
Member

seisman commented Feb 8, 2021

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.

@seisman seisman added the bug Something isn't working label Feb 8, 2021
@seisman seisman added this to the 0.3.0 milestone Feb 8, 2021
@weiji14
Copy link
Member

weiji14 commented Feb 9, 2021

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

@seisman
Copy link
Member Author

seisman commented Feb 9, 2021

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?

@seisman seisman mentioned this issue Feb 9, 2021
19 tasks
@willschlitzer
Copy link
Contributor

willschlitzer commented Feb 10, 2021

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.

@seisman
Copy link
Member Author

seisman commented Feb 10, 2021

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

@weiji14
Copy link
Member

weiji14 commented Feb 11, 2021

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?

@seisman
Copy link
Member Author

seisman commented Feb 11, 2021

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).

@weiji14
Copy link
Member

weiji14 commented Feb 11, 2021

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.

@seisman
Copy link
Member Author

seisman commented Feb 11, 2021

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

@weiji14
Copy link
Member

weiji14 commented Feb 11, 2021

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.

@seisman
Copy link
Member Author

seisman commented Feb 11, 2021

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.

@seisman
Copy link
Member Author

seisman commented Feb 12, 2021

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?

@weiji14
Copy link
Member

weiji14 commented Feb 12, 2021

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

@seisman
Copy link
Member Author

seisman commented Feb 12, 2021

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
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants