1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190
|
From: Kyle Benesch <4b796c65+github@gmail.com>
Subject: Move all setup data to pyproject.toml
Origin: upstream, https://github.com/kvas-it/pytest-console-scripts/commit/aead98a5c429d490d8c271f3a97123f15c7cb235
and https://github.com/kvas-it/pytest-console-scripts/commit/3fb278a1d1fbb544e99a220bfcce4e59f463f7ee
diff --git a/.gitignore b/.gitignore
index 557da99..e7ddc13 100644
--- a/.gitignore
+++ b/.gitignore
@@ -23,6 +23,7 @@ var/
*.egg-info/
.installed.cfg
*.egg
+_version.py
# PyInstaller
# Usually these files are written by a python script from a template
diff --git a/MANIFEST.in b/MANIFEST.in
index 0f270b1..e9919fb 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -3,5 +3,6 @@ graft tests
include tox.ini
include LICENSE
include *.md
+include MANIFEST.in
global-exclude *.py[cod] __pycache__
diff --git a/pyproject.toml b/pyproject.toml
new file mode 100644
index 0000000..dc6378f
--- /dev/null
+++ b/pyproject.toml
@@ -0,0 +1,51 @@
+[build-system]
+requires = ['flit_scm']
+build-backend = 'flit_scm:buildapi'
+
+[project]
+name = 'pytest-console-scripts'
+authors = [{ name = 'Vasily Kuznetsov', email = 'kvas.it@gmail.com' }]
+maintainers = [
+ { name = 'Vasily Kuznetsov', email = 'kvas.it@gmail.com' },
+ { name = 'Kyle Benesch', email = '4b796c65+github@gmail.com' },
+]
+readme = 'README.md'
+license = { file = 'LICENSE' }
+classifiers = [
+ 'Development Status :: 4 - Beta',
+ 'Framework :: Pytest',
+ 'Intended Audience :: Developers',
+ 'License :: OSI Approved :: MIT License',
+ 'Operating System :: OS Independent',
+ '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',
+ 'Topic :: Software Development :: Testing',
+ 'Typing :: Typed',
+]
+requires-python = '>=3.8'
+dynamic = ['version', 'description']
+dependencies = [
+ 'pytest >=4.0.0',
+ "importlib_metadata >=3.6; python_version < '3.10'",
+]
+
+[tool.setuptools_scm]
+write_to = 'pytest_console_scripts/_version.py'
+
+[project.urls]
+Source = 'https://github.com/kvas-it/pytest-console-scripts'
+Changelog = 'https://github.com/kvas-it/pytest-console-scripts/blob/master/CHANGELOG.md'
+Issues = 'https://github.com/kvas-it/pytest-console-scripts/issues'
+Forum = 'https://github.com/kvas-it/pytest-console-scripts/discussions'
+
+[project.entry-points.'pytest11']
+console-scripts = 'pytest_console_scripts'
+
+[tool.flit.sdist]
+include = ['*.md', 'MANIFEST.in', 'tox.ini', 'tests/']
diff --git a/pytest_console_scripts/__init__.py b/pytest_console_scripts/__init__.py
index 157665e..5d5699a 100644
--- a/pytest_console_scripts/__init__.py
+++ b/pytest_console_scripts/__init__.py
@@ -1,3 +1,4 @@
+"""Pytest plugin for testing console scripts."""
from __future__ import annotations
import contextlib
@@ -16,11 +17,15 @@ from unittest import mock
import pytest
+from . import _version
+
if sys.version_info < (3, 10):
import importlib_metadata
else:
import importlib.metadata as importlib_metadata
+__version__ = _version.version
+
_StrOrPath = Union[str, os.PathLike]
"""A command line argument type as a str or path."""
diff --git a/setup.cfg b/setup.cfg
deleted file mode 100644
index b7e4789..0000000
--- a/setup.cfg
+++ /dev/null
@@ -1,2 +0,0 @@
-[aliases]
-test=pytest
diff --git a/setup.py b/setup.py
deleted file mode 100644
index 254f067..0000000
--- a/setup.py
+++ /dev/null
@@ -1,49 +0,0 @@
-from pathlib import Path
-from setuptools import setup
-
-THIS_DIR = Path(__file__).parent
-README_TEXT = (THIS_DIR / 'README.md').read_text(encoding='utf-8')
-
-
-setup(
- name='pytest-console-scripts',
- use_scm_version=True,
- author='Vasily Kuznetsov',
- author_email='kvas.it@gmail.com',
- maintainer='Vasily Kuznetsov, Kyle Benesch',
- maintainer_email='kvas.it@gmail.com, 4b796c65+github@gmail.com',
- license='MIT',
- url='https://github.com/kvas-it/pytest-console-scripts',
- description='Pytest plugin for testing console scripts',
- long_description=README_TEXT,
- long_description_content_type='text/markdown',
- packages=['pytest_console_scripts'],
- package_data={'pytest_console_scripts': ['py.typed']},
- install_requires=[
- 'pytest >=4.0.0',
- "importlib_metadata >=3.6; python_version < '3.10'",
- ],
- python_requires='>=3.8',
- setup_requires=['setuptools-scm'],
- classifiers=[
- 'Development Status :: 4 - Beta',
- 'Framework :: Pytest',
- 'Intended Audience :: Developers',
- 'Topic :: Software Development :: Testing',
- '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',
- 'Operating System :: OS Independent',
- 'License :: OSI Approved :: MIT License',
- ],
- entry_points={
- 'pytest11': [
- 'console-scripts = pytest_console_scripts',
- ],
- },
-)
diff --git a/tox.ini b/tox.ini
index 2e03c93..bfaccb8 100644
--- a/tox.ini
+++ b/tox.ini
@@ -44,9 +44,9 @@ deps =
types-setuptools
commands =
- check-manifest --ignore *.ini,tests*,.*.yml,demo*
- flake8 pytest_console_scripts setup.py tests
- mypy pytest_console_scripts setup.py tests
+ check-manifest --ignore *.ini,tests*,.*.yml,demo*,_version.py
+ flake8 pytest_console_scripts tests
+ mypy pytest_console_scripts tests
[flake8]
exclude = .tox,*.egg,build
|