~lioploum/offpunk-devel

5 2

Issues installing on macOS, e.g. finding timg 1.3.2+

Details
Message ID
<CAKVJ-_5RDgHuB6448+boLfz4JbgEASZbgN3-FcpMhYq-vBGhUg@mail.gmail.com>
DKIM signature
pass
Download raw message
Patch: +3 -2
Hello,

I read about offpunk via Mastodon, and was curious to give it a try -
particularly the image rendering at the terminal which was intriguing.
I am currently trying this on macOS Intel, but if it works for me
would also use macOS ARM, and Linux on Intel.

I could install offpunk itself easily (via "pip install offpunk", or
"git clone ..."), and could work out most of the soft dependencies
easily enough.

However, running "version" inside offpunk says it would like chafa (at
least version 1.10 from the email archives) and/or timg 1.3.2+

I ran into some confusion with rival image projects called timg, and
sadly it looks like the one offpunk wants is harder to install:
https://github.com/hzeller/timg/issues/141

Likewise chafa doesn't currently have macOS binaries (for Intel or
ARM), but that may be happening soon:
https://github.com/hpjansson/chafa/issues/223

For python-pil, it looks like pillow is fine (the maintained fork):
https://pypi.org/project/pillow/

Having a few more details on https://offpunk.net/install.html would
help, even a simple listing of recommended packages, minimum versions,
and a link to the home page?

Finally, a small bug report: The code in opnk.py to check if the
version of less is at least 572 does not account for non-integer
versions like this:

$ which less
/usr/bin/less
$ less --version | head -n 2
less 581.2 (POSIX regular expressions)
Copyright (C) 1984-2021  Mark Nudelman

Possible patch below, generated with "git diff -p > less_macos_version.patch"

Thank you,

Peter

--

diff --git a/opnk.py b/opnk.py
index 1587f39..7488b5f 100755
--- a/opnk.py
+++ b/opnk.py
@@ -29,8 +29,9 @@ output = run("less --version")
words = output.split("\n")[0].split()
less_version = 0
for w in words:
    if w.isdigit():
        less_version = int(w)
    # On macOS the version can be something like 581.2 not just an int:
    if all(_.isdigit() for _ in w.split(".")):
        less_version = int(w.split(".", 1)[0])
# restoring position only works for version of less > 572
if less_version >= 572:
    _LESS_RESTORE_POSITION = True
Details
Message ID
<CAKVJ-_7HPpGrTLHx=QEkn-b3z77uVqHNSPb-6rGhZcp2ywNvqw@mail.gmail.com>
In-Reply-To
<CAKVJ-_5RDgHuB6448+boLfz4JbgEASZbgN3-FcpMhYq-vBGhUg@mail.gmail.com> (view parent)
DKIM signature
pass
Download raw message
I realize that coping some of the information currently on
https://sr.ht/~lioploum/offpunk/#dependencies to the new
site https://offpunk.net/install.html (or linking to it) would help.

Also you write "requirements file to install dependencies with pip"
for https://git.sr.ht/~lioploum/offpunk/tree/HEAD/requirements.txt
which is problematic for timg (as currently that points to a different
library on PyPI, see https://github.com/hzeller/timg/issues/141 ).

Regards,

Peter

On Fri, Oct 18, 2024 at 1:27 AM Peter Cock <p.j.a.cock@googlemail.com> wrote:
>
> Hello,
>
> I read about offpunk via Mastodon, and was curious to give it a try -
> particularly the image rendering at the terminal which was intriguing.
> I am currently trying this on macOS Intel, but if it works for me
> would also use macOS ARM, and Linux on Intel.
>
> I could install offpunk itself easily (via "pip install offpunk", or
> "git clone ..."), and could work out most of the soft dependencies
> easily enough.
>
> However, running "version" inside offpunk says it would like chafa (at
> least version 1.10 from the email archives) and/or timg 1.3.2+
>
> I ran into some confusion with rival image projects called timg, and
> sadly it looks like the one offpunk wants is harder to install:
> https://github.com/hzeller/timg/issues/141
>
> Likewise chafa doesn't currently have macOS binaries (for Intel or
> ARM), but that may be happening soon:
> https://github.com/hpjansson/chafa/issues/223
>
> For python-pil, it looks like pillow is fine (the maintained fork):
> https://pypi.org/project/pillow/
>
> Having a few more details on https://offpunk.net/install.html would
> help, even a simple listing of recommended packages, minimum versions,
> and a link to the home page?
>
> Finally, a small bug report: The code in opnk.py to check if the
> version of less is at least 572 does not account for non-integer
> versions like this:
>
> $ which less
> /usr/bin/less
> $ less --version | head -n 2
> less 581.2 (POSIX regular expressions)
> Copyright (C) 1984-2021  Mark Nudelman
>
> Possible patch below, generated with "git diff -p > less_macos_version.patch"
>
> Thank you,
>
> Peter
>
> --
>
> diff --git a/opnk.py b/opnk.py
> index 1587f39..7488b5f 100755
> --- a/opnk.py
> +++ b/opnk.py
> @@ -29,8 +29,9 @@ output = run("less --version")
>  words = output.split("\n")[0].split()
>  less_version = 0
>  for w in words:
> -    if w.isdigit():
> -        less_version = int(w)
> +    # On macOS the version can be something like 581.2 not just an int:
> +    if all(_.isdigit() for _ in w.split(".")):
> +        less_version = int(w.split(".", 1)[0])
>  # restoring position only works for version of less > 572
>  if less_version >= 572:
>      _LESS_RESTORE_POSITION = True

