diff --git a/Dockerfile b/Dockerfile index 2997ac0..0422ab6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,8 +6,8 @@ FROM $BASE_IMAGE as builder WORKDIR /opt COPY ecs_files_composer /opt/ecs_files_composer -COPY setup.py requirements.txt MANIFEST.in README.rst LICENSE /opt/ -RUN python -m venv venv ; source venv/bin/activate ; pip install wheel; python setup.py sdist bdist_wheel; ls -l dist/ +COPY setup.py pyproject.toml MANIFEST.in README.rst LICENSE /opt/ +RUN python -m pip install pip -U; python -m pip install poetry; poetry build FROM $BASE_IMAGE diff --git a/pyproject.toml b/pyproject.toml index 59434f8..76f0859 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,16 +4,40 @@ version = "0.3.0" description = "Files and configuration handler to inject configuration files into volumes for ECS containers" authors = ["John Preston "] license = "MPL-2.0" +classifiers=[ + "Development Status :: 2 - Pre-Alpha", + "Intended Audience :: Developers", + "Natural Language :: English", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Intended Audience :: System Administrators", + "Intended Audience :: Information Technology", + "License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)" + ] +readme = "README.rst" +keywords=["aws", "ecs", "k8s", "secrets", "docker"] [tool.poetry.dependencies] -python = "^3.9" -boto3 = "^1.17.110" +python = "^3.7" +boto3 = "^1.18" pydantic = "^1.8.2" +pyOpenSSL = "^20.0.1" +requests = "^2.26.0" +PyYAML = "^5.4.1" +Jinja2 = "^3.0.1" +jsonschema = "^3.2.0" [tool.poetry.dev-dependencies] placebo = "^0.9.0" datamodel-code-generator = {version = "^0.11.8", extras = ["http"]} +[tool.poetry.scripts] +files_composer = "ecs_files_composer.cli:main" +ecs_files_composer = "ecs_files_composer.cli:main" + + [build-system] requires = ["poetry-core>=1.0.0"] build-backend = "poetry.core.masonry.api" diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index c2a935c..0000000 --- a/setup.cfg +++ /dev/null @@ -1,25 +0,0 @@ -[bumpversion] -current_version = 0.3.0 -commit = True -tag = True - -[bumpversion:file:setup.py] -search = version='{current_version}' -replace = version='{new_version}' - -[bumpversion:file:ecs_files_composer/__init__.py] -search = __version__ = '{current_version}' -replace = __version__ = '{new_version}' - -[bdist_wheel] -universal = 1 - -[flake8] -exclude = docs - -[aliases] -# Define setup.py command aliases here -test = pytest - -[tool:pytest] -collect_ignore = ['setup.py'] diff --git a/setup.py b/setup.py index 8e68868..2daa01c 100644 --- a/setup.py +++ b/setup.py @@ -1,82 +1,8 @@ -#!/usr/bin/env python +# #!/usr/bin/env python # -*- coding: utf-8 -*- # SPDX-License-Identifier: MPL-2.0 -# Copyright 2020-2021 John Mille -import os -import re +from setuptools import setup -from setuptools import find_packages, setup - -DIR_HERE = os.path.abspath(os.path.dirname(__file__)) -# REMOVE UNSUPPORTED RST syntax -REF_REGX = re.compile(r"(\:ref\:)") - -try: - with open(f"{DIR_HERE}/README.rst", encoding="utf-8") as readme_file: - readme = readme_file.read() - readme = REF_REGX.sub("", readme) -except FileNotFoundError: - readme = "ECS Files Composer" - -try: - with open(f"{DIR_HERE}/HISTORY.rst", encoding="utf-8") as history_file: - history = history_file.read() -except FileNotFoundError: - history = "Latest packaged version." - -requirements = [] -with open(f"{DIR_HERE}/requirements.txt", "r") as req_fd: - for line in req_fd: - requirements.append(line.strip()) - -test_requirements = [] -try: - with open(f"{DIR_HERE}/requirements_dev.txt", "r") as req_fd: - for line in req_fd: - test_requirements.append(line.strip()) -except FileNotFoundError: - print("Failed to load dev requirements. Skipping") - - -setup_requirements = [ - "pytest-runner", -] - -setup( - author="John Preston", - author_email="john@compose-x.io", - python_requires=">=3.7", - classifiers=[ - "Development Status :: 2 - Pre-Alpha", - "Intended Audience :: Developers", - "Natural Language :: English", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Intended Audience :: System Administrators", - "Intended Audience :: Information Technology", - "License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)", - ], - description="Files and configuration handler to inject configuration files into volumes for ECS containers", - entry_points={ - "console_scripts": [ - "ecs_files_composer=ecs_files_composer.cli:main", - ], - }, - install_requires=requirements, - long_description=readme, - long_description_content_type="text/x-rst", - include_package_data=True, - keywords="ecs_files_composer", - name="ecs_files_composer", - packages=find_packages(include=["ecs_files_composer", "ecs_files_composer.*"]), - setup_requires=setup_requirements, - test_suite="tests", - tests_require=test_requirements, - url="https://github.com/compose-x/ecs-files-composer", - version="0.3.0", - zip_safe=False, - license="MPL-2.0", -) +if __name__ == "__main__": + setup()