Re: [BRLTTY] Support multiple Python versions on Windows

2023-10-16 Thread Leonard de Ruijter

Hi Samuel,


I'm not sure whether the current implementation is enough. You added 
CYTHON_LIMITED_API, but it looks like you might also need to add 
Py_LIMITED_API.



Cheers,

Leonard

On 15-10-2023 16:37, Samuel Thibault wrote:

Hello,

Leonard de Ruijter, le lun. 09 oct. 2023 19:50:39 +0200, a ecrit:

Unfortunately, I can't get the thing to load on Python 3.11-32.

I'm getting the error: `ImportError: DLL load failed while importing brlapi:
The specified module could not be found.`

Probably you need to add to your PATH variable the path to the new
brlapi dll? (or put the new dll alongside your own .exe file)

Samuel

___
This message was sent via the BRLTTY mailing list.
To post a message, send an e-mail to: BRLTTY@brltty.app
For general information, go to: http://brltty.app/mailman/listinfo/brltty


Re: [BRLTTY] Support multiple Python versions on Windows

2023-10-15 Thread Samuel Thibault
Hello,

Leonard de Ruijter, le lun. 09 oct. 2023 19:50:39 +0200, a ecrit:
> Unfortunately, I can't get the thing to load on Python 3.11-32.
> 
> I'm getting the error: `ImportError: DLL load failed while importing brlapi:
> The specified module could not be found.`

Probably you need to add to your PATH variable the path to the new
brlapi dll? (or put the new dll alongside your own .exe file)

Samuel
___
This message was sent via the BRLTTY mailing list.
To post a message, send an e-mail to: BRLTTY@brltty.app
For general information, go to: http://brltty.app/mailman/listinfo/brltty


Re: [BRLTTY] Support multiple Python versions on Windows

2023-10-13 Thread Dave Mielke
[quoted lines by Leonard de Ruijter on 2023/10/09 at 19:50 +0200]

>Unfortunately, I can't get the thing to load on Python 3.11-32.
>
>I'm getting the error: `ImportError: DLL load failed while importing brlapi:
>The specified module could not be found.`

I'm not a Windows person so, really, can't be of much help on this one. Might 
there be a way on Windows to trace the execution of a program so that you can 
see which file it's actually looking for and where it's loking for it? On 
Linux, for example, I'd be using strace to do exactly that.

-- 
I believe the Bible to be the very Word of God: http://Mielke.cc/bible/
Dave Mielke| 2213 Fox Crescent | WebHome: http://Mielke.cc/
EMail: d...@mielke.cc  | Ottawa, Ontario   | Twitter: @Dave_Mielke
Phone: +1 613 726 0014 | Canada  K2A 1H7   |
___
This message was sent via the BRLTTY mailing list.
To post a message, send an e-mail to: BRLTTY@brltty.app
For general information, go to: http://brltty.app/mailman/listinfo/brltty


Re: [BRLTTY] Support multiple Python versions on Windows

2023-10-09 Thread Leonard de Ruijter

Unfortunately, I can't get the thing to load on Python 3.11-32.

I'm getting the error: `ImportError: DLL load failed while importing 
brlapi: The specified module could not be found.`


On 9-10-2023 09:28, Dave Mielke wrote:

[quoted lines by Leonard de Ruijter on 2023/10/09 at 07:56 +0200]


Would it be possible to provide a test build of the python bindings based on 
this pr?

You can download one from: http://mielke.cc/~dave/brltty-win-6.6-24-libusb.zip


___
This message was sent via the BRLTTY mailing list.
To post a message, send an e-mail to: BRLTTY@brltty.app
For general information, go to: http://brltty.app/mailman/listinfo/brltty


Re: [BRLTTY] Support multiple Python versions on Windows

2023-10-09 Thread Leonard de Ruijter

Thanks a lot Dave, I'll test this later today and will report back.


Could you elaborate on the development environment you're using to 
create these packages? I have invested multiple hours in getting a build 
to work with msys1 based in mingw-get, but that tooling seems pretty old 
and out of date nowadays. I'm getting errors about windows error 
constants that could not be found.



Cheers,

Leonard

On 09/10/2023 09:28, Dave Mielke wrote:

[quoted lines by Leonard de Ruijter on 2023/10/09 at 07:56 +0200]


Would it be possible to provide a test build of the python bindings based on 
this pr?

You can download one from: http://mielke.cc/~dave/brltty-win-6.6-24-libusb.zip


___
This message was sent via the BRLTTY mailing list.
To post a message, send an e-mail to: BRLTTY@brltty.app
For general information, go to: http://brltty.app/mailman/listinfo/brltty


Re: [BRLTTY] Support multiple Python versions on Windows

2023-10-09 Thread Dave Mielke
[quoted lines by Leonard de Ruijter on 2023/10/09 at 07:56 +0200]

>Would it be possible to provide a test build of the python bindings based on 
>this pr?

You can download one from: http://mielke.cc/~dave/brltty-win-6.6-24-libusb.zip

-- 
I believe the Bible to be the very Word of God: http://Mielke.cc/bible/
Dave Mielke| 2213 Fox Crescent | WebHome: http://Mielke.cc/
EMail: d...@mielke.cc  | Ottawa, Ontario   | Twitter: @Dave_Mielke
Phone: +1 613 726 0014 | Canada  K2A 1H7   |
___
This message was sent via the BRLTTY mailing list.
To post a message, send an e-mail to: BRLTTY@brltty.app
For general information, go to: http://brltty.app/mailman/listinfo/brltty


Re: [BRLTTY] Support multiple Python versions on Windows

2023-10-08 Thread Leonard de Ruijter

Hi Samuel,


Thanks a lot for looking. Would it be possible to provide a test build 
of the python bindings based on this pr?



Cheers,

Leonard

On 08/10/2023 21:26, Samuel Thibault wrote:

Hello,

Samuel Thibault, le jeu. 28 sept. 2023 01:28:01 +0200, a ecrit:

Samuel Thibault, le jeu. 28 sept. 2023 01:26:57 +0200, a ecrit:

Apparently cython3 introduced some support for it, so it will be worth
trying it indeed.

(namely: CYTHON_LIMITED_API, that makes cython use the stable ABI)

I tried it, it seems to be working indeed. I have submitted the change
on

https://github.com/brltty/brltty/pull/429

Samuel

___
This message was sent via the BRLTTY mailing list.
To post a message, send an e-mail to: BRLTTY@brltty.app
For general information, go to: http://brltty.app/mailman/listinfo/brltty


Re: [BRLTTY] Support multiple Python versions on Windows

2023-10-08 Thread Samuel Thibault
Hello,

Samuel Thibault, le jeu. 28 sept. 2023 01:28:01 +0200, a ecrit:
> Samuel Thibault, le jeu. 28 sept. 2023 01:26:57 +0200, a ecrit:
> > Apparently cython3 introduced some support for it, so it will be worth
> > trying it indeed.
> 
> (namely: CYTHON_LIMITED_API, that makes cython use the stable ABI)

I tried it, it seems to be working indeed. I have submitted the change
on

https://github.com/brltty/brltty/pull/429

Samuel
___
This message was sent via the BRLTTY mailing list.
To post a message, send an e-mail to: BRLTTY@brltty.app
For general information, go to: http://brltty.app/mailman/listinfo/brltty


Re: [BRLTTY] Support multiple Python versions on Windows

2023-09-28 Thread Leonard de Ruijter

Hi Samuel,


That is lovely! I'm happy to give that a try if I can get the Python 
bindings to build, though having a hard time with that. The windows 
building docs contain several suggestions for build environment. Ideally 
I'd use something that is as close as possible to the environment Dave 
uses for release builds.



Cheers,

Leoanrd

On 28/09/2023 01:28, Samuel Thibault wrote:

Samuel Thibault, le jeu. 28 sept. 2023 01:26:57 +0200, a ecrit:

Leonard de Ruijter, le mer. 27 sept. 2023 19:51:10 +0200, a ecrit:

Python has something like the stable application binary Interface (ABI), see
https://docs.python.org/3.11/c-api/stable.html . This can be used by
enabling the limited API.

I wonder, has this ever been considered? If not, could it be considered to
create a brlapi python package that uses the limited API, preferably using
an API version that is equal to the minimum Python version that is still in
maintenance (currently 3.8)? That would ensure that you'd be able to use a
brlapi python extension with multiple python versions.

Apparently cython3 introduced some support for it, so it will be worth
trying it indeed.

(namely: CYTHON_LIMITED_API, that makes cython use the stable ABI)
___
This message was sent via the BRLTTY mailing list.
To post a message, send an e-mail to: BRLTTY@brltty.app
For general information, go to: http://brltty.app/mailman/listinfo/brltty

___
This message was sent via the BRLTTY mailing list.
To post a message, send an e-mail to: BRLTTY@brltty.app
For general information, go to: http://brltty.app/mailman/listinfo/brltty


Re: [BRLTTY] Support multiple Python versions on Windows

2023-09-27 Thread Samuel Thibault
Samuel Thibault, le jeu. 28 sept. 2023 01:26:57 +0200, a ecrit:
> Leonard de Ruijter, le mer. 27 sept. 2023 19:51:10 +0200, a ecrit:
> > Python has something like the stable application binary Interface (ABI), see
> > https://docs.python.org/3.11/c-api/stable.html . This can be used by
> > enabling the limited API.
> > 
> > I wonder, has this ever been considered? If not, could it be considered to
> > create a brlapi python package that uses the limited API, preferably using
> > an API version that is equal to the minimum Python version that is still in
> > maintenance (currently 3.8)? That would ensure that you'd be able to use a
> > brlapi python extension with multiple python versions.
> 
> Apparently cython3 introduced some support for it, so it will be worth
> trying it indeed.

(namely: CYTHON_LIMITED_API, that makes cython use the stable ABI)
___
This message was sent via the BRLTTY mailing list.
To post a message, send an e-mail to: BRLTTY@brltty.app
For general information, go to: http://brltty.app/mailman/listinfo/brltty


Re: [BRLTTY] Support multiple Python versions on Windows

2023-09-27 Thread Samuel Thibault
Hello,

Leonard de Ruijter, le mer. 27 sept. 2023 19:51:10 +0200, a ecrit:
> Python has something like the stable application binary Interface (ABI), see
> https://docs.python.org/3.11/c-api/stable.html . This can be used by
> enabling the limited API.
> 
> I wonder, has this ever been considered? If not, could it be considered to
> create a brlapi python package that uses the limited API, preferably using
> an API version that is equal to the minimum Python version that is still in
> maintenance (currently 3.8)? That would ensure that you'd be able to use a
> brlapi python extension with multiple python versions.

Apparently cython3 introduced some support for it, so it will be worth
trying it indeed.

Samuel
___
This message was sent via the BRLTTY mailing list.
To post a message, send an e-mail to: BRLTTY@brltty.app
For general information, go to: http://brltty.app/mailman/listinfo/brltty


Re: [BRLTTY] Support multiple Python versions on Windows

2023-09-27 Thread Leonard de Ruijter

Hi Dave,


Thanks for the quick response.

May be I should setup a dev environment myself first to experiment a 
bit, but I'm slightly puzzled about the docs. What should I do if I want 
to create a x86 python module? Should I go with Cygwin or min-GW, and 
should it be explicitly X86 or can X64 builds of either cygwin or MinGW 
perfectly create X86 modules?



Cheers,

Leonard

On 27-9-2023 22:38, Dave Mielke wrote:

[quoted lines by Leonard de Ruijter on 2023/09/27 at 19:51 +0200]


The NVDA project is currently in the process of upgrading Python to version
3.11. I recall that when we updated to Python 3.7 3 years ago, I had to
create a brlapi python extension manually, as the python version bundled in
the Windows packages didn't match Python 3.7.

Python has something like the stable application binary Interface (ABI), see
https://docs.python.org/3.11/c-api/stable.html . This can be used by enabling
the limited API.

I wonder, has this ever been considered? If not, could it be considered to
create a brlapi python package that uses the limited API, preferably using an
API version that is equal to the minimum Python version that is still in
maintenance (currently 3.8)? That would ensure that you'd be able to use a
brlapi python extension with multiple python versions.

I'm the one who does the builds for Windows but I'm not a Windows person. If 
you can give me the steps to perform to try to get it right, that'd be cool!


___
This message was sent via the BRLTTY mailing list.
To post a message, send an e-mail to: BRLTTY@brltty.app
For general information, go to: http://brltty.app/mailman/listinfo/brltty


Re: [BRLTTY] Support multiple Python versions on Windows

2023-09-27 Thread Dave Mielke
[quoted lines by Leonard de Ruijter on 2023/09/27 at 19:51 +0200]

>The NVDA project is currently in the process of upgrading Python to version
>3.11. I recall that when we updated to Python 3.7 3 years ago, I had to
>create a brlapi python extension manually, as the python version bundled in
>the Windows packages didn't match Python 3.7.
>
>Python has something like the stable application binary Interface (ABI), see
>https://docs.python.org/3.11/c-api/stable.html . This can be used by enabling
>the limited API.
>
>I wonder, has this ever been considered? If not, could it be considered to
>create a brlapi python package that uses the limited API, preferably using an
>API version that is equal to the minimum Python version that is still in
>maintenance (currently 3.8)? That would ensure that you'd be able to use a
>brlapi python extension with multiple python versions.

I'm the one who does the builds for Windows but I'm not a Windows person. If 
you can give me the steps to perform to try to get it right, that'd be cool!

-- 
I believe the Bible to be the very Word of God: http://Mielke.cc/bible/
Dave Mielke| 2213 Fox Crescent | WebHome: http://Mielke.cc/
EMail: d...@mielke.cc  | Ottawa, Ontario   | Twitter: @Dave_Mielke
Phone: +1 613 726 0014 | Canada  K2A 1H7   |
___
This message was sent via the BRLTTY mailing list.
To post a message, send an e-mail to: BRLTTY@brltty.app
For general information, go to: http://brltty.app/mailman/listinfo/brltty


[BRLTTY] Support multiple Python versions on Windows

2023-09-27 Thread Leonard de Ruijter

Hello all, particularly Samuel,


The NVDA project is currently in the process of upgrading Python to 
version 3.11. I recall that when we updated to Python 3.7 3 years ago, I 
had to create a brlapi python extension manually, as the python version 
bundled in the Windows packages didn't match Python 3.7.


Python has something like the stable application binary Interface (ABI), 
see https://docs.python.org/3.11/c-api/stable.html . This can be used by 
enabling the limited API.


I wonder, has this ever been considered? If not, could it be considered 
to create a brlapi python package that uses the limited API, preferably 
using an API version that is equal to the minimum Python version that is 
still in maintenance (currently 3.8)? That would ensure that you'd be 
able to use a brlapi python extension with multiple python versions.



Regards,

Leonard

___
This message was sent via the BRLTTY mailing list.
To post a message, send an e-mail to: BRLTTY@brltty.app
For general information, go to: http://brltty.app/mailman/listinfo/brltty