Re: [Possible phishing attempt] Issues installing on macOS, e.g. finding timg 1.3.2+

Details
Message ID
<172924218773.7.1208680300084024380.466852273@ploum.eu>
In-Reply-To
<CAKVJ-_5RDgHuB6448+boLfz4JbgEASZbgN3-FcpMhYq-vBGhUg@mail.gmail.com> (view parent)
DKIM signature
pass
Download raw message
On 24 oct 18 01:27, Peter Cock wrote:
>Hello,
>
>I read about offpunk via Mastodon, and was curious to give it a try -
>particularly the image rendering at the terminal which was intriguing.
>I am currently trying this on macOS Intel, but if it works for me
>would also use macOS ARM, and Linux on Intel.
>
>I could install offpunk itself easily (via "pip install offpunk", or
>"git clone ..."), and could work out most of the soft dependencies
>easily enough.

As you pointed out in the next message, the offpunk.net page about 
installation could probably be involved. 

I will welcome contributions regarding that (pages of offpunk.net are in 
the offpunk repository, folder "tutorial").

I will try to work on it myself but cannot guarantee having the time in 
the coming weeks (currently on a book launching tour)
>
>However, running "version" inside offpunk says it would like chafa (at
>least version 1.10 from the email archives) and/or timg 1.3.2+
>
>I ran into some confusion with rival image projects called timg, and
>sadly it looks like the one offpunk wants is harder to install:
>https://github.com/hzeller/timg/issues/141

I plan to deprecate timg as chafa is now working great everywhere. 

But I don’t have MacOS and I don’t know of any developer using Offpunk 
on MacOS. So feedbacks and contributions about MacOS are welcome.
>
>Likewise chafa doesn't currently have macOS binaries (for Intel or
>ARM), but that may be happening soon:
>https://github.com/hpjansson/chafa/issues/223
>
>For python-pil, it looks like pillow is fine (the maintained fork):
>https://pypi.org/project/pillow/

using python-pil will be deprecated and should only be needed with chafa 
before 1.10. Starting with 2.4, Offpunk will emits a deprecation warning 
if you are using a too old chafa. Based on feedback, python-pil and 
support for chafa < 1.10 will be removed in Offpunk 2.5 or later.

>
>Having a few more details on https://offpunk.net/install.html would
>help, even a simple listing of recommended packages, minimum versions,
>and a link to the home page?

That’s indeed a good idea. 
>
>Finally, a small bug report: The code in opnk.py to check if the
>version of less is at least 572 does not account for non-integer
>versions like this:

Wow, great catch. Will test the patch and apply it soon.
>
>$ which less
>/usr/bin/less
>$ less --version | head -n 2
>less 581.2 (POSIX regular expressions)
>Copyright (C) 1984-2021  Mark Nudelman
>
>Possible patch below, generated with "git diff -p > less_macos_version.patch"
>
>Thank you,
>
>Peter
>
>--
>
>diff --git a/opnk.py b/opnk.py
>index 1587f39..7488b5f 100755
>--- a/opnk.py
>+++ b/opnk.py
>@@ -29,8 +29,9 @@ output = run("less --version")
> words = output.split("\n")[0].split()
> less_version = 0
> for w in words:
>-    if w.isdigit():
>-        less_version = int(w)
>+    # On macOS the version can be something like 581.2 not just an int:
>+    if all(_.isdigit() for _ in w.split(".")):
>+        less_version = int(w.split(".", 1)[0])
> # restoring position only works for version of less > 572
> if less_version >= 572:
>     _LESS_RESTORE_POSITION = True
>

-- 
Ploum - Lionel Dricot
Blog: https://www.ploum.net
Livres: https://ploum.net/livres.html

Re: [Possible phishing attempt] Issues installing on macOS, e.g. finding timg 1.3.2+

Details
Message ID
<CAKVJ-_5-O0aa_2nS9fi-J_UjpzmzAp3+QEoqQsotRRNaPO-EJg@mail.gmail.com>
In-Reply-To
<172924218773.7.1208680300084024380.466852273@ploum.eu> (view parent)
DKIM signature
pass
Download raw message
On Fri, Oct 18, 2024 at 10:03 AM Ploum <sourcehut24@ploum.eu> wrote:
>
> As you pointed out in the next message, the offpunk.net page about
> installation could probably be involved.
>
> I will welcome contributions regarding that (pages of offpunk.net are in
> the offpunk repository, folder "tutorial").

I know how to work with git and can generate patches, but normally use
GitHub or similar. How would you like patches sent to this mailing list? I
can see this is possible from
https://lists.sr.ht/~lioploum/offpunk-devel/patches
The less check was pretty trivial so worked at the end of my email, but I
did also try sending it as an attachment but that message was rejected.

