Skip to content
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

Sandbox: Optionally use uv package manager to save cycles #661

Merged
merged 1 commit into from
Nov 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ jobs:
cache-dependency-path: |
setup.py

- name: Install uv
uses: yezz123/setup-uv@v4

- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
Expand All @@ -55,7 +58,7 @@ jobs:

- name: Install project
run: |
pip install --editable=.[test]
uv pip install --editable=.[test]

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
3 changes: 3 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ jobs:
cache: 'pip'
cache-dependency-path: 'setup.py'

- name: Install uv
uses: yezz123/setup-uv@v4

- name: Invoke tests
run: |

Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,14 @@ jobs:
cache: 'pip'
cache-dependency-path: 'setup.py'

- name: Install uv
uses: yezz123/setup-uv@v4

- name: Build package
run: |
python -m pip install twine wheel
python setup.py sdist bdist_wheel
twine check dist/*.tar.gz
uv pip install build twine wheel
python -m build
twine check dist/*

- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ jobs:
cache: 'pip'
cache-dependency-path: setup.py

- name: Install uv
uses: yezz123/setup-uv@v4

- name: Invoke tests
run: |

Expand Down
6 changes: 6 additions & 0 deletions DEVELOP.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ CrateDB Python developer guide
Setup
=====

Optionally install Python package and project manager ``uv``,
in order to significantly speed up the package installation::

{apt,brew,pip,zypper} install uv
alias pip="uv pip"

To start things off, bootstrap the sandbox environment::

git clone https://github.com/crate/crate-python
Expand Down
13 changes: 13 additions & 0 deletions bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,25 @@ function finalize() {

}

function activate_uv() {
if command -v uv; then
function pip() {
uv pip "$@"
}
fi
}
function deactivate_uv() {
unset -f pip
}

function main() {
activate_uv
ensure_virtualenv
activate_virtualenv
before_setup
setup_package
run_buildout
deactivate_uv
finalize
}

Expand Down
Loading