Skip to content

Commit aa6a72e

Browse files
committed
Migrate setup.py to declarative setup.cfg
Move all package metadata from setup.py to setup.cfg using setuptools declarative config (via setuptools-py2cfg). setup.py is reduced to a minimal shim. - version: read dynamically via attr: unittest2pytest.__version__ - long_description: read from files via file: README.rst, CHANGELOG.rst - All classifiers, entry_points, install_requires preserved exactly
1 parent 24e799e commit aa6a72e

2 files changed

Lines changed: 40 additions & 83 deletions

File tree

setup.cfg

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,42 @@
1+
[metadata]
2+
name = unittest2pytest
3+
version = attr: unittest2pytest.__version__
4+
author = Hartmut Goebel
5+
author_email = h.goebel@crazy-compilers.com
6+
license = GPLv3+
7+
description = Convert unittest test-cases to pytest
8+
url = https://github.com/pytest-dev/unittest2pytest
9+
long_description = file: README.rst, CHANGELOG.rst
10+
long_description_content_type = text/x-rst
11+
classifiers =
12+
Development Status :: 4 - Beta
13+
Environment :: Console
14+
Intended Audience :: Developers
15+
License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
16+
Operating System :: OS Independent
17+
Programming Language :: Python
18+
Programming Language :: Python :: 3
19+
Programming Language :: Python :: 3 :: Only
20+
Programming Language :: Python :: 3.9
21+
Programming Language :: Python :: 3.10
22+
Programming Language :: Python :: 3.11
23+
Programming Language :: Python :: 3.12
24+
Programming Language :: Python :: 3.13
25+
Programming Language :: Python :: 3.14
26+
Programming Language :: Python :: 3.15
27+
Topic :: Software Development
28+
Topic :: Utilities
29+
30+
[options]
31+
packages = unittest2pytest, unittest2pytest.fixes
32+
zip_safe = False
33+
install_requires = fissix
34+
python_requires = >=3.9
35+
36+
[options.entry_points]
37+
console_scripts =
38+
unittest2pytest = unittest2pytest.__main__:main
39+
140
[zest.releaser]
241
python-file-with-version = unittest2pytest/__init__.py
342
push-changes = no

setup.py

Lines changed: 1 addition & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -1,85 +1,3 @@
1-
#!/usr/bin/env python
2-
#
3-
# Copyright 2015-2019 by Hartmut Goebel <h.goebel@crazy-compilers.com>
4-
#
5-
# This file is part of unittest2pytest.
6-
#
7-
# unittest2pytest is free software: you can redistribute it and/or modify
8-
# it under the terms of the GNU General Public License as published by
9-
# the Free Software Foundation, either version 3 of the License, or
10-
# (at your option) any later version.
11-
#
12-
# This program is distributed in the hope that it will be useful, but
13-
# WITHOUT ANY WARRANTY; without even the implied warranty of
14-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15-
# General Public License for more details.
16-
#
17-
# You should have received a copy of the GNU General Public License
18-
# along with this program. If not, see <http://www.gnu.org/licenses/>.
19-
#
20-
from pathlib import Path
21-
221
from setuptools import setup
23-
import re
24-
25-
26-
this_dir = Path(__file__).parent
27-
28-
def get_version(filename):
29-
"""
30-
Return package version as listed in `__version__` in `filename`.
31-
"""
32-
init_py = this_dir.joinpath(filename).read_text(encoding="utf-8")
33-
return re.search("__version__ = ['\"]([^'\"]+)['\"]", init_py).group(1)
34-
35-
36-
version = get_version('unittest2pytest/__init__.py')
37-
38-
39-
def read(filename):
40-
return this_dir.joinpath(filename).read_text(encoding='utf-8')
41-
42-
43-
long_description = '\n\n'.join([read('README.rst'),
44-
read('CHANGELOG.rst')])
45-
462

47-
setup(
48-
name="unittest2pytest",
49-
license='GPLv3+',
50-
version=version,
51-
description="Convert unittest test-cases to pytest",
52-
long_description=long_description,
53-
long_description_content_type="text/x-rst",
54-
author="Hartmut Goebel",
55-
author_email="h.goebel@crazy-compilers.com",
56-
url="https://github.com/pytest-dev/unittest2pytest",
57-
packages=["unittest2pytest", "unittest2pytest.fixes"],
58-
entry_points={
59-
'console_scripts': [
60-
'unittest2pytest = unittest2pytest.__main__:main',
61-
],
62-
},
63-
classifiers=[
64-
"Development Status :: 4 - Beta",
65-
"Environment :: Console",
66-
"Intended Audience :: Developers",
67-
"License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
68-
"Operating System :: OS Independent",
69-
"Programming Language :: Python",
70-
"Programming Language :: Python :: 3",
71-
"Programming Language :: Python :: 3 :: Only",
72-
"Programming Language :: Python :: 3.9",
73-
"Programming Language :: Python :: 3.10",
74-
"Programming Language :: Python :: 3.11",
75-
"Programming Language :: Python :: 3.12",
76-
"Programming Language :: Python :: 3.13",
77-
"Programming Language :: Python :: 3.14",
78-
"Programming Language :: Python :: 3.15",
79-
"Topic :: Software Development",
80-
"Topic :: Utilities",
81-
],
82-
install_requires=["fissix"],
83-
python_requires=">=3.9",
84-
zip_safe=False
85-
)
3+
setup()

0 commit comments

Comments
 (0)