__init__.py 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  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. """Functions for working with generic syntax URIs."""
  17. try:
  18. import importlib.metadata as importlib_metadata
  19. except ImportError:
  20. import importlib_metadata
  21. __version__ = importlib_metadata.version("lazr.uri")
  22. # Re-export in such a way that __version__ can still be imported if
  23. # dependencies are not yet available.
  24. try:
  25. # While we generally frown on "*" imports, this, combined with the fact we
  26. # only test code from this module, means that we can verify what has been
  27. # exported.
  28. from lazr.uri._uri import *
  29. from lazr.uri._uri import __all__
  30. except ImportError:
  31. pass