~andir/nixpkgs-dev

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
3 3

[PATCH nixpkgs 0/1] pygraphviz update

Details
Message ID
<20210211164044.5321-1-mail@beyermatthias.de>
DKIM signature
missing
Download raw message
If someone can do a more sophisticated test then nix-building this, feel free to
send me your results and how you produced them.
Otherwise, suggestions and review welcome of course!


Matthias Beyer (1):
  python3Packages.pygraphviz: 1.6 -> 1.7

 .../python-modules/pygraphviz/default.nix        |  4 ++--
 .../pygraphviz/graphviz-path.patch               | 16 ++++++++--------
 2 files changed, 10 insertions(+), 10 deletions(-)

-- 
2.29.2

[PATCH nixpkgs 1/1] python3Packages.pygraphviz: 1.6 -> 1.7

Details
Message ID
<20210211164044.5321-2-mail@beyermatthias.de>
In-Reply-To
<20210211164044.5321-1-mail@beyermatthias.de> (view parent)
DKIM signature
missing
Download raw message
Patch: +10 -10
The patch that added graphviz to the PATH was ported to 1.7.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
---
 .../python-modules/pygraphviz/default.nix        |  4 ++--
 .../pygraphviz/graphviz-path.patch               | 16 ++++++++--------
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/pkgs/development/python-modules/pygraphviz/default.nix b/pkgs/development/python-modules/pygraphviz/default.nix
index e9b66a95771..1406462933b 100644
--- a/pkgs/development/python-modules/pygraphviz/default.nix
+++ b/pkgs/development/python-modules/pygraphviz/default.nix
@@ -3,13 +3,13 @@

buildPythonPackage rec {
  pname = "pygraphviz";
  version = "1.6";
  version = "1.7";

  disabled = !isPy3k;

  src = fetchPypi {
    inherit pname version;
    sha256 = "411ae84a5bc313e3e1523a1cace59159f512336318a510573b47f824edef8860";
    sha256 = "0113vc62xapcghw5yv1mz5n10nfnmxsz0ncci5j1xkrpkxhcdgm7";
    extension = "zip";
  };

diff --git a/pkgs/development/python-modules/pygraphviz/graphviz-path.patch b/pkgs/development/python-modules/pygraphviz/graphviz-path.patch
index e4ff925009d..02e3e6d8348 100644
--- a/pkgs/development/python-modules/pygraphviz/graphviz-path.patch
+++ b/pkgs/development/python-modules/pygraphviz/graphviz-path.patch
@@ -1,13 +1,13 @@
diff --git a/pygraphviz/agraph.py b/pygraphviz/agraph.py
index 8f72024..2d8358e 100644
index d539ba0..10f6467 100644
--- a/pygraphviz/agraph.py
+++ b/pygraphviz/agraph.py
@@ -1557,7 +1557,7 @@ class AGraph(object):
         import os
         import glob
@@ -1792,7 +1792,7 @@ class AGraph:
         if platform.system() == "Windows":
             name += ".exe"
 
-        paths = os.environ["PATH"]
+        paths = '@graphviz@/bin:' + os.environ["PATH"]
         if os.name == "nt":
             exe = ".exe"
         else:
+        paths = '@graphviz@/bin' + os.environ["PATH"]
         for path in paths.split(os.pathsep):
             match = glob.glob(os.path.join(path, name))
             if match:
-- 
2.29.2
Details
Message ID
<20210211171220.x26kzyr4tpgmelu5@monad>
In-Reply-To
<20210211164044.5321-1-mail@beyermatthias.de> (view parent)
DKIM signature
missing
Download raw message
Hey Matthias,

Will test this out soon. 

On Thu, Feb 11, 2021 at 05:40:43PM +0100, Matthias Beyer wrote:
> If someone can do a more sophisticated test then nix-building this,
> feel free to send me your results and how you produced them.
> Otherwise, suggestions and review welcome of course!

One thing I recently turned on was in nixpkgs/config.nix:

checkMeta = true

This catches meta evaluation issues which we were missing before
submitting to github.

I'm sure you know but instead of a cover letter you can simply do

	git send-email --annotate HEAD^

and then add your non-commit comments under the --- line:

> Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
> ---

*right here*

>  .../python-modules/pygraphviz/default.nix        |  4 ++--
>  .../pygraphviz/graphviz-path.patch               | 16 ++++++++--------
>  2 files changed, 10 insertions(+), 10 deletions(-)

It's not too big of a deal but saves an email if you're only sending a
single patch anyways.

Cheers,
Will
Details
Message ID
<87k0reia7b.fsf@yoctocell.xyz>
In-Reply-To
<20210211164044.5321-1-mail@beyermatthias.de> (view parent)
DKIM signature
pass
Download raw message
On Thu, Feb 11 2021, Matthias Beyer wrote:

> If someone can do a more sophisticated test then nix-building this, feel free to
> send me your results and how you produced them.
> Otherwise, suggestions and review welcome of course!

I got it working by doing the following:

- At the root of your nixpkgs checkout, create a `test.nix` file with
  the following contents:

  with import ./. { };
  let
    pythonEnv = python38.withPackages (ps: [
      ps.pygraphviz
    ]);
  in
  mkShell {
    buildInputs = [
      pythonEnv
      graphviz
    ];
  }

- Run `nix-shell test.nix`
- Run `python3`
- Paste the following code in the repl: [1]

  import pygraphviz as pgv
  
  A = pgv.AGraph()
  
  A.add_edge(1, 2)
  A.add_edge(2, 3)
  A.add_edge(1, 3)
  
  print(A.string())  # print to screen
  A.write("simple.dot")  # write to simple.dot
  
  B = pgv.AGraph("simple.dot")  # create a new graph from file
  B.layout()  # layout with default (neato)
  B.draw("simple.png")  # draw png

A `simple.png` file should be created with a simple graph.

[1]: https://pygraphviz.github.io/documentation/stable/auto_examples/plot_simple.html#sphx-glr-auto-examples-plot-simple-py

Tested-by: Xinglu Chen <public@yoctocell.xyz>
Reply to thread Export thread (mbox)