Skip to content

Commit

Permalink
Merge pull request #85 from jhermann/move-to-package-32
Browse files Browse the repository at this point in the history
Make configobj a package, moving towards incorporating validate
  • Loading branch information
EliAndrewC committed May 1, 2015
2 parents 0daebcb + e88c7d2 commit a68530a
Show file tree
Hide file tree
Showing 10 changed files with 1,766 additions and 1,666 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ pip-log.txt
.coverage
.tox
nosetests.xml
coverage.xml
htmlcov/

# Translations
*.mo
Expand All @@ -39,6 +41,7 @@ nosetests.xml

# virtualenv
env
.venv/

# autogenerated by distutils
MANIFEST
6 changes: 6 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#
# Additional files for source distribution
#
include README.md LICENSE *.txt *.ini
recursive-include tests *.py *.spec *.ini
recursive-include docs Makefile *.bat *.conf *.css *.html *.py *.rst *.tmp
1 change: 0 additions & 1 deletion _version.py

This file was deleted.

28 changes: 28 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#
# Configuration for setuptools
#

[egg_info]
tag_build = .dev0
tag_date = false


[sdist]
formats = zip


[bdist_wheel]
# If you set this to 1, make sure you have a proper Travis CI build matrix,
# and that your Trove classifiers state you support Python 2 and 3
universal = 1


[pytest]
norecursedirs = .* *.egg *.egg-info bin dist include lib local share static docs
python_files = tests/test_*.py
#addopts =


[flake8]
#ignore = E226,…
max-line-length = 132
50 changes: 32 additions & 18 deletions setup.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env python
# setup.py
# Install script for ConfigObj
# Copyright (C) 2005-2014:
Expand All @@ -11,10 +12,11 @@
# This software is licensed under the terms of the BSD license.
# http://opensource.org/licenses/BSD-3-Clause
import os
import re
import sys
from contextlib import closing

from setuptools import setup
# a simple import wouldn't work if we moved towards a package with __init__
from _version import __version__

if sys.version_info < (2, 6):
print('for python versions < 2.6 use configobj '
Expand All @@ -23,14 +25,23 @@

__here__ = os.path.abspath(os.path.dirname(__file__))

VERSION = __version__
NAME = 'configobj'
MODULES = 'configobj', 'validate', '_version'

MODULES = ['validate']
PACKAGES = ['configobj']
DESCRIPTION = 'Config file reading, writing and validation.'

URL = 'https://github.com/DiffSK/configobj'

REQUIRES = """
six
"""

VERSION = ''
with closing(open(os.path.join(__here__, 'src', PACKAGES[0], '_version.py'), 'r')) as handle:
for line in handle.readlines():
if line.startswith('__version__'):
VERSION = re.split('''['"]''', line)[1]
assert re.match(r"[0-9](\.[0-9]+)", VERSION), "No semantic version found in 'configobj._version'"

LONG_DESCRIPTION = """**ConfigObj** is a simple but powerful config file reader and writer: an *ini
file round tripper*. Its main feature is that it is very easy to use, with a
straightforward programmer's interface and a simple syntax for config files.
Expand Down Expand Up @@ -92,15 +103,18 @@
KEYWORDS = "config, ini, dictionary, application, admin, sysadmin, configuration, validation".split(', ')


setup(name=NAME,
version=VERSION,
install_requires=['six'],
description=DESCRIPTION,
long_description=LONG_DESCRIPTION,
author=AUTHOR,
author_email=AUTHOR_EMAIL,
url=URL,
py_modules=MODULES,
classifiers=CLASSIFIERS,
keywords=KEYWORDS
)
if __name__ == '__main__':
setup(name=NAME,
version=VERSION,
description=DESCRIPTION,
long_description=LONG_DESCRIPTION,
author=AUTHOR,
author_email=AUTHOR_EMAIL,
url=URL,
py_modules=MODULES,
package_dir={'': 'src'},
packages=PACKAGES,
install_requires=[i.strip() for i in REQUIRES.splitlines() if i.strip()],
classifiers=CLASSIFIERS,
keywords=KEYWORDS
)
Loading

0 comments on commit a68530a

Please sign in to comment.