Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ jobs:
strategy:
matrix:
python-version:
- 3.7
- 3.8
- 3.9
- "3.7"
- "3.8"
- "3.9"
- "3.10"
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
Expand Down
2 changes: 1 addition & 1 deletion dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ flake8-future-import
flake8-import-order
flake8-type-checking; python_version >= '3.8'
furo==2022.4.7 # Sphinx theme
pytest~=6.2.5
pytest~=7.1.0
pytest-vcr~=1.0.2
requests-mock~=1.9.3
sphinx>=4,<5
Expand Down
10 changes: 9 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ classifiers = [
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Topic :: Communications :: Chat :: Internet Relay Chat",
]
requires-python = ">=3.7"
Expand All @@ -53,11 +54,18 @@ dependencies = [
"Source" = "https://github.com/sopel-irc/sopel"
"Coverage" = "https://coveralls.io/github/sopel-irc/sopel"


[project.scripts]
sopel = "sopel.cli.run:main"
sopel-config = "sopel.cli.config:main"
sopel-plugins = "sopel.cli.plugins:main"

[project.entry-points.pytest11]
pytest-sopel = "sopel.tests.pytest_plugin"

[tool.pytest.ini_options]
python_files = "*.py"
addopts = "--tb=short -p no:nose"
norecursedirs = "build contrib"
filterwarnings = [
"ignore::pytest.PytestAssertRewriteWarning",
]
5 changes: 0 additions & 5 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,3 @@ no-accept-encodings = True
[mypy]
plugins = sqlalchemy.ext.mypy.plugin
show_error_codes = True

[tool:pytest]
python_files = *.py
addopts = --tb=short
norecursedirs = contrib
13 changes: 7 additions & 6 deletions sopel/plugins/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
from __future__ import annotations

import collections
import imp
import importlib
import itertools
import os

Expand Down Expand Up @@ -67,12 +67,13 @@ def find_internal_plugins():
Internal plugins can be found under ``sopel.modules``. This list does not
include the ``coretasks`` plugin.
"""
plugin_dir = imp.find_module(
'modules',
[imp.find_module('sopel')[1]]
)[1]
modules = importlib.util.find_spec('sopel.modules')
plugin_list = itertools.chain.from_iterable(
_list_plugin_filenames(path)
for path in modules.submodule_search_locations
)

for name, _ in _list_plugin_filenames(plugin_dir):
for name, _ in set(plugin_list):
yield handlers.PyModulePlugin(name, 'sopel.modules')


Expand Down