[Python-Dev] How official binaries are built?

2019-10-15 Thread Inada Naoki
Hi, all.

I want Homebrew uses `--enable-optimizations` and `--with-lto` option
for building Python.  But maintainer said:

> Given this is not a default option, probably not, unless it is done in 
> upstream (“official”) binaries.

https://github.com/Homebrew/homebrew-core/pull/45337

Are these options used for official macOS binaries?
Is there official information about the build step of official binaries?

Regards,
-- 
Inada Naoki  
___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/EILILECNTLTW4VCBCPW37R4QRU7ZBDEU/
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-Dev] Re: How official binaries are built?

2019-10-15 Thread Ned Deily
On Oct 15, 2019, at 04:54, Inada Naoki  wrote:
> I want Homebrew uses `--enable-optimizations` and `--with-lto` option
> for building Python.  But maintainer said:
> 
>> Given this is not a default option, probably not, unless it is done in 
>> upstream (“official”) binaries.
> 
> https://github.com/Homebrew/homebrew-core/pull/45337
> 
> Are these options used for official macOS binaries?
> Is there official information about the build step of official binaries?

We currently do not use those options to build the binaries for the python.org 
macOS installers.  The main reason is that the Pythons we provide are built to 
support a wide-range of macOS releases and to do so safely we build the 
binaries on the oldest version of macOS supported by that installer.  So, for 
example, the 10.9+ installer variant is built on a 10.9 system.  Some of the 
optimization features either aren't available or are less robust on older build 
tools.  And I believe it is more important for the python.org macOS installers 
to continue to provide a single installer that is usable on many systems and 
can be used in a broad range of applications and by a broad range of users 
rather than trying to optimize performance for a specific application: you can 
always build your own Python.

As far as what other distributors of Python for macOS do, what we do shouldn't 
necessarily constrain them.  I don't see any problem with Homebrew optimizing 
for a particular user's installation.  I see that MacPorts, another distributor 
of Python on macOS, provides a non-default variant that uses 
--enable-optimizations.

https://github.com/macports/macports-ports/blob/master/lang/python37/Portfile

--
  Ned Deily
  n...@python.org -- []
___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/HJXKYD62KBTYMNBSAMEZHWXSC6FH7PVO/
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-Dev] Re: [RELEASE] Python 3.8.0 is now available

2019-10-15 Thread Łukasz Langa

> On 15 Oct 2019, at 06:37, Glenn Linderman  wrote:
> 
>> I look forward to using Python 3.8.0.
>> 
>> However, having installed it, I then needed to install brotli, so I ran pip 
>> install brotli, and that worked, but I was very surprised to get told:
>> 
>> You are using pip version 18.1, however version 19.3 is available.
>> You should consider upgrading via the 'python -m pip install --upgrade pip' 
>> command.
>> 
>> The upgrade worked, but why would the newest, just-released version of 
>> Python not include the newest version of pip?
>> 
>> Glenn

The reason why ensurepip is complaining on 3.8 (and it is) is that pip 19.3 was 
released on the same day as 3.8.0. Like any other part of CPython, it takes a 
while to stabilize ensurepip and I wouldn't update it for 3.8.0 at any point 
after RC1 was released unless it fixed a critical bug.

Admittedly, it is a bit surprising to say the least to have pip outdated from 
Day 1. However, keep in mind that pip is a relatively fast-moving external 
project and it was a matter of time for ensurepip to go out of date. In fact, 
it's pretty much guaranteed to happen sooner or later.

I wouldn't worry about it.

- Ł


signature.asc
Description: Message signed with OpenPGP
___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/LXE6OM4JAAKMNZQA7WTP3GYEXCRUBUWU/
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-Dev] Re: How official binaries are built?

2019-10-15 Thread Victor Stinner
Hi Inada-san,

You can query the sysconfig module to check how Python has been built.

Example:

