-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
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
fetchPypi -> fetchFromPyPI #146564
fetchPypi -> fetchFromPyPI #146564
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't think of any reasons not to, and it's more consistent with the other platform-specific fetchers.
curious if @FRidh has any feedback though.
why |
Py thon Package Index |
I am not sure about the benefits of capitalizing acronyms in here |
pkgs/development/interpreters/python/update-python-libraries/update-python-libraries.py
Outdated
Show resolved
Hide resolved
@@ -56,7 +56,9 @@ let | |||
# See build-setupcfg/default.nix for documentation. | |||
buildSetupcfg = import ../build-support/build-setupcfg self; | |||
|
|||
fetchPypi = callPackage ../development/interpreters/python/fetchpypi.nix { }; | |||
# fetchPypi -> fetchFromPyPI | |||
fetchPypi = fetchFromPyPI; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we can deprecate this and remove in the (long) future?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there's not a good way to deprecate within nixpkgs. If you emit warnings then that breaks a lot of CI's (including ofborg)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you emit warnings then that breaks a lot of CI's (including ofborg)
Which is kinda stupid.
I see myself already doing this quite often so why not.
fetchPypi = fetchFromPyPI; | |
fetchPypi = fetchFromPyPI; | |
fetchFromPyPi = throw "Did you mean fetchFromPyPI?" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this useful? The compiler will catch it anyway...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would say so, it's pretty common to do a typo like this, but it reads as correct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this useful? The compiler will catch it anyway...
I am all about this alias. Same as fetchFromGithub
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like a case for a whole mistaken-aliases.nix
file.
We also have mixed case with the GitHub fetcher. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using the new fetcher will probably break nix-update, nixpkgs-update and nix-prefetch-url.
pkgs/top-level/python-packages.nix
Outdated
@@ -56,7 +56,9 @@ let | |||
# See build-setupcfg/default.nix for documentation. | |||
buildSetupcfg = import ../build-support/build-setupcfg self; | |||
|
|||
fetchPypi = callPackage ../development/interpreters/python/fetchpypi.nix { }; | |||
# fetchPypi -> fetchFromPyPI |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# fetchPypi -> fetchFromPyPI |
This is pretty clear from the line below, no need to comment it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using the new fetcher will probably break nix-update, nixpkgs-update and nix-prefetch-url.
How?
This is not a "new fetcher", it is the same with a new name. Do the updaters rely on the name of the function?
This is pretty clear from the line below, no need to comment it.
Okay!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nix-prefetch-url should be fine. AFAIK, it only works with the nix store and curl.
nix-update
might be sensitive to that term. But it's not like we are rolling it out immediately
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I accidently edited your message instead of replying @SuperSandro2000
I wanted to say that there are other possible spellings like fetchFromPypi
, I'm not sure about the change in capitalization
@@ -56,7 +56,9 @@ let | |||
# See build-setupcfg/default.nix for documentation. | |||
buildSetupcfg = import ../build-support/build-setupcfg self; | |||
|
|||
fetchPypi = callPackage ../development/interpreters/python/fetchpypi.nix { }; | |||
# fetchPypi -> fetchFromPyPI | |||
fetchPypi = fetchFromPyPI; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you emit warnings then that breaks a lot of CI's (including ofborg)
Which is kinda stupid.
I see myself already doing this quite often so why not.
fetchPypi = fetchFromPyPI; | |
fetchPypi = fetchFromPyPI; | |
fetchFromPyPi = throw "Did you mean fetchFromPyPI?" |
Since the Python Package Index works as a package index, it is more intuitive to call the function that fetches packages from it `fetchFromPyPI`, following the unwritten rule for sources obtained from a "repository" like fetchFrom{GitHub, Gitlab, Bitbucket, ...} For now, this commit will act as a placeholder for the new fetchFromPyPI function, while the old one will act as a safe alias.
I have tested it locally. It is failing:
|
I will close and redo this. |
I have quite mixed feelings about this. By now, I don't really like fetchers that build upon other actual fetchers. So, in case of |
Something like |
Motivation for this change
Since the Python Package Index works as a package index, it is more intuitive to
call the function that fetches packages from it
fetchFromPyPI
, following theunwritten rule for sources obtained from a "repository" like fetchFrom{GitHub,
Gitlab, Bitbucket, ...}
For now, this commit will act as a placeholder for the new fetchFromPyPI
function, while the old one will act as a safe alias.
Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)