From c9030b6d5042d1fcbb911f218e3d36b4a50d2722 Mon Sep 17 00:00:00 2001 From: Istvan Pasztor Date: Tue, 12 Apr 2016 01:16:55 +0100 Subject: [PATCH] moving library sources to an src subdir and excluding the tests package from the installation. --- .gitignore | 31 +++------------------ CHANGES.rst | 1 + MANIFEST.in | 1 + setup.py | 7 +++-- {jsoncfg => src/jsoncfg}/__init__.py | 0 {jsoncfg => src/jsoncfg}/compatibility.py | 0 {jsoncfg => src/jsoncfg}/config_classes.py | 0 {jsoncfg => src/jsoncfg}/exceptions.py | 0 {jsoncfg => src/jsoncfg}/functions.py | 0 {jsoncfg => src/jsoncfg}/parser.py | 0 {jsoncfg => src/jsoncfg}/parser_listener.py | 0 {jsoncfg => src/jsoncfg}/text_encoding.py | 0 {jsoncfg => src/jsoncfg}/tree_config.py | 0 {jsoncfg => src/jsoncfg}/tree_python.py | 0 {jsoncfg => src/jsoncfg}/value_mappers.py | 0 15 files changed, 10 insertions(+), 30 deletions(-) rename {jsoncfg => src/jsoncfg}/__init__.py (100%) rename {jsoncfg => src/jsoncfg}/compatibility.py (100%) rename {jsoncfg => src/jsoncfg}/config_classes.py (100%) rename {jsoncfg => src/jsoncfg}/exceptions.py (100%) rename {jsoncfg => src/jsoncfg}/functions.py (100%) rename {jsoncfg => src/jsoncfg}/parser.py (100%) rename {jsoncfg => src/jsoncfg}/parser_listener.py (100%) rename {jsoncfg => src/jsoncfg}/text_encoding.py (100%) rename {jsoncfg => src/jsoncfg}/tree_config.py (100%) rename {jsoncfg => src/jsoncfg}/tree_python.py (100%) rename {jsoncfg => src/jsoncfg}/value_mappers.py (100%) diff --git a/.gitignore b/.gitignore index 6e45c74..8f13763 100644 --- a/.gitignore +++ b/.gitignore @@ -1,33 +1,10 @@ -# Byte-compiled / optimized / DLL files -/__pycache__/ -*.py[cod] - -# PyCharm +/.eggs/ /.idea/ - -# C extensions -*.so - -# Distribution / packaging -.Python -/env/ /build/ -/develop-eggs/ /dist/ -/downloads/ -/eggs/ -/.eggs/ -/lib/ -/lib64/ -/parts/ -/sdist/ -/var/ -/*.egg-info/ -/.installed.cfg -*.egg +/src/json_cfg.egg-info/ /README.html +/CHANGES.html -# PyInstaller -# Usually these files are written by a python script from a template -# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.py[cod] diff --git a/CHANGES.rst b/CHANGES.rst index e390d63..45f80bb 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -9,6 +9,7 @@ Recent changes *Release date: future* - Adding this CHANGES.rst file. +- Moving library sources to an ``src`` subdir and excluding the ``tests`` package from the installation. v0.4.0-beta diff --git a/MANIFEST.in b/MANIFEST.in index e49bbb3..bf20310 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,3 +1,4 @@ include README.rst include CHANGES.rst include LICENSE.txt +recursive-include tests *.py diff --git a/setup.py b/setup.py index dc44b76..12a7524 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ import os import re import codecs -from setuptools import setup +from setuptools import setup, find_packages script_dir = os.path.dirname(os.path.abspath(__file__)) @@ -31,7 +31,7 @@ def find_version(*path): setup( name='json-cfg', - version=find_version('jsoncfg', '__init__.py'), + version=find_version('src', 'jsoncfg', '__init__.py'), description='JSON config file parser with extended syntax (e.g.: comments), ' 'line/column numbers in error messages, etc...', keywords='json config file parser configuration comment', @@ -62,7 +62,8 @@ def find_version(*path): ], install_requires=['kwonly-args>=1.0.7'], - packages=['jsoncfg', 'tests'], + packages=find_packages('src'), + package_dir={'': 'src'}, test_suite= 'tests', tests_require=['mock'], diff --git a/jsoncfg/__init__.py b/src/jsoncfg/__init__.py similarity index 100% rename from jsoncfg/__init__.py rename to src/jsoncfg/__init__.py diff --git a/jsoncfg/compatibility.py b/src/jsoncfg/compatibility.py similarity index 100% rename from jsoncfg/compatibility.py rename to src/jsoncfg/compatibility.py diff --git a/jsoncfg/config_classes.py b/src/jsoncfg/config_classes.py similarity index 100% rename from jsoncfg/config_classes.py rename to src/jsoncfg/config_classes.py diff --git a/jsoncfg/exceptions.py b/src/jsoncfg/exceptions.py similarity index 100% rename from jsoncfg/exceptions.py rename to src/jsoncfg/exceptions.py diff --git a/jsoncfg/functions.py b/src/jsoncfg/functions.py similarity index 100% rename from jsoncfg/functions.py rename to src/jsoncfg/functions.py diff --git a/jsoncfg/parser.py b/src/jsoncfg/parser.py similarity index 100% rename from jsoncfg/parser.py rename to src/jsoncfg/parser.py diff --git a/jsoncfg/parser_listener.py b/src/jsoncfg/parser_listener.py similarity index 100% rename from jsoncfg/parser_listener.py rename to src/jsoncfg/parser_listener.py diff --git a/jsoncfg/text_encoding.py b/src/jsoncfg/text_encoding.py similarity index 100% rename from jsoncfg/text_encoding.py rename to src/jsoncfg/text_encoding.py diff --git a/jsoncfg/tree_config.py b/src/jsoncfg/tree_config.py similarity index 100% rename from jsoncfg/tree_config.py rename to src/jsoncfg/tree_config.py diff --git a/jsoncfg/tree_python.py b/src/jsoncfg/tree_python.py similarity index 100% rename from jsoncfg/tree_python.py rename to src/jsoncfg/tree_python.py diff --git a/jsoncfg/value_mappers.py b/src/jsoncfg/value_mappers.py similarity index 100% rename from jsoncfg/value_mappers.py rename to src/jsoncfg/value_mappers.py