pyvstinner@apu$ python3
Python 3.7.4 (default, Jul  9 2019, 16:32:37)
[GCC 9.1.1 20190503 (Red Hat 9.1.1-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sysconfig

>>> sysconfig.get_config_var('PY_CFLAGS')
'-Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1
-DNDEBUG  -O2 -g -pipe -Wall -Werror=format-security
-Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions
-fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic
-fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection
-D_GNU_SOURCE -fPIC -fwrapv'

>>> sysconfig.get_config_var('PY_CFLAGS_NODIST')
'-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2
-Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong
-grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1
-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic
-fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection
-D_GNU_SOURCE -fPIC -fwrapv -flto -fuse-linker-plugin
-ffat-lto-objects -flto-partition=none -g -std=c99 -Wextra
-Wno-unused-result -Wno-unused-parameter
-Wno-missing-field-initializers -Wno-cast-function-type
-Werror=implicit-function-declaration -O2 -g -pipe -Wall
-Werror=format-security -Wp,-D_FORTIFY_SOURCE=2
-Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong
-grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1
-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic
-fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection
-D_GNU_SOURCE -fPIC -fwrapv -fprofile-use -fprofile-correction'

>>> sysconfig.get_config_var('PY_LDFLAGS')
'-Wl,-z,relro -Wl,--as-needed  -Wl,-z,now  -g'

>>> sysconfig.get_config_var('PY_LDFLAGS_NODIST')
'-Wl,-z,relro -Wl,--as-needed  -Wl,-z,now
-specs=/usr/lib/rpm/redhat/redhat-hardened-ld -g  -flto
-fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g'

>>> import shlex
>>> [opt for opt in shlex.split(sysconfig.get_config_var('PY_CFLAGS') + 
>>> sysconfig.get_config_var('PY_CFLAGS_NODIST')) if opt.startswith('-O') or 
>>> 'profile' in opt]
['-O2', '-O2', '-fprofile-use', '-fprofile-correction']

>>> [opt for opt in shlex.split(sysconfig.get_config_var('PY_LDFLAGS') + 
>>> sysconfig.get_config_var('PY_LDFLAGS_NODIST')) if 'lto' in opt]
['-flto', '-ffat-lto-objects', '-flto-partition=none']


You can see that Fedora 30 /usr/bin/python3.7 is built using -O2 and
has been optimized with PGO (compiler flag -fprofile-use) and LTO
(linker flag -flto).

Victor


Le mar. 15 oct. 2019 à 11:02, Inada Naoki  a écrit :
>
> Hi, all.
>
> I want Homebrew uses `--enable-optimizations` and `--with-lto` option
> for building Python.  But maintainer said:
>
> > Given this is not a default option, probably not, unless it is done in 
> > upstream (“official”) binaries.
>
> https://github.com/Homebrew/homebrew-core/pull/45337
>
> Are these options used for official macOS binaries?
> Is there official information about the build step of official binaries?
>
> Regards,
> --
> Inada Naoki  
> ___
> Python-Dev mailing list -- python-dev@python.org
> To unsubscribe send an email to python-dev-le...@python.org
> https://mail.python.org/mailman3/lists/python-dev.python.org/
> Message archived at 
> https://mail.python.org/archives/list/python-dev@python.org/message/EILILECNTLTW4VCBCPW37R4QRU7ZBDEU/
> Code of Conduct: http://python.org/psf/codeofconduct/



-- 
Night gathers, and now my watch begins. It shall not end until my death.
___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/33GTAOJBEQ2QM25ZK27FFWTIE45D2SAX/
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-Dev] Re: How official binaries are built?

2019-10-15 Thread Inada Naoki
On Tue, Oct 15, 2019 at 10:57 PM Victor Stinner  wrote:
>
> Hi Inada-san,
>
> You can query the sysconfig module to check how Python has been built.

Thank you for pointing it out.  It seems official macOS binary doesn't use
--enable-optimizations and --with-lto options...

Python 3.8.0 (v3.8.0:fa919fdf25, Oct 14 2019, 10:23:27)
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sysconfig
>>> sysconfig.get_config_var('PY_CFLAGS')
'-Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common
-dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g'
>>> sysconfig.get_config_var('PY_CFLAGS_NODIST')
'-std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter
-Wno-missing-field-initializers -Wstrict-prototypes
-Werror=implicit-function-declaration
-I/Users/sysadmin/build/v3.8.0/Include/internal'
>>> sysconfig.get_config_var('PY_LDFLAGS_NODIST')
''
>>> sysconfig.get_config_var('PY_LDFLAGS')
'-arch x86_64 -g'



-- 
Inada Naoki  
___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/VUA2AG6J2QG2GK52DZ4VKZMRUTKJ4DWO/
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-Dev] Re: [RELEASE] Python 3.8.0 is now available

