|
8 | 8 | msgstr "" |
9 | 9 | "Project-Id-Version: Python Packaging User Guide \n" |
10 | 10 | "Report-Msgid-Bugs-To: \n" |
11 | | -"POT-Creation-Date: 2024-02-09 11:35+0000\n" |
| 11 | +"POT-Creation-Date: 2024-02-29 18:31+0000\n" |
12 | 12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" |
13 | 13 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" |
14 | 14 | "Language-Team: LANGUAGE <LL@li.org>\n" |
@@ -4810,82 +4810,82 @@ msgid "There are many techniques to maintain a single source of truth for the ve |
4810 | 4810 | msgstr "" |
4811 | 4811 |
|
4812 | 4812 | #: ../source/guides/single-sourcing-package-version.rst:12 |
4813 | | -msgid "Read the file in :file:`setup.py` and get the version. Example (from `pip setup.py <https://github.com/pypa/pip/blob/main/setup.py>`_)::" |
| 4813 | +msgid "Read the file in :file:`setup.py` and get the version. Example::" |
4814 | 4814 | msgstr "" |
4815 | 4815 |
|
4816 | | -#: ../source/guides/single-sourcing-package-version.rst:39 |
| 4816 | +#: ../source/guides/single-sourcing-package-version.rst:38 |
4817 | 4817 | msgid "As of the release of setuptools 46.4.0, one can accomplish the same thing by instead placing the following in the project's :file:`setup.cfg` file (replacing \"package\" with the import name of the package):" |
4818 | 4818 | msgstr "" |
4819 | 4819 |
|
4820 | | -#: ../source/guides/single-sourcing-package-version.rst:49 |
| 4820 | +#: ../source/guides/single-sourcing-package-version.rst:48 |
4821 | 4821 | msgid "As of the release of setuptools 61.0.0, one can specify the version dynamically in the project's :file:`pyproject.toml` file." |
4822 | 4822 | msgstr "" |
4823 | 4823 |
|
4824 | | -#: ../source/guides/single-sourcing-package-version.rst:61 |
| 4824 | +#: ../source/guides/single-sourcing-package-version.rst:60 |
4825 | 4825 | msgid "Please be aware that declarative config indicators, including the ``attr:`` directive, are not supported in parameters to :file:`setup.py`." |
4826 | 4826 | msgstr "" |
4827 | 4827 |
|
4828 | | -#: ../source/guides/single-sourcing-package-version.rst:65 |
| 4828 | +#: ../source/guides/single-sourcing-package-version.rst:64 |
4829 | 4829 | msgid "Use an external build tool that either manages updating both locations, or offers an API that both locations can use." |
4830 | 4830 | msgstr "" |
4831 | 4831 |
|
4832 | | -#: ../source/guides/single-sourcing-package-version.rst:68 |
| 4832 | +#: ../source/guides/single-sourcing-package-version.rst:67 |
4833 | 4833 | msgid "Few tools you could use, in no particular order, and not necessarily complete: `bump2version <https://pypi.org/project/bump2version>`_, `changes <https://pypi.org/project/changes>`_, `commitizen <https://pypi.org/project/commitizen>`_, `zest.releaser <https://pypi.org/project/zest.releaser>`_." |
4834 | 4834 | msgstr "" |
4835 | 4835 |
|
4836 | | -#: ../source/guides/single-sourcing-package-version.rst:75 |
| 4836 | +#: ../source/guides/single-sourcing-package-version.rst:74 |
4837 | 4837 | msgid "Set the value to a ``__version__`` global variable in a dedicated module in your project (e.g. :file:`version.py`), then have :file:`setup.py` read and ``exec`` the value into a variable." |
4838 | 4838 | msgstr "" |
4839 | 4839 |
|
4840 | | -#: ../source/guides/single-sourcing-package-version.rst:86 |
| 4840 | +#: ../source/guides/single-sourcing-package-version.rst:85 |
4841 | 4841 | msgid "Example using this technique: `warehouse <https://github.com/pypa/warehouse/blob/64ca42e42d5613c8339b3ec5e1cb7765c6b23083/warehouse/__about__.py>`_." |
4842 | 4842 | msgstr "" |
4843 | 4843 |
|
4844 | | -#: ../source/guides/single-sourcing-package-version.rst:88 |
| 4844 | +#: ../source/guides/single-sourcing-package-version.rst:87 |
4845 | 4845 | msgid "Place the value in a simple ``VERSION`` text file and have both :file:`setup.py` and the project code read it." |
4846 | 4846 | msgstr "" |
4847 | 4847 |
|
4848 | | -#: ../source/guides/single-sourcing-package-version.rst:96 |
| 4848 | +#: ../source/guides/single-sourcing-package-version.rst:95 |
4849 | 4849 | msgid "An advantage with this technique is that it's not specific to Python. Any tool can read the version." |
4850 | 4850 | msgstr "" |
4851 | 4851 |
|
4852 | | -#: ../source/guides/single-sourcing-package-version.rst:101 |
| 4852 | +#: ../source/guides/single-sourcing-package-version.rst:100 |
4853 | 4853 | msgid "With this approach you must make sure that the ``VERSION`` file is included in all your source and binary distributions (e.g. add ``include VERSION`` to your :file:`MANIFEST.in`)." |
4854 | 4854 | msgstr "" |
4855 | 4855 |
|
4856 | | -#: ../source/guides/single-sourcing-package-version.rst:105 |
| 4856 | +#: ../source/guides/single-sourcing-package-version.rst:104 |
4857 | 4857 | msgid "Set the value in :file:`setup.py`, and have the project code use the ``importlib.metadata`` API to fetch the value at runtime. (``importlib.metadata`` was introduced in Python 3.8 and is available to older versions as the ``importlib-metadata`` project.) An installed project's version can be fetched with the API as follows::" |
4858 | 4858 | msgstr "" |
4859 | 4859 |
|
4860 | | -#: ../source/guides/single-sourcing-package-version.rst:120 |
| 4860 | +#: ../source/guides/single-sourcing-package-version.rst:119 |
4861 | 4861 | msgid "Be aware that the ``importlib.metadata`` API only knows about what's in the installation metadata, which is not necessarily the code that's currently imported." |
4862 | 4862 | msgstr "" |
4863 | 4863 |
|
4864 | | -#: ../source/guides/single-sourcing-package-version.rst:124 |
| 4864 | +#: ../source/guides/single-sourcing-package-version.rst:123 |
4865 | 4865 | msgid "If a project uses this method to fetch its version at runtime, then its ``install_requires`` value needs to be edited to install ``importlib-metadata`` on pre-3.8 versions of Python like so::" |
4866 | 4866 | msgstr "" |
4867 | 4867 |
|
4868 | | -#: ../source/guides/single-sourcing-package-version.rst:138 |
| 4868 | +#: ../source/guides/single-sourcing-package-version.rst:137 |
4869 | 4869 | msgid "An older (and less efficient) alternative to ``importlib.metadata`` is the ``pkg_resources`` API provided by ``setuptools``::" |
4870 | 4870 | msgstr "" |
4871 | 4871 |
|
4872 | | -#: ../source/guides/single-sourcing-package-version.rst:144 |
| 4872 | +#: ../source/guides/single-sourcing-package-version.rst:143 |
4873 | 4873 | msgid "If a project uses ``pkg_resources`` to fetch its own version at runtime, then ``setuptools`` must be added to the project's ``install_requires`` list." |
4874 | 4874 | msgstr "" |
4875 | 4875 |
|
4876 | | -#: ../source/guides/single-sourcing-package-version.rst:148 |
| 4876 | +#: ../source/guides/single-sourcing-package-version.rst:147 |
4877 | 4877 | msgid "Example using this technique: `setuptools <https://github.com/pypa/setuptools/blob/main/setuptools/version.py>`_." |
4878 | 4878 | msgstr "" |
4879 | 4879 |
|
4880 | | -#: ../source/guides/single-sourcing-package-version.rst:151 |
| 4880 | +#: ../source/guides/single-sourcing-package-version.rst:150 |
4881 | 4881 | msgid "Set the value to ``__version__`` in ``sample/__init__.py`` and import ``sample`` in :file:`setup.py`." |
4882 | 4882 | msgstr "" |
4883 | 4883 |
|
4884 | | -#: ../source/guides/single-sourcing-package-version.rst:165 |
| 4884 | +#: ../source/guides/single-sourcing-package-version.rst:164 |
4885 | 4885 | msgid "Although this technique is common, beware that it will fail if ``sample/__init__.py`` imports packages from ``install_requires`` dependencies, which will very likely not be installed yet when :file:`setup.py` is run." |
4886 | 4886 | msgstr "" |
4887 | 4887 |
|
4888 | | -#: ../source/guides/single-sourcing-package-version.rst:171 |
| 4888 | +#: ../source/guides/single-sourcing-package-version.rst:170 |
4889 | 4889 | msgid "Keep the version number in the tags of a version control system (Git, Mercurial, etc) instead of in the code, and automatically extract it from there using `setuptools_scm <https://pypi.org/project/setuptools-scm/>`_." |
4890 | 4890 | msgstr "" |
4891 | 4891 |
|
|
0 commit comments