Skip to content

Commit

Permalink
Merge pull request #2347 from PyCQA/revert-2346-ci/uv-replacement-for…
Browse files Browse the repository at this point in the history
…-poetry

Revert "UV replacement of Poetry"
  • Loading branch information
staticdev authored Jan 26, 2025
2 parents f7ab073 + cc12cce commit b3760ab
Show file tree
Hide file tree
Showing 30 changed files with 2,876 additions and 3,191 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/constraints.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
pip==24.3.1
virtualenv==20.29.1
pip==23.2
virtualenv==20.17.1
1 change: 0 additions & 1 deletion .github/workflows/hatch-constraints.txt

This file was deleted.

8 changes: 5 additions & 3 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,13 @@ jobs:
pip install --constraint=.github/workflows/constraints.txt pip
pip --version
- name: Install UV
uses: astral-sh/setup-uv@v5
- name: Install Poetry
run: |
pipx install --pip-args=--constraint=.github/workflows/poetry-constraints.txt poetry
poetry --version
- name: Install dependencies
run: uv sync --all-extras --frozen
run: poetry install

- name: Test integration
run: ./scripts/test_integration.sh
8 changes: 5 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,13 @@ jobs:
pip install --constraint=.github/workflows/constraints.txt pip
pip --version
- name: Install UV
uses: astral-sh/setup-uv@v5
- name: Install Poetry
run: |
pip install --constraint=.github/workflows/poetry-constraints.txt poetry
poetry --version
- name: Install dependencies
run: uv sync --all-extras --frozen
run: poetry install

- name: Lint
run: ./scripts/lint.sh
1 change: 1 addition & 0 deletions .github/workflows/poetry-constraints.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
poetry==2.0.1
30 changes: 0 additions & 30 deletions .github/workflows/release-dev.yml

This file was deleted.

36 changes: 23 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ name: Release

"on":
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
branches:
- main

jobs:
release:
Expand All @@ -17,35 +17,45 @@ jobs:
with:
fetch-depth: 2

- name: Set Tag env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.13"
python-version: "3.12"

- name: Upgrade pip
run: |
pip install --constraint=.github/workflows/constraints.txt pip
pip --version
- name: Install Hatch
- name: Install Poetry
run: |
pip install --constraint=.github/workflows/hatch-constraints.txt hatch
hatch --version
- name: Install UV
uses: astral-sh/setup-uv@v5
pip install --constraint=.github/workflows/poetry-constraints.txt poetry
poetry --version
- name: Check if there is a parent commit
id: check-parent-commit
run: |
echo "::set-output name=sha::$(git rev-parse --verify --quiet HEAD^)"
- name: Detect and tag new version
id: check-version
if: steps.check-parent-commit.outputs.sha
uses: salsify/action-detect-and-tag-new-version@v2
with:
tag-template: "{VERSION}"
version-command: |
bash -o pipefail -c "poetry version | awk '{ print \$2 }'"
- name: Bump version for developmental release
if: "! steps.check-version.outputs.tag"
run: |
poetry version patch &&
version=$(poetry version | awk '{ print $2 }') &&
poetry version $version.dev.$(date +%s)
- name: Build package
run: |
uv build
poetry build --ansi
- name: Publish package on PyPI
if: steps.check-version.outputs.tag
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,13 @@ jobs:
pip install --constraint=.github/workflows/constraints.txt pip
pip --version
- name: Install UV
uses: astral-sh/setup-uv@v5
- name: Install Poetry
run: |
pip install --constraint=.github/workflows/poetry-constraints.txt poetry
poetry --version
- name: Install dependencies
run: uv sync --all-extras --frozen
run: poetry install

- name: Test
shell: bash
Expand Down
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
ARG VERSION=3
FROM python:$VERSION

# Install pip and uv
RUN python -m pip install --upgrade pip && python -m pip install uv
# Install pip and poetry
RUN python -m pip install --upgrade pip && python -m pip install poetry

# Setup as minimal a stub project as possible, simply to allow caching base dependencies
# between builds.
Expand All @@ -14,13 +14,13 @@ RUN touch /isort/isort/__init__.py
RUN touch /isort/tests/__init__.py
RUN touch /isort/README.md
WORKDIR /isort
COPY pyproject.toml uv.lock /isort/
RUN uv sync
COPY pyproject.toml poetry.lock /isort/
RUN poetry install

# Install latest code for actual project
RUN rm -rf /isort
COPY . /isort
RUN uv sync
RUN poetry install

# Run full test suite
CMD /isort/scripts/test.sh
6 changes: 3 additions & 3 deletions docs/contributing/1.-contributing-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Account Requirements:
Base System Requirements:

- Python3.9+
- uv
- poetry
- bash or a bash compatible shell (should be auto-installed on Linux / Mac)
- WSL users running Ubuntu may need to install Python's venv module even after installing Python.

Expand All @@ -25,8 +25,8 @@ Once you have verified that your system matches the base requirements you can st
2. Clone your fork to your local file system:
`git clone https://github.com/$GITHUB_ACCOUNT/isort.git`
3. `cd isort`
4. `uv sync --all-extras --frozen`
* Optionally, isolate uv's installation from the rest of your system using the instructions on the uv site here: https://docs.astral.sh/uv/
4. `poetry install`
* Optionally, isolate poetry's installation from the rest of your system using the instructions on the poetry site here: https://python-poetry.org/docs/#installation
5. `./scripts/test.sh` should yield Success: no issues found
6. `./scripts/clean.sh` should yield a Safety report checking packages

Expand Down
4 changes: 0 additions & 4 deletions docs/quick_start/1.-install.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ Install `isort` using your preferred Python package manager:

OR

`uv add isort`

OR

`poetry add isort`

OR
Expand Down
174 changes: 174 additions & 0 deletions example_isort_formatting_plugin/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b3760ab

Please sign in to comment.