Skip to content

Commit b3760ab

Browse files
authored
Merge pull request #2347 from PyCQA/revert-2346-ci/uv-replacement-for-poetry
Revert "UV replacement of Poetry"
2 parents f7ab073 + cc12cce commit b3760ab

30 files changed

+2876
-3191
lines changed

.github/workflows/constraints.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
pip==24.3.1
2-
virtualenv==20.29.1
1+
pip==23.2
2+
virtualenv==20.17.1

.github/workflows/hatch-constraints.txt

-1
This file was deleted.

.github/workflows/integration.yml

+5-3
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,13 @@ jobs:
2929
pip install --constraint=.github/workflows/constraints.txt pip
3030
pip --version
3131
32-
- name: Install UV
33-
uses: astral-sh/setup-uv@v5
32+
- name: Install Poetry
33+
run: |
34+
pipx install --pip-args=--constraint=.github/workflows/poetry-constraints.txt poetry
35+
poetry --version
3436
3537
- name: Install dependencies
36-
run: uv sync --all-extras --frozen
38+
run: poetry install
3739

3840
- name: Test integration
3941
run: ./scripts/test_integration.sh

.github/workflows/lint.yml

+5-3
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,13 @@ jobs:
2929
pip install --constraint=.github/workflows/constraints.txt pip
3030
pip --version
3131
32-
- name: Install UV
33-
uses: astral-sh/setup-uv@v5
32+
- name: Install Poetry
33+
run: |
34+
pip install --constraint=.github/workflows/poetry-constraints.txt poetry
35+
poetry --version
3436
3537
- name: Install dependencies
36-
run: uv sync --all-extras --frozen
38+
run: poetry install
3739

3840
- name: Lint
3941
run: ./scripts/lint.sh
+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
poetry==2.0.1

.github/workflows/release-dev.yml

-30
This file was deleted.

.github/workflows/release.yml

+23-13
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ name: Release
33

44
"on":
55
push:
6-
tags:
7-
- "v[0-9]+.[0-9]+.[0-9]+"
6+
branches:
7+
- main
88

99
jobs:
1010
release:
@@ -17,35 +17,45 @@ jobs:
1717
with:
1818
fetch-depth: 2
1919

20-
- name: Set Tag env
21-
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
22-
2320
- name: Set up Python
2421
uses: actions/setup-python@v5
2522
with:
26-
python-version: "3.13"
23+
python-version: "3.12"
2724

2825
- name: Upgrade pip
2926
run: |
3027
pip install --constraint=.github/workflows/constraints.txt pip
3128
pip --version
3229
33-
- name: Install Hatch
30+
- name: Install Poetry
3431
run: |
35-
pip install --constraint=.github/workflows/hatch-constraints.txt hatch
36-
hatch --version
37-
38-
- name: Install UV
39-
uses: astral-sh/setup-uv@v5
32+
pip install --constraint=.github/workflows/poetry-constraints.txt poetry
33+
poetry --version
4034
4135
- name: Check if there is a parent commit
4236
id: check-parent-commit
4337
run: |
4438
echo "::set-output name=sha::$(git rev-parse --verify --quiet HEAD^)"
4539
40+
- name: Detect and tag new version
41+
id: check-version
42+
if: steps.check-parent-commit.outputs.sha
43+
uses: salsify/action-detect-and-tag-new-version@v2
44+
with:
45+
tag-template: "{VERSION}"
46+
version-command: |
47+
bash -o pipefail -c "poetry version | awk '{ print \$2 }'"
48+
49+
- name: Bump version for developmental release
50+
if: "! steps.check-version.outputs.tag"
51+
run: |
52+
poetry version patch &&
53+
version=$(poetry version | awk '{ print $2 }') &&
54+
poetry version $version.dev.$(date +%s)
55+
4656
- name: Build package
4757
run: |
48-
uv build
58+
poetry build --ansi
4959
5060
- name: Publish package on PyPI
5161
if: steps.check-version.outputs.tag

.github/workflows/test.yml

+5-3
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,13 @@ jobs:
3434
pip install --constraint=.github/workflows/constraints.txt pip
3535
pip --version
3636
37-
- name: Install UV
38-
uses: astral-sh/setup-uv@v5
37+
- name: Install Poetry
38+
run: |
39+
pip install --constraint=.github/workflows/poetry-constraints.txt poetry
40+
poetry --version
3941
4042
- name: Install dependencies
41-
run: uv sync --all-extras --frozen
43+
run: poetry install
4244

4345
- name: Test
4446
shell: bash

Dockerfile

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
ARG VERSION=3
22
FROM python:$VERSION
33

4-
# Install pip and uv
5-
RUN python -m pip install --upgrade pip && python -m pip install uv
4+
# Install pip and poetry
5+
RUN python -m pip install --upgrade pip && python -m pip install poetry
66

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

2020
# Install latest code for actual project
2121
RUN rm -rf /isort
2222
COPY . /isort
23-
RUN uv sync
23+
RUN poetry install
2424

2525
# Run full test suite
2626
CMD /isort/scripts/test.sh

docs/contributing/1.-contributing-guide.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Account Requirements:
1515
Base System Requirements:
1616

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

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

docs/quick_start/1.-install.md

-4
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@ Install `isort` using your preferred Python package manager:
44

55
OR
66

7-
`uv add isort`
8-
9-
OR
10-
117
`poetry add isort`
128

139
OR

example_isort_formatting_plugin/poetry.lock

+174
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)