Skip to content

Commit 466e572

Browse files
author
EliuX
committed
fix: Refactor time_tracker_events for deployment #101
1 parent 6d887ea commit 466e572

File tree

15 files changed

+23
-13
lines changed

15 files changed

+23
-13
lines changed

.DS_Store

-6 KB
Binary file not shown.

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,10 @@ automatically [pip](https://pip.pypa.io/en/stable/) as well.
4646
* `prod`: For anything deployed
4747
4848
49-
Remember to do it with Python 3.
49+
Remember to do it with Python 3.
50+
51+
Bear in mind that the requirements for `time_tracker_events`, must be located on its local requirements.txt, by
52+
[convention](https://docs.microsoft.com/en-us/azure/azure-functions/functions-reference-python#folder-structure).
5053
5154
- Run `pre-commit install`. For more details, check out Development > Git hooks.
5255
@@ -134,6 +137,9 @@ following notes regarding to the manipulation of the data from and towards the A
134137
- The [recommended](https://docs.microsoft.com/en-us/azure/cosmos-db/working-with-dates#storing-datetimes) format for
135138
DateTime strings in Azure Cosmos DB is `YYYY-MM-DDThh:mm:ss.fffffffZ` which follows the ISO 8601 **UTC standard**.
136139

140+
The Azure function project `time_tracker_events` also have some constraints to have into account. It is recommended that
141+
you read the [Azure Functions Python developer guide](https://docs.microsoft.com/en-us/azure/azure-functions/functions-reference-python#folder-structure).
142+
137143
## Development
138144

139145
### Git hooks
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# requirements/time_tracker_events/prod.txt
22

3-
# Azure Functions library
4-
azure-functions
5-
3+
# Include the requirements of that folder, required there by convention
4+
-r ../../time_tracker_events/requirements.txt

tests/time_tracker_events/shared_code/__init__.py

Whitespace-only changes.

tests/time_tracker_events/test_handle_events_trigger.py renamed to tests/time_tracker_events/shared_code/test_handle_events_trigger.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import azure.functions as func
22
from faker import Faker
33

4-
from time_tracker_events.handle_events_trigger import main as main_handler
4+
from time_tracker_events.shared_code.handle_events_trigger import main as main_handler
55

66
fake = Faker()
77

time_tracker_events/.funcignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
1+
run.sh
2+
.vscode

time_tracker_events/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,4 @@ venv.bak/
4040
# Byte-compiled / optimized / DLL files
4141
__pycache__/
4242
*.py[cod]
43-
*$py.class
43+
*$py.class
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
from ..handle_events_trigger import main as handler
1+
from time_tracker_events.shared_code.handle_events_trigger import main as handler
22

33
main = handler
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
from ..handle_events_trigger import main as handler
1+
from time_tracker_events.shared_code.handle_events_trigger import main as handler
22

33
main = handler
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
from ..handle_events_trigger import main as handler
1+
from time_tracker_events.shared_code.handle_events_trigger import main as handler
22

33
main = handler

0 commit comments

Comments
 (0)