Skip to content

Commit

Permalink
Merge branch 'main' into fix-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
staticdev authored Feb 26, 2025
2 parents 20425ce + 790bb06 commit ee477e9
Show file tree
Hide file tree
Showing 58 changed files with 3,632 additions and 3,073 deletions.
11 changes: 0 additions & 11 deletions .flake8

This file was deleted.

2 changes: 0 additions & 2 deletions .github/workflows/constraints.txt

This file was deleted.

17 changes: 6 additions & 11 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,15 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip"

- name: Upgrade pip
run: |
pip install --constraint=.github/workflows/constraints.txt pip
pip --version
- name: Install Poetry
run: |
pipx install --pip-args=--constraint=.github/workflows/poetry-constraints.txt poetry
poetry --version
- name: Install UV
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
version: ">=0.6.0"

- name: Install dependencies
run: poetry install
run: uv sync --all-extras --frozen

- name: Test integration
run: ./scripts/test_integration.sh
17 changes: 6 additions & 11 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,15 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip"

- name: Upgrade pip
run: |
pip install --constraint=.github/workflows/constraints.txt pip
pip --version
- name: Install Poetry
run: |
pip install --constraint=.github/workflows/poetry-constraints.txt poetry
poetry --version
- name: Install UV
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
version: ">=0.6.0"

- name: Install dependencies
run: poetry install
run: uv sync --all-extras --frozen

- name: Lint
run: ./scripts/lint.sh
1 change: 0 additions & 1 deletion .github/workflows/poetry-constraints.txt

This file was deleted.

32 changes: 32 additions & 0 deletions .github/workflows/release-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
name: Release Dev

"on":
push:
branches:
- main

jobs:
release:
if: github.repository_owner == 'PyCQA'
name: Release
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@v4
with:
fetch-depth: 2

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

- name: Install UV
uses: astral-sh/setup-uv@v5
with:
version: ">=0.6.0"

- name: Build package
run: |
uv build
42 changes: 13 additions & 29 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:
branches:
- main
tags:
- "[0-9]+.[0-9]+.[0-9]+"

jobs:
release:
Expand All @@ -17,51 +17,35 @@ 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.12"
python-version: "3.13"

- name: Upgrade pip
run: |
pip install --constraint=.github/workflows/constraints.txt pip
pip --version
- name: Install UV
uses: astral-sh/setup-uv@v5
with:
version: ">=0.6.0"

- name: Install Poetry
- name: Install dependencies
run: |
pip install --constraint=.github/workflows/poetry-constraints.txt poetry
poetry --version
uv sync --all-extras --frozen
- 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: |
poetry build --ansi
uv build
- name: Publish package on PyPI
if: steps.check-version.outputs.tag
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}

- name: Publish the release notes
Expand Down
17 changes: 6 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,15 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip"

- name: Upgrade pip
run: |
pip install --constraint=.github/workflows/constraints.txt pip
pip --version
- name: Install Poetry
run: |
pip install --constraint=.github/workflows/poetry-constraints.txt poetry
poetry --version
- name: Install UV
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
version: ">=0.6.0"

- name: Install dependencies
run: poetry install
run: uv sync --all-extras --frozen

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

# Install pip and poetry
RUN python -m pip install --upgrade pip && python -m pip install poetry
WORKDIR /isort
COPY pyproject.toml uv.lock /isort/

# Install uv
COPY --from=ghcr.io/astral-sh/uv:0.6.0 /uv /uvx /bin/

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

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

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

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

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

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

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

Expand Down
2 changes: 1 addition & 1 deletion docs/contributing/2.-coding-standard.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@ All code submitted to hug should run through the following tools:
- Flake8
- flake8-bugbear
- Bandit
- ruff
- pep8-naming
- vulture
- safety
4 changes: 4 additions & 0 deletions docs/quick_start/1.-install.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ Install `isort` using your preferred Python package manager:

OR

`uv add isort`

OR

`poetry add isort`

OR
Expand Down
Loading

0 comments on commit ee477e9

Please # to comment.