Re: debug moviepy with jgart

2023-01-27 Thread jgart
Thanks for the reply.

Interestingly, there is no hypothesis code in the moviepy tests so I'm not sure 
why we get that plugins output section mentioning hypothesis.

I wonder if there's a way to start pdb or pudb in the failed build environment 
so that I can step through the test? hmmm

Will try that next... for fun

Here's one test that fails:

# -*- coding: utf-8 -*-
"""Image sequencing clip tests meant to be run with pytest."""
import os
import sys

import pytest

from moviepy.video.io.ImageSequenceClip import ImageSequenceClip

from .test_helper import TMP_DIR


def test_1():
images=[]
durations=[]

for i in range(5):
durations.append(i)
images.append("media/python_logo.png")
durations.append(i)
images.append("media/python_logo_upside_down.png")

with ImageSequenceClip(images, durations=durations) as clip:
assert clip.duration == sum(durations)
clip.write_videofile(os.path.join(TMP_DIR, "ImageSequenceClip1.mp4"), 
fps=30)

def test_2():
images=[]
durations=[]

durations.append(1)
images.append("media/python_logo.png")
durations.append(2)
images.append("media/matplotlib_demo1.png")

#images are not the same size..
with pytest.raises(Exception):
 ImageSequenceClip(images, durations=durations).close()


if __name__ == '__main__':
   pytest.main()

and here's the test failure output:

 test_1 

def test_1():
images=[]
durations=[]

for i in range(5):
durations.append(i)
images.append("media/python_logo.png")
durations.append(i)
images.append("media/python_logo_upside_down.png")

with ImageSequenceClip(images, durations=durations) as clip:
assert clip.duration == sum(durations)
>   clip.write_videofile(os.path.join(TMP_DIR, 
> "ImageSequenceClip1.mp4"), fps=30)

tests/test_ImageSequenceClip.py:25: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/gnu/store/zfw5y8356i5hmfghpix46qk3iaxg3i6y-python-decorator-5.0.9/lib/python3.9/site-packages/decorator.py:232:
 in fun
return caller(func, *(extras + args), **kw)
moviepy/decorators.py:54: in requires_duration
return f(clip, *a, **k)
/gnu/store/zfw5y8356i5hmfghpix46qk3iaxg3i6y-python-decorator-5.0.9/lib/python3.9/site-packages/decorator.py:232:
 in fun
return caller(func, *(extras + args), **kw)
moviepy/decorators.py:135: in use_clip_fps_by_default
return f(clip, *new_a, **new_kw)
/gnu/store/zfw5y8356i5hmfghpix46qk3iaxg3i6y-python-decorator-5.0.9/lib/python3.9/site-packages/decorator.py:232:
 in fun
