diff --git a/.travis.yml b/.travis.yml index 8f494963..6dd56648 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,7 @@ dist: xenial language: python cache: pip env: -- TEST_CMD="pytest tests/ --integration --cov=esque --local" +- ESQUE_ENV=dev TEST_CMD="pytest tests/ --integration --cov=esque --local" before_install: - wget https://mirror.netcologne.de/apache.org/kafka/2.2.0/kafka_2.12-2.2.0.tgz -O kafka.tgz - mkdir -p kafka && tar xzf kafka.tgz -C kafka --strip-components 1 diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..17386461 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 real.digital + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 00000000..87343a9b --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,4 @@ +include esque/config/sample_config.cfg +include scripts/auto_completion.sh +include README.md +include LICENSE \ No newline at end of file diff --git a/config/__init__.py b/config/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/esque/config.py b/esque/config.py index 0a1c312d..3bbf9c00 100644 --- a/esque/config.py +++ b/esque/config.py @@ -1,6 +1,7 @@ import configparser import random import string +from distutils.sysconfig import get_python_lib from pathlib import Path from typing import Any, Dict, List, Optional, Tuple @@ -28,8 +29,9 @@ def config_path() -> Path: def sample_config_path() -> Path: - sample_path = Path(__file__).parent.parent / "config" / "sample_config.cfg" - return sample_path + if ESQUE_ENV == "dev": + return Path(__file__).parent / "config" / "sample_config.cfg" + return Path(get_python_lib()) / "esque" / "config" / "sample_config.cfg" class Config: diff --git a/config/sample_config.cfg b/esque/config/sample_config.cfg similarity index 100% rename from config/sample_config.cfg rename to esque/config/sample_config.cfg diff --git a/auto_completion.sh b/scripts/auto_completion.sh similarity index 100% rename from auto_completion.sh rename to scripts/auto_completion.sh diff --git a/setup.py b/setup.py index a8f630a0..f4c92668 100644 --- a/setup.py +++ b/setup.py @@ -40,7 +40,7 @@ class InstallWithPostCommand(install): def run(self): install.run(self) print("installing auto completion") - call(["./auto_completion.sh"]) + call(["./scripts/auto_completion.sh"]) setup( @@ -55,7 +55,6 @@ def run(self): author_email="opensource@real-digital.de", packages=find_packages(exclude=["tests", "tests.*"]), entry_points={"console_scripts": ["esque=esque.cli.commands:esque"]}, - package_data={"config": ["sample_config.cfg"]}, python_requires=">=3.6", setup_requires=[], install_requires=required,