Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
language: python

cache: pip

python:
- "2.7"
- "3.4"
- "3.6"
- '2.7'
- '3.4'
- '3.6'

before_install:
- pip install codecov nose
Expand All @@ -15,3 +17,14 @@ script: nosetests --with-coverage

after_success:
- codecov

deploy:
provider: pypi
user: tonio
password:
secure: Mb1Xiif6MnUmEC6c0lUcW3BEqxvmBeh8V46BkMznX7FgqG1jUcBTtvLLub7Hzh31gvL7xltcUCS9AMhu3CnJrxSLxkyzthpWMp/kib00WM5qmrw9o8ZWeJm+wFMfFJchZ7Nx61PL/17D/Qjaf6lNLYQudXW8Z+hZ1CcQic3B3Kw=
skip_cleanup: true
distributions: sdist bdist_wheel
on:
tags: true
python: '3.6'
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[bdist_wheel]
universal = 1
122 changes: 53 additions & 69 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,77 +1,61 @@
# coding=utf-8
import os
import re
from setuptools import setup, find_packages

ROOT = os.path.dirname(__file__)
PIP_REQUIRES = os.path.join(ROOT, "requirements.txt")
#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""
A setuptools based setup module.

def parse_requirements(*filenames):
"""
We generate our install_requires from the pip-requires and test-requires
files so that we don't have to maintain the dependency definitions in
two places.
"""
requirements = []
for f in filenames:
for line in open(f, 'r').read().split('\n'):
# Comment lines. Skip.
if re.match(r'(\s*#)|(\s*$)', line):
continue
# Editable matches. Put the egg name into our reqs list.
if re.match(r'\s*-e\s+', line):
pkg = re.sub(r'\s*-e\s+.*#egg=(.*)$', r'\1', line)
requirements.append("%s" % pkg)
# File-based installs not supported/needed. Skip.
elif re.match(r'\s*-f\s+', line):
pass
else:
requirements.append(line)
return requirements
See:
https://packaging.python.org/en/latest/distributing.html
"""

from __future__ import unicode_literals

def parse_dependency_links(*filenames):
"""
We generate our dependency_links from the pip-requires and test-requires
files for the dependencies pulled from github (prepended with -e).
"""
dependency_links = []
for f in filenames:
for line in open(f, 'r').read().split('\n'):
if re.match(r'\s*-[ef]\s+', line):
line = re.sub(r'\s*-[ef]\s+', '', line)
line = re.sub(r'\s*git\+https', 'http', line)
line = re.sub(r'\.git#', '/tarball/master#', line)
dependency_links.append(line)
return dependency_links
import io
from os import path
from pip.req import parse_requirements
from setuptools import setup, find_packages


def read(fname):
return open(os.path.join(ROOT, fname)).read()
def get_requirements(requirements_file):
"""Use pip to parse requirements file."""
requirements = []
if path.isfile(requirements_file):
for req in parse_requirements(requirements_file, session="hack"):
# check markers, such as
#
# rope_py3k ; python_version >= '3.0'
#
if req.match_markers():
requirements.append(str(req.req))
return requirements


setup(
name="sievelib",
packages=find_packages(),
include_package_data=True,
version="1.1.0",
description="Client-side SIEVE library",
author="Antoine Nguyen",
author_email="[email protected]",
url="https://github.com/tonioo/sievelib",
license="MIT",
keywords=["sieve", "managesieve", "parser", "client"],
install_requires=parse_requirements(PIP_REQUIRES),
dependency_links=parse_dependency_links(PIP_REQUIRES),
classifiers=[
"Programming Language :: Python",
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Communications :: Email :: Filters"
],
long_description=read("README.rst")
)
if __name__ == "__main__":
HERE = path.abspath(path.dirname(__file__))
INSTALL_REQUIRES = get_requirements(path.join(HERE, "requirements.txt"))
with io.open(path.join(HERE, "README.rst"), encoding="utf-8") as readme:
LONG_DESCRIPTION = readme.read()
setup(
name="sievelib",
packages=find_packages(),
include_package_data=True,
description="Client-side SIEVE library",
author="Antoine Nguyen",
author_email="[email protected]",
url="https://github.com/tonioo/sievelib",
license="MIT",
keywords=["sieve", "managesieve", "parser", "client"],
install_requires=INSTALL_REQUIRES,
setup_requires=["setuptools_scm"],
use_scm_version=True,
classifiers=[
"Programming Language :: Python",
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Communications :: Email :: Filters"
],
long_description=LONG_DESCRIPTION
)
14 changes: 14 additions & 0 deletions sievelib/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# -*- coding: utf-8 -*-

"""sievelib."""

from __future__ import unicode_literals

from pkg_resources import get_distribution, DistributionNotFound


try:
__version__ = get_distribution(__name__).version
except DistributionNotFound:
# package is not installed
pass