This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Use gen-libm-test.py to generate ulps table for manual
- From: Zack Weinberg <zackw at panix dot com>
- To: Joseph Myers <joseph at codesourcery dot com>
- Cc: Andreas Schwab <schwab at suse dot de>, GNU C Library <libc-alpha at sourceware dot org>, Paul Eggert <eggert at cs dot ucla dot edu>
- Date: Tue, 4 Sep 2018 10:44:35 -0400
- Subject: Re: Use gen-libm-test.py to generate ulps table for manual
- References: <alpine.DEB.2.20.1808092025590.28500@digraph.polyomino.org.uk> <alpine.DEB.2.21.1808211719240.1581@digraph.polyomino.org.uk> <mvmbm9dgzd6.fsf@suse.de> <CAKCAbMgo=+vv_cX5edqEHAf-Uo41zzaJZJpPZFwb9MuGcNbZrw@mail.gmail.com> <mvm36upgy4m.fsf@suse.de> <alpine.DEB.2.21.1809041418540.13030@digraph.polyomino.org.uk>
On Tue, Sep 4, 2018 at 10:30 AM Joseph Myers <joseph@codesourcery.com> wrote:
> On Tue, 4 Sep 2018, Andreas Schwab wrote:
>
> > On Sep 04 2018, Zack Weinberg <zackw@panix.com> wrote:
> >
> > > On Tue, Sep 4, 2018 at 9:34 AM Andreas Schwab <schwab@suse.de> wrote:
> > >>
> > >> I withdraw my objection, under the condition that the use of python is
> > >> restricted to the base python language.
> > >
> > > Can you define "base python language" more precisely, please?
> >
> > Basically what is part of the openSUSE python3-base package.
>
> Based on the description at
> <https://software.opensuse.org/package/python3-base> I've updated
> <https://sourceware.org/glibc/wiki/Style_and_Conventions> to say:
>
> * Scripts used in the build of glibc (a standard {{{make}}}, possibly
> regenerating files in the source tree if timestamps are out of order and
> the dependencies are present in the normal makefiles) need to avoid
> modules outside the Python standard library, and standard library modules
> depending on external libraries (such as XML, database and UI libraries).
The Debian equivalent, (lib)python2.7-minimal, has a README with an
exact list of modules that may be used. This appears to be a subset
of the stuff in SUSE's python3-base I've reproduced the contents of
that file (from unstable; specifically, 2.7.15-3_amd64.deb) below.
If SUSE has already gotten to the point where Python 2 is not part of
their bootstrap, maybe we should ditch Python 2 now rather than
waiting for its EOL. Debian currently has both python2.7-minimal and
python3.6-minimal packages. The sets of standard library modules
available from each appear to be roughly the same, after accounting
for all the Python 3 module renames.
May I additionally suggest that it's not obvious that this stuff is
documented under "Code formatting in python sources", and the section
should be renamed to indicate it's general policy for Python usage?
zw
----
Contents of the python2.7-minimal package
-----------------------------------------
python2.7-minimal consists of a minimum set of modules which may be needed
for python scripts used during the boot process. If other packages
are needed in these scripts, don't work around the missing module, but
file a bug report against this package. The modules in this package
are:
__builtin__ builtin
__future__ module
_abcoll module
_bisect extension
_bytesio extension
_codecs builtin
_collections extension
_fileio extension
_functools extension
_hashlib extensionx
_heapq extension
_io extension
_locale extension
_md5 extension
_random extension
_sha extension
_sha256 extension
_sha512 extension
_socket extension
_sre builtin
_ssl extensionx
_struct extension
_symtable builtin
_sysconfigdata module
_types builtin
_warnings builtin
_weakref extension
_weakrefset module
abc module
atexit module
ConfigParser module
StringIO module
UserDict module
cPickle extension
cStringIO extension
array extension
base64 module
binascii extension
bisect module
cmath extension
calendar module
codecs module
collections module
compileall module
contextlib module
copy module
copy_reg module
datetime extension
dis module
encodings package
errno builtin
exceptions builtin
fcntl extension
fnmatch module
functools module
gc builtin
genericpath module
getopt module
glob module
grp extension
hashlib module
heapq module
imp builtin
inspect module
io module
itertools extension
keyword module
linecache module
locale module
logging package
marshal builtin
math extension
md5 module
opcode module
operator extension
optparse module
os module
pickle module
platform module
popen2 module
posix builtin
posixpath module
pkgutil module
pwd builtin
py_compile module
random module
re module
repr module
runpy module
select extension
sha module
shutil module
signal builtin
socket module
spwd extension
sre module
sre_compile module
sre_constants module
sre_parse module
ssl module
stat module
string module
strop extension
struct module
subprocess module
sys builtin
syslog extension
sysconfig module
tempfile module
textwrap module
time extension
token module
thread builtin
token module
tokenize module
traceback module
types module
unicodedata extension
weakref module
warnings module
zipimport extension
zlib extension
Included are as well the codecs and stringprep modules, and the encodings
modules for all encodings except the multibyte encodings and the bz2 codec.
The following modules are excluded, their import is guarded from the
importing module:
Used in Excluded
------------ ------------------------------------
os nt ntpath os2 os2emxpath mac macpath
riscos riscospath riscosenviron
optparse gettext
pickle doctest
subprocess threading
This list was derived by looking at the modules in the perl-base package,
then adding python specific "core modules".
TODO's
------
- time.strptime cannot be used. The required _strptime module is not
included in the -minimal package yet. _strptime, locale, _locale and
calendar have to be added.
- modules used very often in the testsuite: copy, cPickle, operator.