summaryrefslogtreecommitdiff
path: root/src/s3ql/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/s3ql/__init__.py')
-rw-r--r--src/s3ql/__init__.py46
1 files changed, 31 insertions, 15 deletions
diff --git a/src/s3ql/__init__.py b/src/s3ql/__init__.py
index b3c5bce..2065901 100644
--- a/src/s3ql/__init__.py
+++ b/src/s3ql/__init__.py
@@ -6,23 +6,39 @@ Copyright © 2008 Nikolaus Rath <Nikolaus@rath.org>
This work can be distributed under the terms of the GNU GPLv3.
'''
-# We must not import s3ql.logging.logging as s3ql.logging,
+# First, enable warnings. This should happen before any imports,
+# so that we can catch warnings emitted by code that runs during
+# the import.
+# Sadly, we cannot simply use $PYTHONWARNINGS, because it
+# does not allow regexes (cf https://bugs.python.org/issue34920)
+import os
+if 'S3QL_ENABLE_WARNINGS' in os.environ:
+ import warnings
+ warnings.resetwarnings()
+
+ # Not sure what this is or what causes it, bug the internet
+ # is full of similar reports so probably a false positive.
+ warnings.filterwarnings(
+ action='ignore', category=ImportWarning,
+ message="can't resolve package from __spec__ or __package__, falling "
+ "back on __name__ and __path__")
+
+ for cat in (DeprecationWarning, PendingDeprecationWarning):
+ warnings.filterwarnings(action='default', category=cat,
+ module='^s3ql', append=True)
+ warnings.filterwarnings(action='ignore', category=cat, append=True)
+ warnings.filterwarnings(action='default', append=True)
+
+# Ensure use of custom logger class
+# (We must not import s3ql.logging.logging as s3ql.logging,
# otherwise future imports of s3ql.logging will incorrectly
-# use s3ql.logging.logging.
-from . import logging # Ensure use of custom logger class
+# use s3ql.logging.logging).
+from . import logging
+assert logging.LOG_ONCE # prevent warnings about unused module
+
from llfuse import ROOT_INODE
-# False positives, pylint doesn't grok that these are module names
-#pylint: disable=E0603
-__all__ = [ 'adm', 'backends', 'block_cache', 'common', 'calc_mro',
- 'cp', 'ctrl', 'daemonize', 'database', 'deltadump', 'fs',
- 'fsck', 'inherit_docstrings', 'inode_cache', 'lock',
- 'logging', 'metadata', 'mkfs', 'mount', 'parse_args',
- 'remove', 'statfs', 'umount', 'VERSION', 'CURRENT_FS_REV',
- 'REV_VER_MAP', 'RELEASE', 'BUFSIZE',
- 'CTRL_NAME', 'CTRL_INODE' ]
-
-VERSION = '2.30'
+VERSION = '2.32'
RELEASE = '%s' % VERSION
# TODO: On next revision bump, remove upgrade code from backend/comprenc.py and
@@ -34,7 +50,7 @@ BUFSIZE = 64 * 1024
# Name and inode of the special s3ql control file
CTRL_NAME = '.__s3ql__ctrl__'
-CTRL_INODE = 2
+CTRL_INODE = ROOT_INODE+1
# Maps file system revisions to the last S3QL version that
# supported this revision.