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
Python user documentation: fix code highlighting, use valid Nix expressions #23535
Python user documentation: fix code highlighting, use valid Nix expressions #23535
Conversation
@alexeymuranov, thanks for your PR! By analyzing the history of the files in this pull request, we identified @FRidh, @globin and @bennofs to be potential reviewers. |
doc/languages-frameworks/python.md
Outdated
}; | ||
{ | ||
# ... | ||
toolz = buildPythonPackage rec{ |
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.
While you're at it, you could add a space after the rec
keyword, for cleaness! ❓
doc/languages-frameworks/python.md
Outdated
name = "toolz-${version}"; | ||
version = "0.7.4"; | ||
|
||
src = pkgs.fetchurl{ |
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.
Same here after fetchurl
.
doc/languages-frameworks/python.md
Outdated
|
||
buildInputs = with self; [ pkgs.libxml2 pkgs.libxslt ]; | ||
buildInputs = with self; [ pkgs.libxml2 pkgs.libxslt ]; |
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.
Why with self
if you only use pkgs.<something>
?
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 only reformatted the source. What is self
?
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'm not sure, but I think we don't need it at that location. Probably should ask one of the python guys in here...
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.
But this is Nix, not Python. I just don't know what self
in Nix is. Nix manual does not mention 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.
No, I mean we should ask the python guys from nixpkgs to ensure that we can remove self
here.
self
is commonly used to refer to the attribute set currently in, so this would bring everything from the current set into the scope of the expression. But my guess is that we do not need it, as we do not refer to something from self
, like self.somepackage
, but rather to pkgs.somepackage
- so bringing pkgs
into scope like so:
with pkgs; [ libxml2 libxslt ];
would make more sense to me. But as said: I'm not into the python-packaging ecosystem that much, so I would say we need someone from the python packaging team to approve what I suggest.
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.
Ok, but i suppose it is not necessary to fix everything in one go.
doc/languages-frameworks/python.md
Outdated
|
||
buildInputs = [ pkgs.fftw pkgs.fftwFloat pkgs.fftwLongDouble]; | ||
buildInputs = [ pkgs.fftw pkgs.fftwFloat pkgs.fftwLongDouble]; |
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.
Can we consider using with pkgs
here?
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.
Ok.
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.
One should try to avoid with
because it can shadow other packages.
doc/languages-frameworks/python.md
Outdated
meta = { | ||
homepage = http://twistedmatrix.com/; | ||
description = "Twisted, an event-driven networking engine written in Python"; | ||
license = stdenv.lib.licenses.mit; }; |
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.
Sure we need this closing };
?
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.
No, we don't, thanks.
Permission denied | ||
|
||
This is a [known bug](https://github.com/pypa/setuptools/issues/130) in setuptools. | ||
``` |
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'm not entirely sure, but it could be that we need blank lines before and after code listings that are introduced with three back-ticks... ?
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.
Hm, i never leave a blank line if it is the same paragraph, it renders fine on GitHub, but possibly it is not correct Markdown...
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 didn't find any mention of required blank lines before and after "fenced" code blocks, and both GitHub and https://stackedit.io/editor are rendering fine without.
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.
Remember that this file is converted with pandoc to docbook.
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 tried with http://pandoc.org/try/ , i do not see any issues.
doc/languages-frameworks/python.md
Outdated
# FIXME! | ||
LDFLAGS="-L${pkgs.fftw.dev}/lib -L${pkgs.fftwFloat.out}/lib -L${pkgs.fftwLongDouble.out}/lib" | ||
CFLAGS="-I${pkgs.fftw.dev}/include -I${pkgs.fftwFloat.dev}/include -I${pkgs.fftwLongDouble.dev}/include" | ||
''; |
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.
@matthiasbeyer, @FRidh, what is actually supposed to be here?
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.
exactly that. Why?
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.
This is not even valid Nix.
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.
and why not? Check python-packages.nix
where it is used.
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 is no LDFLAGS
in https://github.com/NixOS/nixpkgs/blob/master/pkgs/top-level/python-packages.nix
The latest version uses
```
preConfigure = ''
export LDFLAGS="-L${pkgs.fftw.out}/lib -L${pkgs.fftwFloat.out}/lib
-L${pkgs.fftwLongDouble.out}/lib"
export CFLAGS="-I${pkgs.fftw.dev}/include
-I${pkgs.fftwFloat.dev}/include -I${pkgs.fftwLongDouble.dev}/include"
'';
```
…On Sun, Mar 5, 2017 at 7:21 PM, Alexey Muranov ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In doc/languages-frameworks/python.md
<#23535 (comment)>:
>
- LDFLAGS="-L${pkgs.fftw.dev}/lib -L${pkgs.fftwFloat.out}/lib -L${pkgs.fftwLongDouble.out}/lib"
- CFLAGS="-I${pkgs.fftw.dev}/include -I${pkgs.fftwFloat.dev}/include -I${pkgs.fftwLongDouble.dev}/include"
- '';
+ # FIXME!
+ LDFLAGS="-L${pkgs.fftw.dev}/lib -L${pkgs.fftwFloat.out}/lib -L${pkgs.fftwLongDouble.out}/lib"
+ CFLAGS="-I${pkgs.fftw.dev}/include -I${pkgs.fftwFloat.dev}/include -I${pkgs.fftwLongDouble.dev}/include"
+ '';
There is no LDFLAGS in https://github.com/NixOS/
nixpkgs/blob/master/pkgs/top-level/python-packages.nix
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#23535 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ACB872QoGieMkkQsangBIWINzsbM7ItLks5riv0fgaJpZM4MTeGV>
.
|
Sorry, i do not know where to look for the "latest version". Anyway, i see now that apparently it is
that is missing, thanks. |
Its not really missing. The way it is currently in the docs is valid as well. |
The way it is currently in the docs is not even valid Nix. |
What you highlighted with your last commit is indeed valid nix. At least I fail to figure out what would be non-valid in there... |
I suppose that {
LDFLAGS="-L${pkgs.fftw.dev}/lib -L${pkgs.fftwFloat.out}/lib -L${pkgs.fftwLongDouble.out}/lib"
CFLAGS="-I${pkgs.fftw.dev}/include -I${pkgs.fftwFloat.dev}/include -I${pkgs.fftwLongDouble.dev}/include"
'';
} is then also valid Nix, right? |
Ah, now I see what you mean... Yep, sorry, this is not valid Nix, you are right! |
Indeed, that would give a syntax error. |
Yes, and for a good reason. Should i add |
The former would have the preference. |
Fix code syntax highlighting by specifying language in every code block and adding some context to Nix code blocks to make them valid expressions. Use the same markup style for all code blocks. Reformat some code blocks.
Fix code syntax highlighting by specifying language in every code block and adding some context to Nix code blocks to make them valid expressions. Use the same markup style for all code blocks.