From d76a45b447b56859e524231930155c6b96d9a55c Mon Sep 17 00:00:00 2001 From: Cristian Le Date: Mon, 9 Sep 2024 16:49:08 +0200 Subject: [PATCH 1/2] Switch to hatchling (PEP517) --- .github/workflows/build.yml | 33 +++++++++++------------------- pyproject.toml | 40 ++++++++++++++++++++++--------------- 2 files changed, 36 insertions(+), 37 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bdd6f664..3a6ea5f6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,34 +11,25 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-20.04, macOS-10.15, windows-2019] - python-version: [3.6, 3.7, 3.8, 3.9, "3.10", 3.11, 3.12.0-rc.2] + os: [ubuntu-latest, macos-latest, windows-latest] + python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - - name: Install dependencies + - name: Install package run: | - python3 -m pip install poetry - poetry install -v + python3 -m pip install -e .[test] - name: Run tests - run: poetry run pytest + run: pytest style: runs-on: ubuntu-latest - strategy: - fail-fast: false steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: 3.9 - - name: Install dependencies - run: | - python3 -m pip install poetry - poetry install -v - - name: Run linters - run: poetry run pre-commit run -a + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: 3.x + - uses: pre-commit/action@v3.0.1 diff --git a/pyproject.toml b/pyproject.toml index 07359556..644d4fe7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,15 +1,16 @@ [build-system] -requires = ["poetry-core>=1.0.0"] -build-backend = "poetry.core.masonry.api" +requires = ["hatchling"] +build-backend = "hatchling.build" -[tool.poetry] +[project] name = "docstring_parser" version = "0.16" description = "Parse Python docstrings in reST, Google and Numpydoc format" -authors = ["Marcin Kurczewski "] -license = "MIT" +authors = [ + {name="Marcin Kurczewski", email="dash@wind.garden"}, +] +license = { text = "MIT" } readme = "README.md" -repository = "https://github.com/rr-/docstring_parser" classifiers = [ "Environment :: Other Environment", "Development Status :: 4 - Beta", @@ -28,18 +29,25 @@ classifiers = [ "Topic :: Text Processing :: Markup", "Topic :: Software Development :: Libraries :: Python Modules", ] -packages = [ - { include = "docstring_parser" } -] -include = ["docstring_parser/py.typed"] +requires-python = ">=3.6,<4.0" -[tool.poetry.dependencies] -python = ">=3.6,<4.0" +[project.urls] +homepage = "https://github.com/rr-/docstring_parser" +repository = "https://github.com/rr-/docstring_parser" +changelog = "https://github.com/rr-/docstring_parser/blob/master/CHANGELOG.md" -[tool.poetry.dev-dependencies] -pre-commit = {version = ">=2.16.0", python = ">=3.9"} -pytest = "*" -pydoctor = ">=22.3.0" +[project.optional-dependencies] +test = [ + "pytest", +] +docs = [ + "pydoctor >= 22.3.0", +] +dev = [ + "docstring_parser[test]", + "docstring_parser[docs]", + "pre-commit >= 2.16.0; python_version>='3.9'", +] [tool.black] line-length = 79 From 60573d7ee3b4534a29e213ac62591940aac51780 Mon Sep 17 00:00:00 2001 From: Cristian Le Date: Mon, 9 Sep 2024 17:07:13 +0200 Subject: [PATCH 2/2] Drop Python<3.8 support --- .github/workflows/build.yml | 2 +- pyproject.toml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3a6ea5f6..c4c9a60a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,7 +12,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} diff --git a/pyproject.toml b/pyproject.toml index 644d4fe7..66dd4384 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,7 +29,7 @@ classifiers = [ "Topic :: Text Processing :: Markup", "Topic :: Software Development :: Libraries :: Python Modules", ] -requires-python = ">=3.6,<4.0" +requires-python = ">=3.8" [project.urls] homepage = "https://github.com/rr-/docstring_parser" @@ -51,7 +51,7 @@ dev = [ [tool.black] line-length = 79 -py36 = true +py38 = true [tool.isort] known_third_party = "docstring_parser"