Skip to content

Commit 510dfb7

Browse files
committed
uv for dependency management 💜
1 parent 6f47d12 commit 510dfb7

8 files changed

+893
-140
lines changed

Diff for: ‎.python-version

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.13

Diff for: ‎Dockerfile

+7-23
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,21 @@
11
FROM quay.io/keboola/docker-custom-python:latest
2-
ENV PYTHONIOENCODING utf-8
32

3+
# install gcc to be able to build packages - e.g. required by regex, dateparser, also required for pandas
4+
# RUN apt-get update && apt-get install -y build-essential
45

6+
RUN pip install uv
57

6-
# Create directory for user packages
7-
# This directory is usually created automatically by pip
8-
# ... but if it doesn't exist when you run the script
9-
# ... then the modules installed during the transformation are not loaded automatically!
10-
# ... because the loader thinks that this directory does not exist (it did not exist at the start of the script)
11-
# Eg. mkdir -p /var/www/.local/lib/python3.8/site-packages
12-
RUN . "$VIRTUAL_ENV/bin/activate" && mkdir -p $(su www-data -s /bin/bash -c "python -c 'import site; print(site.USER_SITE)'")
8+
COPY requirements.txt /code/requirements.txt
9+
COPY requirements-tests.txt /code/requirements-tests.txt
1310

14-
# Make home directory writable
15-
RUN chown -R www-data:www-data /var/www
11+
RUN uv pip sync --system /code/requirements.txt /code/requirements-tests.txt
1612

1713
COPY /src /code/src/
1814
COPY /tests /code/tests/
1915
COPY /scripts /code/scripts/
20-
COPY requirements.txt /code/requirements.txt
21-
COPY requirements-tests.txt /code/requirements-tests.txt
2216
COPY flake8.cfg /code/flake8.cfg
2317
COPY deploy.sh /code/deploy.sh
2418

25-
# install gcc to be able to build packages - e.g. required by regex, dateparser, also required for pandas
26-
RUN apt-get update && apt-get install -y build-essential
27-
28-
RUN . "$VIRTUAL_ENV/bin/activate" && pip freeze
29-
30-
RUN . "$VIRTUAL_ENV/bin/activate" && pip install -r /code/requirements-tests.txt
31-
32-
RUN . "$VIRTUAL_ENV/bin/activate" && pip install -r /code/requirements.txt
33-
3419
WORKDIR /code/
3520

36-
RUN . "$VIRTUAL_ENV/bin/activate" && pip freeze
37-
CMD . "$VIRTUAL_ENV/bin/activate" && python -u /code/src/component.py
21+
CMD uv run /code/src/component.py

Diff for: ‎bitbucket-pipelines.yml

-71
This file was deleted.

Diff for: ‎pyproject.toml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[project]
2+
name = "custom-python"
3+
version = "0.1.0"
4+
description = "Add your description here"
5+
readme = "README.md"
6+
requires-python = ">=3.13"
7+
dependencies = [
8+
"dlt>=1.6.1",
9+
"duckdb>=1.2.0",
10+
"keboola-component>=1.6.10",
11+
]
12+
13+
[dependency-groups]
14+
dev = [
15+
"flake8>=7.1.1",
16+
"freezegun>=1.5.1",
17+
"mock>=5.1.0",
18+
]

Diff for: ‎requirements-tests.txt

+18-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,18 @@
1-
flake8
2-
mock
3-
freezegun
4-
1+
# This file was autogenerated by uv via the following command:
2+
# uv pip compile requirements-tests.in --universal -o requirements-tests.txt
3+
flake8==7.1.1
4+
# via -r requirements-tests.in
5+
freezegun==1.5.1
6+
# via -r requirements-tests.in
7+
mccabe==0.7.0
8+
# via flake8
9+
mock==5.1.0
10+
# via -r requirements-tests.in
11+
pycodestyle==2.12.1
12+
# via flake8
13+
pyflakes==3.2.0
14+
# via flake8
15+
python-dateutil==2.9.0.post0
16+
# via freezegun
17+
six==1.17.0
18+
# via python-dateutil

Diff for: ‎requirements.txt

+102-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,102 @@
1-
git+https://github.com/keboola/python-component.git@fix/table-metadata-schema-support
2-
airbyte==0.15.0
3-
dlt==0.5.1
4-
duckdb==1.0.0
5-
mock
6-
freezegun
1+
# This file was autogenerated by uv via the following command:
2+
# uv pip compile pyproject.toml -o requirements.txt
3+
certifi==2025.1.31
4+
# via requests
5+
cffi==1.17.1
6+
# via dlt-pendulum
7+
charset-normalizer==3.4.1
8+
# via requests
9+
click==8.1.8
10+
# via dlt
11+
deprecated==1.2.18
12+
# via keboola-component
13+
dlt==1.6.1
14+
# via custom-python (pyproject.toml)
15+
dlt-pendulum==3.0.2
16+
# via dlt
17+
duckdb==1.2.0
18+
# via custom-python (pyproject.toml)
19+
fsspec==2025.2.0
20+
# via dlt
21+
gitdb==4.0.12
22+
# via gitpython
23+
gitpython==3.1.44
24+
# via dlt
25+
giturlparse==0.12.0
26+
# via dlt
27+
hexbytes==1.3.0
28+
# via dlt
29+
humanize==4.11.0
30+
# via dlt
31+
idna==3.10
32+
# via requests
33+
jsonpath-ng==1.7.0
34+
# via dlt
35+
keboola-component==1.6.10
36+
# via custom-python (pyproject.toml)
37+
makefun==1.15.6
38+
# via dlt
39+
markdown-it-py==3.0.0
40+
# via rich
41+
mdurl==0.1.2
42+
# via markdown-it-py
43+
orjson==3.10.15
44+
# via dlt
45+
packaging==24.2
46+
# via
47+
# dlt
48+
# requirements-parser
49+
pathvalidate==3.2.3
50+
# via dlt
51+
pluggy==1.5.0
52+
# via dlt
53+
ply==3.11
54+
# via jsonpath-ng
55+
pycparser==2.22
56+
# via cffi
57+
pygelf==0.4.2
58+
# via keboola-component
59+
pygments==2.19.1
60+
# via rich
61+
python-dateutil==2.9.0.post0
62+
# via dlt-pendulum
63+
pytz==2025.1
64+
# via
65+
# dlt
66+
# keboola-component
67+
pyyaml==6.0.2
68+
# via dlt
69+
requests==2.32.3
70+
# via dlt
71+
requirements-parser==0.11.0
72+
# via dlt
73+
rich==13.9.4
74+
# via rich-argparse
75+
rich-argparse==1.7.0
76+
# via dlt
77+
semver==3.0.4
78+
# via dlt
79+
setuptools==75.8.0
80+
# via dlt
81+
simplejson==3.19.3
82+
# via dlt
83+
six==1.17.0
84+
# via python-dateutil
85+
smmap==5.0.2
86+
# via gitdb
87+
tenacity==9.0.0
88+
# via dlt
89+
tomlkit==0.13.2
90+
# via dlt
91+
types-setuptools==75.8.0.20250210
92+
# via requirements-parser
93+
typing-extensions==4.12.2
94+
# via dlt
95+
tzdata==2025.1
96+
# via
97+
# dlt
98+
# dlt-pendulum
99+
urllib3==2.3.0
100+
# via requests
101+
wrapt==1.17.2
102+
# via deprecated

0 commit comments

Comments
 (0)