return caller(func, *(extras + args), **kw)
moviepy/decorators.py:22: in convert_masks_to_RGB
return f(clip, *a, **k)
moviepy/video/VideoClip.py:300: in write_videofile
ffmpeg_write_video(self, filename, fps, codec,
moviepy/video/io/ffmpeg_writer.py:213: in ffmpeg_write_video
with FFMPEG_VideoWriter(filename, clip.size, fps, codec = codec,
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = 
filename = '/tmp/guix-build-python-moviepy-1.0.3.drv-0/ImageSequenceClip1.mp4'
size = (260, 77), fps = None, codec = 'libx264', audiofile = None
preset = 'medium', bitrate = None, withmask = False, logfile = -1
threads = None, ffmpeg_params = None

def __init__(self, filename, size, fps, codec="libx264", audiofile=None,
 preset="medium", bitrate=None, withmask=False,
 logfile=None, threads=None, ffmpeg_params=None):

if logfile is None:
logfile = sp.PIPE

self.filename = filename
self.codec = codec
self.ext = self.filename.split(".")[-1]

# order is important
cmd = [
get_setting("FFMPEG_BINARY"),
'-y',
'-loglevel', 'error' if logfile == sp.PIPE else 'info',
'-f', 'rawvideo',
'-vcodec', 'rawvideo',
'-s', '%dx%d' % (size[0], size[1]),
'-pix_fmt', 'rgba' if withmask else 'rgb24',
>   '-r', '%.02f' % fps,
'-an', '-i', '-'
]
E   TypeError: must be real number, not NoneType

moviepy/video/io/ffmpeg_writer.py:88: TypeError

--

Here's the Guix package for the curious:

;;; GNU Guix --- Functional package management for GNU
;;;
;;; Copyright © 2022 jgart 
;;; This file is not part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more 

Re: debug moviepy with jgart

2023-01-27 Thread Development of GNU Guix and the GNU System distribution.
> Hi,
> 
> I'm trying to get the tests to pass for a Guix package that I am writing for 
> moviepy.
> 
> Any thoughts on how to resolve the below failures?
> 
> I need to make some dir writeable?

Hello,

The non-writeable cache dir error seems to be coming from an imagemagick
subprocess. So yeah, we could look at what imagemagick needs for a
cache directory.

There are many errors so I'd try tackling them one by one. Starting
with those that are more obvious to be related to the environment and
IO (and hoping fixing them will also fix some of the non-obvious ones).

You could try using the approach described in [1] to enter the build
environment. Then you can rerun the Hypothesis tests by hand. I'd look
into Hypothesis documentation and check how to only run a sepcific test
to save time. I'd then also check the other options of the tool —
perhaps there's a way to increase verbosity in test output?

Good luck,
Wojtek

[1] https://guix.gnu.org/manual/en/html_node/Debugging-Build-Failures.html


pgpN5IhTmSymk.pgp
Description: OpenPGP digital signature


Re: Making sense of webkitgtk and webkitgtk-next

2023-01-27 Thread Liliana Marie Prikler
Am Mittwoch, dem 25.01.2023 um 12:59 +0200 schrieb André A. Gomes:
> Hi Guix,
Hi André,

> I noticed that webkitgtk-next is defined in such a way that its name
> is set to "webkitgtk", not "webkitgtk-next".  This contrasts with how
> other *-next packages are defined, such as emacs-next.
> 
> With respect to webkitgtk, if I run:
> 
> --8<---cut here---start->8---
> guix install webkitgtk
> --8<---cut here---end--->8---
> 
> the version assigned in webkitgtk-next will be installed.  On the
> other hand, all packages that depend on webkitgtk will be build with
> version according to version assigned to %webkit-version.
> 
> I think I'm correct since I've just installed cl-cffi-gtk (which
> depends on webkitgtk) and the REPL told me:
> 
> --8<---cut here---start->8---
> WEBKIT> (format nil "~a.~a" (webkit-get-major-version) (webkit-get-
> minor-version))
> "2.36"
> --8<---cut here---end--->8---
> 
> That is, it picked up the version assigned to webkitgtk, not
> webkitgtk-next.
> 
> My question is: shouldn't webkitgtk-next be defined with its name set
> to "webkitgtk-next" instead of "webkitgtk"?  Thanks.
You are a little late to the party.  #60864 fixes that issue and the
related issue of two different versions being used.  I intend to push
it on Sunday, but might be convinced to delay doing so if
issues.guix.gnu.org continues timing out.

Cheers



Re: guix package updates review: app team?

2023-01-27 Thread Andy Tai
last paragraph shall be

As application packages are usually at
the end of the dependency chain (they depend on other libraries or
components more than the other way around) updating application packages shall
take less review effort.

On Fri, Jan 27, 2023 at 2:19 PM Andy Tai  wrote:
>
> Hi, currently Guix has teams of reviewers for different types of
> packages.   For example, changes to R packages and emacs seem to be
> reviewed quickly.  However, recently, patches for updating more
> general application packages (octave, for example) seem to be reviewed
> and processed very slowly.
>
> As a GNU/Linux distribution the update speed of applications impact
> the perception of the community on a distribution, and thus it is
> beneficial if packages update can be processed quickly to keep Guix
> "up to date" so to speak.  Hope Guix maintainers can give some thought
> to this and let more volunteers participate in package review process
> to allow package updates more quickly.   As packages are usually at
> the end of the dependency chain (they depend on other libraries or
> components more than the other way around) updating packages shall
> take less review effort.



-- 
Andy Tai, a...@atai.org, Skype: licheng.tai, Line: andy_tai, WeChat: andytai1010
Year 2023 民國112年
自動的精神力是信仰與覺悟
自動的行為力是勞動與技能



guix package updates review: app team?

2023-01-27 Thread Andy Tai
Hi, currently Guix has teams of reviewers for different types of
packages.   For example, changes to R packages and emacs seem to be
reviewed quickly.  However, recently, patches for updating more
general application packages (octave, for example) seem to be reviewed
and processed very slowly.

As a GNU/Linux distribution the update speed of applications impact
the perception of the community on a distribution, and thus it is
beneficial if packages update can be processed quickly to keep Guix
"up to date" so to speak.  Hope Guix maintainers can give some thought
to this and let more volunteers participate in package review process
to allow package updates more quickly.   As packages are usually at
the end of the dependency chain (they depend on other libraries or
components more than the other way around) updating packages shall
take less review effort.



Re: Unexpected error with #~(modify-phases

2023-01-27 Thread Simon Tournier
Hi Tobias,

On Fri, 27 Jan 2023 at 20:03, Tobias Geerinckx-Rice  wrote:
>
> You're probably missing (guix gexp), and the 'replace' syntax fails before 
> Guile ever gets to expanding the '#~'.

Damned!  Stupid me!  I missed the obvious.  Thanks for the quick help. :-)

Cheerw,
simon



Re: Unexpected error with #~(modify-phases

2023-01-27 Thread Tobias Geerinckx-Rice
You're probably missing (guix gexp), and the 'replace' syntax fails before 
Guile ever gets to expanding the '#~'.

Kind regards,

T G-R

Sent on the go.  Excuse or enjoy my brevity.



Unexpected error with #~(modify-phases

2023-01-27 Thread Simon Tournier
Hi,

Reviewing #59997 [1], there is something I am missing.

Using the V2, all works as expected.  But when I just modify with this
diff:

--8<---cut here---start->8---
1 file changed, 2 insertions(+), 2 deletions(-)
gnu/packages/minimacy.scm | 4 ++--

modified   gnu/packages/minimacy.scm
@@ -48,8 +48,8 @@ (define-public minimacy
"X11" ;for GUI programs, with X11 and ALSA
"X11GL")) ;for GUI programs, with X11, OpenGL, and ALSA
 (arguments
- `(#:phases
-   (modify-phases %standard-phases
+ (list #:phases
+   #~(modify-phases %standard-phases
  (add-after 'unpack 'patch-path
(lambda* (#:key outputs #:allow-other-keys)
  (substitute* "src/hw.c"
--8<---cut here---end--->8---

then I get this error:

--8<---cut here---start->8---
gnu/packages/minimacy.scm:59:9: error: (replace (quote build) (lambda _ (chdir 
"unix") (invoke "make" "nox") (for-each delete-file (find-files "../obj" 
"\\.o$")) (invoke "make" "x11") (for-each delete-file (find-files "../obj" 
"\\.o$")) (invoke "make" "x11gl") (chdir ".."))): 'replace' may only be used 
within 'modify-inputs'
--8<---cut here---end--->8---

where the (unmodified) phase reads:

--8<---cut here---start->8---
 (add-after 'unpack 'patch-path
[...]
 (delete 'configure)
 (replace 'build
   (lambda _
 (chdir "unix")
 (invoke "make" "nox")
 (for-each delete-file
   (find-files "../obj" "\\.o$"))
 (invoke "make" "x11")
 (for-each delete-file
   (find-files "../obj" "\\.o$"))
 (invoke "make" "x11gl")
 (chdir "..")))
 (replace 'install
[...]
--8<---cut here---end--->8---

What do I miss?

1: https://issues.guix.gnu.org/msgid/m1tu219bmo@fastmail.net


Cheers,
simon



Re: guix lint false positives and RFC patch

2023-01-27 Thread Simon Tournier
Hi,

On sam., 12 nov. 2022 at 17:54, Vagrant Cascadian  wrote:
> On 2022-11-05, Ludovic Courtès wrote:
>> Vagrant Cascadian  skribis:
>>> From bfa13fdd3616839883e50efbbc05fb132610ce67 Mon Sep 17 00:00:00 2001
>>> From: Vagrant Cascadian 
>>> Date: Wed, 2 Nov 2022 19:56:12 -0700
>>> Subject: [PATCH 01/12] guix: lint: Exclude some "@" symbols from various
>>>  checks.
>>>
>>> The visual representation of "@code{}" or similar in the description and
>>> synopsis do not include the string, so exclude it from checks to avoid false
>>> positives.
>>>
>>> FIXME handle @command, @file, @acronym, etc.
>>>
>>> * guix/linx.scm (properly-starts-sentence): Exclude leading "@".
>>>   (check-synopsis-length): Exclude "@code" and "@acronym".
>>
>> LGTM!  Bonus points for a test in ‘tests/lint.scm’.  :-)
>
> No bonus points for me just yet...

[...]

> What is failing to match what here?

Well, almost done but not merged, right?

Still an issue this ’match’?


Cheers,
simon



Re: CLI flag to ignore guix channel

2023-01-27 Thread Simon Tournier
Hi,

On jeu., 03 nov. 2022 at 21:51, jgart  wrote:

> I'd like a CLI flag to be able to ignore channels.
>
> Where should I look if I'd like to implement something like this?
>
> I prefer not to edit and comment out channels in ~/.config/guix/channels.scm
>
> I'd prefer to do the following
>
> guix import crate behemoth-rust-package-foo -r --ignore-channel=guixrus

Well, this would be nice but we have nothing in this direction.

>From my point of view, the best is to have several channels.scm files
where some or other channels are defined.  Then, you switch using “guix
time-machine”, for example:

guix time-machine -C path/to/channels-wo-guixrus.scm \
 -- import crate behemoth-rust-package-foo -r

HTH,
simon



Re: Struggling to write Dissecting Guix, Part 2

2023-01-27 Thread Simon Tournier
Hi,

On jeu., 26 janv. 2023 at 21:03, b...@bokr.com wrote:

> Indeed, Simon Peyton Jones is tops.

If I might, I would recommend « Build Systems à la Carte » [1].  It
provides a framework to deal with various build system; Guix being one,
see Table 2.

1: 
https://www.microsoft.com/en-us/research/uploads/prod/2018/03/build-systems.pdf


> 4: 

Oh cool!  Thanks.

Cheers,
simon