-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
107 lines (95 loc) · 3.21 KB
/
setup.py
File metadata and controls
107 lines (95 loc) · 3.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#!/usr/bin/env python3
"""
Setup script for UnitMail.
This is a shim that reads configuration from pyproject.toml.
For most use cases, you should use `pip install .` or `pip install -e .`
which will use pyproject.toml directly via PEP 517/518.
This file exists for backward compatibility with tools that don't
support pyproject.toml yet.
"""
import sys
if sys.version_info < (3, 11):
sys.exit("Error: UnitMail requires Python 3.11 or higher.")
try:
from setuptools import setup
except ImportError:
sys.exit("Error: setuptools is required. Install it with: pip install setuptools")
# Try to read version from __version__.py for consistency
try:
import re
from pathlib import Path
version_file = Path(__file__).parent / "src" / "unitmail" / "__version__.py"
version_content = version_file.read_text(encoding="utf-8")
version_match = re.search(r'^__version__\s*=\s*["\']([^"\']+)["\']', version_content, re.M)
version = version_match.group(1) if version_match else "0.1.0"
except Exception:
version = "0.1.0"
# Read long description from README if available
try:
from pathlib import Path
readme_path = Path(__file__).parent / "README.md"
if readme_path.exists():
long_description = readme_path.read_text(encoding="utf-8")
long_description_content_type = "text/markdown"
else:
long_description = "A modern email client with encryption support"
long_description_content_type = "text/plain"
except Exception:
long_description = "A modern email client with encryption support"
long_description_content_type = "text/plain"
# Core dependencies (keep in sync with pyproject.toml)
# Note: SQLite is built into Python - no additional package needed
install_requires = [
"Flask>=3.0.0",
"PyGObject>=3.46.0",
"python-gnupg>=0.5.2",
"PyJWT>=2.8.0",
"cryptography>=41.0.0",
"aiosmtpd>=1.4.4",
"requests>=2.31.0",
"pydantic>=2.0.0",
"pydantic-settings>=2.0.0",
]
# Development dependencies
extras_require = {
"dev": [
"pytest>=7.4.0",
"playwright>=1.40.0",
"pytest-playwright>=0.4.0",
"black>=23.0.0",
"flake8>=6.1.0",
"mypy>=1.7.0",
"pytest-cov>=4.1.0",
"pytest-asyncio>=0.21.0",
],
}
setup(
name="unitmail",
version=version,
description="A modern email client with encryption support",
long_description=long_description,
long_description_content_type=long_description_content_type,
author="UnitMail Team",
license="MIT",
python_requires=">=3.11",
packages=["unitmail"],
package_dir={"": "src"},
install_requires=install_requires,
extras_require=extras_require,
entry_points={
"console_scripts": [
"unitmail=unitmail.cli:main",
],
},
classifiers=[
"Development Status :: 3 - Alpha",
"Intended Audience :: End Users/Desktop",
"License :: OSI Approved :: MIT License",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Communications :: Email",
],
keywords=["email", "encryption", "gpg", "smtp", "client"],
)