Skip to content

Commit a026d9d

Browse files
committed
rm scrapy condition for sys exit
1 parent c33b83f commit a026d9d

File tree

2 files changed

+3
-23
lines changed

2 files changed

+3
-23
lines changed

docs/02_guides/code/_scrapy_project/.actor/Dockerfile

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,8 @@
1-
FROM apify/actor-python:3.12
1+
FROM apify/actor-python:3.13
22

3-
COPY pyproject.toml ./
3+
COPY requirements.txt ./
44

5-
RUN echo "Python version:" \
6-
&& python --version \
7-
&& echo "Pip version:" \
8-
&& pip --version \
9-
&& echo "Installing Poetry:" \
10-
&& pip install --no-cache-dir poetry~=1.8.0 \
11-
&& echo "Installing dependencies:" \
12-
&& poetry config virtualenvs.create false \
13-
&& poetry install --only main --no-interaction --no-ansi \
14-
&& rm -rf /tmp/.poetry-cache \
15-
&& echo "All installed Python packages:" \
5+
RUN pip install --no-cache-dir --requirement requirements.txt \
166
&& pip freeze
177

188
COPY . ./

src/apify/_actor.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,6 @@
3535
from apify.log import _configure_logging, logger
3636
from apify.storages import Dataset, KeyValueStore, RequestQueue
3737

38-
try:
39-
import scrapy # noqa: F401
40-
41-
scrapy_installed = True
42-
except ImportError:
43-
scrapy_installed = False
44-
4538
if TYPE_CHECKING:
4639
import logging
4740
from types import TracebackType
@@ -277,9 +270,6 @@ async def finalize() -> None:
277270
self.log.debug(f'Not calling sys.exit({exit_code}) because Actor is running in IPython')
278271
elif os.getenv('PYTEST_CURRENT_TEST', default=False): # noqa: PLW1508
279272
self.log.debug(f'Not calling sys.exit({exit_code}) because Actor is running in an unit test')
280-
elif scrapy_installed:
281-
self.log.debug(f'Not calling sys.exit({exit_code}) because Actor is running with Scrapy')
282-
# Otherwise, it will just freeze.
283273
else:
284274
sys.exit(exit_code)
285275

0 commit comments

Comments
 (0)