Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

chore: deprecate pip-compile-multi in favor or uv #31313

Merged
merged 13 commits into from
Dec 19, 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
3 changes: 3 additions & 0 deletions .github/actions/setup-backend/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,13 @@ runs:
if [ "${{ inputs.install-superset }}" = "true" ]; then
sudo apt-get update && sudo apt-get -y install libldap2-dev libsasl2-dev
pip install --upgrade pip setuptools wheel uv

if [ "${{ inputs.requirements-type }}" = "dev" ]; then
uv pip install --system -r requirements/development.txt
elif [ "${{ inputs.requirements-type }}" = "base" ]; then
uv pip install --system -r requirements/base.txt
fi

uv pip install --system -e .
fi
shell: bash
3 changes: 1 addition & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ updates:


# - package-ecosystem: "pip"
# NOTE: as dependabot isn't compatible with our python
# dependency setup (pip-compile-multi), we'll be using
# NOTE: as dependabot isn't compatible with our usage of `uv pip compile` we're using
# `supersetbot` instead

- package-ecosystem: "npm"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/bump-python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ jobs:
with:
python-version: "3.10"

- name: Install pip-compile-multi
run: pip install pip-compile-multi
- name: Install uv
run: pip install uv

- name: supersetbot bump-python -p "${{ github.event.inputs.package }}"
env:
Expand Down
44 changes: 44 additions & 0 deletions .github/workflows/check-python-deps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Check python dependencies

on:
push:
branches:
- "master"
- "[0-9].[0-9]*"
pull_request:
types: [synchronize, opened, reopened, ready_for_review]

# cancel previous workflow jobs for PRs
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true

jobs:
check-python-deps:
runs-on: ubuntu-22.04
steps:

- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
uses: actions/checkout@v4
with:
persist-credentials: false
submodules: recursive
depth: 1

- name: Setup Python
if: steps.check.outputs.python
uses: ./.github/actions/setup-backend/

- name: Run uv
if: steps.check.outputs.python
run: ./scripts/uv-pip-compile.sh

- name: Check for uncommitted changes
run: |
if [[ -n "$(git diff)" ]]; then
echo "ERROR: The pinned dependencies are not up-to-date."
echo "Please run './scripts/uv-pip-compile.sh' and commit the changes."
exit 1
else
echo "Pinned dependencies are up-to-date."
fi
4 changes: 0 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ repos:
types-paramiko,
types-Markdown,
]
- repo: https://github.com/peterdemin/pip-compile-multi
rev: v2.6.4
hooks:
- id: pip-compile-multi-verify
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ FROM python-base AS python-translation-compiler
# Install Python dependencies using docker/pip-install.sh
COPY requirements/translations.txt requirements/
RUN --mount=type=cache,target=/root/.cache/uv \
/app/docker/pip-install.sh -r requirements/translations.txt
/app/docker/pip-install.sh --requires-build-essential -r requirements/translations.txt

COPY superset/translations/ /app/translations_mo/
RUN if [ "$BUILD_TRANSLATIONS" = "true" ]; then \
Expand Down
10 changes: 5 additions & 5 deletions docs/docs/contributing/development.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -255,19 +255,19 @@ If you add a new requirement or update an existing requirement (per the `install
$ python3 -m venv venv
$ source venv/bin/activate
$ python3 -m pip install -r requirements/development.txt
$ pip-compile-multi --no-upgrade
$ ./scripts/uv-pip-compile.sh
```

When upgrading the version number of a single package, you should run `pip-compile-multi` with the `-P` flag:
When upgrading the version number of a single package, you should run `./scripts/uv-pip-compile.sh` with the `-P` flag:

```bash
$ pip-compile-multi -P my-package
$ ./scripts/uv-pip-compile.sh -P some-package-to-upgrade
```

To bring all dependencies up to date as per the restrictions defined in `setup.py` and `requirements/*.in`, run pip-compile-multi` without any flags:
To bring all dependencies up to date as per the restrictions defined in `setup.py` and `requirements/*.in`, run `./scripts/uv-pip-compile.sh --upgrade`

```bash
$ pip-compile-multi
$ ./scripts/uv-pip-compile.sh --upgrade
```

This should be done periodically, but it is recommended to do thorough manual testing of the application to ensure no breaking changes have been introduced that aren't caught by the unit and integration tests.
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,6 @@ development = [
"grpcio>=1.55.3",
"openapi-spec-validator",
"parameterized",
"pip-compile-multi",
"pre-commit",
"progress>=1.5,<2",
"psutil",
Expand Down
1 change: 0 additions & 1 deletion requirements/base.in
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
# specific language governing permissions and limitations
# under the License.
#
-e file:.
urllib3>=1.26.18
werkzeug>=3.0.1
numexpr>=2.9.0
Expand Down
Loading
Loading