Skip to content

Commit 8e5b2cc

Browse files
committed
Update noxfile.py
1 parent 1f09eba commit 8e5b2cc

2 files changed

Lines changed: 55 additions & 50 deletions

File tree

locales/messages.pot

Lines changed: 52 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgid ""
88
msgstr ""
99
"Project-Id-Version: Python Packaging User Guide \n"
1010
"Report-Msgid-Bugs-To: \n"
11-
"POT-Creation-Date: 2021-07-03 21:32+0800\n"
11+
"POT-Creation-Date: 2021-07-06 12:35+0800\n"
1212
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1313
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1414
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -3306,180 +3306,184 @@ msgid "The approaches described below don't simplify the distribution case at al
33063306
msgstr ""
33073307

33083308
#: ../source/guides/packaging-binary-extensions.rst:162
3309-
msgid "In addition to being useful for the creation of accelerator modules, `Cython <http://cython.org/>`__ is also useful for creating wrapper modules. It still involves wrapping the interfaces by hand, however, so may not be a good choice for wrapping large APIs."
3309+
msgid "In addition to being useful for the creation of accelerator modules, `Cython <http://cython.org/>`__ is also useful for creating wrapper modules for C or C++. It still involves wrapping the interfaces by hand, however, and is very repetitive, so may not be a good choice for wrapping large APIs."
33103310
msgstr ""
33113311

3312-
#: ../source/guides/packaging-binary-extensions.rst:167
3312+
#: ../source/guides/packaging-binary-extensions.rst:168
3313+
msgid "`pybind11 <https://pybind11.readthedocs.io>`__ is a pure C++11 library that provides a clean C++ interface to the CPython (and PyPy) C API. It does not require a pre-processing step; it is written entirely in templated C++. Helpers are included for Setuptools or CMake builds. It was based on `Boost.Python <https://www.boost.org/doc/libs/1_76_0/libs/python/doc/html/index.html>`__, but doesn't require the Boost libraries or BJam."
3314+
msgstr ""
3315+
3316+
#: ../source/guides/packaging-binary-extensions.rst:175
33133317
msgid "`cffi <https://cffi.readthedocs.io/>`__ is a project created by some of the PyPy developers to make it straightforward for developers that already know both Python and C to expose their C modules to Python applications. It also makes it relatively straightforward to wrap a C module based on its header files, even if you don't know C yourself."
33143318
msgstr ""
33153319

3316-
#: ../source/guides/packaging-binary-extensions.rst:173
3320+
#: ../source/guides/packaging-binary-extensions.rst:181
33173321
msgid "One of the key advantages of ``cffi`` is that it is compatible with the PyPy JIT, allowing CFFI wrapper modules to participate fully in PyPy's tracing JIT optimisations."
33183322
msgstr ""
33193323

3320-
#: ../source/guides/packaging-binary-extensions.rst:177
3321-
msgid "`SWIG <http://www.swig.org/>`__ is a wrapper interface generator that allows a variety of programming languages, including Python, to interface with C *and C++* code."
3324+
#: ../source/guides/packaging-binary-extensions.rst:185
3325+
msgid "`SWIG <http://www.swig.org/>`__ is a wrapper interface generator that allows a variety of programming languages, including Python, to interface with C and C++ code."
33223326
msgstr ""
33233327

3324-
#: ../source/guides/packaging-binary-extensions.rst:181
3328+
#: ../source/guides/packaging-binary-extensions.rst:189
33253329
msgid "The standard library's ``ctypes`` module, while useful for getting access to C level interfaces when header information isn't available, suffers from the fact that it operates solely at the C ABI level, and thus has no automatic consistency checking between the interface actually being exported by the library and the one declared in the Python code. By contrast, the above alternatives are all able to operate at the C *API* level, using C header files to ensure consistency between the interface exported by the library being wrapped and the one expected by the Python wrapper module. While ``cffi`` *can* operate directly at the C ABI level, it suffers from the same interface inconsistency problems as ``ctypes`` when it is used that way."
33263330
msgstr ""
33273331

3328-
#: ../source/guides/packaging-binary-extensions.rst:195
3332+
#: ../source/guides/packaging-binary-extensions.rst:203
33293333
msgid "Alternatives for low level system access"
33303334
msgstr ""
33313335

