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

Split up smithy-python #195

Merged
merged 12 commits into from
Jan 16, 2024
Merged

Split up smithy-python #195

merged 12 commits into from
Jan 16, 2024

Conversation

JordonPhillips
Copy link
Contributor

@JordonPhillips JordonPhillips commented Dec 14, 2023

This refactors smithy-python into two packages: smithy-core and smithy-http, separating concerns to bring things more in line with the split other sdks are moving towards. This allows non-http clients to exclude http features altogether. It also makes awscrt and aiohttp into optional dependencies.

Additionally, this attempts to break out async components into their own sections so that it will be more feasible to provide a sync client later on if necessary.

Another goal of this was to remove the weird _private directories we had going on.

Aside from adding in checks for the optional dependencies, the actual logic has not changed, only the locations of bits of code.

There is one bit that needs resolving in a follow-up, which is making the default http client configurable.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

This refactors smithy-python into two packages: smithy-core and
smithy-http, separating concerns to bring things more in line with
the split other sdks are moving towards. This allows non-http
clients to exclude http features altogether. It also makes awscrt
and aiohttp into optional dependencies.

Additionally, this attempts to break out async components into their
own sections so that it will be more feasible to provide a sync
client later on if necessary.

Aside from ading in checks for the optional dependencies, the actual
logic has not changed, only the locations of bits of code.
@codecov-commenter
Copy link

codecov-commenter commented Dec 22, 2023

Codecov Report

Attention: 29 lines in your changes are missing coverage. Please review.

Comparison is base (8034de6) 94.64% compared to head (a6d657b) 85.09%.
Report is 2 commits behind head on develop.

Files Patch % Lines
...ython-packages/smithy-core/smithy_core/__init__.py 83.07% 11 Missing ⚠️
...on-packages/smithy-http/smithy_http/aio/aiohttp.py 81.81% 4 Missing ⚠️
python-packages/smithy-http/smithy_http/aio/crt.py 84.00% 4 Missing ⚠️
...n-packages/smithy-core/smithy_core/aio/__init__.py 78.57% 3 Missing ⚠️
...ges/smithy-core/smithy_core/interfaces/__init__.py 89.28% 3 Missing ⚠️
...smithy-core/smithy_core/aio/interfaces/__init__.py 87.50% 1 Missing ⚠️
...smithy-core/smithy_core/aio/interfaces/identity.py 80.00% 1 Missing ⚠️
...n-packages/smithy-http/smithy_http/aio/__init__.py 96.77% 1 Missing ⚠️
...-packages/smithy-http/smithy_http/aio/endpoints.py 92.30% 1 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #195      +/-   ##
===========================================
- Coverage    94.64%   85.09%   -9.56%     
===========================================
  Files           35       37       +2     
  Lines         1682     1134     -548     
===========================================
- Hits          1592      965     -627     
- Misses          90      169      +79     
Flag Coverage Δ
unittests 85.09% <92.87%> (-9.56%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

This renames the AWS python package to be in line with the new core
packages, and updates its dependency to be on the new core package
rather than the old one.
This removes the smithy-python package, which has been replaced by
smithy-core and smithy-http
@JordonPhillips JordonPhillips marked this pull request as ready for review December 22, 2023 16:54
@JordonPhillips JordonPhillips requested a review from a team as a code owner December 22, 2023 16:54
@JordonPhillips JordonPhillips changed the title WIP: split up smithy-python Split up smithy-python Dec 27, 2023
Copy link
Contributor

@nateprewitt nateprewitt left a comment

Choose a reason for hiding this comment

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

A few small comments/questions, but otherwise looks good. Let me know what you think and we can ship it.

README.md Outdated Show resolved Hide resolved
python-packages/smithy-http/BUILD Outdated Show resolved Hide resolved
Comment on lines +1 to +2
aiohttp>=3.8.6,<3.10.0
awscrt>=0.15,<1.0
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this for pants/testing? Ideally we'd be able to just install .[aiohttp] or .[awscrt] during testing to avoid specifying these ranges twice.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes this is for pants since we had to stop sourcing deps from pyproject.toml

@JordonPhillips JordonPhillips merged commit fb671b2 into develop Jan 16, 2024
5 checks passed
@JordonPhillips JordonPhillips deleted the split-python-package branch January 16, 2024 18:19
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