2019-10-15 Thread MRAB

On 2019-10-14 21:23, Łukasz Langa wrote:
On behalf of the Python development community and the Python 3.8 release 
team, I’m pleased to announce *the availability of Python 3.8.0*.



[snip]
I've installed pywin32 on Python 3.8, but when I try to import 
win32clipboard it says it can't find it:


Python 3.8.0 (tags/v3.8.0:fa919fd, Oct 14 2019, 19:37:50) [MSC v.1916 64 
bit (AMD64)] on win32

Type "help", "copyright", "credits" or "license" for more information.
>>> import win32
>>> import win32clipboard
Traceback (most recent call last):
  File "", line 1, in 
ImportError: DLL load failed while importing win32clipboard: The 
specified module could not be found.

>>>

Does anyone else have this problem?
___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/MHSHP3Z5TN4SDSG6G3MLAV6H56C36DHP/
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-Dev] Re: [RELEASE] Python 3.8.0 is now available

2019-10-15 Thread Glenn Linderman

On 10/15/2019 11:03 AM, MRAB wrote:

On 2019-10-14 21:23, Łukasz Langa wrote:
On behalf of the Python development community and the Python 3.8 
release team, I’m pleased to announce *the availability of Python 
3.8.0*.



[snip]
I've installed pywin32 on Python 3.8, but when I try to import 
win32clipboard it says it can't find it:


Python 3.8.0 (tags/v3.8.0:fa919fd, Oct 14 2019, 19:37:50) [MSC v.1916 
64 bit (AMD64)] on win32

Type "help", "copyright", "credits" or "license" for more information.
>>> import win32
>>> import win32clipboard
Traceback (most recent call last):
  File "", line 1, in 
ImportError: DLL load failed while importing win32clipboard: The 
specified module could not be found.

>>>

Does anyone else have this problem?


Yes, and also win32gui (of pywin32) gets the same error.
___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/3OCA42T6Q7JEDKNE55YW46MSNDAXIK6M/
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-Dev] Re: [RELEASE] Python 3.8.0 is now available

2019-10-15 Thread MRAB

On 2019-10-15 19:03, MRAB wrote:

On 2019-10-14 21:23, Łukasz Langa wrote:
On behalf of the Python development community and the Python 3.8 release 
team, I’m pleased to announce *the availability of Python 3.8.0*.



[snip]
I've installed pywin32 on Python 3.8, but when I try to import
win32clipboard it says it can't find it:

Python 3.8.0 (tags/v3.8.0:fa919fd, Oct 14 2019, 19:37:50) [MSC v.1916 64
bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
  >>> import win32
  >>> import win32clipboard
Traceback (most recent call last):
File "", line 1, in 
ImportError: DLL load failed while importing win32clipboard: The
specified module could not be found.
  >>>

Does anyone else have this problem?

I found the solution: copy pywintypes38.dll and pythoncom38.dll from 
site-packages/pywin32_system32 into site-packages/win32.

___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/NQKC533WWIFD5BYPWH2QULSO2ECSRVOP/
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-Dev] [RELEASE] Python 3.7.5 is now available

2019-10-15 Thread Ned Deily
Python 3.7.5 is now available, the next maintenance release of Python 3.7.  You 
can find the release files, a link to the changelog, and more information here:

https://www.python.org/downloads/release/python-375/

