{% set version = "5.13.2" %}

package:
  name: isort
  version: {{ version }}

source:
  url: https://pypi.io/packages/source/i/isort/isort-{{ version }}.tar.gz
  sha256: 48fdfcb9face5d58a4f6dde2e72a1fb8dcaf8ab26f95ab49fab84c2ddefb0109

build:
  number: 1
  skip: True  # [py<38]
  script: {{ PYTHON }} -m pip install . -vv --no-deps --no-build-isolation
  entry_points:
    - isort = isort.main:main

requirements:
  host:
    - python
    - pip
    - poetry-core >=1.0.0
  run:
    - python
  run_constrained:
    - colorama >=0.4.6

# Skipping tests since pylama is unavailable
{% set test_files_to_skip = " --ignore=tests/unit/test_format.py" %}
{% set test_files_to_skip = test_files_to_skip + " --ignore=tests/unit/test_pylama_isort.py" %}
# Skipping due to various errors
{% set tests_to_skip = "test_requirements_dir" %}
{% set tests_to_skip = tests_to_skip + " or test_requirements_finder" %}
{% set tests_to_skip = tests_to_skip + " or test_git_hook" %}
{% set tests_to_skip = tests_to_skip + " or test_importable" %}
{% set tests_to_skip = tests_to_skip + " or test_module" %}
{% set tests_to_skip = tests_to_skip + " or test_isort_supports_shared_profiles_issue_970" %}
{% set tests_to_skip = tests_to_skip + " or test_sort_configurable_sort_issue_1732" %}
{% set tests_to_skip = tests_to_skip + " or test_black_pyi_file" %}
{% set tests_to_skip = tests_to_skip + " or test_gitignore" %}  # [not osx]

test:
  source_files:
    - tests/unit/
  imports:
    - isort
  commands:
    - pip check
    - isort --help
    - pytest tests/unit/ -v {{ test_files_to_skip }} -k "not({{ tests_to_skip }})"
  requires:
    - pip
    - pytest
    - anyio
    - coverage
    - exceptiongroup
    - hypothesis
    - psutil
    - pytest-mock
    - trustme
    - uvloop  # [unix]

about:
  home: https://github.com/timothycrosley/isort
  license: MIT
  license_file: LICENSE
  license_family: MIT
  summary: A Python utility / library to sort Python imports.
  description: |
    isort is a Python utility / library to sort imports alphabetically, and
    automatically separated into sections. It provides a command line utility,
    Python library and plugins for various editors to quickly sort all your
    imports. It currently cleanly supports Python 2.6 - 3.5 using pies to
    achieve this without ugly hacks and/or py2to3.
  doc_url: https://pycqa.github.io/isort/
  dev_url: https://github.com/timothycrosley/isort

extra:
  recipe-maintainers:
    - goanpeca
    - nicoddemus
    - nehaljwani
    - ocefpaf
