Prior99 / mopidy-subidy

Mopidy extension for playing music from Subsonic servers.
BSD 3-Clause "New" or "Revised" License
30 stars 10 forks source link

Modernize extension #32

Closed jodal closed 4 years ago

jodal commented 4 years ago

Hi!

This extension recently replaced the unmaintained extension Mopidy-Subsonic in the Mopidy extension registry at https://mopidy.com/ext.

Because of that, I discovered that this extension has not been published to PyPI, and are thus harder for users to install than other Mopidy extensions. Motivated by that, I set out to modernize the extension's project setup to match the Mopidy extension cookiecutter and most other extensions, to make it ready for publishing to PyPI and ready for future contributions.

This PR includes the same upgrade treatment as I applied to all the "official" Mopidy extensions for the Mopidy 3 release. To get completely up to par with other extensions, there are only two things you need to do after merging this.

CircleCI setup

  1. Sign up to CircleCI with your GitHub account at https://circleci.com/signup/
  2. Go to CircleCI organization security settings, e.g. https://circleci.com/gh/organizations/Prior99/settings#security
  3. Check Yes, allow all members of my organization to (...) use third-party orbs
  4. Find the mopidy-subidy project at https://circleci.com/gh/organizations/Prior99/settings#projects
  5. Open Project settings on the right project
  6. Click the Follow project button
  7. Open Project settings > Advanced settings
  8. Set Build forked pull requests to On

CircleCI is now ready to build any branch/PR with a .circleci/config.yml.

Setup of coverage data from CircleCI to Codecov.io is automatic. The badge in the readme should start working as soon as the first CircleCI build of the master branch completes.

Publish to PyPI

  1. If you don't already have a PyPI account, register one at https://pypi.org/account/register/
  2. Update CHANGELOG.rst with the correct release date and commit it. setup.cfg is already updated with the version number "1.0.0" to signify the huge change from Python 2 to 3. Feel free to change this if you don't agree that this deserves a major version bump.
  3. Build the release artifacts into the dist/ directory:
python3 -m pip install wheel
python3 setup.py sdist bdist_wheel
  1. Upload the release artifacts to PyPI:
python3 -m pip install twine
python3 -m twine upload dist/*
  1. Voila! The extension will be available from https://pypi.org/project/Mopidy-Subidy/ and python3 -m pip install Mopidy-Subidy will work.

Updating the Mopidy extension registry

Submit a PR to https://github.com/mopidy/website to add PyPI install instructions to https://mopidy.com/ext/subidy/. The change is basically just to add:

dist:
  pypi: Mopidy-Subidy

After merging this PR, you can also add the following to show CI/coverage badges on mopidy.com:

dev:
  circleci: true
  codecov: true

There's a number of other extensions to look at for examples.

Prior99 commented 4 years ago

Hi,

thanks for your contribution. To be honest, I no longer use mopidy and this is the only python project I currently maintain.

If any other capable developer would be available, I'd be happy if they could publish it to pypi instead. I would of course also make them contributer on this git repository or if necessary give it up for a forked one.

If no one has the time, I will take a look at this is in the coming days.

jodal commented 4 years ago

Thanks for the quick response!

I posted at the forum asking for a new maintainer. Let's hope someone using both Mopidy and Subsonic steps up to take over the maintenance of this extension :-)

In the meantime, please consider merging the PR. It includes instructions in the readme for how to install the extension directly from GitHub's generated zip file of the repo, making it a bit easier to get started with, even if you don't publish to PyPI for now.

jodal commented 4 years ago

That said, both GitHub repositories and PyPI projects can easily be transferred to other owners in the future, so publishing to PyPI will in no way be a blocker for a new maintainer to take over.

Prior99 commented 4 years ago

Ok. I will merge and publish this on Thursday, when I have stable internet again. Is there any specific reason that you added an auto-generated Changelog file and changed the README from Markdown to RST?

jodal commented 4 years ago

Great!

I actually wrote the changelog by hand. I added it mostly by habit to make it easier for users to get a feel for what the change is about without having to read through the commits.

I converted the readme both because rST is the default (and until recently only supported) format of PyPI, and because it was easier to apply the text in the old readme to the template from cookiecutter-mopidy-ext than to modify the readme to match the cookiecutter. rST is still used a lot in Python circles. I use Markdown myself for e.g. JavaScript projects. It depends on context and conventions.

Prior99 commented 4 years ago

Thank you for your efforts!