Skip to content

Commit

Permalink
Convert plugin to entrypoint style; next release to be 'sopel-weather'
Browse files Browse the repository at this point in the history
The old package name on PyPI can be updated with a shim directing users
to the new location for further updates.
  • Loading branch information
dgw committed Nov 4, 2023
1 parent 5f81791 commit bbbf438
Show file tree
Hide file tree
Showing 15 changed files with 55 additions and 68 deletions.
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
File renamed without changes.
File renamed without changes.
9 changes: 0 additions & 9 deletions tests/requirements.txt

This file was deleted.

2 changes: 1 addition & 1 deletion tests/test_weather.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bbbf438

Please sign in to comment.