Skip to content

Commit 67e3782

Browse files
authored
Switch from setup.py to declarative setup.cfg (#375)
1 parent 8a0c498 commit 67e3782

File tree

4 files changed

+58
-90
lines changed

4 files changed

+58
-90
lines changed

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
=======
22
janus
33
=======
4-
.. image:: https://travis-ci.com/aio-libs/janus.svg?branch=master
5-
:target: https://travis-ci.com/aio-libs/janus
4+
.. image:: https://github.com/aio-libs/janus/actions/workflows/ci.yml/badge.svg
5+
:target: https://github.com/aio-libs/janus/actions/workflows/ci.yml
66
.. image:: https://codecov.io/gh/aio-libs/janus/branch/master/graph/badge.svg
77
:target: https://codecov.io/gh/aio-libs/janus
88
.. image:: https://img.shields.io/pypi/v/janus.svg

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[build-system]
2+
requires = ["setuptools>=51", "wheel>=0.36"]
3+
build-backend = "setuptools.build_meta"

setup.cfg

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,54 @@
1+
[metadata]
2+
name = janus
3+
version = attr: janus.__version__
4+
url = https://github.com/aio-libs/janus
5+
project_urls =
6+
Chat: Gitter = https://gitter.im/aio-libs/Lobby
7+
CI: GitHub Actions = https://github.com/aio-libs/janus/actions/workflows/ci.yml
8+
Coverage: codecov = https://codecov.io/github/aio-libs/janus
9+
GitHub: issues = https://github.com/aio-libs/janus/issues
10+
GitHub: repo = https://github.com/aio-libs/janus
11+
description = Mixed sync-async queue to interoperate between asyncio tasks and classic threads
12+
long_description = file: README.rst
13+
long_description_content_type = text/x-rst
14+
author = Andrew Svetlov <[email protected]>
15+
author_email = [email protected]
16+
license = Apache 2
17+
license_files = LICENSE.txt
18+
classifiers =
19+
Development Status :: 5 - Production/Stable
20+
21+
Framework :: AsyncIO
22+
23+
Intended Audience :: Developers
24+
25+
License :: OSI Approved :: Apache Software License
26+
27+
Operating System :: POSIX
28+
Operating System :: MacOS :: MacOS X
29+
Operating System :: Microsoft :: Windows
30+
31+
Programming Language :: Python
32+
Programming Language :: Python :: 3
33+
Programming Language :: Python :: 3.6
34+
Programming Language :: Python :: 3.7
35+
Programming Language :: Python :: 3.8
36+
Programming Language :: Python :: 3.9
37+
Programming Language :: Python :: 3.10
38+
39+
Topic :: Software Development :: Libraries
40+
41+
keywords= janus, queue, asyncio
42+
43+
[options]
44+
python_requires = >=3.6
45+
packages = find:
46+
# https://setuptools.readthedocs.io/en/latest/setuptools.html#setting-the-zip-safe-flag
47+
zip_safe = True
48+
include_package_data = True
49+
50+
install_requires =
51+
152
[flake8]
253
exclude = .git,.env,__pycache__,.eggs
354
max-line-length = 88

setup.py

Lines changed: 2 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -1,88 +1,2 @@
1-
import codecs
2-
import os
3-
import re
4-
import sys
5-
6-
from setuptools import find_packages, setup
7-
from setuptools.command.test import test as TestCommand
8-
9-
10-
class PyTest(TestCommand):
11-
user_options = [("pytest-args=", "a", "Arguments to pass to py.test")]
12-
13-
def initialize_options(self):
14-
TestCommand.initialize_options(self)
15-
self.pytest_args = []
16-
17-
def finalize_options(self):
18-
TestCommand.finalize_options(self)
19-
self.test_args = []
20-
self.test_suite = True
21-
22-
def run_tests(self):
23-
# import here, cause outside the eggs aren't loaded
24-
import pytest
25-
26-
errno = pytest.main(self.pytest_args)
27-
sys.exit(errno)
28-
29-
30-
with codecs.open(
31-
os.path.join(os.path.abspath(os.path.dirname(__file__)), "janus", "__init__.py"),
32-
"r",
33-
"latin1",
34-
) as fp:
35-
try:
36-
version = re.findall(r'^__version__ = "([^"]+)"$', fp.read(), re.M)[0]
37-
except IndexError:
38-
raise RuntimeError("Unable to determine version.")
39-
40-
41-
def read(f):
42-
return open(os.path.join(os.path.dirname(__file__), f)).read().strip()
43-
44-
45-
install_requires = []
46-
47-
tests_require = install_requires + [
48-
"pytest>=5.4",
49-
"pytest-asyncio>=0.10.0",
50-
]
51-
extras_require = {}
52-
53-
54-
setup(
55-
name="janus",
56-
version=version,
57-
description=(
58-
"Mixed sync-async queue to interoperate between "
59-
"asyncio tasks and classic threads"
60-
),
61-
long_description="\n\n".join((read("README.rst"), read("CHANGES.rst"))),
62-
classifiers=[
63-
"License :: OSI Approved :: Apache Software License",
64-
"Intended Audience :: Developers",
65-
"Programming Language :: Python",
66-
"Programming Language :: Python :: 3",
67-
"Programming Language :: Python :: 3.6",
68-
"Programming Language :: Python :: 3.7",
69-
"Programming Language :: Python :: 3.8",
70-
"Programming Language :: Python :: 3.9",
71-
"Programming Language :: Python :: 3.10",
72-
"Topic :: Software Development :: Libraries",
73-
"Framework :: AsyncIO",
74-
],
75-
author="Andrew Svetlov",
76-
author_email="[email protected]",
77-
url="https://github.com/aio-libs/janus/",
78-
license="Apache 2",
79-
packages=find_packages(),
80-
python_requires=">=3.6",
81-
install_requires=install_requires,
82-
tests_require=tests_require,
83-
cmdclass={"test": PyTest},
84-
include_package_data=True,
85-
zip_safe=True,
86-
keywords=["janus", "queue", "asyncio"],
87-
extras_require=extras_require,
88-
)
1+
from setuptools import setup
2+
setup()

0 commit comments

Comments
 (0)