Skip to content

Commit

Permalink
Use uv for dependency_type managemange
Browse files Browse the repository at this point in the history
  • Loading branch information
blink1073 committed Mar 23, 2024
1 parent 1d24a7a commit 3e499fd
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 155 deletions.
10 changes: 7 additions & 3 deletions .github/actions/base-setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ runs:
run: |
set -eux
echo "::group::Upgrade packaging dependencies"
python -m pip install --upgrade pip
pip install --upgrade pip
pipx install uv
if [ "$RUNNER_OS" != "Windows" ]; then
pipx install hatch --python $(which python)
else
Expand All @@ -125,11 +126,14 @@ runs:
shell: bash
run: |
set -eux
FLAGS=""
if [ $DEPENDENCY_TYPE == 'pre' ]; then
echo "PIP_PRE=1" >> $GITHUB_ENV
FLAGS="--prerelease=allow"
elif [ $DEPENDENCY_TYPE == 'minimum' ]; then
source ${{ github.action_path }}/setup_constraints.sh
FLAGS="--resolution=lowest-direct"
fi
uv pip compile $FLAGS pyproject.toml -o constraints.txt
echo "PIP_CONSTRAINT=$HOME/constraints.txt" >> $GITHUB_ENV
- name: Print Diagnostics
shell: bash
Expand Down
11 changes: 0 additions & 11 deletions .github/actions/base-setup/setup_constraints.sh

This file was deleted.

45 changes: 0 additions & 45 deletions .github/actions/install-minimums/action.yml

This file was deleted.

35 changes: 0 additions & 35 deletions .github/actions/install-minimums/create_constraints_file.py

This file was deleted.

29 changes: 0 additions & 29 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,35 +148,6 @@ jobs:
pre_commit: true
target: "https://github.com/jupyterlab/maintainer-tools/pull/39"

install_minimums:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8"] # Test against minimum Python version as well
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Base Setup
uses: ./.github/actions/base-setup
- name: Clone a repo
run: git clone --depth=1 https://github.com/jupyter/nbformat.git
- name: Install minimum versions
uses: ./.github/actions/install-minimums
with:
working-directory: nbformat
- name: Run the unit tests
working-directory: nbformat
run: pytest -vv
- name: Only create file
uses: ./.github/actions/install-minimums
with:
only_create_file: 1
constraints_file_path: "./constraints-test.txt"
- name: Ensure constraints file
run: |
cat ./constraints-test.txt
echo $PIP_CONSTRAINT | grep "constraints-test.txt"
update_snapshots-manual-server:
runs-on: ubuntu-latest
env:
Expand Down
32 changes: 0 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,38 +193,6 @@ jobs:

To test against a prerelease use `package_download_extra_args: "--pre"`.
## Test Against Dependency Minimum Version
**DEPRECATED**. Use `dependency_type: minimum` in the `base-setup` action
instead.

Use this action to test that your minimum dependency version constraints are valid. Note: you may want to also use the minimum supported version of Python
since the minimum versions might not have wheels on newer Pythons. Note that you should use `pytest -W default` if you are using `filterwarnings` and relying on newer versions of the library to have removed warnings.

```yaml
name: Minimum Dependencies
on:
push:
branches: ["main"]
pull_request:
jobs:
test_minimums:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Base Setup
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
with:
python_version: "3.8" # Test against minimum Python version as well
- name: Install minimum versions
uses: jupyterlab/maintainer-tools/.github/actions/install-minimums@v1
- name: Run the unit tests
run: pytest -vv -W default
```

## Test SDist
Use this pair of actions to build an sdist for your package, and then test it
Expand Down

0 comments on commit 3e499fd

Please sign in to comment.