3332-
#: ../source/guides/packaging-binary-extensions.rst:197
3336+
#: ../source/guides/packaging-binary-extensions.rst:205
33333337
msgid "For applications that need low level system access (regardless of the reason), a binary extension module often *is* the best way to go about it. This is particularly true for low level access to the CPython runtime itself, since some operations (like releasing the Global Interpreter Lock) are simply invalid when the interpreter is running code, even if a module like ``ctypes`` or ``cffi`` is used to obtain access to the relevant C API interfaces."
33343338
msgstr ""
33353339

3336-
#: ../source/guides/packaging-binary-extensions.rst:205
3340+
#: ../source/guides/packaging-binary-extensions.rst:213
33373341
msgid "For cases where the extension module is manipulating the underlying operating system or hardware (rather than the CPython runtime), it may sometimes be better to just write an ordinary C library (or a library in another systems programming language like C++ or Rust that can export a C compatible ABI), and then use one of the wrapping techniques described above to make the interface available as an importable Python module."
33383342
msgstr ""
33393343

3340-
#: ../source/guides/packaging-binary-extensions.rst:214
3344+
#: ../source/guides/packaging-binary-extensions.rst:222
33413345
msgid "Implementing binary extensions"
33423346
msgstr ""
33433347

3344-
#: ../source/guides/packaging-binary-extensions.rst:216
3348+
#: ../source/guides/packaging-binary-extensions.rst:224
33453349
msgid "The CPython `Extending and Embedding <https://docs.python.org/3/extending/>`_ guide includes an introduction to writing a `custom extension module in C <https://docs.python.org/3/extending/extending.html>`_."
33463350
msgstr ""
33473351

3348-
#: ../source/guides/packaging-binary-extensions.rst:233
3352+
#: ../source/guides/packaging-binary-extensions.rst:241
33493353
msgid "Building binary extensions"
33503354
msgstr ""
33513355

3352-
#: ../source/guides/packaging-binary-extensions.rst:236
3356+
#: ../source/guides/packaging-binary-extensions.rst:244
33533357
msgid "Building extensions for multiple platforms"
33543358
msgstr ""
33553359

3356-
#: ../source/guides/packaging-binary-extensions.rst:238
3360+
#: ../source/guides/packaging-binary-extensions.rst:246
33573361
msgid "If you plan to distribute your extension, you should provide :term:`wheels <Wheel>` for all the platforms you intend to support. For most extensions, this is at least one package per Python version times the number of OS and architectures you support. These are usually built on continuous integration (CI) systems. There are tools to help you build highly redistributable binaries from CI; these include :ref:`cibuildwheel` and :ref:`multibuild`."
33583362
msgstr ""
33593363

3360-
#: ../source/guides/packaging-binary-extensions.rst:248
3364+
#: ../source/guides/packaging-binary-extensions.rst:256
33613365
msgid "Binary extensions for Windows"
33623366
msgstr ""
33633367

3364-
#: ../source/guides/packaging-binary-extensions.rst:250
3368+
#: ../source/guides/packaging-binary-extensions.rst:258
33653369
msgid "Before it is possible to build a binary extension, it is necessary to ensure that you have a suitable compiler available. On Windows, Visual C is used to build the official CPython interpreter, and should be used to build compatible binary extensions."
33663370
msgstr ""
33673371

3368-
#: ../source/guides/packaging-binary-extensions.rst:255
3372+
#: ../source/guides/packaging-binary-extensions.rst:263
33693373
msgid "Python 2.7 used Visual Studio 2008, Python 3.3 and 3.4 used Visual Studio 2010, and Python 3.5+ uses Visual Studio 2015 or later. Unfortunately, older versions of Visual Studio are no longer easily available from Microsoft, so for versions of Python prior to 3.5, the compilers must be obtained differently if you do not already have a copy of the relevant version of Visual Studio."
33703374
msgstr ""
33713375

3372-
#: ../source/guides/packaging-binary-extensions.rst:261
3376+
#: ../source/guides/packaging-binary-extensions.rst:269
33733377
msgid "To set up a build environment for binary extensions, the steps are as follows:"
33743378
msgstr ""
33753379

3376-
#: ../source/guides/packaging-binary-extensions.rst:263
3380+
#: ../source/guides/packaging-binary-extensions.rst:271
33773381
msgid "For Python 2.7"
33783382
msgstr ""
33793383

3380-
#: ../source/guides/packaging-binary-extensions.rst:265
3384+
#: ../source/guides/packaging-binary-extensions.rst:273
33813385
msgid "Install \"Visual C++ Compiler Package for Python 2.7\", which is available from `Microsoft's website <https://www.microsoft.com/en-gb/download/details.aspx?id=44266>`__."
33823386
msgstr ""
33833387

