Skip to content
This repository was archived by the owner on Jul 14, 2025. It is now read-only.

Commit 2aa9785

Browse files
authored
Merge pull request #144 from fyfe/prepeare-for-release
prepare for release
2 parents 6217463 + 59fc2c9 commit 2aa9785

File tree

7 files changed

+90
-83
lines changed

7 files changed

+90
-83
lines changed

.travis.yml

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,24 @@ env:
1010
- PYTHONWARNINGS="default,ignore::PendingDeprecationWarning,ignore::ResourceWarning"
1111
matrix:
1212
- DB="POSTGRESQL"
13+
- DB="MYSQL"
1314

1415
sudo: false
1516

1617
cache: pip
1718

18-
services:
19-
- postgres
19+
addons:
20+
postgresql: "9.3"
21+
mysql: "5.5"
2022

2123
before_install:
2224
- pip install codecov
23-
- if [[ $DB = "POSTGRESQL" ]]; then pip install -q psycopg2; fi
24-
- pip install -e git+https://github.com/modoboa/modoboa#egg=modoboa
25+
- pip install -e git+https://github.com/modoboa/modoboa.git#egg=modoboa
2526

2627
install:
27-
- pip install -q -r requirements.txt
28-
- pip install -q -r test-requirements.txt
29-
- python setup.py -q develop
30-
31-
before_script:
32-
- if [[ $DB = "POSTGRESQL" ]]; then psql -c "CREATE DATABASE modoboa_test;" -U postgres; fi
28+
- pip install -r requirements.txt
29+
- pip install -r test-requirements.txt
30+
- python setup.py develop
3331

3432
script:
3533
- cd test_project
@@ -48,8 +46,9 @@ deploy:
4846
user: tonio
4947
password:
5048
secure: vDpojbQnBdmXXfzJdwWhLbVHyFXpSC0glYNk42rbfzdwQnAA9rbXxzX683OcBZPhqozHwCkazOQmDzzBU/Vue4hgAz5U5rLemMQp288urVUQrt2IPwfWyXe+Cgu9CebiwhWDh4tgWBiFvNySmpuP0xJRVi0oKkWoEM+dcfsTa7OSuCx/e8eRA35fWIo7/xyxc1Gl1sdg0J+TwQJV6EyUxvhTzqP0PoZSGLkOHE+SOZJyM8UAo48VV5+uFqKVae33tsIhJBJu6/LvWFFu0Yedr/DqjZ8OY5tTU86Bn+MblBM8LmKpKI1XNxgULL7+GXS1c1YIo5Wbw8esEHJq5ro7eqXe/KnDar8l4/+MPExlQsmjkOxwvWAF45VMfFm5oVXZYsD8giD+a6EFT6ELDOKb973fDLKZLmNToZRNWkbBDTrcd/ppElswTORMkHhew/W7UuXtEQxNKWcUETuuViyPNMFrTy3SZ8oIuG2hqbx3wIrj34PlxSJGHSRlE7aLwG5whnkgkEFN9bfvfqpsowrHnqbBfgUJt07uV0bKEjwqEz55PALRhDjRoGkvtDkPJjnJvwY+ieC2VKyLNzZBi2iw/Mh6peyK0oTgCzdpUvSLRuiNzpWf+jpGE0aOWxcwcdEA6a4aTJXivMgg5/4Jbvs+NbjNgTfXdOApMWkxu2aCNWI=
51-
server: https://upload.pypi.org/legacy/
5249
skip_cleanup: true
50+
distributions: "sdist bdist_wheel"
5351
on:
5452
tags: true
55-
python: '3.6'
53+
python: "3.6"
54+
condition: $DB = POSTGRESQL

modoboa_webmail/__init__.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1-
__version__ = "1.2.3"
1+
# -*- coding: utf-8 -*-
2+
3+
"""DMARC related tools for Modoboa."""
4+
5+
from __future__ import unicode_literals
6+
7+
from pkg_resources import get_distribution, DistributionNotFound
8+
9+
10+
try:
11+
__version__ = get_distribution(__name__).version
12+
except DistributionNotFound:
13+
# package is not installed
14+
pass
215

316
default_app_config = "modoboa_webmail.apps.WebmailConfig"

