Skip to content

Commit

Permalink
Convert to a package using latest Sopel 8+ cookiecutter template
Browse files Browse the repository at this point in the history
First time I've done this for a plugin not under EFLv2, which threw me
for a bit of a loop. Finding the GPLv3 text to paste into COPYING (over
top of the template's EFLv2 text) wasn't too hard, though.

I *could* relicense the thing, since it's my own damn code, but I also
happen to appreciate having some variety in my life.
  • Loading branch information
dgw committed Jun 9, 2024
1 parent cce4b30 commit 2e6b2a1
Show file tree
Hide file tree
Showing 8 changed files with 764 additions and 52 deletions.
36 changes: 0 additions & 36 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so
Expand Down Expand Up @@ -43,51 +42,16 @@ htmlcov/
nosetests.xml
coverage.xml
*,cover
.hypothesis/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# IPython Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# dotenv
.env

# virtualenv
venv/
ENV/

# Spyder project settings
.spyderproject

# Rope project settings
.ropeproject

# PyCharm
.idea/

674 changes: 674 additions & 0 deletions COPYING

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
include NEWS
include COPYING
include README.md

recursive-exclude * __pycache__
recursive-exclude * *.py[co]
5 changes: 5 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## Changelog

### 0.1.0

First packaged release of `sopel-jisho`.
35 changes: 23 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,35 @@
# sopel-jisho
Sopel plugin that provides search results from the Jisho Japanese/English dictionary

This plugin has alpha-level functionality. It can request and display most results, but
may not correctly deal with incomplete API responses (words that have no readings, for
example). That said, anything that doesn't behave as expected should be reported in the
plugin's [issue tracker](https://github.com/dgw/sopel-jisho/issues) if it isn't already
listed there (be sure to **also search closed issues!**).
Sopel plugin to search Jisho.org, a Japanese/English dictionary.

Jisho's API is undocumented and subject to change, so there are sure to be edge cases
where the code receives something it doesn't expect. Some of these are handled. Others
aren't...yet. Report problematic queries to the issue tracker.
## Installing

## Requirements
The Jisho plugin relies on `requests`, which Sopel itself also requires.
Releases are hosted on PyPI, so after installing Sopel, all you need is `pip`:

You will need Sopel 7.1+ to load this plugin.
```shell
$ pip install sopel-jisho
```

### Requirements

`sopel-jisho` requires Sopel 7.1+ and `requests`.

## Usage
Commands & arguments:

* `.jisho <search query>` (also available as `.ji`)
* `<search query>`: the keyword(s) to search for on Jisho

## Notes

This plugin has beta-level functionality. It can search and display most
queries, but may not correctly deal with incomplete API responses (for example,
words that have no readings). That said, anything that doesn't behave as
expected should be reported in the plugin's [issue tracker][] if it isn't
already listed there (be sure to **also search closed issues!**).

Jisho's API is undocumented and subject to change, so there are sure to be edge
cases where the code receives something it doesn't expect. Some of these are
handled. Others aren't…yet. Report problematic queries to the issue tracker.

[issue tracker]: https://github.com/dgw/sopel-jisho/issues
51 changes: 51 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
[build-system]
requires = ["setuptools>=63.0", "wheel"]
build-backend = "setuptools.build_meta"

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

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

[tool.setuptools.dynamic]
readme = { file=["README.md", "NEWS"], content-type="text/markdown" }

[project]
name = "sopel-jisho"
version = "0.1.0"
description = "Jisho lookup plugin for Sopel IRC bots."

authors = [
{ name="dgw", email="[email protected]" },
]

license = { text="GPL-3.0" }
dynamic = ["readme"]

classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: System Administrators",
"License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
"Topic :: Communications :: Chat :: Internet Relay Chat",
]
keywords = [
"sopel",
"plugin",
"bot",
"irc",
]

requires-python = ">=3.8, <4"
dependencies = [
"sopel>=8.0",
]

[project.urls]
"Homepage" = "https://github.com/dgw/sopel-jisho"
"Bug Tracker" = "https://github.com/dgw/sopel-jisho/issues"

[project.entry-points."sopel.plugins"]
"jisho" = "sopel_jisho.plugin"
Empty file added sopel_jisho/__init__.py
Empty file.
9 changes: 5 additions & 4 deletions jisho.py → sopel_jisho/plugin.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
"""
jisho.py - Jisho lookup module for Sopel
"""sopel-jisho
Jisho lookup plugin for Sopel IRC bots.
Copyright 2016, dgw
Licensed under the GPL v3.0 or later
"""

from __future__ import unicode_literals
from __future__ import annotations

from sopel import plugin

Expand Down

0 comments on commit 2e6b2a1

Please sign in to comment.