Skip to content

Commit

Permalink
refactor!: remove unused config properties (#978)
Browse files Browse the repository at this point in the history
Relates: #906
  • Loading branch information
vdusek authored Feb 12, 2025
1 parent 207c983 commit 4b7fe29
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 28 deletions.
8 changes: 8 additions & 0 deletions docs/upgrading/upgrading_to_v0x.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ title: Upgrading to v0.x

This page summarizes the breaking changes between Crawlee for Python zero-based versions.

## Upgrading to v0.6

This section summarizes the breaking changes between v0.5.x and v0.6.0.

### Configuration

The `Configuration` fields `chrome_executable_path`, `xvfb`, and `verbose_log` have been removed. The `chrome_executable_path` and `xvfb` fields were unused, while `verbose_log` can be replaced by setting `log_level` to `DEBUG`.

## Upgrading to v0.5

This section summarizes the breaking changes between v0.4.x and v0.5.0.
Expand Down
4 changes: 1 addition & 3 deletions src/crawlee/_log_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@
def get_configured_log_level() -> int:
config = service_locator.get_configuration()

verbose_logging_requested = 'verbose_log' in config.model_fields_set and config.verbose_log

if 'log_level' in config.model_fields_set:
if config.log_level == 'DEBUG':
return logging.DEBUG
Expand All @@ -53,7 +51,7 @@ def get_configured_log_level() -> int:

assert_never(config.log_level)

if sys.flags.dev_mode or verbose_logging_requested:
if sys.flags.dev_mode:
return logging.DEBUG

return logging.INFO
Expand Down
25 changes: 0 additions & 25 deletions src/crawlee/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ class Configuration(BaseSettings):
internal_timeout: Annotated[timedelta | None, Field(alias='crawlee_internal_timeout')] = None
"""Timeout for the internal asynchronous operations."""

verbose_log: Annotated[bool, Field(alias='crawlee_verbose_log')] = False
"""Whether to enable verbose logging."""

default_browser_path: Annotated[
str | None,
Field(
Expand Down Expand Up @@ -244,17 +241,6 @@ class Configuration(BaseSettings):
] = './storage'
"""The path to the storage directory. This option is utilized by the `MemoryStorageClient`."""

chrome_executable_path: Annotated[
str | None,
Field(
validation_alias=AliasChoices(
'apify_chrome_executable_path',
'crawlee_chrome_executable_path',
)
),
] = None
"""This setting is currently unused."""

headless: Annotated[
bool,
Field(
Expand All @@ -270,17 +256,6 @@ class Configuration(BaseSettings):
https://playwright.dev/docs/api/class-browsertype#browser-type-launch.
"""

xvfb: Annotated[
bool,
Field(
validation_alias=AliasChoices(
'apify_xvfb',
'crawlee_xvfb',
)
),
] = False
"""This setting is currently unused."""

@classmethod
def get_global_configuration(cls) -> Self:
"""Retrieve the global instance of the configuration.
Expand Down

0 comments on commit 4b7fe29

Please sign in to comment.