source: trunk/src/allmydata/__init__.py

Last change on this file was 134bcd7, checked in by Itamar Turner-Trauring <itamar@…>, at 2023-11-15T15:54:27Z

We're not support Python 2 anymore, and future breaks on 3.12 (for now) when
standard_library is patched.

  • Property mode set to 100644
File size: 2.1 KB
Line 
1"""
2Decentralized storage grid.
3
4community web site: U{https://tahoe-lafs.org/}
5"""
6
7__all__ = [
8    "__version__",
9    "full_version",
10    "branch",
11    "__appname__",
12    "__full_version__",
13]
14
15__version__ = "unknown"
16try:
17    # type ignored as it fails in CI
18    # (https://app.circleci.com/pipelines/github/tahoe-lafs/tahoe-lafs/1647/workflows/60ae95d4-abe8-492c-8a03-1ad3b9e42ed3/jobs/40972)
19    from allmydata._version import __version__  # type: ignore
20except ImportError:
21    # We're running in a tree that hasn't run update_version, and didn't
22    # come with a _version.py, so we don't know what our version is.
23    # This should not happen very often.
24    pass
25
26full_version = "unknown"
27branch = "unknown"
28try:
29    # type ignored as it fails in CI
30    # (https://app.circleci.com/pipelines/github/tahoe-lafs/tahoe-lafs/1647/workflows/60ae95d4-abe8-492c-8a03-1ad3b9e42ed3/jobs/40972)
31    from allmydata._version import full_version, branch  # type: ignore
32except ImportError:
33    # We're running in a tree that hasn't run update_version, and didn't
34    # come with a _version.py, so we don't know what our full version or
35    # branch is. This should not happen very often.
36    pass
37
38__appname__ = "tahoe-lafs"
39
40# __full_version__ is the one that you ought to use when identifying yourself
41# in the "application" part of the Tahoe versioning scheme:
42# https://tahoe-lafs.org/trac/tahoe-lafs/wiki/Versioning
43__full_version__ = __appname__ + '/' + str(__version__)
44
45# Monkey-patch 3rd party libraries:
46from ._monkeypatch import patch
47patch()
48del patch
49
50
51# On Python 3, turn BytesWarnings into exceptions. This can have potential
52# production impact... if BytesWarnings are actually present in the codebase.
53# Given that this has been enabled before Python 3 Tahoe-LAFS was publicly
54# released, no such code should exist, and this will ensure it doesn't get
55# added either.
56#
57# Also note that BytesWarnings only happen if Python is run with -b option, so
58# in practice this should only affect tests.
59import warnings
60# Error on BytesWarnings, to catch things like str(b""), but only for
61# allmydata code.
62warnings.filterwarnings("error", category=BytesWarning, module=".*allmydata.*")
Note: See TracBrowser for help on using the repository browser.