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

add section: File resolution (#434) #436

Merged
merged 3 commits into from
Apr 25, 2022
Merged

add section: File resolution (#434) #436

merged 3 commits into from
Apr 25, 2022

Conversation

milahu
Copy link
Contributor

@milahu milahu commented Apr 25, 2022

fix #434

maybe a bit too verbose ...

maybe belongs to eli5.md ; )

Readme.md Outdated
Comment on lines 222 to 260
The wheel URL is constructed in [pypi-crawlers/src/crawl_wheel_deps.py](pypi-crawlers/src/crawl_wheel_deps.py)

```py
def construct_url(name, pyver, filename: str):
base_url = "https://files.pythonhosted.org/packages/"
return f"{base_url}{pyver}/{name[0]}/{name}/{filename}"
```

So in this example, the full URL would be

```
https://files.pythonhosted.org/packages/cp39/p/pillow/Pillow-9.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
```

Now we can call Nix's `fetchurl` like

```nix
builtins.fetchurl {
url = "https://files.pythonhosted.org/packages/cp39/p/pillow/Pillow-9.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl";
sha256 = "gig6+ZwcOluh2kTGcpbVqtGfEcU1tVGlrlUyijF84zE=";
}
```

... and we get

```
$ unzip -l /nix/store/7gbbbrsqkw7f69axyh818abh9yw45fnb-Pillow-9.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | head
Archive: /nix/store/7gbbbrsqkw7f69axyh818abh9yw45fnb-Pillow-9.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Length Date Time Name
--------- ---------- ----- ----
0 04-01-2022 10:08 PIL/
0 04-01-2022 10:08 Pillow.libs/
0 04-01-2022 10:08 Pillow-9.1.0.dist-info/
7311 04-01-2022 10:08 PIL/PdfImagePlugin.py
141328 04-01-2022 10:08 PIL/_imagingcms.cpython-39-x86_64-linux-gnu.so
46872 04-01-2022 10:08 PIL/_imagingtk.cpython-39-x86_64-linux-gnu.so
1513 04-01-2022 10:08 PIL/GribStubImagePlugin.py
```

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this really relevant to the user?
Should this better go to a contributors guide?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes ... lets move the whole how-does-mach-nix-work section to implementation.md?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets move the whole how-does-mach-nix-work section to implementation.md?

probably no

a "high level view" should stay in readme

@DavHau DavHau merged commit 26f06e4 into DavHau:master Apr 25, 2022
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

Successfully merging this pull request may close these issues.

how does mach-nix resolve urls and hashes
2 participants