Skip to content

Commit ee477e9

Browse files
authored
Merge branch 'main' into fix-docs
2 parents 20425ce + 790bb06 commit ee477e9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+3632
-3073
lines changed

.flake8

-11
This file was deleted.

.github/workflows/constraints.txt

-2
This file was deleted.

.github/workflows/integration.yml

+6-11
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,15 @@ jobs:
2222
uses: actions/setup-python@v5
2323
with:
2424
python-version: ${{ matrix.python-version }}
25-
cache: "pip"
2625

27-
- name: Upgrade pip
28-
run: |
29-
pip install --constraint=.github/workflows/constraints.txt pip
30-
pip --version
31-
32-
- name: Install Poetry
33-
run: |
34-
pipx install --pip-args=--constraint=.github/workflows/poetry-constraints.txt poetry
35-
poetry --version
26+
- name: Install UV
27+
uses: astral-sh/setup-uv@v5
28+
with:
29+
enable-cache: true
30+
version: ">=0.6.0"
3631

3732
- name: Install dependencies
38-
run: poetry install
33+
run: uv sync --all-extras --frozen
3934

4035
- name: Test integration
4136
run: ./scripts/test_integration.sh

.github/workflows/lint.yml

+6-11
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,15 @@ jobs:
2222
uses: actions/setup-python@v5
2323
with:
2424
python-version: ${{ matrix.python-version }}
25-
cache: "pip"
2625

27-
- name: Upgrade pip
28-
run: |
29-
pip install --constraint=.github/workflows/constraints.txt pip
30-
pip --version
31-
32-
- name: Install Poetry
33-
run: |
34-
pip install --constraint=.github/workflows/poetry-constraints.txt poetry
35-
poetry --version
26+
- name: Install UV
27+
uses: astral-sh/setup-uv@v5
28+
with:
29+
enable-cache: true
30+
version: ">=0.6.0"
3631

3732
- name: Install dependencies
38-
run: poetry install
33+
run: uv sync --all-extras --frozen
3934

4035
- name: Lint
4136
run: ./scripts/lint.sh

.github/workflows/poetry-constraints.txt

-1
This file was deleted.

.github/workflows/release-dev.yml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
name: Release Dev
3+
4+
"on":
5+
push:
6+
branches:
7+
- main
8+
9+
jobs:
10+
release:
11+
if: github.repository_owner == 'PyCQA'
12+
name: Release
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Check out the repository
16+
uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 2
19+
20+
- name: Set up Python
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: "3.13"
24+
25+
- name: Install UV
26+
uses: astral-sh/setup-uv@v5
27+
with:
28+
version: ">=0.6.0"
29+
30+
- name: Build package
31+
run: |
32+
uv build

.github/workflows/release.yml

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

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

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

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

25-
- name: Upgrade pip
26-
run: |
27-
pip install --constraint=.github/workflows/constraints.txt pip
28-
pip --version
28+
- name: Install UV
29+
uses: astral-sh/setup-uv@v5
30+
with:
31+
version: ">=0.6.0"
2932

30-
- name: Install Poetry
33+
- name: Install dependencies
3134
run: |
32-
pip install --constraint=.github/workflows/poetry-constraints.txt poetry
33-
poetry --version
35+
uv sync --all-extras --frozen
3436
3537
- name: Check if there is a parent commit
3638
id: check-parent-commit
3739
run: |
3840
echo "::set-output name=sha::$(git rev-parse --verify --quiet HEAD^)"
3941
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-
5642
- name: Build package
5743
run: |
58-
poetry build --ansi
44+
uv build
5945
6046
- name: Publish package on PyPI
61-
if: steps.check-version.outputs.tag
6247
uses: pypa/gh-action-pypi-publish@release/v1
6348
with:
64-
user: __token__
6549
password: ${{ secrets.PYPI_API_TOKEN }}
6650

6751
- name: Publish the release notes

.github/workflows/test.yml

+6-11
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,15 @@ jobs:
2727
uses: actions/setup-python@v5
2828
with:
2929
python-version: ${{ matrix.python-version }}
30-
cache: "pip"
3130

32-
- name: Upgrade pip
33-
run: |
34-
pip install --constraint=.github/workflows/constraints.txt pip
35-
pip --version
36-
37-
- name: Install Poetry
38-
run: |
39-
pip install --constraint=.github/workflows/poetry-constraints.txt poetry
40-
poetry --version
31+
- name: Install UV
32+
uses: astral-sh/setup-uv@v5
33+
with:
34+
enable-cache: true
35+
version: ">=0.6.0"
4136

4237
- name: Install dependencies
43-
run: poetry install
38+
run: uv sync --all-extras --frozen
4439

4540
- name: Test
4641
shell: bash

Dockerfile

+8-9
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
ARG VERSION=3
2-
FROM python:$VERSION
1+
FROM python:3.13
32

4-
# Install pip and poetry
5-
RUN python -m pip install --upgrade pip && python -m pip install poetry
3+
WORKDIR /isort
4+
COPY pyproject.toml uv.lock /isort/
5+
6+
# Install uv
7+
COPY --from=ghcr.io/astral-sh/uv:0.6.0 /uv /uvx /bin/
68

79
# Setup as minimal a stub project as possible, simply to allow caching base dependencies
810
# between builds.
@@ -13,14 +15,11 @@ RUN mkdir -p /isort/tests
1315
RUN touch /isort/isort/__init__.py
1416
RUN touch /isort/tests/__init__.py
1517
RUN touch /isort/README.md
16-
WORKDIR /isort
17-
COPY pyproject.toml poetry.lock /isort/
18-
RUN poetry install
18+
COPY . /isort
19+
RUN SETUPTOOLS_SCM_PRETEND_VERSION=0.0.0 uv sync --all-extras --frozen
1920

2021
# Install latest code for actual project
2122
RUN rm -rf /isort
22-
COPY . /isort
23-
RUN poetry install
2423

2524
# Run full test suite
2625
CMD /isort/scripts/test.sh

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

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

1717
- Python3.9+
18-
- poetry
18+
- uv
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

2222
Once you have verified that your system matches the base requirements you can start to get the project working by following these steps:
2323

2424
1. [Fork the project on GitHub](https://github.com/pycqa/isort/fork).
25-
2. Clone your fork to your local file system:
25+
1. Clone your fork to your local file system:
2626
`git clone https://github.com/$GITHUB_ACCOUNT/isort.git`
27-
3. `cd isort`
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
30-
5. `./scripts/test.sh` should yield Success: no issues found
31-
6. `./scripts/clean.sh` should yield a Safety report checking packages
27+
1. `cd isort`
28+
1. `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/
30+
1. `./scripts/test.sh` should yield Success: no issues found
31+
1. `./scripts/clean.sh` should yield a report checking packages
3232

3333
**TIP**: `./scripts/done.sh` will run both clean and test in one step.
3434

docs/contributing/2.-coding-standard.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,6 @@ All code submitted to hug should run through the following tools:
5252
- Flake8
5353
- flake8-bugbear
5454
- Bandit
55+
- ruff
5556
- pep8-naming
5657
- vulture
57-
- safety

docs/quick_start/1.-install.md

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

55
OR
66

7+
`uv add isort`
8+
9+
OR
10+
711
`poetry add isort`
812

913
OR

0 commit comments

Comments
 (0)