Skip to content

Commit 93cc7e3

Browse files
authored
Merge pull request #17 from sopel-irc/upgrade-sopel-8
Upgrade for Sopel 8, Python 3.8 to 3.12, and make it an entrypoint plugin
2 parents 3afd545 + b6b357e commit 93cc7e3

11 files changed

Lines changed: 72 additions & 69 deletions

File tree

.github/workflows/python-publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ jobs:
2020
- name: Install dependencies
2121
run: |
2222
python -m pip install --upgrade pip
23-
pip install setuptools wheel twine
23+
pip install build wheel twine
2424
- name: Build and publish
2525
env:
2626
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
2727
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
2828
run: |
29-
python setup.py sdist bdist_wheel
29+
python -m build
3030
twine upload dist/*

.github/workflows/python-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
runs-on: ubuntu-latest
1616
strategy:
1717
matrix:
18-
python-version: [3.6, 3.7, 3.8, 3.9]
18+
python-version: [3.8, 3.9, 3.10, 3.11, 3.12]
1919
steps:
2020
- uses: actions/checkout@v2
2121
- name: Set up Python ${{ matrix.python-version }}

MANIFEST.in

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
include NEWS
2-
include COPYING
1+
include LICENSE
32
include README.md
4-
include *requirements.txt
53

6-
recursive-include tests *
74
recursive-exclude * __pycache__
85
recursive-exclude * *.py[co]

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ Since omdbapi put their API behind a free key, moving this module to a standalon
2424
## Requirements
2525
```
2626
requests
27-
sopel
27+
sopel>=8
2828
```

pyproject.toml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
[build-system]
2+
requires = ["setuptools>=68.0", "wheel"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[tool.setuptools]
6+
platforms = ["Linux x86, x86-64"]
7+
8+
[tool.setuptools.packages.find]
9+
include = ["sopel_imdb", "sopel_imdb.*"]
10+
namespaces = false
11+
12+
[project]
13+
name = "sopel-imdb"
14+
version = "1.3.0.dev0"
15+
description = "A working re-implementation of the imdb module for Sopel"
16+
keywords = [
17+
"sopel",
18+
"plugin",
19+
"imdb",
20+
"cinema",
21+
"movie",
22+
"bot",
23+
"irc",
24+
]
25+
maintainers = [
26+
{ name="Rusty Bower" },
27+
]
28+
authors = [
29+
{ name="Rusty Bower" },
30+
]
31+
32+
readme = "README.md"
33+
license = { text="MIT License" }
34+
classifiers = [
35+
"Development Status :: 5 - Production/Stable",
36+
"Intended Audience :: Developers",
37+
"Intended Audience :: System Administrators",
38+
"License :: Eiffel Forum License (EFL)",
39+
"License :: OSI Approved :: Eiffel Forum License",
40+
"Operating System :: POSIX :: Linux",
41+
"Programming Language :: Python :: 3.8",
42+
"Programming Language :: Python :: 3.9",
43+
"Programming Language :: Python :: 3.10",
44+
"Programming Language :: Python :: 3.11",
45+
"Programming Language :: Python :: 3.12",
46+
"Topic :: Communications :: Chat :: Internet Relay Chat",
47+
]
48+
requires-python = ">=3.8, <4"
49+
dependencies = [
50+
"requests",
51+
"sopel>=8",
52+
]
53+
54+
[project.urls]
55+
"Homepage" = "http://github.com/rustybower/sopel-imdb"
56+
"Bug Tracker" = "http://github.com/rustybower/sopel-imdb/issues"
57+
58+
[project.entry-points."sopel.plugins"]
59+
imdb = "sopel_imdb.imdb"

requirements.txt

Lines changed: 0 additions & 2 deletions
This file was deleted.

setup.py

Lines changed: 0 additions & 36 deletions
This file was deleted.

sopel_imdb/__init__.py

Whitespace-only changes.
Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
# coding=utf-8
2+
"""A working re-implementation of the imdb module for Sopel"""
23
# Copyright 2008, Sean B. Palmer, inamidst.com
34
# Copyright 2012, Elsie Powell, embolalia.com
45
# Copyright 2018, Rusty Bower, rustybower.com
56
# Licensed under the Eiffel Forum License 2.
6-
from __future__ import unicode_literals, absolute_import, print_function, division
7+
from __future__ import annotations
78

89
import re
9-
import requests
10-
from sopel.module import commands, example, url
10+
11+
from sopel.plugin import command, example, url
1112
from sopel.config.types import NO_DEFAULT, StaticSection, ValidatedAttribute
12-
from sopel.logger import get_logger
13+
from sopel.tools import get_logger
14+
import requests
1315

1416

15-
LOGGER = get_logger(__name__)
17+
LOGGER = get_logger('imdb')
1618

1719
yearfmt = re.compile(r'\(?(\d{4})\)?')
1820

@@ -34,7 +36,7 @@ def setup(bot):
3436
bot.config.define_section('imdb', IMDBSection)
3537

3638

37-
@commands('imdb', 'movie')
39+
@command('imdb', 'movie')
3840
@example('.imdb ThisTitleDoesNotExist', '[Error] Movie not found!')
3941
@example('.imdb Citizen Kane', '[Movie] Title: Citizen Kane | Year: 1941 | Rating: 8.3 | Tomatometer: 100% | Genre: Drama, Mystery | Plot: Following the death of a publishing tycoon, news reporters scramble to discover the meaning of his final utterance. | IMDB Link: http://imdb.com/title/tt0033467')
4042
@example('.imdb Chuck', '[Series] Title: Chuck | Seasons: 5 | Year: 2007–2012 | Rating: 8.2 | Genre: Action, Comedy, Drama | Plot: When a twenty-something computer geek inadvertently downloads critical government secrets into his brain, the C.I.A. and the N.S.A. assign two age[…] | IMDB Link: http://imdb.com/title/tt0934814')
@@ -128,8 +130,3 @@ def imdb_url(bot, trigger, match=None):
128130
return bot.reply("OMDb API key missing. Please configure this module.")
129131

130132
bot.say(run_omdb_query({'i': match.group(1)}, bot.config.core.verify_ssl, bot.config.imdb.api_key, False))
131-
132-
133-
if __name__ == "__main__":
134-
from sopel.test_tools import run_example_tests
135-
run_example_tests(__file__)

sopel_modules/__init__.py

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)