3384-
#: ../source/guides/packaging-binary-extensions.rst:268
3388+
#: ../source/guides/packaging-binary-extensions.rst:276
33853389
msgid "Use (a recent version of) setuptools in your setup.py (pip will do this for you, in any case)."
33863390
msgstr ""
33873391

3388-
#: ../source/guides/packaging-binary-extensions.rst:270
3389-
#: ../source/guides/packaging-binary-extensions.rst:280
3390-
#: ../source/guides/packaging-binary-extensions.rst:287
3392+
#: ../source/guides/packaging-binary-extensions.rst:278
3393+
#: ../source/guides/packaging-binary-extensions.rst:288
3394+
#: ../source/guides/packaging-binary-extensions.rst:295
33913395
msgid "Done."
33923396
msgstr ""
33933397

3394-
#: ../source/guides/packaging-binary-extensions.rst:272
3398+
#: ../source/guides/packaging-binary-extensions.rst:280
33953399
msgid "For Python 3.4"
33963400
msgstr ""
33973401

3398-
#: ../source/guides/packaging-binary-extensions.rst:274
3402+
#: ../source/guides/packaging-binary-extensions.rst:282
33993403
msgid "Install \"Windows SDK for Windows 7 and .NET Framework 4\" (v7.1), which is available from `Microsoft's website <https://www.microsoft.com/en-gb/download/details.aspx?id=8279>`__."
34003404
msgstr ""
34013405

3402-
#: ../source/guides/packaging-binary-extensions.rst:277
3406+
#: ../source/guides/packaging-binary-extensions.rst:285
34033407
msgid "Work from an SDK command prompt (with the environment variables set, and the SDK on PATH)."
34043408
msgstr ""
34053409

3406-
#: ../source/guides/packaging-binary-extensions.rst:279
3410+
#: ../source/guides/packaging-binary-extensions.rst:287
34073411
msgid "Set DISTUTILS_USE_SDK=1"
34083412
msgstr ""
34093413

3410-
#: ../source/guides/packaging-binary-extensions.rst:282
3414+
#: ../source/guides/packaging-binary-extensions.rst:290
34113415
msgid "For Python 3.5"
34123416
msgstr ""
34133417

3414-
#: ../source/guides/packaging-binary-extensions.rst:284
3418+
#: ../source/guides/packaging-binary-extensions.rst:292
34153419
msgid "Install `Visual Studio 2015 Community Edition <https://www.visualstudio.com/en-us/downloads/download-visual-studio-vs.aspx>`__ (or any later version, when these are released)."
34163420
msgstr ""
34173421

3418-
#: ../source/guides/packaging-binary-extensions.rst:289
3422+
#: ../source/guides/packaging-binary-extensions.rst:297
34193423
msgid "Note that from Python 3.5 onwards, Visual Studio works in a backward compatible way, which means that any future version of Visual Studio will be able to build Python extensions for all Python versions from 3.5 onwards."
34203424
msgstr ""
34213425

3422-
#: ../source/guides/packaging-binary-extensions.rst:293
3426+
#: ../source/guides/packaging-binary-extensions.rst:301
34233427
msgid "Building with the recommended compiler on Windows ensures that a compatible C library is used throughout the Python process."
34243428
msgstr ""
34253429

3426-
#: ../source/guides/packaging-binary-extensions.rst:297
3430+
#: ../source/guides/packaging-binary-extensions.rst:305
34273431
msgid "Binary extensions for Linux"
34283432
msgstr ""
34293433

3430-
#: ../source/guides/packaging-binary-extensions.rst:299
3434+
#: ../source/guides/packaging-binary-extensions.rst:307
34313435
msgid "Linux binaries must use a sufficiently old glibc to be compatible with older distributions. The `manylinux <https://github.com/pypa/manylinux>`_ Docker images provide a build environment with a glibc old enough to support most current Linux distributions on common architectures."
34323436
msgstr ""
34333437

3434-
#: ../source/guides/packaging-binary-extensions.rst:305
3438+
#: ../source/guides/packaging-binary-extensions.rst:313
34353439
msgid "Binary extensions for macOS"
34363440
msgstr ""
34373441

3438-
#: ../source/guides/packaging-binary-extensions.rst:307
3442+
#: ../source/guides/packaging-binary-extensions.rst:315
34393443
msgid "Binary compatibility on macOS is determined by the target minimum deployment system, e.g. *10.9*, which is often specified with the ``MACOSX_DEPLOYMENT_TARGET`` environmental variable when building binaries on macOS. When building with setuptools / distutils, the deployment target is specified with the flag ``--plat-name``, e.g. ``macosx-10.9-x86_64``. For common deployment targets for macOS Python distributions, see the `MacPython Spinning Wheels wiki <https://github.com/MacPython/wiki/wiki/Spinning-wheels>`_."
34403444
msgstr ""
34413445

