Skip to content

Commit

Permalink
Modernize the heck out of things
Browse files Browse the repository at this point in the history
* `pyproject.toml` packaging
* Entry-point plugin style; no more `sopel_modules` namespace
* Compatibility with Sopel 8
* Drop Python 2 and EOL 3.x releases; minimum now py3.8
* Drop Sopel 7.0 (but keep 7.1 for now, except on old Pythons)
* Improved documentation, metadata, etc.

Closes #2 🥳
  • Loading branch information
dgw committed Jun 20, 2024
1 parent 478f998 commit 814b8d2
Show file tree
Hide file tree
Showing 12 changed files with 116 additions and 92 deletions.
2 changes: 0 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
include NEWS
include COPYING
include README.md
include *requirements.txt

recursive-include tests *
recursive-exclude * __pycache__
recursive-exclude * *.py[co]
29 changes: 24 additions & 5 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
Changes between 0.1.0 and 0.2.0
===============================

Changed:
* Updated compatibility for Sopel 7
## Changelog

### 0.3.0

First release as `sopel-inclusivity`, replacing `sopel_modules.inclusivity`.

Changed:
* Updated compatibility for Sopel 8
* Minimum Sopel version is now 7.1
* Use newer `search` rule type, instead of bookending pattern with `.*`

Meta:
* Packaging converted to `pyproject.toml` and modernized
* Package name has changed: `sopel_modules.inclusivity` → `sopel-inclusivity`
* Author & Maintainer metadata corrected to credit embolalia as the creator

### 0.2.0

Changed:
* Updated compatibility for Sopel 7

### 0.1.0

Initial release of `sopel_modules.inclusivity`.
29 changes: 23 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,25 @@
# sopel-inclusivity

Sopel Inclusive Language suggests better wordings when people don't use
inclusive language. It's inspired by [this blog
post](https://18f.gsa.gov/2016/01/12/hacking-inclusion-by-customizing-a-slack-bot/)
from 18F, who've added a similar feature to their Slack rooms. It only deals
with use of the word "guys" for now, but if there is any other language it
could cover, PRs are welcome.
Have your Sopel bot suggest more inclusive language

## Installing

Releases are hosted on PyPI, so after installing Sopel, all you need is `pip`:

```shell
$ pip install sopel-inclusivity
```

### Requirements

The `sopel-inclusivity` plugin is compatible with Sopel 7.1 or higher, but your
bot must run on Python 3.8 or higher; legacy Python versions are not supported.

## Functionality

`sopel-inclusivity` suggests better wordings when people don't use inclusive
language in chat. It's inspired by [this blog post][18f-post] from 18F, who
added a similar feature to their Slack rooms. It only deals with use of the word
"guys" for now, but PRs are welcome to add coverage of more vocabulary.

[18f-post]: https://18f.gsa.gov/2016/01/12/hacking-inclusion-by-customizing-a-slack-bot/
62 changes: 62 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
[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_inclusivity", "sopel_inclusivity.*"]
namespaces = false

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

[project]
name = "sopel-inclusivity"
version = "0.3.0.dev0"
description = "Have your Sopel bot suggest more inclusive language"

authors = [
{ name="Elsie Powell" },
]

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

license = { text="EFL-2.0" }
dynamic = ["readme"]

classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: System Administrators",
"License :: Eiffel Forum License (EFL)",
"License :: OSI Approved :: Eiffel Forum License",
"Programming Language :: Python :: 3 :: Only",
"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",
]
keywords = [
"sopel",
"plugin",
"bot",
"irc",
]

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

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

[project.entry-points."sopel.plugins"]
"inclusivity" = "sopel_inclusivity.plugin"
1 change: 0 additions & 1 deletion requirements.txt

This file was deleted.

44 changes: 0 additions & 44 deletions setup.py

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# coding=utf-8
"""sopel-inclusivity
from __future__ import unicode_literals, absolute_import, division, print_function
Inclusive language plugin for Sopel IRC bots
"""
from __future__ import annotations

import random

from sopel import module
from sopel import plugin


# Works for generic "hi, guys", but maybe not "you (specific group of) guys"
Expand All @@ -14,11 +16,11 @@
yall = ["y'all", 'you all', 'you folks']


@module.rule('(hey|hi|yo|hello|howdy|um|er|oh)[,.?!:;]? guys')
@plugin.rule('(hey|hi|yo|hello|howdy|um|er|oh)[,.?!:;]? guys')
def hi_guys(bot, trigger):
bot.reply('Did you mean {}?'.format(random.choice(greet)))


@module.rule('.*you guys.*')
@plugin.search('you guys')
def you_guys(bot, trigger):
bot.reply('Did you mean {}?'.format(random.choice(yall)))
1 change: 0 additions & 1 deletion sopel_modules/__init__.py

This file was deleted.

13 changes: 0 additions & 13 deletions sopel_modules/inclusivity/__init__.py

This file was deleted.

1 change: 0 additions & 1 deletion tests/__init__.py

This file was deleted.

14 changes: 0 additions & 14 deletions tests/test_inclusivity.py

This file was deleted.

0 comments on commit 814b8d2

Please sign in to comment.