-
Notifications
You must be signed in to change notification settings - Fork 2
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
🐛 Fix C Extension Packaging #253
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0f665a3
to
4942915
Compare
4942915
to
f67f974
Compare
A `setup.py` file is needed for `poetry build` to include compiled libaries in the final wheel.
57fb33b
to
329cceb
Compare
C extension compilation pops off the initial stack frame. Thresholding indexing to prevent `IndexError`s (this should work for both C extensions and pure Python packages).
Errors due to `structlog_sentry` dependency. `TypeError` example: ``` Run echo "Default output (JSON)" echo "Default output (JSON)" python ./docs_src/pure_structlog_logging_without_sentry.py echo "dev-local output (formatted)" export CI_ENVIRONMENT_SLUG=dev-local python ./docs_src/pure_structlog_logging_without_sentry.py shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0} env: pythonLocation: /opt/hostedtoolcache/Python/3.7.11/x64 LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.7.11/x64/lib Default output (JSON) Traceback (most recent call last): File "./docs_src/pure_structlog_logging_without_sentry.py", line 3, in <module> LOGGER = structlog_sentry_logger.get_logger() File "structlog_sentry_logger/_config.py", line 80, in get_logger set_structlog_config(timestamper) File "structlog_sentry_logger/_config.py", line 204, in set_structlog_config SentryBreadcrumbJsonProcessor(level=logging.ERROR, tag_keys="__all__"), File "structlog_sentry_logger/_config.py", line 406, in __init__ super().__init__( File "structlog_sentry_logger/_config.py", line 352, in __init__ super().__init__(*args, **kwargs) TypeError: int object expected; got tuple[ Error: Process completed with exit code 1. ``` `SystemError` example: ``` Run echo "Default output (JSON)" Default output (JSON) Traceback (most recent call last): File "/home/runner/work/structlog-sentry-logger/structlog-sentry-logger/./docs_src/pure_structlog_logging_without_sentry.py", line 3, in <module> LOGGER = structlog_sentry_logger.get_logger() File "structlog_sentry_logger/_config.py", line 77, in get_logger set_structlog_config(timestamper) File "structlog_sentry_logger/_config.py", line 201, in set_structlog_config SentryBreadcrumbJsonProcessor(level=logging.ERROR, tag_keys="__all__"), File "structlog_sentry_logger/_config.py", line 242, in __init__ super().__init__( File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/structlog_sentry/__init__.py", line 132, in __init__ super().__init__(*args, **kwargs) File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/structlog_sentry/__init__.py", line 33, in __init__ self.level = level SystemError: Objects/dictobject.c:bug: bad argument to internal function Error: Process completed with exit code 1. ```
Since these tests use monkeypatching, they are unable to modify the underlying C-compiled Python modules, rendering their output spurious outside the context of pure Python library testing.
Excluding tests only valid in a pure Python context.
`.so`/`.pyd` files get included in project sdist package installations intended to be pure Python packages (in other words, `.so`/`.pyd` files are executed instead of the corresponding Python modules) which incidentally causes `test_invalid_git_repository()` to fail.
d3f84a0
to
b972627
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
C extensions (i.e.,
.so
shared library files) were not previously being included in wheel package distributions.