modoboa_webmail/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ def new_compose_form(request, action, mbox, mailid):
494494
"""
495495
form = ComposeMailForm(request.user)
496496
modclass = globals()["%sModifier" % action.capitalize()]
497-
email = modclass(form, request, "%s:%s" % (mbox, mailid), links="1")
497+
email = modclass(form, request, "%s:%s" % (mbox, mailid), links=True)
498498
url = "?action=%s&mbox=%s&mailid=%s" % (action, mbox, mailid)
499499
return render_compose(request, form, url, email)
500500

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
modoboa>=1.8.2
1+
modoboa>=1.10.0
22
chardet
33
lxml

setup.cfg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
[bdist_wheel]
2+
universal = 1
13
[pep8]
24
max-line-length = 80
35
exclude = migrations

setup.py

Lines changed: 59 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,71 @@
1-
"""Setup script for modoboa-admin."""
1+
#!/usr/bin/env python
2+
# -*- coding: utf-8 -*-
23

3-
import re
4-
import os
5-
from setuptools import setup, find_packages
6-
7-
from modoboa_webmail import __version__
4+
"""
5+
A setuptools based setup module.
86
9-
ROOT = os.path.dirname(__file__)
7+
See:
8+
https://packaging.python.org/en/latest/distributing.html
9+
"""
1010

11+
from __future__ import unicode_literals
1112

12-
PIP_REQUIRES = os.path.join(ROOT, "requirements.txt")
13+
import io
14+
from os import path
15+
from pip.req import parse_requirements
16+
from setuptools import setup, find_packages
1317

1418

15-
def parse_requirements(*filenames):
16-
"""
17-
We generate our install_requires from the pip-requires and test-requires
18-
files so that we don't have to maintain the dependency definitions in
19-
two places.
20-
"""
19+
def get_requirements(requirements_file):
20+
"""Use pip to parse requirements file."""
2121
requirements = []
22-
for f in filenames:
23-
for line in open(f, 'r').read().split('\n'):
24-
# Comment lines. Skip.
25-
if re.match(r'(\s*#)|(\s*$)', line):
26-
continue
27-
# Editable matches. Put the egg name into our reqs list.
28-
if re.match(r'\s*-e\s+', line):
29-
pkg = re.sub(r'\s*-e\s+.*#egg=(.*)$', r'\1', line)
30-
requirements.append("%s" % pkg)
31-
# File-based installs not supported/needed. Skip.
32-
elif re.match(r'\s*-f\s+', line):
33-
pass
34-
else:
35-
requirements.append(line)
22+
if path.isfile(requirements_file):
23+
for req in parse_requirements(requirements_file, session="hack"):
24+
# check markers, such as
25+
#
26+
# rope_py3k ; python_version >= '3.0'
27+
#
28+
if req.match_markers():
29+
requirements.append(str(req.req))
3630
return requirements
3731

3832

39-
def parse_dependency_links(*filenames):
40-
"""
41-
We generate our dependency_links from the pip-requires and test-requires
42-
files for the dependencies pulled from github (prepended with -e).
43-
"""
44-
dependency_links = []
45-
for f in filenames:
46-
for line in open(f, 'r').read().split('\n'):
47-
if re.match(r'\s*-[ef]\s+', line):
48-
line = re.sub(r'\s*-[ef]\s+', '', line)
49-
line = re.sub(r'\s*git\+https', 'http', line)
50-
line = re.sub(r'\.git#', '/tarball/master#', line)
51-
dependency_links.append(line)
52-
return dependency_links
53-
54-
55-
def read(fname):
56-
"""A simple function to read the content of a file."""
57-
return open(os.path.join(ROOT, fname)).read()
33+
if __name__ == "__main__":
34+
HERE = path.abspath(path.dirname(__file__))
35+
INSTALL_REQUIRES = get_requirements(path.join(HERE, "requirements.txt"))
5836

37+
with io.open(path.join(HERE, "README.rst"), encoding="utf-8") as readme:
38+
LONG_DESCRIPTION = readme.read()
5939

60-
setup(
61-
name="modoboa-webmail",
62-
version=__version__,
63-
url='http://modoboa.org/',
64-
license='MIT',
65-
description="The webmail of Modoboa",
66-
long_description=read('README.rst'),
67-
author='Antoine Nguyen',
68-
author_email='[email protected]',
69-
packages=find_packages(),
70-
include_package_data=True,
71-
install_requires=parse_requirements(PIP_REQUIRES),
72-
dependency_links=parse_dependency_links(PIP_REQUIRES),
73-
classifiers=['Development Status :: 5 - Production/Stable',
74-
'Framework :: Django',
75-
'Intended Audience :: System Administrators',
76-
'License :: OSI Approved :: MIT License',
77-
'Operating System :: OS Independent',
78-
'Programming Language :: Python',
79-
'Topic :: Internet :: WWW/HTTP']
80-
)
40+
setup(
41+
name="modoboa-webmail",
42+
description="The webmail of Modoboa",
43+
long_description=LONG_DESCRIPTION,
44+
license="MIT",
45+
url="http://modoboa.org/",
46+
author="Antoine Nguyen",
47+
author_email="[email protected]",
48+
classifiers=[
49+
"Development Status :: 5 - Production/Stable",
50+
"Environment :: Web Environment",
51+
"Framework :: Django :: 1.11",
52+
"Intended Audience :: System Administrators",
53+
"License :: OSI Approved :: MIT License",
54+
"Operating System :: OS Independent",
55+
"Programming Language :: Python :: 2",
56+
"Programming Language :: Python :: 2.7",
57+
"Programming Language :: Python :: 3",
58+
"Programming Language :: Python :: 3.4",
59+
"Programming Language :: Python :: 3.5",
60+
"Programming Language :: Python :: 3.6",
61+
"Topic :: Communications :: Email",
62+
"Topic :: Internet :: WWW/HTTP",
63+
],
64+
keywords="email webmail",
65+
packages=find_packages(exclude=["docs", "test_project"]),
66+
include_package_data=True,
67+
zip_safe=False,
68+
install_requires=INSTALL_REQUIRES,
69+
use_scm_version=True,
70+
setup_requires=["setuptools_scm"],
71+
)

test-requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
factory-boy>=2.4
22
testfixtures==4.7.0
3+
psycopg2>=2.5.4
4+
mysqlclient>=1.3.3

0 commit comments

Comments
 (0)