Skip to content

Add project metadata #364

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion aws_advanced_python_wrapper/database_dialect.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previously, this would try to load pyproject.toml at the current working directory. So running pytest from the project root worked but running it from inside tests/unit did not

DRIVER_NAME = PYPROJECT["tool"]["poetry"]["description"]
DRIVER_VERSION = PYPROJECT["tool"]["poetry"]["version"]
16 changes: 16 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should I add 3.12 even though we don't test it? I know boto3 supports 3.12

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can skip 3.12 for now

]

[tool.poetry.dependencies]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we have our optional/extra dependencies set up correctly for packaging, my main confusion is there are two concepts in poetry: dependency groups and extras. In the poetry docs they use dependency groups to separate out the test dependencies, but they also say extras should be used for optional dependencies that enhance a package but are not required. There's also this SO post but I'm still not sure if dependency groups or extras should be used (or both)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't use both dependency groups and extras at the same time.
I don't think what we are doing right now is wrong, it still works, but I think we can move the target driver dependencies and sqlalchemy to extras for a smoother user experience.

python = "^3.8.1"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason this is ^3.8.1 instead of ^3.8

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think there was a particular reason

Expand Down
2 changes: 1 addition & 1 deletion tests/integration/container/utils/rds_test_utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
import pytest
from botocore.config import Config

from aws_advanced_python_wrapper.driver_info import DriverInfo
from aws_advanced_python_wrapper.errors import UnsupportedOperationError
from aws_advanced_python_wrapper.utils.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
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_dialect.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.utils.driver_info import DriverInfo
from aws_advanced_python_wrapper.utils.properties import (Properties,
WrapperProperties)

Expand Down