-
Notifications
You must be signed in to change notification settings - Fork 60
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
Rename all package names with dashes to use underscore instead #796
Comments
@cekees @certik @ahmadia how do you feel about banning dashes in package names? dashes are commonly used in package names in other systems, but they don't refer to packages in Python code.. One alternative would be to treat dash and underscore as same character, and then we'll have a mix everywhere. But it's more backwards compatible. I'm going to do this in Hashdist now as a temporary solution.. |
No feeling one way or the other. Supporting them doesn't seem like it's worth much time at this point, but if it's not hard might as well support common Unix file name conventions. Sent from my BlackBerry 10 smartphone on the Verizon Wireless 4G LTE network. From: Dag Sverre SeljebotnSent: Thursday, May 28, 2015 7:15 AMTo: hashdist/hashstackReply To: hashdist/hashstackCc: Chris KeesSubject: Re: [hashstack] Rename all package names with dashes to use underscore instead (#796)@cekees @certik @ahmadia how do you feel about banning dashes in package names? dashes are commonly used in package names in other systems, but they don't refer to packages in Python code.. One alternative would be to treat dash and underscore as same character, and then we'll have a mix everywhere. But it's more backwards compatible. I'm going to do this in Hashdist now as a temporary solution.. —Reply to this email directly or view it on GitHub. |
So a package name must be a Python identifier? |
Yes, though I don't see why people would want to use unicode etc. |
What are the alternative options? Lots of packages have |
Alternative 1: Allow
That looks a bit ugly and inconsistent to me but it's an alternative. Alternative 2: Access some object as a dict:
I'm very against this myself. Alternative 3: Use another language for the expressions in YAML-files:
This looks ugly to me (it's Python, but not..) and also is a bit tricky to implement, although not impossible at all (minimal viable is just replace '-' with '_' but leave ' - ' alone..) A stronger counter-argument to me is that we use Python hook files, and then this syntax is not legal anyway. I do want expressions in hook files and in YAML files to be as similar as possible myself. |
Hmm, something I actually like better is use So:
|
How about this:
or this:
Where |
Yes, it works. I think How about |
I think one should refer to packages by their names as strings, then there is no issue. This is what Spack does. How will this be implemented --- you have to create Python symbols for all packages and load it into some namespace and evaluate in that namespace? I think using something like P("...") is much cleaner. |
Also, you can't name a package that is also a Python keyword, and any future Python keyword... It seems that's a wrong way to approach it. |
Dependencies are just other parameters. I feel the core of Hashdist depends on this -- remember Hashdist is much more like a programming language than Debian, RedHat etc.; you can parametrize a lot more. Then invariably you have to treat stuff the way you do in programming languages. So: A dependency is a parameter in a programming language (just like in Nix BTW) So if you want to use
etc etc etc, that's a way too high price to pay for dashes in packages. I guess I disagree with you about the Python keyword thingie. The big difference between us and Debian is simply that Hashdist is a programming language for generating stacks, Debian packages is not that at all. Also I think the coupling with Python hooks will become stronger, not weaker, in time. Writing a new programming language from scratch, which is really what is needed, is just too much effort. (For instance, we should automatically compute Nix made its own functional language, and the other Nix derivative GUIX is based on a LISP dialect. We're based on Python, perhaps not the best choice, but much preferable to writing our own language from scratch like Nix did. I guess I have a much stronger opinion about this now than earlier today :) |
@certik what convention does Spack use? I guess all packages are Python identifiers by construction, but do you know how Spack would seperate |
Spack seems to just use strings. We can change yaml to something else, but that's a different discussion, where you never replied to my objections: https://groups.google.com/d/msg/hashdist/DGg58Ed6vRI/SU_1BqKTPGsJ |
Ah right, I though the class name had to be the same but there it is, package name |
See email. If it helps my proposal, we could make it "packages must only be identifiers that are valid in both Python, JavaScript, Julia, Haskell, Ruby, and Go". |
How about making packages strings, but if the string also happens to be a valid Python identifier, you can refer to it as such, otherwise use |
Yes, that works. I just prefer Perhaps @cekees can break the tie? |
I am fine with |
OK +1 dash. I'm always for saving 20 minutes. On Thu, May 28, 2015 at 2:40 PM, Ondřej Čertík [email protected]
|
Seems wonky to me. Maybe I'm not following the conversation. On Thursday, May 28, 2015, Chris Kees [email protected] wrote:
|
The only non-wonky alternative I see so far is not allowing But the |
BTW this is not an original thought; Google App Engine can give you domain names with |
Since we allow arbitrary Pytyhon expressions that refer to parameters like
numpy.version
in when-clauses and{{numpy.version}}
, in packages that depend on NumPy, it seems to follow that we have to disable dashes in package names..Working on a script to do this, but it has some problems (
host-pkg-config
turns intohost-pkg_config
...), pasting here as WIP for the record:The text was updated successfully, but these errors were encountered: