Skip to content
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

Add project metadata #364

Merged
merged 3 commits into from
Jan 9, 2024
Merged

Add project metadata #364

merged 3 commits into from
Jan 9, 2024

Conversation

congoamz
Copy link
Contributor

@congoamz congoamz commented Jan 5, 2024

  • add project metadata to pyproject.toml
  • driver name/version can be loaded programmatically regardless of where in the file tree the program is being run

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.


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

"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
]

[tool.poetry.dependencies]
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

"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

"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
]

[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.

@congoamz congoamz merged commit d10f331 into main Jan 9, 2024
7 checks passed
@congoamz congoamz deleted the metadata branch January 9, 2024 00:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants