Debian Codegraph @

src/lazr/uri/__init__.py

raw symbols SCIP
1 # Copyright 2009 Canonical Ltd. All rights reserved.
2 #
3 # This file is part of lazr.uri
4 #
5 # lazr.uri is free software: you can redistribute it and/or modify it
6 # under the terms of the GNU Lesser General Public License as published by
7 # the Free Software Foundation, version 3 of the License.
8 #
9 # lazr.uri is distributed in the hope that it will be useful, but WITHOUT
10 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
12 # License for more details.
13 #
14 # You should have received a copy of the GNU Lesser General Public License
15 # along with lazr.uri. If not, see <http://www.gnu.org/licenses/>.
16
17 """Functions for working with generic syntax URIs."""
18
19 try:
20 import importlib.metadata as importlib_metadata
21 except ImportError: # pragma: no cover
22 import importlib_metadata # pragma: no cover
23
24 try:
25 __version__ = importlib_metadata.version("lazr.uri")
26 except importlib_metadata.PackageNotFoundError: # pragma: no cover
27 __version__ = importlib_metadata.version("lazr-uri")
28
29 # Re-export in such a way that __version__ can still be imported if
30 # dependencies are not yet available.
31 try:
32 # While we generally frown on "*" imports, this, combined with the fact we
33 # only test code from this module, means that we can verify what has been
34 # exported.
35 from lazr.uri._uri import * # noqa: F401, F403
36 from lazr.uri._uri import __all__ # noqa: F401
37 except ImportError:
38 pass