Skip to content

Commit

Permalink
Update project to match cookiecutter-mopidy-ext
Browse files Browse the repository at this point in the history
  • Loading branch information
tkem committed Dec 4, 2019
1 parent 83f21b7 commit cd1dbd9
Show file tree
Hide file tree
Showing 9 changed files with 180 additions and 115 deletions.
51 changes: 51 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
version: 2.1

orbs:
codecov: codecov/[email protected]

workflows:
version: 2
test:
jobs:
- py38
- py37
- black
- check-manifest
- flake8

jobs:
py38: &test-template
docker:
- image: mopidy/ci-python:3.8
steps:
- checkout
- restore_cache:
name: Restoring tox cache
key: tox-v1-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.cfg" }}
- run:
name: Run tests
command: |
tox -e $CIRCLE_JOB -- \
--junit-xml=test-results/pytest/results.xml \
--cov-report=xml
- save_cache:
name: Saving tox cache
key: tox-v1-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.cfg" }}
paths:
- ./.tox
- ~/.cache/pip
- codecov/upload:
file: coverage.xml
- store_test_results:
path: test-results

py37:
<<: *test-template
docker:
- image: mopidy/ci-python:3.7

black: *test-template

check-manifest: *test-template

flake8: *test-template
16 changes: 9 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
*.egg-info
*.pyc
.coverage
.pytest_cache/
.tox/
MANIFEST
build/
dist/
/*.egg-info
/.coverage
/.mypy_cache/
/.pytest_cache/
/.tox/
/MANIFEST
/build/
/dist/
/docs/_build/
28 changes: 0 additions & 28 deletions .travis.yml

This file was deleted.

8 changes: 8 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
Changelog
*********

v3.0.0a2 (UNRELEASED)
=====================

- Require Python >= 3.7.
- Require Mopidy >= 3.0.0a5.
- Require Pykka >= 2.0.1.
- Update project setup.


v3.0.0a1 (2019-08-04)
=====================
Expand Down
15 changes: 11 additions & 4 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
include .travis.yml
include CHANGELOG.rst
include *.py
include *.rst
include .mailmap
include LICENSE
include MANIFEST.in
include README.rst
include mopidy_local/ext.conf
include pyproject.toml
include tox.ini

recursive-include .circleci *
recursive-include .github *

include mopidy_*/ext.conf

recursive-include tests *.py
recursive-include tests/data *
recursive-include mopidy_local/www *.html
recursive-include mopidy_local/sql *.sql
14 changes: 7 additions & 7 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
Mopidy-Local
************

.. image:: https://img.shields.io/pypi/v/Mopidy-Local.svg?style=flat
.. image:: https://img.shields.io/pypi/v/Mopidy-Local
:target: https://pypi.org/project/Mopidy-Local/
:alt: Latest PyPI version

.. image:: https://img.shields.io/travis/mopidy/mopidy-local/master.svg?style=flat
:target: https://travis-ci.org/mopidy/mopidy-local
:alt: Travis CI build status
.. image:: https://img.shields.io/circleci/build/gh/tkem/mopidy-local
:target: https://circleci.com/gh/tkem/mopidy-local
:alt: CircleCI build status

.. image:: https://img.shields.io/coveralls/mopidy/mopidy-local/master.svg?style=flat
:target: https://coveralls.io/r/mopidy/mopidy-local
:alt: Test coverage
.. image:: https://img.shields.io/codecov/c/gh/tkem/mopidy-local
:target: https://codecov.io/gh/tkem/mopidy-local
:alt: Test coverage

`Mopidy`_ extension for playing music from your local music archive.

