From c2ce88ba89c1ae9e4d5c9a2afa25d4c5007c1441 Mon Sep 17 00:00:00 2001 From: insolor <2442833+insolor@users.noreply.github.com> Date: Thu, 11 Jan 2024 23:15:18 +0300 Subject: [PATCH] Move most of the metadata from setup.py to pyproject.toml (#29) --- .github/workflows/tests.yml | 2 +- pyproject.toml | 51 +++++++++++++++++++++++++++++-------- setup.py | 41 +++++------------------------ 3 files changed, 48 insertions(+), 46 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d557878..03c76a6 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -38,7 +38,7 @@ jobs: env: TEST: true run: | - python setup.py build_ext --inplace + pip install -e . - name: "Run tests for ${{ matrix.python-version }}" run: | diff --git a/pyproject.toml b/pyproject.toml index d4448fc..e71f0d8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,18 +1,49 @@ -[build-system] -requires = ["setuptools", "wheel", "Cython"] +[project] +name = "DAWG2" +version = "0.12.1" +requires-python = ">= 3.8" +description = "Fast and memory efficient DAWG (DAFSA) for Python" +readme = "README.md" +license = {file = "LICENSE"} -[tool.coverage.run] -plugins = [ - "Cython.Coverage" +authors = [ + {name = "Mikhail Korobov", email = "kmike84@gmail.com"} ] -source = [ - "src", - "tests" +maintainers = [ + {name = "insolor", email = "insolor@gmail.com"} ] -omit = [ - "bench/*", + +classifiers=[ + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "Intended Audience :: Science/Research", + "License :: OSI Approved :: MIT License", + "Programming Language :: Cython", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: Implementation :: CPython", + "Topic :: Software Development :: Libraries :: Python Modules", + "Topic :: Scientific/Engineering :: Information Analysis", + "Topic :: Text Processing :: Linguistic", ] +[project.urls] +Homepage = "https://github.com/pymorphy2-fork/DAWG/" +Changelog = "https://github.com/pymorphy2-fork/DAWG/blob/master/CHANGES.md" + +[build-system] +requires = ["setuptools", "wheel", "Cython"] + +[tool.coverage.run] +plugins = ["Cython.Coverage"] +source = ["src", "tests"] +omit = ["bench/*"] + [tool.coverage.report] exclude_lines = [ "pragma: no cover", diff --git a/setup.py b/setup.py index a5acd58..bf498d0 100755 --- a/setup.py +++ b/setup.py @@ -1,4 +1,4 @@ -#! /usr/bin/env python +#!/usr/bin/env python import glob import os @@ -24,40 +24,11 @@ ) ] -ext_modules = cythonize( - extensions, - annotate=False, - compiler_directives=compiler_directives, -) - -long_description = open("README.md", encoding="utf-8").read() + "\n\n" + open("CHANGES.md", encoding="utf-8").read() - setup( name="DAWG2", - version="0.12.1", - description="Fast and memory efficient DAWG (DAFSA) for Python", - long_description=long_description, - long_description_content_type='text/markdown', - author="Mikhail Korobov", - author_email="kmike84@gmail.com", - url="https://github.com/pymorphy2-fork/DAWG/", - ext_modules=ext_modules, - classifiers=[ - "Development Status :: 4 - Beta", - "Intended Audience :: Developers", - "Intended Audience :: Science/Research", - "License :: OSI Approved :: MIT License", - "Programming Language :: Cython", - "Programming Language :: Python", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", - "Programming Language :: Python :: Implementation :: CPython", - "Topic :: Software Development :: Libraries :: Python Modules", - "Topic :: Scientific/Engineering :: Information Analysis", - "Topic :: Text Processing :: Linguistic", - ], + ext_modules=cythonize( + extensions, + annotate=False, + compiler_directives=compiler_directives, + ), )