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

[feature] get wheel from PYPI? #106

Open
Freed-Wu opened this issue Jul 6, 2023 · 4 comments
Open

[feature] get wheel from PYPI? #106

Freed-Wu opened this issue Jul 6, 2023 · 4 comments

Comments

@Freed-Wu
Copy link
Contributor

Freed-Wu commented Jul 6, 2023

Now fetch.pypi only can get the sdist. How can we get wheel?

    src = fetchurl {
      url = "https://pypi.org/packages/source/f/foo-bar/foo-bar-0.0.1.tar.gz";
      sha256 = "sha256-LpqOFSAPgw3roaocDRQpajPyt+twvce4KY/kZD9xAY4=";
    };
@berberman
Copy link
Owner

Shouldn't fetch.url work as long as you have the url?

@Freed-Wu
Copy link
Contributor Author

nvfetcher.toml:

[feeluown]
src.pypi = "feeluown"
fetch.pypi = "feeluown"
{ fetchgit, fetchurl, fetchFromGitHub }:
{
  feeluown = {
    pname = "feeluown";
    version = "3.8.2";
    src = fetchurl {
      url = "https://pypi.io/packages/source/f/feeluown/feeluown-3.8.2.tar.gz";
      sha256 = "sha256-V2yzpkmjRkipZOvQGB2mYRhiiEly6QPrTOMJ7BmyWBQ=";
    };
  };
}

How to

{ fetchgit, fetchurl, fetchFromGitHub }:
{
  feeluown = {
    pname = "feeluown";
    version = "3.8.2";
    src = fetchurl {
      url = "the url of wheel";
      sha256 = "";
    };
  };
}

@berberman
Copy link
Owner

Sorry, did you mean to fetch a wheel instead of the source code for a python package? Do we know the url of the wheel given the package name?

@Freed-Wu
Copy link
Contributor Author

https://wiki.archlinux.org/title/Python_package_guidelines#Source:

Pure Python wheel package
https://files.pythonhosted.org/packages/py2.py3/${_name::1}/$_name/${_name//-/_}-$pkgver-py2.py3-none-any.whl (Bilingual – Python 2 and Python 3 compatible)
https://files.pythonhosted.org/packages/py3/${_name::1}/$_name/${_name//-/_}-$pkgver-py3-none-any.whl (Python 3 only)
Note that the distribution name can contain dashes, while its representation in a wheel filename cannot (they are converted to underscores).

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

No branches or pull requests

2 participants