Skip to content

Commit 4c43747

Browse files
Use python-core (#271)
* python-core: migrate trigger utils
1 parent 7ecfc44 commit 4c43747

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+335
-2562
lines changed

.pre-commit-config.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,9 @@ repos:
3434
hooks:
3535
- id: detect-secrets
3636
args: ['--baseline', '.secrets.baseline']
37+
38+
- repo: https://github.com/pycqa/isort
39+
rev: 5.11.5
40+
hooks:
41+
- id: isort
42+
args: ["--profile", "black"]

.secrets.baseline

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -131,51 +131,35 @@
131131
"filename": "src/test/unit/event/test_event_dumper.py",
132132
"hashed_secret": "885bb9903f72e004ff2974807b70e7c970d3e6d5",
133133
"is_verified": false,
134-
"line_number": 206
134+
"line_number": 207
135135
},
136136
{
137137
"type": "Base64 High Entropy String",
138138
"filename": "src/test/unit/event/test_event_dumper.py",
139139
"hashed_secret": "0c47032b03ad0916df339b9c21b194ad8b2ed7b1",
140140
"is_verified": false,
141-
"line_number": 208
141+
"line_number": 209
142142
},
143143
{
144144
"type": "Hex High Entropy String",
145145
"filename": "src/test/unit/event/test_event_dumper.py",
146146
"hashed_secret": "5e55d44082c01c474ac9d6101d9f88c0a66ae558",
147147
"is_verified": false,
148-
"line_number": 372
148+
"line_number": 373
149149
},
150150
{
151151
"type": "Hex High Entropy String",
152152
"filename": "src/test/unit/event/test_event_dumper.py",
153153
"hashed_secret": "0615ba62fbaec0ee83b8a181ff49afc60cb043f5",
154154
"is_verified": false,
155-
"line_number": 556
155+
"line_number": 557
156156
},
157157
{
158158
"type": "Hex High Entropy String",
159159
"filename": "src/test/unit/event/test_event_dumper.py",
160160
"hashed_secret": "5bbac409dd4ddefe2ffc72ce9fc42932d8a238c1",
161161
"is_verified": false,
162-
"line_number": 557
163-
}
164-
],
165-
"src/test/unit/event/test_event_trigger.py": [
166-
{
167-
"type": "Base64 High Entropy String",
168-
"filename": "src/test/unit/event/test_event_trigger.py",
169-
"hashed_secret": "885bb9903f72e004ff2974807b70e7c970d3e6d5",
170-
"is_verified": false,
171-
"line_number": 613
172-
},
173-
{
174-
"type": "Hex High Entropy String",
175-
"filename": "src/test/unit/event/test_event_trigger.py",
176-
"hashed_secret": "3fae06dc55a618caed1d794dcd512bfe7e76c9f1",
177-
"is_verified": false,
178-
"line_number": 658
162+
"line_number": 558
179163
}
180164
],
181165
"src/test/unit/test_lumigo_utils.py": [
@@ -220,5 +204,5 @@
220204
}
221205
]
222206
},
223-
"generated_at": "2023-01-29T12:29:33Z"
207+
"generated_at": "2023-02-19T16:59:36Z"
224208
}

requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ pytest==5.2.0
33
mock
44
boto3
55
pytest-cov==2.6.1
6-
capturer==2.4
76
attrs==19.1.0
87
requests==2.28.1
98
pymongo==3.11.0

scripts/prepare_layer_files.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ python setup.py bdist_wheel
55
rm -rf python && mkdir python
66
cp -R src/lumigo_tracer.egg-info python/
77
cp -R src/lumigo_tracer python/
8+
python -m pip install -r src/lumigo_tracer.egg-info/requires.txt
9+
cp -R "$(python -c "import lumigo_core; print(lumigo_core.__path__[0])")"* python/

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
url="https://github.com/lumigo-io/python_tracer.git",
1515
package_dir={"": "src"},
1616
packages=setuptools.find_packages("src"),
17-
install_requires=[],
17+
install_requires=["lumigo_core==0.0.4"],
1818
license="Apache License 2.0",
1919
classifiers=["Programming Language :: Python :: 3", "Operating System :: OS Independent"],
2020
long_description=open("README.md").read(),

src/lumigo_tracer/__init__.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
from lumigo_tracer.lambda_tracer.tracer import lumigo_tracer, LumigoChalice # noqa
1+
from lumigo_tracer.lambda_tracer.tracer import LumigoChalice, lumigo_tracer # noqa
2+
3+
from .auto_instrument_handler import _handler # noqa
4+
from .lambda_tracer.global_scope_exec import global_scope_exec
25
from .user_utils import ( # noqa
3-
report_error,
46
add_execution_tag,
7+
error,
8+
info,
9+
report_error,
510
start_manual_trace,
611
stop_manual_trace,
7-
info,
812
warn,
9-
error,
1013
)
11-
from .auto_instrument_handler import _handler # noqa
12-
from .lambda_tracer.global_scope_exec import global_scope_exec
1314

1415
global_scope_exec()

src/lumigo_tracer/auto_tag/auto_tag_event.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
from abc import ABC, abstractmethod
21
import os
2+
from abc import ABC, abstractmethod
33
from typing import Dict, List, Optional
44

5+
from lumigo_core.logger import get_logger
6+
from lumigo_core.parsing_utils import safe_get, str_to_list
7+
8+
from lumigo_tracer.lumigo_utils import Configuration, is_api_gw_event, warn_client
59
from lumigo_tracer.user_utils import add_execution_tag
6-
from lumigo_tracer.parsing_utils import str_to_list, safe_get
7-
from lumigo_tracer.lumigo_utils import get_logger, is_api_gw_event, Configuration, warn_client
810

911
AUTO_TAG_API_GW_HEADERS: Optional[List[str]] = (
1012
str_to_list(os.environ.get("LUMIGO_AUTO_TAG_API_GW_HEADERS", "")) or []
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import lumigo_tracer.event.trigger_parsing # noqa: F401

src/lumigo_tracer/event/event_dumper.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@
44
from collections import OrderedDict
55
from typing import Dict, List, Optional
66

7-
from lumigo_tracer.parsing_utils import str_to_list, safe_get
7+
from lumigo_core.logger import get_logger
8+
from lumigo_core.parsing_utils import safe_get, str_to_list
9+
810
from lumigo_tracer.lumigo_utils import (
9-
get_logger,
11+
Configuration,
12+
aws_dump,
1013
is_api_gw_event,
1114
lumigo_dumps,
12-
Configuration,
1315
should_use_tracer_extension,
14-
aws_dump,
1516
)
1617

1718
EVENT_MAX_SIZE = 6 * 1024 * 1024

src/lumigo_tracer/event/event_trigger.py

Lines changed: 0 additions & 42 deletions
This file was deleted.

0 commit comments

Comments
 (0)