-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
uv 💜 #4
Open
soustruh
wants to merge
8
commits into
main
Choose a base branch
from
feature/uv
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
uv 💜 #4
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
422780d
Use venv
davidesner 8c95dc1
run pipelines in venv
davidesner 5a3e7e4
test tag as branch name
davidesner 18849a5
temp keboola package
davidesner d908d86
uv for dependency management 💜
soustruh 04cb36d
python 3.10 + uv sync 💜
soustruh def8628
use uv to run tests 💜
soustruh 68bcc97
single python env 🐍
soustruh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,4 +9,5 @@ __pycache__/ | |
|
||
# kbc datafolder | ||
/data | ||
/venv | ||
/venv | ||
test.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
3.10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,21 @@ | ||
FROM quay.io/keboola/docker-custom-python:latest | ||
ENV PYTHONIOENCODING utf-8 | ||
|
||
|
||
|
||
# Create directory for user packages | ||
# This directory is usually created automatically by pip | ||
# ... but if it doesn't exist when you run the script | ||
# ... then the modules installed during the transformation are not loaded automatically! | ||
# ... because the loader thinks that this directory does not exist (it did not exist at the start of the script) | ||
# Eg. mkdir -p /var/www/.local/lib/python3.8/site-packages | ||
RUN mkdir -p $(su www-data -s /bin/bash -c "python -c 'import site; print(site.USER_SITE)'") | ||
|
||
# Make home directory writable | ||
RUN chown -R www-data:www-data /var/www | ||
|
||
COPY /src /code/src/ | ||
COPY /tests /code/tests/ | ||
COPY /scripts /code/scripts/ | ||
COPY requirements.txt /code/requirements.txt | ||
COPY flake8.cfg /code/flake8.cfg | ||
COPY deploy.sh /code/deploy.sh | ||
|
||
# install gcc to be able to build packages - e.g. required by regex, dateparser, also required for pandas | ||
RUN apt-get update && apt-get install -y build-essential | ||
|
||
RUN pip install flake8 | ||
# RUN apt-get update && apt-get install -y build-essential | ||
|
||
RUN pip install -r /code/requirements.txt | ||
RUN pip install uv | ||
|
||
WORKDIR /code/ | ||
|
||
COPY pyproject.toml . | ||
COPY uv.lock . | ||
|
||
RUN uv pip sync --system pyproject.toml | ||
|
||
COPY src/ src/ | ||
COPY tests/ tests/ | ||
COPY scripts/ scripts/ | ||
COPY flake8.cfg . | ||
COPY deploy.sh . | ||
|
||
CMD ["python", "-u", "/code/src/component.py"] | ||
CMD uv run --active /code/src/component.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
[flake8] | ||
exclude = | ||
.git, | ||
.venv, | ||
__pycache__, | ||
tests, | ||
example | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
[project] | ||
name = "custom-python" | ||
version = "0.1.0" | ||
description = "Add your description here" | ||
readme = "README.md" | ||
requires-python = ">=3.10" | ||
dependencies = [ | ||
"dlt>=1.6.1", | ||
"duckdb>=1.2.0", | ||
"keboola-component>=1.6.10", | ||
] | ||
|
||
[dependency-groups] | ||
dev = [ | ||
"flake8>=7.1.2", | ||
"freezegun>=1.5.1", | ||
"mock>=5.2.0", | ||
] |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
flake8 --config=flake8.cfg | ||
python -m unittest discover | ||
uv run --active flake8 --config=flake8.cfg | ||
uv run --active python -m unittest discover |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logging of sys.executable appears to be a leftover debug statement; consider removing it or wrapping it in a conditional to avoid unintended output in production.
Copilot is powered by AI, so mistakes are possible. Review output carefully before use.