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

Upgrade for Sopel 8, Python 3.8 to 3.12, and make it an entrypoint plugin #17

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
pip install build wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
python -m build
twine upload dist/*
2 changes: 1 addition & 1 deletion .github/workflows/python-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]
python-version: [3.8, 3.9, 3.10, 3.11, 3.12]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
Expand Down
5 changes: 1 addition & 4 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
include NEWS
include COPYING
include LICENSE
include README.md
include *requirements.txt

recursive-include tests *
recursive-exclude * __pycache__
recursive-exclude * *.py[co]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ Since omdbapi put their API behind a free key, moving this module to a standalon
## Requirements
```
requests
sopel
sopel>=8
```
59 changes: 59 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
[build-system]
requires = ["setuptools>=68.0", "wheel"]
build-backend = "setuptools.build_meta"

[tool.setuptools]
platforms = ["Linux x86, x86-64"]

[tool.setuptools.packages.find]
include = ["sopel_imdb", "sopel_imdb.*"]
namespaces = false

[project]
name = "sopel-imdb"
version = "1.3.0.dev0"
description = "A working re-implementation of the imdb module for Sopel"
keywords = [
"sopel",
"plugin",
"imdb",
"cinema",
"movie",
"bot",
"irc",
]
maintainers = [
{ name="Rusty Bower" },
]
authors = [
{ name="Rusty Bower" },
]

readme = "README.md"
license = { text="MIT License" }
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Intended Audience :: System Administrators",
"License :: Eiffel Forum License (EFL)",
"License :: OSI Approved :: Eiffel Forum License",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Communications :: Chat :: Internet Relay Chat",
]
requires-python = ">=3.8, <4"
dependencies = [
"requests",
"sopel>=8",
]

[project.urls]
"Homepage" = "http://github.com/rustybower/sopel-imdb"
"Bug Tracker" = "http://github.com/rustybower/sopel-imdb/issues"

[project.entry-points."sopel.plugins"]
imdb = "sopel_imdb.imdb"
2 changes: 0 additions & 2 deletions requirements.txt

This file was deleted.

36 changes: 0 additions & 36 deletions setup.py

This file was deleted.

Empty file added sopel_imdb/__init__.py
Empty file.
19 changes: 8 additions & 11 deletions sopel_modules/imdb/imdb.py → sopel_imdb/imdb.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
# coding=utf-8
"""A working re-implementation of the imdb module for Sopel"""
# Copyright 2008, Sean B. Palmer, inamidst.com
# Copyright 2012, Elsie Powell, embolalia.com
# Copyright 2018, Rusty Bower, rustybower.com
# Licensed under the Eiffel Forum License 2.
from __future__ import unicode_literals, absolute_import, print_function, division
from __future__ import annotations

import re
import requests
from sopel.module import commands, example, url

from sopel.plugin import command, example, url
from sopel.config.types import NO_DEFAULT, StaticSection, ValidatedAttribute
from sopel.logger import get_logger
from sopel.tools import get_logger
import requests


LOGGER = get_logger(__name__)
LOGGER = get_logger('imdb')

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

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


@commands('imdb', 'movie')
@command('imdb', 'movie')
@example('.imdb ThisTitleDoesNotExist', '[Error] Movie not found!')
@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')
@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')
Expand Down Expand Up @@ -128,8 +130,3 @@ def imdb_url(bot, trigger, match=None):
return bot.reply("OMDb API key missing. Please configure this module.")

bot.say(run_omdb_query({'i': match.group(1)}, bot.config.core.verify_ssl, bot.config.imdb.api_key, False))


if __name__ == "__main__":
from sopel.test_tools import run_example_tests
run_example_tests(__file__)
1 change: 0 additions & 1 deletion sopel_modules/__init__.py

This file was deleted.

11 changes: 0 additions & 11 deletions sopel_modules/imdb/__init__.py

This file was deleted.