Skip to content

Commit e470a3b

Browse files
author
Shriyansh Agnihotri
authored
Losing some weight, reducing docker container size, removing unwanted packages from pyproject (#9)
### Summary 📝 Losing some weight, reducing docker container size, removing unwanted packages from pyproject ### Details 1. Remove uvloop and other packages. 2. reduce docker container size. 3. fixing non CI test, targetted to SF.
1 parent 7a2d08d commit e470a3b

File tree

11 files changed

+482
-577
lines changed

11 files changed

+482
-577
lines changed

.dockerignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,9 @@ test_output.xml
4747
*.py,cover
4848
.hypothesis/
4949
.pytest_cache/
50+
.github/
51+
opt
52+
**/run_data
53+
**/statics
54+
.mypy_cache
55+
.git

.github/workflows/main-push.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
curl -sSL ${{ env.POETRY_URL }} | python - --version ${{ env.POETRY_VERSION }}
4646
echo "$HOME/.local/bin" >> $GITHUB_PATH
4747
- name: Install project
48-
run: make install
48+
run: make install-extra
4949
- name: Run linter
5050
run: make lint
5151
# - name: Run tests

.github/workflows/main-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
curl -sSL ${{ env.POETRY_URL }} | python - --version ${{ env.POETRY_VERSION }}
4242
echo "$HOME/.local/bin" >> $GITHUB_PATH
4343
- name: Install project
44-
run: make install
44+
run: make install-extra
4545
- name: Run linter
4646
run: make lint
4747
- name: Run tests

.github/workflows/non-main-push.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,6 @@ jobs:
5353
curl -sSL ${{ env.POETRY_URL }} | python - --version ${{ env.POETRY_VERSION }}
5454
echo "$HOME/.local/bin" >> $GITHUB_PATH
5555
- name: Install project
56-
run: make install
56+
run: make install-extra
5757
- name: Run linter
5858
run: make lint

.github/workflows/non-main-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
curl -sSL ${{ env.POETRY_URL }} | python - --version ${{ env.POETRY_VERSION }}
5050
echo "$HOME/.local/bin" >> $GITHUB_PATH
5151
- name: Install project
52-
run: make install
52+
run: make install-extra
5353
- name: Run linter
5454
run: make lint
5555
- name: Run tests

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
curl -sSL ${{ env.POETRY_URL }} | python - --version ${{ env.POETRY_VERSION }}
5959
echo "$HOME/.local/bin" >> $GITHUB_PATH
6060
- name: Install project
61-
run: make install
61+
run: make install-extra
6262
- name: Build and publish to PyPI
6363
env:
6464
TWINE_USERNAME: __token__

Dockerfile

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,22 @@
11
# Use an official Python 3.11 image based on Ubuntu
22
FROM python:3.11-slim
33

4-
# Install Playwright and dependencies
5-
RUN pip install -U playwright && \
6-
playwright install --with-deps
4+
# # Install Playwright and dependencies
5+
# RUN pip install -U playwright && \
6+
# playwright install --with-deps
77

88
# Set the working directory in the container
99
WORKDIR /testzeus-hercules
1010

1111
# Copy only the necessary files for installation
1212
COPY pyproject.toml poetry.lock /testzeus-hercules/
13-
COPY .cache /testzeus-hercules/
1413

1514
# Install Poetry
1615
RUN pip install poetry
1716

1817
# Install dependencies and the package
1918
RUN poetry install --no-dev
20-
RUN poetry run playwright install
19+
RUN poetry run playwright install --with-deps
2120

2221
# Copy the rest of the project files
2322
COPY . /testzeus-hercules

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,13 @@ show: ## Show the current environment.
1515
@echo "Current environment:"
1616
poetry env info && exit
1717

18+
.PHONY: install-extra
19+
install-extra: ## Install the project in dev mode.
20+
poetry install --all-extras && exit && poetry run playwright install --with-deps
21+
1822
.PHONY: install
1923
install: ## Install the project in dev mode.
20-
poetry install --all-extras && exit && poetry run playwright install --with-deps
24+
poetry install && exit && poetry run playwright install --with-deps
2125

2226
.PHONY: fmt
2327
fmt: ## Format code using black & isort.

poetry.lock

Lines changed: 460 additions & 560 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,14 @@ pyparsing = "^3.1.2"
7474
pypdfium2 = "^4.30.0"
7575
python-dotenv = "^1.0.0"
7676
python-json-logger = "^2.0.7"
77-
python-multipart = "^0.0.9"
77+
python-multipart = "^0.0.18"
7878
pyyaml = "^6.0.1"
7979
regex = "^2023.12.25"
8080
requests = "^2.31.0"
8181
rich = "^13.7.1"
8282
rsa = "^4.9"
8383
shellingham = "^1.5.4"
8484
sniffio = "^1.3.1"
85-
starlette = "^0.40.0"
8685
tabulate = "^0.9.0"
8786
termcolor = "^2.4.0"
8887
tiktoken = "^0.6.0"
@@ -91,8 +90,6 @@ tqdm = "^4.66.2"
9190
typer = "^0.12.3"
9291
uritemplate = "^4.1.1"
9392
urllib3 = "^2.2.3"
94-
uvicorn = "^0.30.3"
95-
uvloop = "^0.21.0"
9693
watchfiles = "^0.24.0"
9794
websockets = "^13.1"
9895
typing-extensions = "^4.12.2"
@@ -109,7 +106,6 @@ sentry-sdk = "^2.18.0"
109106
setuptools = "^75.3.0"
110107
wheel = "^0.44.0"
111108
playwright-recaptcha = "^0.5.1"
112-
twine = "^5.1.1"
113109
junit2html = "^31.0.2"
114110
anthropic = "^0.39.0"
115111
pandas = "^2.2.3"

0 commit comments

Comments
 (0)