Skip to content

Commit 1dd31b2

Browse files
authored
Merge pull request #880 from bluetech/setup-cfg
Move stuff from setup.py to setup.cfg, add pytest_django.__version__
2 parents 625ff05 + f0871a9 commit 1dd31b2

File tree

4 files changed

+67
-68
lines changed

4 files changed

+67
-68
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,5 @@ _build
1616
.Python
1717
.eggs
1818
*.egg
19+
# autogenerated by setuptools-scm
20+
/pytest_django/_version.py

pytest_django/__init__.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
try:
2+
from ._version import version as __version__
3+
except ImportError: # pragma: no cover
4+
# Broken installation, we don't even try.
5+
__version__ = "unknown"
6+
7+
8+
__all__ = (
9+
"__version__",
10+
)

setup.cfg

Lines changed: 52 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,54 @@
1+
[metadata]
2+
name = pytest-django
3+
description = A Django plugin for pytest.
4+
long_description = file: README.rst
5+
long_description_content_type = text/x-rst
6+
author = Andreas Pelme
7+
author_email = andreas@pelme.se
8+
maintainer = Andreas Pelme
9+
maintainer_email = andreas@pelme.se
10+
url = https://pytest-django.readthedocs.io/
11+
license = BSD-3-Clause
12+
license_file = LICENSE
13+
classifiers =
14+
Development Status :: 5 - Production/Stable
15+
Framework :: Django
16+
Framework :: Django :: 2.2
17+
Framework :: Django :: 3.0
18+
Framework :: Django :: 3.1
19+
Intended Audience :: Developers
20+
License :: OSI Approved :: BSD License
21+
Operating System :: OS Independent
22+
Programming Language :: Python
23+
Programming Language :: Python :: 3.5
24+
Programming Language :: Python :: 3.6
25+
Programming Language :: Python :: 3.7
26+
Programming Language :: Python :: 3.8
27+
Programming Language :: Python :: Implementation :: CPython
28+
Programming Language :: Python :: Implementation :: PyPy
29+
Topic :: Software Development :: Testing
30+
project_urls =
31+
Source=https://github.com/pytest-dev/pytest-django
32+
Changelog=https://pytest-django.readthedocs.io/en/latest/changelog.html
33+
34+
[options]
35+
packages = pytest_django
36+
python_requires = >=3.5
37+
setup_requires = setuptools_scm>=1.11.1
38+
install_requires = pytest>=5.4.0
39+
40+
[options.entry_points]
41+
pytest11 =
42+
django = pytest_django.plugin
43+
44+
[options.extras_require]
45+
docs =
46+
sphinx
47+
sphinx_rtd_theme
48+
testing =
49+
Django
50+
django-configurations>=2.0
51+
152
[tool:pytest]
253
# --strict: warnings become errors.
354
# -ra: show extra test summary info for everything.
@@ -15,8 +66,4 @@ max-line-length = 99
1566
exclude = lib/,src/,docs/,bin/
1667

1768
[isort]
18-
# NOTE: local imports are handled special (they do not get handled as "tests").
19-
forced_separate=tests,pytest_django,pytest_django_test
20-
21-
[metadata]
22-
license_file=LICENSE
69+
forced_separate = tests,pytest_django,pytest_django_test

setup.py

Lines changed: 3 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,7 @@
1-
#!/usr/bin/env python
2-
3-
import codecs
4-
import os
5-
61
from setuptools import setup
72

8-
9-
# Utility function to read the README file.
10-
# Used for the long_description. It's nice, because now 1) we have a top level
11-
# README file and 2) it's easier to type in the README file than to put a raw
12-
# string in below ...
13-
def read(fname):
14-
file_path = os.path.join(os.path.dirname(__file__), fname)
15-
return codecs.open(file_path, encoding='utf-8').read()
16-
17-
183
setup(
19-
name='pytest-django',
20-
use_scm_version=True,
21-
description='A Django plugin for pytest.',
22-
author='Andreas Pelme',
23-
author_email='andreas@pelme.se',
24-
maintainer="Andreas Pelme",
25-
maintainer_email="andreas@pelme.se",
26-
url='https://pytest-django.readthedocs.io/',
27-
license='BSD-3-Clause',
28-
packages=['pytest_django'],
29-
long_description=read('README.rst'),
30-
python_requires='>=3.5',
31-
setup_requires=['setuptools_scm>=1.11.1'],
32-
install_requires=[
33-
'pytest>=5.4.0',
34-
],
35-
extras_require={
36-
'docs': [
37-
'sphinx',
38-
'sphinx_rtd_theme',
39-
],
40-
'testing': [
41-
'Django',
42-
'django-configurations>=2.0',
43-
],
44-
},
45-
classifiers=['Development Status :: 5 - Production/Stable',
46-
'Framework :: Django',
47-
'Framework :: Django :: 2.2',
48-
'Framework :: Django :: 3.0',
49-
'Framework :: Django :: 3.1',
50-
'Intended Audience :: Developers',
51-
'License :: OSI Approved :: BSD License',
52-
'Operating System :: OS Independent',
53-
'Programming Language :: Python',
54-
'Programming Language :: Python :: 3.5',
55-
'Programming Language :: Python :: 3.6',
56-
'Programming Language :: Python :: 3.7',
57-
'Programming Language :: Python :: 3.8',
58-
'Programming Language :: Python :: Implementation :: CPython',
59-
'Programming Language :: Python :: Implementation :: PyPy',
60-
'Topic :: Software Development :: Testing',
61-
],
62-
project_urls={
63-
'Source': 'https://github.com/pytest-dev/pytest-django',
64-
'Changelog': 'https://pytest-django.readthedocs.io/en/latest/changelog.html',
4+
use_scm_version={
5+
'write_to': 'pytest_django/_version.py',
656
},
66-
# the following makes a plugin available to pytest
67-
entry_points={'pytest11': ['django = pytest_django.plugin']})
7+
)

0 commit comments

Comments
 (0)