diff --git a/MANIFEST.in b/MANIFEST.in index 60ca266..5b849ba 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -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__ diff --git a/README.rst b/README.rst index cda16dd..83f93cc 100644 --- a/README.rst +++ b/README.rst @@ -22,7 +22,7 @@ Published release ~~~~~~~~~~~~~~~~~ .. code-block:: - pip install sopel-modules.weather + pip install sopel-weather From source ~~~~~~~~~~~ @@ -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 ===== @@ -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 @@ -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 diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 634c518..0000000 --- a/requirements.txt +++ /dev/null @@ -1,3 +0,0 @@ -requests -sopel>=7.1 -pytz diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..4f93031 --- /dev/null +++ b/setup.cfg @@ -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 = rusty@rustybower.com +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 diff --git a/setup.py b/setup.py index fa22620..6f91e98 100755 --- a/setup.py +++ b/setup.py @@ -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='rusty@rustybower.com', - 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() diff --git a/sopel_modules/__init__.py b/sopel_modules/__init__.py deleted file mode 100644 index de40ea7..0000000 --- a/sopel_modules/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__import__('pkg_resources').declare_namespace(__name__) diff --git a/sopel_modules/weather/__init__.py b/sopel_modules/weather/__init__.py deleted file mode 100644 index a515437..0000000 --- a/sopel_modules/weather/__init__.py +++ /dev/null @@ -1,11 +0,0 @@ -# coding=utf8 -""" -A working re-implementation of the weather module for Sopel -""" -from __future__ import unicode_literals, absolute_import, division, print_function - -from .weather import * - -__author__ = 'Rusty Bower' -__email__ = 'rusty@rustybower.com' -__version__ = '1.6.0' diff --git a/sopel_modules/weather/weather.py b/sopel_weather/__init__.py similarity index 99% rename from sopel_modules/weather/weather.py rename to sopel_weather/__init__.py index ed65f4a..30dd804 100644 --- a/sopel_modules/weather/weather.py +++ b/sopel_weather/__init__.py @@ -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 diff --git a/sopel_modules/weather/providers/__init__.py b/sopel_weather/providers/__init__.py similarity index 100% rename from sopel_modules/weather/providers/__init__.py rename to sopel_weather/providers/__init__.py diff --git a/sopel_modules/weather/providers/weather/__init__.py b/sopel_weather/providers/weather/__init__.py similarity index 100% rename from sopel_modules/weather/providers/weather/__init__.py rename to sopel_weather/providers/weather/__init__.py diff --git a/sopel_modules/weather/providers/weather/openmeteo.py b/sopel_weather/providers/weather/openmeteo.py similarity index 100% rename from sopel_modules/weather/providers/weather/openmeteo.py rename to sopel_weather/providers/weather/openmeteo.py diff --git a/sopel_modules/weather/providers/weather/openweathermap.py b/sopel_weather/providers/weather/openweathermap.py similarity index 100% rename from sopel_modules/weather/providers/weather/openweathermap.py rename to sopel_weather/providers/weather/openweathermap.py diff --git a/sopel_modules/weather/providers/weather/pirateweather.py b/sopel_weather/providers/weather/pirateweather.py similarity index 100% rename from sopel_modules/weather/providers/weather/pirateweather.py rename to sopel_weather/providers/weather/pirateweather.py diff --git a/tests/requirements.txt b/tests/requirements.txt deleted file mode 100644 index 33e1215..0000000 --- a/tests/requirements.txt +++ /dev/null @@ -1,9 +0,0 @@ -codeclimate-test-reporter -coveralls -flake8 -mock -pycodestyle -pytest>=3.6 -pytest-cov -requests_mock -sopel diff --git a/tests/test_weather.py b/tests/test_weather.py index ac1513c..4e85a29 100644 --- a/tests/test_weather.py +++ b/tests/test_weather.py @@ -11,7 +11,7 @@ from sopel.tools import Identifier from sopel import module -from sopel_modules.weather import weather +import sopel_weather as weather @pytest.fixture