From 7f7625dacf6a194a9871c4c2a7f41f018b5b4bdc Mon Sep 17 00:00:00 2001 From: Aaron Congo Date: Thu, 4 Jan 2024 11:29:05 -0800 Subject: [PATCH 1/3] wip --- setup.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 setup.py diff --git a/setup.py b/setup.py new file mode 100644 index 00000000..9865ac81 --- /dev/null +++ b/setup.py @@ -0,0 +1,14 @@ +from distutils.core import setup + +setup( + name='aws-advanced-python-wrapper', + version='1.0.0', + packages=['tests', 'tests.unit', 'tests.unit.utils', 'tests.integration', 'tests.integration.container', + 'tests.integration.container.utils', 'tests.integration.container.scripts', 'benchmarks', + 'aws_advanced_python_wrapper', 'aws_advanced_python_wrapper.utils'], + url='https://github.com/awslabs/aws-advanced-python-wrapper', + license='Apache License 2.0', + author='Amazon Web Services', + author_email='', + description='Amazon Web Services (AWS) Advanced Python Wrapper' +) From cfb050be11080114c8ea9a27a580b9a13a31aa8b Mon Sep 17 00:00:00 2001 From: Aaron Congo Date: Thu, 4 Jan 2024 16:26:42 -0800 Subject: [PATCH 2/3] Add project metadata --- aws_advanced_python_wrapper/database_dialect.py | 2 +- .../{utils => }/driver_info.py | 10 ++++++++-- pyproject.toml | 16 ++++++++++++++++ setup.py | 14 -------------- .../container/utils/rds_test_utility.py | 2 +- tests/unit/test_dialect.py | 2 +- 6 files changed, 27 insertions(+), 19 deletions(-) rename aws_advanced_python_wrapper/{utils => }/driver_info.py (70%) delete mode 100644 setup.py diff --git a/aws_advanced_python_wrapper/database_dialect.py b/aws_advanced_python_wrapper/database_dialect.py index f04b197b..4d997e7d 100644 --- a/aws_advanced_python_wrapper/database_dialect.py +++ b/aws_advanced_python_wrapper/database_dialect.py @@ -17,7 +17,7 @@ from typing import (TYPE_CHECKING, Callable, ClassVar, Dict, Optional, Protocol, Tuple, runtime_checkable) -from .utils.driver_info import DriverInfo +from aws_advanced_python_wrapper.driver_info import DriverInfo if TYPE_CHECKING: from aws_advanced_python_wrapper.pep249 import Connection diff --git a/aws_advanced_python_wrapper/utils/driver_info.py b/aws_advanced_python_wrapper/driver_info.py similarity index 70% rename from aws_advanced_python_wrapper/utils/driver_info.py rename to aws_advanced_python_wrapper/driver_info.py index b751bb4d..c6c7c77e 100644 --- a/aws_advanced_python_wrapper/utils/driver_info.py +++ b/aws_advanced_python_wrapper/driver_info.py @@ -12,9 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. +import os +from pathlib import Path + import toml +PROJECT_DIR = Path(__file__).parent.parent +PYPROJECT = toml.load(os.path.join(PROJECT_DIR, "pyproject.toml")) + class DriverInfo: - DRIVER_NAME = "Amazon Web Services (AWS) Advanced Python Wrapper" - DRIVER_VERSION = toml.load("pyproject.toml")["tool"]["poetry"]["version"] + DRIVER_NAME = PYPROJECT["tool"]["poetry"]["description"] + DRIVER_VERSION = PYPROJECT["tool"]["poetry"]["version"] diff --git a/pyproject.toml b/pyproject.toml index b91b47b2..f231a3c9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,6 +5,22 @@ description = "Amazon Web Services (AWS) Advanced Python Wrapper" authors = ["Amazon Web Services"] readme = "README.md" license = "Apache-2.0" +include = ["CONTRIBUTING.md"] +repository = "https://github.com/awslabs/aws-advanced-python-wrapper" +documentation = "https://github.com/awslabs/aws-advanced-python-wrapper/docs/" +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", + "Natural Language :: English", + "License :: OSI Approved :: Apache Software License", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", +] [tool.poetry.dependencies] python = "^3.8.1" diff --git a/setup.py b/setup.py deleted file mode 100644 index 9865ac81..00000000 --- a/setup.py +++ /dev/null @@ -1,14 +0,0 @@ -from distutils.core import setup - -setup( - name='aws-advanced-python-wrapper', - version='1.0.0', - packages=['tests', 'tests.unit', 'tests.unit.utils', 'tests.integration', 'tests.integration.container', - 'tests.integration.container.utils', 'tests.integration.container.scripts', 'benchmarks', - 'aws_advanced_python_wrapper', 'aws_advanced_python_wrapper.utils'], - url='https://github.com/awslabs/aws-advanced-python-wrapper', - license='Apache License 2.0', - author='Amazon Web Services', - author_email='', - description='Amazon Web Services (AWS) Advanced Python Wrapper' -) diff --git a/tests/integration/container/utils/rds_test_utility.py b/tests/integration/container/utils/rds_test_utility.py index fd7de040..9c62cd87 100644 --- a/tests/integration/container/utils/rds_test_utility.py +++ b/tests/integration/container/utils/rds_test_utility.py @@ -31,7 +31,7 @@ from botocore.config import Config from aws_advanced_python_wrapper.errors import UnsupportedOperationError -from aws_advanced_python_wrapper.utils.driver_info import DriverInfo +from aws_advanced_python_wrapper.driver_info import DriverInfo from aws_advanced_python_wrapper.utils.log import Logger from aws_advanced_python_wrapper.utils.messages import Messages from .database_engine import DatabaseEngine diff --git a/tests/unit/test_dialect.py b/tests/unit/test_dialect.py index a2555471..d8d33eee 100644 --- a/tests/unit/test_dialect.py +++ b/tests/unit/test_dialect.py @@ -23,7 +23,7 @@ RdsMysqlDialect, RdsPgDialect, TargetDriverType, UnknownDatabaseDialect) from aws_advanced_python_wrapper.errors import AwsWrapperError from aws_advanced_python_wrapper.hostinfo import HostInfo -from aws_advanced_python_wrapper.utils.driver_info import DriverInfo +from aws_advanced_python_wrapper.driver_info import DriverInfo from aws_advanced_python_wrapper.utils.properties import (Properties, WrapperProperties) From cb7808cd47a4935959c7399418d9372fa44afd60 Mon Sep 17 00:00:00 2001 From: Aaron Congo Date: Fri, 5 Jan 2024 09:31:29 -0800 Subject: [PATCH 3/3] Fix build errors --- tests/integration/container/utils/rds_test_utility.py | 2 +- tests/unit/test_dialect.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/integration/container/utils/rds_test_utility.py b/tests/integration/container/utils/rds_test_utility.py index 9c62cd87..ba166b57 100644 --- a/tests/integration/container/utils/rds_test_utility.py +++ b/tests/integration/container/utils/rds_test_utility.py @@ -30,8 +30,8 @@ import pytest from botocore.config import Config -from aws_advanced_python_wrapper.errors import UnsupportedOperationError from aws_advanced_python_wrapper.driver_info import DriverInfo +from aws_advanced_python_wrapper.errors import UnsupportedOperationError from aws_advanced_python_wrapper.utils.log import Logger from aws_advanced_python_wrapper.utils.messages import Messages from .database_engine import DatabaseEngine diff --git a/tests/unit/test_dialect.py b/tests/unit/test_dialect.py index d8d33eee..4830f291 100644 --- a/tests/unit/test_dialect.py +++ b/tests/unit/test_dialect.py @@ -21,9 +21,9 @@ AuroraMysqlDialect, AuroraPgDialect, DatabaseDialectManager, DialectCode, MultiAzMysqlDialect, MysqlDatabaseDialect, PgDatabaseDialect, RdsMysqlDialect, RdsPgDialect, TargetDriverType, UnknownDatabaseDialect) +from aws_advanced_python_wrapper.driver_info import DriverInfo from aws_advanced_python_wrapper.errors import AwsWrapperError from aws_advanced_python_wrapper.hostinfo import HostInfo -from aws_advanced_python_wrapper.driver_info import DriverInfo from aws_advanced_python_wrapper.utils.properties import (Properties, WrapperProperties)