* Add comprehensive tests for IMAP email restoration functionality - Implement tests for loading labels manifest, including both old and new formats. - Add tests for extracting flags from the manifest. - Create tests for parsing .eml files, including edge cases. - Develop tests for retrieving .eml files from a directory. - Validate configuration settings and handle missing credentials. - Integrate tests for restoring emails from a backup, including Gmail mode and deletion of orphaned emails. - Test progress caching and backup folder discovery. - Ensure robust handling of email labels and flags during restoration. - Verify that the restore process correctly interacts with a mock IMAP server. * Add comprehensive tests for IMAP utilities and compression support - Introduced tests for `imap_common.py` covering environment variable verification, IMAP connection handling, folder name normalization, MIME header decoding, message details extraction, duplicate detection, filename sanitization, and trash folder detection. - Added tests for `imap_compress.py` to validate the functionality of the `_CompressedSocket` wrapper, ensuring data compression and decompression works as expected. - Implemented integration tests to verify that compression is enabled during IMAP connection setup.
102 lines
2.6 KiB
TOML
102 lines
2.6 KiB
TOML
# Ruff configuration for IMAP Migration Tools
|
|
# https://docs.astral.sh/ruff/
|
|
|
|
[build-system]
|
|
requires = ["setuptools>=61.0"]
|
|
build-backend = "setuptools.build_meta"
|
|
|
|
[project]
|
|
name = "imap-migration-tools"
|
|
version = "1.1.0"
|
|
authors = [
|
|
{ name="Javier Callico", email="jcallico@callicode.com" },
|
|
{ name="Nathan Moinvaziri", email="nathan@nathanm.com" }
|
|
]
|
|
description = "Tools for migrating IMAP emails"
|
|
readme = "README.md"
|
|
requires-python = ">=3.9"
|
|
classifiers = [
|
|
"Programming Language :: Python :: 3",
|
|
"License :: OSI Approved :: MIT License",
|
|
"Operating System :: OS Independent",
|
|
]
|
|
dependencies = [
|
|
"google-auth-oauthlib",
|
|
"msal",
|
|
]
|
|
|
|
[project.urls]
|
|
"Homepage" = "https://github.com/jcallico/imap-migration-tools"
|
|
"Bug Tracker" = "https://github.com/jcallico/imap-migration-tools/issues"
|
|
|
|
[project.scripts]
|
|
imap-backup = "imap_backup:main"
|
|
imap-restore = "imap_restore:main"
|
|
imap-migrate = "imap_migrate:main"
|
|
imap-count = "imap_count:main"
|
|
imap-compare = "imap_compare:main"
|
|
|
|
[tool.setuptools.package-dir]
|
|
"" = "src"
|
|
|
|
[tool.ruff]
|
|
target-version = "py39"
|
|
line-length = 120
|
|
|
|
# Include src, tools, and test directories
|
|
src = ["src", "tools", "test"]
|
|
|
|
[tool.ruff.lint]
|
|
# Enable recommended rules
|
|
select = [
|
|
"E", # pycodestyle errors
|
|
"W", # pycodestyle warnings
|
|
"F", # Pyflakes
|
|
"I", # isort
|
|
"B", # flake8-bugbear
|
|
"C4", # flake8-comprehensions
|
|
"UP", # pyupgrade
|
|
]
|
|
|
|
ignore = [
|
|
"E501", # line too long (handled by formatter)
|
|
"E701", # multiple statements on one line (colon) - used for concise code
|
|
"E722", # bare except - used in connection handling
|
|
"B008", # do not perform function calls in argument defaults
|
|
"B905", # zip without explicit strict parameter
|
|
"F841", # local variable assigned but never used - used for clarity
|
|
"W293", # blank line contains whitespace - handled by formatter
|
|
]
|
|
|
|
# Allow unused variables when underscore-prefixed
|
|
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
|
|
|
|
[tool.ruff.lint.per-file-ignores]
|
|
"test/*.py" = [
|
|
"S101", # assert statements are fine in tests
|
|
]
|
|
|
|
[tool.ruff.format]
|
|
quote-style = "double"
|
|
indent-style = "space"
|
|
skip-magic-trailing-comma = false
|
|
line-ending = "auto"
|
|
|
|
[tool.pytest.ini_options]
|
|
testpaths = ["test"]
|
|
python_files = ["test_*.py"]
|
|
python_classes = ["Test*"]
|
|
python_functions = ["test_*"]
|
|
addopts = "-v --tb=short"
|
|
|
|
[tool.coverage.run]
|
|
source = ["src"]
|
|
omit = ["test/*", "tools/*"]
|
|
|
|
[tool.coverage.report]
|
|
exclude_lines = [
|
|
"pragma: no cover",
|
|
"if __name__ == .__main__.:",
|
|
"raise NotImplementedError",
|
|
]
|