Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a31bb37

Browse files
committed
Update register example
1 parent 0a9cc58 commit a31bb37

1 file changed

Lines changed: 16 additions & 10 deletions

File tree

Doc/whatsnew/whatsnew23.tex

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -726,18 +726,25 @@ \section{PEP 301: Package Index and Metadata for Distutils\label{section-pep301}
726726
\function{setup()} function. A list of
727727
\citetitle[http://www.tuxedo.org/\%7Eesr/trove/]{Trove}-style strings can be supplied to help classify the software.
728728

729-
Here's an example \file{setup.py} with classifiers:
729+
Here's an example \file{setup.py} with classifiers, written to be compatible
730+
with older versions of the Distutils:
730731

731732
\begin{verbatim}
732-
setup (name = "Quixote",
733-
version = "0.5.1",
734-
description = "A highly Pythonic Web application framework",
735-
...
736-
classifiers= ['Topic :: Internet :: WWW/HTTP :: Dynamic Content',
737-
'Environment :: No Input/Output (Daemon)',
738-
'Intended Audience :: Developers'],
733+
from distutils import core
734+
kw = ('name': "Quixote",
735+
'version': "0.5.1",
736+
'description': "A highly Pythonic Web application framework",
739737
...
740738
)
739+
740+
if (hasattr(core, 'setup_keywords') and
741+
'classifiers' in core.setup_keywords):
742+
kw['classifiers'] = \
743+
['Topic :: Internet :: WWW/HTTP :: Dynamic Content',
744+
'Environment :: No Input/Output (Daemon)',
745+
'Intended Audience :: Developers'],
746+
747+
core.setup (**kw)
741748
\end{verbatim}
742749

743750
The full list of classifiers can be obtained by running
@@ -1279,8 +1286,7 @@ \section{New, Improved, and Deprecated Modules}
12791286
it now checks for the \envvar{CC}, \envvar{CFLAGS}, \envvar{CPP},
12801287
\envvar{LDFLAGS}, and \envvar{CPPFLAGS} environment variables, using
12811288
them to override the settings in Python's configuration (contributed
1282-
by Robert Weber); the \function{get_distutils_options()} method lists
1283-
recently-added extensions to Distutils.
1289+
by Robert Weber).
12841290

12851291
\item The \module{getopt} module gained a new function,
12861292
\function{gnu_getopt()}, that supports the same arguments as the existing

0 commit comments

Comments
 (0)