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

Convert plugin to entrypoint style; next release to be 'sopel-weather' #49

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
5 changes: 2 additions & 3 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
include NEWS
include COPYING
include README.md
include *requirements.txt
include README.rst
include LICENSE

recursive-include tests *
recursive-exclude * __pycache__
Expand Down
12 changes: 6 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Published release
~~~~~~~~~~~~~~~~~
.. code-block::

pip install sopel-modules.weather
pip install sopel-weather

From source
~~~~~~~~~~~
Expand All @@ -47,7 +47,6 @@ However, if you want or need to configure this plugin manually, you will need to
weather_api_key = WEATHER_API_KEY



Usage
=====

Expand Down Expand Up @@ -130,11 +129,12 @@ Python Requirements
~~~~~~~~~~~~~~~~~~~
.. code-block::

pytz
requests
sopel

.. |version| image:: https://img.shields.io/pypi/v/sopel-modules.weather.svg
:target: https://pypi.python.org/pypi/sopel-modules.weather
.. |version| image:: https://img.shields.io/pypi/v/sopel-weather.svg
:target: https://pypi.python.org/pypi/sopel-weather
.. |build| image:: https://github.com/sopel-irc/sopel-weather/actions/workflows/python-tests.yml/badge.svg?branch=master
:target: https://github.com/sopel-irc/sopel-weather/actions/workflows/python-tests.yml
.. |issues| image:: https://img.shields.io/github/issues/sopel-irc/sopel-weather.svg
Expand All @@ -143,5 +143,5 @@ Python Requirements
:target: https://lgtm.com/projects/g/sopel-irc/sopel-weather/alerts/
.. |coverage-status| image:: https://coveralls.io/repos/github/sopel-irc/sopel-weather/badge.svg?branch=master
:target: https://coveralls.io/github/sopel-irc/sopel-weather?branch=master
.. |license| image:: https://img.shields.io/pypi/l/sopel-modules.weather.svg
:target: https://github.com/sopel-irc/sopel-modules.weather/blob/master/COPYING
.. |license| image:: https://img.shields.io/pypi/l/sopel-weather.svg
:target: https://github.com/sopel-irc/sopel-weather/blob/master/LICENSE
3 changes: 0 additions & 3 deletions requirements.txt

This file was deleted.

39 changes: 39 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
[metadata]
name = sopel-weather
version = 1.6.0
description = A working re-implementation of the weather plugin for Sopel
long_description = file: README.rst, NEWS
long_description_content_type = text/x-rst; charset=UTF-8
author = Rusty Bower
author_email = [email protected]
url = https://github.com/sopel-irc/sopel-weather
license = MIT License
classifiers =
Intended Audience :: Developers
Intended Audience :: System Administrators
License :: OSI Approved :: MIT License
Topic :: Communications :: Chat :: Internet Relay Chat

[options]
packages = find:
zip_safe = false
include_package_data = true
test_suite = tests
install_requires =
sopel>=7.1
requests
pytz
tests_require =
codeclimate-test-reporter
coveralls
flake8
mock
pycodestyle
pytest>=3.6
pytest-cov
requests_mock
sopel

[options.entry_points]
sopel.plugins =
weather = sopel_weather
37 changes: 3 additions & 34 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,44 +1,13 @@
# -*- coding: utf-8 -*-
from __future__ import print_function
import os
import sys
from setuptools import setup, find_packages
from setuptools import setup


if __name__ == '__main__':
print('Sopel does not correctly load modules installed with setup.py '
'directly. Please use "pip install .", or add {}/sopel_modules to '
'core.extra in your config.'.format(
os.path.dirname(os.path.abspath(__file__))),
'directly. Please use "pip install .".',
file=sys.stderr)

with open('README.rst') as readme_file:
readme = readme_file.read()

with open('NEWS') as history_file:
history = history_file.read()

with open('requirements.txt') as requirements_file:
requirements = [req for req in requirements_file.readlines()]

with open('tests/requirements.txt') as dev_requirements_file:
dev_requirements = [req for req in dev_requirements_file.readlines()]


setup(
name='sopel_modules.weather',
version='1.6.0',
description='A working re-implementation of the weather module for Sopel',
long_description=readme + '\n\n' + history,
long_description_content_type='text/x-rst',
author='Rusty Bower',
author_email='[email protected]',
url='http://github.com/rustybower/sopel-weather',
packages=find_packages('.'),
namespace_packages=['sopel_modules'],
include_package_data=True,
install_requires=requirements,
tests_require=dev_requirements,
test_suite='tests',
license='MIT License',
)
setup()
1 change: 0 additions & 1 deletion sopel_modules/__init__.py

This file was deleted.

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

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# coding=utf-8
"""sopel-weather

A working re-implementation of the weather plugin for Sopel
"""
# Copyright 2008, Sean B. Palmer, inamidst.com
# Copyright 2012, Elsie Powell, embolalia.com
# Copyright 2018, Rusty Bower, rustybower.com
Expand Down
9 changes: 0 additions & 9 deletions tests/requirements.txt

This file was deleted.

18 changes: 9 additions & 9 deletions tests/test_weather.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
from sopel.trigger import PreTrigger, Trigger
from sopel.test_tools import MockSopel, MockSopelWrapper
from sopel.tools import Identifier
from sopel import module
from sopel import plugin

from sopel_modules.weather import weather
import sopel_weather as weather


@pytest.fixture
Expand All @@ -26,7 +26,7 @@ def bot(sopel, pretrigger):
bot = MockSopelWrapper(sopel, pretrigger)
bot.privileges = dict()
bot.privileges[Identifier('#Sopel')] = dict()
bot.privileges[Identifier('#Sopel')][Identifier('Foo')] = module.VOICE
bot.privileges[Identifier('#Sopel')][Identifier('Foo')] = plugin.VOICE
return bot


Expand Down Expand Up @@ -125,26 +125,26 @@ def forecast_results():


def test_forecast_command(bot, trigger):
@module.commands('forecast')
@module.example('.forecast', 'True')
@plugin.commands('forecast')
@plugin.example('.forecast', 'True')
def mock(bot, trigger, match=None):
return True

assert mock(bot, trigger) is True


def test_wea_command(bot, trigger):
@module.commands('wea')
@module.example('.wea', 'True')
@plugin.commands('wea')
@plugin.example('.wea', 'True')
def mock(bot, trigger, match=None):
return True

assert mock(bot, trigger) is True


def test_weather_command(bot, trigger):
@module.commands('weather')
@module.example('.weather', 'True')
@plugin.commands('weather')
@plugin.example('.weather', 'True')
def mock(bot, trigger, match=None):
return True

Expand Down
Loading