Note that the next feature release of Python 3, Python 3.8.0, is also now 
available.  Python 3.8 contains many new features and optimizations. You should 
consider upgrading to it. We plan to continue regular bugfix releases of Python 
3.7.x through mid-year 2020 and provide security fixes for it until mid-year 
2023.  More details are available in PEP 537, the Python 3.7 Release Schedule 
(https://www.python.org/dev/peps/pep-0537/).

Thanks to all of the many volunteers who help make Python Development and these 
releases possible!  Please consider supporting our efforts by volunteering 
yourself or through organization contributions to the Python Software 
Foundation.

--
  Ned Deily
  n...@python.org -- []
___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/Q5OUNSBNIQTMVOUXYKBOPEX6NSBKNKEE/
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-Dev] Re: [RELEASE] Python 3.8.0 is now available

2019-10-15 Thread Steve Dower

On 15Oct2019 1143, MRAB wrote:

On 2019-10-15 19:03, MRAB wrote:

I've installed pywin32 on Python 3.8, but when I try to import
win32clipboard it says it can't find it:

Python 3.8.0 (tags/v3.8.0:fa919fd, Oct 14 2019, 19:37:50) [MSC v.1916 64
bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
  >>> import win32
  >>> import win32clipboard
Traceback (most recent call last):
    File "", line 1, in 
ImportError: DLL load failed while importing win32clipboard: The
specified module could not be found.
  >>>

Does anyone else have this problem?

I found the solution: copy pywintypes38.dll and pythoncom38.dll from 
site-packages/pywin32_system32 into site-packages/win32.


The new os.add_dll_directory() function [1] is a way for pywin32 to work 
around this themselves without having to relocate files. The note in the 
doc also explains the cause.


Cheers,
Steve

[1]: https://docs.python.org/3.8/library/os.html#os.add_dll_directory
___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/SIXLMFOZ6KZUMVWT2RY5XBMRSMUBFCG5/
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-Dev] How do I install Python 3.8.0 on Linux (not possible? no one is doing this?)

2019-10-15 Thread devlocalca
I cannot get Python 3.8.0 installed on Linux ( RHEL 8 / CentOS 8).

It's not available in any package repo.  When I try to build from source, there 
are dependencies missing (3), that I cannot find anywhere.

More info here: (I did not want to write this up twice)

https://www.reddit.com/r/Python/comments/digewe/python_38_not_possible_to_install_on_linux_why/

The latest version of Python 3 available to me on Linux was released over three 
years ago ( Python 3.6.0 ), I don't understand why.
___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/ZP3RSTYWBCPBEYNUGH2THA5OVRLYO3RX/
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-Dev] Re: How do I install Python 3.8.0 on Linux (not possible? no one is doing this?)

2019-10-15 Thread Chris Angelico
On Wed, Oct 16, 2019 at 10:51 AM  wrote:
>
> I cannot get Python 3.8.0 installed on Linux ( RHEL 8 / CentOS 8).
>
> It's not available in any package repo.  When I try to build from source, 
> there are dependencies missing (3), that I cannot find anywhere.
>
> More info here: (I did not want to write this up twice)
>
> https://www.reddit.com/r/Python/comments/digewe/python_38_not_possible_to_install_on_linux_why/
>
> The latest version of Python 3 available to me on Linux was released over 
> three years ago ( Python 3.6.0 ), I don't understand why.

Python 3.8 was just released this week, so it's no surprise that it
isn't in your OS's main repositories. Red Hat really isn't a
fast-moving distribution, and if you're expecting the latest versions
of things, you're going to frequently be frustrated by it.

But as to why you can't install those development libraries - no idea.
They don't look critical (eg bluez is for Bluetooth, not necessary for
the core Python interpreter), so you could try building Python without
them.

Further discussion might want to move to python-list rather than here.

ChrisA
___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/6RQHCMBWYURXQ3L7XLTRDKGZKFKBMU2F/
Code of Conduct: http://python.org/psf/codeofconduct/