Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch from setup.py to declarative setup.cfg #375

Merged
merged 1 commit into from Nov 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.rst
@@ -1,8 +1,8 @@
=======
janus
=======
.. image:: https://travis-ci.com/aio-libs/janus.svg?branch=master
:target: https://travis-ci.com/aio-libs/janus
.. image:: https://github.com/aio-libs/janus/actions/workflows/ci.yml/badge.svg
:target: https://github.com/aio-libs/janus/actions/workflows/ci.yml
.. image:: https://codecov.io/gh/aio-libs/janus/branch/master/graph/badge.svg
:target: https://codecov.io/gh/aio-libs/janus
.. image:: https://img.shields.io/pypi/v/janus.svg
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
@@ -0,0 +1,3 @@
[build-system]
requires = ["setuptools>=51", "wheel>=0.36"]
build-backend = "setuptools.build_meta"
51 changes: 51 additions & 0 deletions setup.cfg
@@ -1,3 +1,54 @@
[metadata]
name = janus
version = attr: janus.__version__
url = https://github.com/aio-libs/janus
project_urls =
Chat: Gitter = https://gitter.im/aio-libs/Lobby
CI: GitHub Actions = https://github.com/aio-libs/janus/actions/workflows/ci.yml
Coverage: codecov = https://codecov.io/github/aio-libs/janus
GitHub: issues = https://github.com/aio-libs/janus/issues
GitHub: repo = https://github.com/aio-libs/janus
description = Mixed sync-async queue to interoperate between asyncio tasks and classic threads
long_description = file: README.rst
long_description_content_type = text/x-rst
author = Andrew Svetlov <andrew.svetlov@gmail.com>
author_email = andrew.svetlov@gmail.com
license = Apache 2
license_files = LICENSE.txt
classifiers =
Development Status :: 5 - Production/Stable

Framework :: AsyncIO

Intended Audience :: Developers

License :: OSI Approved :: Apache Software License

Operating System :: POSIX
Operating System :: MacOS :: MacOS X
Operating System :: Microsoft :: Windows

Programming Language :: Python
Programming Language :: Python :: 3
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10

Topic :: Software Development :: Libraries

keywords= janus, queue, asyncio

[options]
python_requires = >=3.6
packages = find:
# https://setuptools.readthedocs.io/en/latest/setuptools.html#setting-the-zip-safe-flag
zip_safe = True
include_package_data = True

install_requires =

[flake8]
exclude = .git,.env,__pycache__,.eggs
max-line-length = 88
Expand Down
90 changes: 2 additions & 88 deletions setup.py
@@ -1,88 +1,2 @@
import codecs
import os
import re
import sys

from setuptools import find_packages, setup
from setuptools.command.test import test as TestCommand


class PyTest(TestCommand):
user_options = [("pytest-args=", "a", "Arguments to pass to py.test")]

def initialize_options(self):
TestCommand.initialize_options(self)
self.pytest_args = []

def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
self.test_suite = True

def run_tests(self):
# import here, cause outside the eggs aren't loaded
import pytest

errno = pytest.main(self.pytest_args)
sys.exit(errno)


with codecs.open(
os.path.join(os.path.abspath(os.path.dirname(__file__)), "janus", "__init__.py"),
"r",
"latin1",
) as fp:
try:
version = re.findall(r'^__version__ = "([^"]+)"$', fp.read(), re.M)[0]
except IndexError:
raise RuntimeError("Unable to determine version.")


def read(f):
return open(os.path.join(os.path.dirname(__file__), f)).read().strip()


install_requires = []

tests_require = install_requires + [
"pytest>=5.4",
"pytest-asyncio>=0.10.0",
]
extras_require = {}


setup(
name="janus",
version=version,
description=(
"Mixed sync-async queue to interoperate between "
"asyncio tasks and classic threads"
),
long_description="\n\n".join((read("README.rst"), read("CHANGES.rst"))),
classifiers=[
"License :: OSI Approved :: Apache Software License",
"Intended Audience :: Developers",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Topic :: Software Development :: Libraries",
"Framework :: AsyncIO",
],
author="Andrew Svetlov",
author_email="andrew.svetlov@gmail.com",
url="https://github.com/aio-libs/janus/",
license="Apache 2",
packages=find_packages(),
python_requires=">=3.6",
install_requires=install_requires,
tests_require=tests_require,
cmdclass={"test": PyTest},
include_package_data=True,
zip_safe=True,
keywords=["janus", "queue", "asyncio"],
extras_require=extras_require,
)
from setuptools import setup
setup()