From 52d9cb80d406d46526803005122165f4f6cff786 Mon Sep 17 00:00:00 2001 From: Daniel Roythorne Date: Thu, 16 Mar 2023 15:56:51 +0000 Subject: [PATCH 1/3] Replace setup.py with pyproject.toml, removing need for deprecated setup_requires setup.py configuration field. --- Pipfile | 1 + pyproject.toml | 31 +++++++++++++++++++++++++++++ setup.py | 54 -------------------------------------------------- 3 files changed, 32 insertions(+), 54 deletions(-) create mode 100644 pyproject.toml delete mode 100644 setup.py diff --git a/Pipfile b/Pipfile index cef4773..f354a40 100644 --- a/Pipfile +++ b/Pipfile @@ -13,6 +13,7 @@ isort = "*" [packages] numpy = "*" scikit-learn = "*" +seqeval = {editable = true, extras = ["dev"], path = "."} [requires] python_version = "3.8" diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..0e93454 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,31 @@ +[build-system] +requires = ["setuptools", "setuptools-scm"] +build-backend = "setuptools.build_meta" + +[project] +name = "seqeval" +authors = [ + {name = "Hironsan", email = "hiroki.nakayama.py@gmail.com"}, +] +description = "Testing framework for sequence labeling" +readme = "README.md" +requires-python = ">=3.8" +license = {text = "MIT"} +classifiers = [ + "License :: OSI Approved :: MIT License", + "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 :: Implementation :: CPython", + "Programming Language :: Python :: Implementation :: PyPy" +] +dependencies = ["numpy>=1.14.0", "scikit-learn>=0.21.3"] +dynamic = ["version"] + +[project.optional-dependencies] +dev = ["pytest", "autopep8", "flake8", "pytest-cov", "isort"] + +[project.scripts] diff --git a/setup.py b/setup.py deleted file mode 100644 index bd36f8f..0000000 --- a/setup.py +++ /dev/null @@ -1,54 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -import io -import os -import sys - -from setuptools import find_packages, setup - -# Package meta-data. -NAME = 'seqeval' -DESCRIPTION = 'Testing framework for sequence labeling' -URL = 'https://github.com/chakki-works/seqeval' -EMAIL = 'hiroki.nakayama.py@gmail.com' -AUTHOR = 'Hironsan' -LICENSE = 'MIT' - -here = os.path.abspath(os.path.dirname(__file__)) -with io.open(os.path.join(here, 'README.md'), encoding='utf-8') as f: - long_description = '\n' + f.read() - -if sys.argv[-1] == 'publish': - os.system('python setup.py sdist bdist_wheel upload') - sys.exit() - -required = ['numpy>=1.14.0', 'scikit-learn>=0.21.3'] - -setup( - name=NAME, - use_scm_version=True, - setup_requires=['setuptools_scm'], - description=DESCRIPTION, - long_description=long_description, - long_description_content_type='text/markdown', - author=AUTHOR, - author_email=EMAIL, - url=URL, - packages=find_packages(exclude=('tests',)), - install_requires=required, - extras_require={ - 'cpu': [], - 'gpu': [], - }, - include_package_data=True, - license=LICENSE, - classifiers=[ - 'License :: OSI Approved :: MIT License', - 'Programming Language :: Python', - 'Programming Language :: Python :: 3.6', - 'Programming Language :: Python :: 3.7', - 'Programming Language :: Python :: 3.8', - 'Programming Language :: Python :: Implementation :: CPython', - 'Programming Language :: Python :: Implementation :: PyPy' - ], -) From 2bce119cf7a95483e73879771a532d8ef00349d4 Mon Sep 17 00:00:00 2001 From: Daniel Roythorne Date: Thu, 16 Mar 2023 16:16:55 +0000 Subject: [PATCH 2/3] Remove Pipfile editable install. --- Pipfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Pipfile b/Pipfile index f354a40..cef4773 100644 --- a/Pipfile +++ b/Pipfile @@ -13,7 +13,6 @@ isort = "*" [packages] numpy = "*" scikit-learn = "*" -seqeval = {editable = true, extras = ["dev"], path = "."} [requires] python_version = "3.8" From dd7103c4fa1881b7395357d4d62afc313af5f102 Mon Sep 17 00:00:00 2001 From: Daniel Roythorne Date: Thu, 16 Mar 2023 16:24:50 +0000 Subject: [PATCH 3/3] Added shell setup.py file to ensure compatibility with legacy builds. --- setup.py | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 setup.py diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..6068493 --- /dev/null +++ b/setup.py @@ -0,0 +1,3 @@ +from setuptools import setup + +setup()