Skip to content

Commit 55a8542

Browse files
authored
feat: add new environment variables (#26)
There were several new environment variables added to Actors over time, this adds them to the constants here.
1 parent b6ee7a7 commit 55a8542

File tree

4 files changed

+25
-3
lines changed

4 files changed

+25
-3
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
11
# Changelog
22

3+
## [1.2.0](../../releases/tag/v1.2.0) - 2024-12-05
4+
5+
### Added
6+
7+
- Added new environment variables
8+
39
## [1.1.2](../../releases/tag/v1.1.2) - 2024-07-04
410

11+
### Added
12+
513
- Added constants for Actor Standby
614

715
## [1.1.1](../../releases/tag/v1.1.1) - 2024-01-08

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ Currently, there is no explicit approval process, so when you are done with the
8686

8787
Once released, manually bump the version in `pyproject.toml` ([commit example](https://github.com/apify/apify-shared-python/commit/24a269bcf046df7202a8652ee788ffe9a461e58b)).
8888

89-
## Maintanance
89+
## Maintenance
9090

9191
### Removing Support for an outdated Python version
9292

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "apify_shared"
3-
version = "1.1.2"
3+
version = "1.2.0"
44
description = "Tools and constants shared across Apify projects."
55
readme = "README.md"
66
license = { text = "Apache Software License" }

src/apify_shared/consts.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ class ActorEnvVars(str, Enum):
7070
BUILD_ID = 'ACTOR_BUILD_ID'
7171
#: BUILD_NUMBER
7272
BUILD_NUMBER = 'ACTOR_BUILD_NUMBER'
73+
#: BUILD_TAGS
74+
BUILD_TAGS = 'ACTOR_BUILD_TAGS'
7375
#: DEFAULT_DATASET_ID
7476
DEFAULT_DATASET_ID = 'ACTOR_DEFAULT_DATASET_ID'
7577
#: DEFAULT_KEY_VALUE_STORE_ID
@@ -78,18 +80,24 @@ class ActorEnvVars(str, Enum):
7880
DEFAULT_REQUEST_QUEUE_ID = 'ACTOR_DEFAULT_REQUEST_QUEUE_ID'
7981
#: EVENTS_WEBSOCKET_URL
8082
EVENTS_WEBSOCKET_URL = 'ACTOR_EVENTS_WEBSOCKET_URL'
83+
#: FULL_NAME
84+
FULL_NAME = 'ACTOR_FULL_NAME'
8185
#: ID
8286
ID = 'ACTOR_ID'
8387
#: INPUT_KEY
8488
INPUT_KEY = 'ACTOR_INPUT_KEY'
8589
#: MAX_PAID_DATASET_ITEMS
8690
MAX_PAID_DATASET_ITEMS = 'ACTOR_MAX_PAID_DATASET_ITEMS'
91+
#: MAX_TOTAL_CHARGE_USD
92+
MAX_TOTAL_CHARGE_USD = 'ACTOR_MAX_TOTAL_CHARGE_USD'
8793
#: MEMORY_MBYTES
8894
MEMORY_MBYTES = 'ACTOR_MEMORY_MBYTES'
8995
#: RUN_ID
9096
RUN_ID = 'ACTOR_RUN_ID'
9197
#: STANDBY_PORT
9298
STANDBY_PORT = 'ACTOR_STANDBY_PORT'
99+
#: STANDBY_URL
100+
STANDBY_URL = 'ACTOR_STANDBY_URL'
93101
#: STARTED_AT
94102
STARTED_AT = 'ACTOR_STARTED_AT'
95103
#: TASK_ID
@@ -285,7 +293,10 @@ class MetaOrigin(str, Enum):
285293

286294
INTEGER_ENV_VARS: list[INTEGER_ENV_VARS_TYPE] = list(get_args(INTEGER_ENV_VARS_TYPE))
287295

288-
FLOAT_ENV_VARS_TYPE = Literal[ApifyEnvVars.MAX_USED_CPU_RATIO,]
296+
FLOAT_ENV_VARS_TYPE = Literal[
297+
ActorEnvVars.MAX_TOTAL_CHARGE_USD,
298+
ApifyEnvVars.MAX_USED_CPU_RATIO,
299+
]
289300

290301
FLOAT_ENV_VARS: list[FLOAT_ENV_VARS_TYPE] = list(get_args(FLOAT_ENV_VARS_TYPE))
291302

@@ -316,13 +327,16 @@ class MetaOrigin(str, Enum):
316327
# Actor env vars
317328
ActorEnvVars.BUILD_ID,
318329
ActorEnvVars.BUILD_NUMBER,
330+
ActorEnvVars.BUILD_TAGS,
319331
ActorEnvVars.DEFAULT_DATASET_ID,
320332
ActorEnvVars.DEFAULT_KEY_VALUE_STORE_ID,
321333
ActorEnvVars.DEFAULT_REQUEST_QUEUE_ID,
322334
ActorEnvVars.EVENTS_WEBSOCKET_URL,
335+
ActorEnvVars.FULL_NAME,
323336
ActorEnvVars.ID,
324337
ActorEnvVars.INPUT_KEY,
325338
ActorEnvVars.RUN_ID,
339+
ActorEnvVars.STANDBY_URL,
326340
ActorEnvVars.TASK_ID,
327341
ActorEnvVars.WEB_SERVER_URL,
328342
# Apify env vars

0 commit comments

Comments
 (0)