diff --git a/.github/workflows/tox.yml b/.github/workflows/tox.yml index 4a63b89..360c9b2 100644 --- a/.github/workflows/tox.yml +++ b/.github/workflows/tox.yml @@ -3,25 +3,36 @@ name: tox on: [push, pull_request] jobs: - tox: + flake8-and-docs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: 3.12 + - name: Install Tox and any other packages + run: pip install tox + - name: Run flake8 / docs + run: tox -e flake8,docs + test: runs-on: ubuntu-latest strategy: matrix: - python: ["3.11", "3.12"] + python: ["3.11", "3.12", "3.13"] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Setup Python uses: actions/setup-python@v4 with: python-version: ${{ matrix.python }} - name: Start Redis - uses: supercharge/redis-github-action@1.5.0 + uses: supercharge/redis-github-action@1.8.0 + with: + redis-version: 6 - name: Install Tox and any other packages run: pip install tox - name: Run Tox run: tox -e py - - name: Run flake8 / docs - run: tox -e flake8,docs - if: matrix.python == 3.12 diff --git a/MANIFEST.in b/MANIFEST.in index d624caa..ce91fd5 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -9,7 +9,6 @@ include Makefile *.rst *.cfg *.ini *.txt global-exclude *.pyc *.swp global-exclude __pycache__ include conftest.py -exclude bootstrap.py exclude .installed.cfg exclude .coveragerc exclude update.sh diff --git a/README.rst b/README.rst index 888482a..aff8ff6 100644 --- a/README.rst +++ b/README.rst @@ -19,7 +19,7 @@ A pluggable irc client library based on python's `asyncio :target: http://thenounproject.com/term/hydra/46963/ -Requires python 3.5+ +Requires python 3.11+ Python 2 is no longer supported, but if you don't have a choice you can use an older version:: diff --git a/examples/wsgiapp.py b/examples/wsgiapp.py index 253aa09..d68b641 100644 --- a/examples/wsgiapp.py +++ b/examples/wsgiapp.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- import asyncio -from aiohttp import wsgi +from aiohttp_wsgi import wsgi from irc3 import plugin import json diff --git a/irc3/plugins/web.py b/irc3/plugins/web.py index 645c637..1191553 100644 --- a/irc3/plugins/web.py +++ b/irc3/plugins/web.py @@ -6,9 +6,9 @@ Introduce a web interface to post messages -Install aiohttp:: +Install aiohttp and aiohttp-wsgi:: - $ pip install aiohttp + $ pip install aiohttp aiohttp-wsgi .. >>> from irc3.testing import IrcBot diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..f650e14 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,66 @@ +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[project] +name = "irc3" +version = "1.1.11.dev0" +description = "plugable irc client library based on asyncio with DCC and SASL support" +readme = "README.rst" +requires-python = ">=3.11" +license = { file = "LICENSE" } +authors = [{ name = "Gael Pasgrimaud", email = "gael@gawel.org" }] +keywords = ["irc", "dcc", "asyncio"] +classifiers = [ + "Intended Audience :: Developers", + "Programming Language :: Python :: 3", + "Topic :: Communications :: Chat :: Internet Relay Chat", + "Development Status :: 5 - Production/Stable", +] +dependencies = ["venusian>=3.0", "docopt"] + +[project.optional-dependencies] +test = [ + "aiocron", + "aiohttp", + "aiohttp-wsgi", + "feedparser", + "irc3-plugins-test", + "pysocks", + "pytest", + "pytest-aiohttp", + "pytest-asyncio", + "redis", + "requests", + "twitter", +] +web = [ + "aiohttp", + "aiohttp-wsgi", +] + +[project.scripts] +irc3 = "irc3:run" +irc3d = "irc3d:run" + +[project.urls] +Homepage = "https://github.com/gawel/irc3/" + +[tool.setuptools.packages.find] +exclude = ["docs", "tests"] + +[tool.pytest.ini_options] +asyncio_default_fixture_loop_scope = "function" +addopts = [ + "-p no:warnings", + "-p no:unraisableexception", + "--doctest-modules", + "--doctest-glob='*.rst'", +] +ignore = [ + "CHANGES.rst", + "examples/*", + "docs/conf.py", + "irc3/_*.py", + "irc3/testing.py", +] diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index fea3734..0000000 --- a/setup.cfg +++ /dev/null @@ -1,21 +0,0 @@ -[tool:pytest] -asyncio_default_fixture_loop_scope=function -addopts = -p no:warnings - -p no:unraisableexception - --doctest-modules - --doctest-glob='*.rst' - --ignore=CHANGES.rst - --ignore=setup.py - --ignore=bootstrap.py - --ignore=examples/ - --ignore=docs/conf.py - --ignore=irc3/_*.py - --ignore=irc3/testing.py - -[flake8] -exclude=bootstrap.py,./irc3/compat.py,./.tox/*,./src/*,./docs*,./.eggs/ -ignore=W605 - -[aliases] -dev = develop easy_install irc3[test] -test=pytest diff --git a/setup.py b/setup.py deleted file mode 100644 index b6aef8a..0000000 --- a/setup.py +++ /dev/null @@ -1,68 +0,0 @@ -# -*- coding: utf-8 -*- -import os -import codecs -from setuptools import setup -from setuptools import find_packages - -version = '1.1.11.dev0' - -install_requires = ['venusian>=3.0', 'docopt'] -test_requires = [ - 'pytest-asyncio', - 'pytest-aiohttp', - 'feedparser', - 'requests', - 'pysocks', - 'twitter', - 'aiocron', - 'redis', - 'pytest', - 'irc3-plugins-test', -] - - -def read(*rnames): - filename = os.path.join(os.path.dirname(__file__), *rnames) - with codecs.open(filename, encoding='utf8') as fd: - return fd.read() - - -setup( - name='irc3', - version=version, - description=( - "plugable irc client library based on asyncio " - "with DCC and SASL support" - ), - long_description=read('README.rst'), - classifiers=[ - 'Intended Audience :: Developers', - 'Programming Language :: Python :: 3.7', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'License :: OSI Approved :: MIT License', - 'Topic :: Communications :: Chat :: Internet Relay Chat', - 'Development Status :: 5 - Production/Stable', - ], - keywords='irc dcc asyncio', - author='Gael Pasgrimaud', - author_email='gael@gawel.org', - url='https://github.com/gawel/irc3/', - license='MIT', - packages=find_packages(exclude=['docs', 'tests']), - include_package_data=True, - zip_safe=False, - install_requires=install_requires, - tests_require=test_requires, - setup_requires=["pytest-runner"], - extras_require={ - 'test': test_requires, - 'web': ['aiohttp'], - }, - entry_points=''' - [console_scripts] - irc3 = irc3:run - irc3d = irc3d:run - ''', -) diff --git a/tox.ini b/tox.ini index 3d8a6ee..0e21ff4 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,6 @@ [tox] -envlist = py311,py312,flake8,docs +envlist = py311,py312,py313,flake8,docs +isolated_build=true [testenv] skipsdist=true @@ -8,7 +9,7 @@ allowlist_externals = rm commands = rm -f .coverage - coverage run {envbindir}/py.test -xv [] + coverage run {envbindir}/py.test -xv tests coverage report -m deps = -e .[test,web] @@ -44,3 +45,13 @@ commands = python -m irc3._parse_rfc python -m irc3._gen_doc deps = + +[flake8] +exclude = + ./irc3/compat.py + ./.tox/* + ./src/* + ./docs* + ./.eggs/ + ./.venv/ +ignore = W605