Or is it easier via the issue tracker https://todo.sr.ht/~lioploum/offpunk ?

> >I ran into some confusion with rival image projects called timg, and
> >sadly it looks like the one offpunk wants is harder to install:
> >https://github.com/hzeller/timg/issues/141
>
> I plan to deprecate timg as chafa is now working great everywhere.
>
> But I don’t have MacOS and I don’t know of any developer using Offpunk
> on MacOS. So feedbacks and contributions about MacOS are welcome.
> >
> >Likewise chafa doesn't currently have macOS binaries (for Intel or
> >ARM), but that may be happening soon:
> >https://github.com/hpjansson/chafa/issues/223

It makes sense for me to ignore timg and focus on chafa then. Thank you.

> >Finally, a small bug report: The code in opnk.py to check if the
> >version of less is at least 572 does not account for non-integer
> >versions like this:
>
> Wow, great catch. Will test the patch and apply it soon.

Great, thanks!

Peter
Details
Message ID
<172950586393.7.2741074120759355784.469447276@ploum.eu>
In-Reply-To
<CAKVJ-_5-O0aa_2nS9fi-J_UjpzmzAp3+QEoqQsotRRNaPO-EJg@mail.gmail.com> (view parent)
DKIM signature
pass
Download raw message
On 24 oct 18 10:20, Peter Cock wrote:
>On Fri, Oct 18, 2024 at 10:03 AM Ploum <sourcehut24@ploum.eu> wrote:
>>
>> As you pointed out in the next message, the offpunk.net page about
>> installation could probably be involved.
>>
>> I will welcome contributions regarding that (pages of offpunk.net are in
>> the offpunk repository, folder "tutorial").
>
>I know how to work with git and can generate patches, but normally use
>GitHub or similar. How would you like patches sent to this mailing list? I
>can see this is possible from
>https://lists.sr.ht/~lioploum/offpunk-devel/patches
>The less check was pretty trivial so worked at the end of my email, but I
>did also try sending it as an attachment but that message was rejected.
>
>Or is it easier via the issue tracker https://todo.sr.ht/~lioploum/offpunk ?

Patches sent to this mailing-list are the prefered way.

See https://git-send-email.io/


>
>> >I ran into some confusion with rival image projects called timg, and
>> >sadly it looks like the one offpunk wants is harder to install:
>> >https://github.com/hzeller/timg/issues/141
>>
>> I plan to deprecate timg as chafa is now working great everywhere.
>>
>> But I don’t have MacOS and I don’t know of any developer using Offpunk
>> on MacOS. So feedbacks and contributions about MacOS are welcome.
>> >
>> >Likewise chafa doesn't currently have macOS binaries (for Intel or
>> >ARM), but that may be happening soon:
>> >https://github.com/hpjansson/chafa/issues/223
>
>It makes sense for me to ignore timg and focus on chafa then. Thank you.

Yeah, definitely focus on Chafa
>
>> >Finally, a small bug report: The code in opnk.py to check if the
>> >version of less is at least 572 does not account for non-integer
>> >versions like this:
>>
>> Wow, great catch. Will test the patch and apply it soon.
>
>Great, thanks!
>
>Peter
>

-- 
Ploum - Lionel Dricot
Blog: https://www.ploum.net
Livres: https://ploum.net/livres.html
Details
Message ID
<172950633860.7.3201159751298534622.469452379@ploum.eu>
In-Reply-To
<CAKVJ-_5RDgHuB6448+boLfz4JbgEASZbgN3-FcpMhYq-vBGhUg@mail.gmail.com> (view parent)
DKIM signature
pass
Download raw message
Patch merged. Thanks!

On 24 oct 18 01:27, Peter Cock wrote:
>
>Finally, a small bug report: The code in opnk.py to check if the
>version of less is at least 572 does not account for non-integer
>versions like this:
>
>$ which less
>/usr/bin/less
>$ less --version | head -n 2
>less 581.2 (POSIX regular expressions)
>Copyright (C) 1984-2021  Mark Nudelman
>
>Possible patch below, generated with "git diff -p > less_macos_version.patch"
>
>Thank you,
>
>Peter
>
>--
>
>diff --git a/opnk.py b/opnk.py
>index 1587f39..7488b5f 100755
>--- a/opnk.py
>+++ b/opnk.py
>@@ -29,8 +29,9 @@ output = run("less --version")
> words = output.split("\n")[0].split()
> less_version = 0
> for w in words:
>-    if w.isdigit():
>-        less_version = int(w)
>+    # On macOS the version can be something like 581.2 not just an int:
>+    if all(_.isdigit() for _ in w.split(".")):
>+        less_version = int(w.split(".", 1)[0])
> # restoring position only works for version of less > 572
> if less_version >= 572:
>     _LESS_RESTORE_POSITION = True
>

-- 
Ploum - Lionel Dricot
Blog: https://www.ploum.net
Livres: https://ploum.net/livres.html
Reply to thread Export thread (mbox)