| 1 | #!/usr/bin/python3 |
| 2 | # SPDX-License-Identifier: MPL-2.0 |
| 3 | # |
| 4 | # libpathrs: safe path resolution on Linux |
| 5 | # Copyright (C) 2019-2025 SUSE LLC |
| 6 | # Copyright (C) 2026 Aleksa Sarai <[email protected]> |
| 7 | # |
| 8 | # This Source Code Form is subject to the terms of the Mozilla Public |
| 9 | # License, v. 2.0. If a copy of the MPL was not distributed with this |
| 10 | # file, You can obtain one at https://mozilla.org/MPL/2.0/. |
| 11 | |
| 12 | import importlib |
| 13 | import importlib.metadata |
| 14 | |
| 15 | from . import _pathrs |
| 16 | from ._pathrs import * # noqa: F403 # We just re-export everything. |
| 17 | |
| 18 | # In order get pydoc to include the documentation for the re-exported code from |
| 19 | # _pathrs, we need to include all of the members in __all__. Rather than |
| 20 | # duplicating the member list here explicitly, just re-export __all__. |
| 21 | __all__ = [] |
| 22 | __all__ += _pathrs.__all__ # pyright doesn't support "=" here. |
| 23 | |
| 24 | try: |
| 25 | # In order to avoid drift between this version and the dist-info/ version |
| 26 | # information, just fill __version__ with the dist-info/ information. |
| 27 | __version__ = importlib.metadata.version("pathrs") |
| 28 | except importlib.metadata.PackageNotFoundError: |
| 29 | # We're being run from a local directory without an installed version of |
| 30 | # pathrs, so just fill in a dummy version. |
| 31 | __version__ = "<unknown>" |