Expand Down
88 changes: 80 additions & 8 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,12 +1,84 @@
[tool:pytest]
filterwarnings =
ignore::PendingDeprecationWarning:mopidy[.*]
[metadata]
name = Mopidy-Local
version = 3.0.0a2
url = https://github.com/mopidy/mopidy-local
author = Stein Magnus Jodal
author_email = [email protected]
license = Apache License, Version 2.0
license_file = LICENSE
description = Mopidy extension for playing music from your local music archive
long_description = file: README.rst
classifiers =
Environment :: No Input/Output (Daemon)
Intended Audience :: End Users/Desktop
License :: OSI Approved :: Apache Software License
Operating System :: OS Independent
Programming Language :: Python :: 3
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Topic :: Multimedia :: Sound/Audio :: Players


[flake8]
application-import-names = mopidy_local,tests
exclude = .git,.tox
[options]
zip_safe = False
include_package_data = True
packages = find:
python_requires = >= 3.7
install_requires =
Mopidy >= 3.0.0a5 # Change to >= 3.0 once final is released
Pykka >= 2.0.1
setuptools
uritools >= 1.0


[options.extras_require]
lint =
black
check-manifest
flake8
flake8-bugbear
flake8-import-order
isort[pyproject]
release =
twine
wheel
test =
pytest
pytest-cov
dev =
%(lint)s
%(release)s
%(test)s


[options.packages.find]
exclude =
tests
tests.*

[wheel]
universal = 1

[options.entry_points]
mopidy.ext =
local = mopidy_local:Extension


[flake8]
application-import-names = mopidy_local, tests
max-line-length = 80
exclude = .git, .tox, build
select =
# Regular flake8 rules
C, E, F, W
# flake8-bugbear rules
B
# B950: line too long (soft speed limit)
B950
# pep8-naming rules
N
ignore =
# E203: whitespace before ':' (not PEP8 compliant)
E203
# E501: line too long (replaced by B950)
E501
# W503: line break before binary operator (not PEP8 compliant)
W503
48 changes: 2 additions & 46 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,47 +1,3 @@
from __future__ import unicode_literals
from setuptools import setup

import re

from setuptools import find_packages, setup


def get_version(filename):
with open(filename) as fh:
metadata = dict(re.findall('__([a-z]+)__ = "([^"]+)"', fh.read()))
return metadata["version"]


setup(
name="Mopidy-Local",
version=get_version("mopidy_local/__init__.py"),
url="https://github.com/mopidy/mopidy-local",
license="Apache License, Version 2.0",
author="Stein Magnus Jodal",
author_email="[email protected]",
description=(
"Mopidy extension for playing music from your local music archive"),
long_description=open("README.rst").read(),
packages=find_packages(exclude=["tests", "tests.*"]),
zip_safe=False,
include_package_data=True,
python_requires="> 2.7, < 3",
install_requires=[
"setuptools",
"Mopidy >= 3.0.0a1",
"Pykka >= 2.0",
"uritools >= 1.0"
],
entry_points={
"mopidy.ext": [
"local = mopidy_local:Extension",
]
},
classifiers=[
"Environment :: No Input/Output (Daemon)",
"Intended Audience :: End Users/Desktop",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 2.7",
"Topic :: Multimedia :: Sound/Audio :: Players",
],
)
setup()
27 changes: 12 additions & 15 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,26 +1,23 @@
[tox]
envlist = py27, flake8, check-manifest
envlist = py37, py38, black, check-manifest, flake8

[testenv]
sitepackages = true
deps =
mock
pytest
pytest-cov
pytest-xdist
deps = .[test]
commands =
pytest \
python -m pytest \
--basetemp={envtmpdir} \
--cov=mopidy_local --cov-report=term-missing \
{posargs}

[testenv:flake8]
deps =
flake8
flake8-import-order
skip_install = true
commands = flake8
[testenv:black]
deps = .[lint]
commands = python -m black --check .

[testenv:check-manifest]
deps = check-manifest
commands = check-manifest
deps = .[lint]
commands = python -m check_manifest

[testenv:flake8]
deps = .[lint]
commands = python -m flake8 --show-source --statistics

0 comments on commit cd1dbd9

Please sign in to comment.