3442-
#: ../source/guides/packaging-binary-extensions.rst:317
3446+
#: ../source/guides/packaging-binary-extensions.rst:325
34433447
msgid "Publishing binary extensions"
34443448
msgstr ""
34453449

3446-
#: ../source/guides/packaging-binary-extensions.rst:319
3450+
#: ../source/guides/packaging-binary-extensions.rst:327
34473451
msgid "For interim guidance on this topic, see the discussion in `this issue <https://github.com/pypa/python-packaging-user-guide/issues/284>`_."
34483452
msgstr ""
34493453

3450-
#: ../source/guides/packaging-binary-extensions.rst:335
3454+
#: ../source/guides/packaging-binary-extensions.rst:343
34513455
msgid "Additional resources"
34523456
msgstr ""
34533457

3454-
#: ../source/guides/packaging-binary-extensions.rst:337
3458+
#: ../source/guides/packaging-binary-extensions.rst:345
34553459
msgid "Cross-platform development and distribution of extension modules is a complex topic, so this guide focuses primarily on providing pointers to various tools that automate dealing with the underlying technical challenges. The additional resources in this section are instead intended for developers looking to understand more about the underlying binary interfaces that those systems rely on at runtime."
34563460
msgstr ""
34573461

3458-
#: ../source/guides/packaging-binary-extensions.rst:344
3462+
#: ../source/guides/packaging-binary-extensions.rst:352
34593463
msgid "Cross-platform wheel generation with scikit-build"
34603464
msgstr ""
34613465

3462-
#: ../source/guides/packaging-binary-extensions.rst:346
3466+
#: ../source/guides/packaging-binary-extensions.rst:354
34633467
msgid "The `scikit-build <https://scikit-build.readthedocs.io/en/latest/>`_ package helps abstract cross-platform build operations and provides additional capabilities when creating binary extension packages. Additional documentation is also available on the `C runtime, compiler, and build system generator <https://scikit-build.readthedocs.io/en/latest/generators.html>`_ for Python binary extension modules."
34643468
msgstr ""
34653469

3466-
#: ../source/guides/packaging-binary-extensions.rst:354
3470+
#: ../source/guides/packaging-binary-extensions.rst:362
34673471
msgid "Introduction to C/C++ extension modules"
34683472
msgstr ""
34693473

3470-
#: ../source/guides/packaging-binary-extensions.rst:356
3474+
#: ../source/guides/packaging-binary-extensions.rst:364
34713475
msgid "For a more in depth explanation of how extension modules are used by CPython on a Debian system, see the following articles:"
34723476
msgstr ""
34733477

3474-
#: ../source/guides/packaging-binary-extensions.rst:359
3478+
#: ../source/guides/packaging-binary-extensions.rst:367
34753479
msgid "`What are (c)python extension modules? <https://thomasnyberg.com/what_are_extension_modules.html>`_"
34763480
msgstr ""
34773481

3478-
#: ../source/guides/packaging-binary-extensions.rst:360
3482+
#: ../source/guides/packaging-binary-extensions.rst:368
34793483
msgid "`Releasing the gil <https://thomasnyberg.com/releasing_the_gil.html>`_"
34803484
msgstr ""
34813485

3482-
#: ../source/guides/packaging-binary-extensions.rst:361
3486+
#: ../source/guides/packaging-binary-extensions.rst:369
34833487
msgid "`Writing cpython extension modules using C++ <https://thomasnyberg.com/cpp_extension_modules.html>`_"
34843488
msgstr ""
34853489

noxfile.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,16 @@
88

99
@nox.session(py="3")
1010
def translation(session):
11-
session.install("sphinx-intl")
12-
session.install("sphinx-inline-tabs")
11+
session.install("-r", "requirements.txt")
1312
target_dir = "locales"
1413
session.run(
1514
"sphinx-build",
1615
"-b", # select a builder
1716
"gettext", # build gettext-style message catalogs (.pot file)
1817
"source/", # where the rst files are located
1918
target_dir, # where to put the .pot file
19+
"-d",
20+
".nox/", # path to put the cache
2021
)
2122

2223
@nox.session(py="3")

0 commit comments

Comments
 (0)