fix release and test process
authorMarcel van der Veldt <m.vanderveldt@outlook.com>
Fri, 11 Sep 2020 12:58:34 +0000 (14:58 +0200)
committerMarcel van der Veldt <m.vanderveldt@outlook.com>
Fri, 11 Sep 2020 12:58:34 +0000 (14:58 +0200)
12 files changed:
.github/release-drafter.yml [new file with mode: 0644]
.github/workflows/publish-to-pypi.yml [new file with mode: 0644]
.github/workflows/release-drafter.yml [new file with mode: 0644]
.github/workflows/test.yml [new file with mode: 0644]
.vscode/settings.json
music_assistant.egg-info/PKG-INFO
music_assistant.egg-info/SOURCES.txt
music_assistant.egg-info/entry_points.txt [new file with mode: 0644]
music_assistant.egg-info/requires.txt
music_assistant/constants.py
music_assistant/web.py
setup.py

diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml
new file mode 100644 (file)
index 0000000..a7352b9
--- /dev/null
@@ -0,0 +1,9 @@
+change-template: "- #$NUMBER - $TITLE (@$AUTHOR)"
+categories:
+  - title: "⚠ Breaking Changes"
+    labels:
+      - "breaking change"
+template: |
+  ## What’s Changed
+
+  $CHANGES
diff --git a/.github/workflows/publish-to-pypi.yml b/.github/workflows/publish-to-pypi.yml
new file mode 100644 (file)
index 0000000..ac19fa3
--- /dev/null
@@ -0,0 +1,27 @@
+name: Publish releases to PyPI
+
+on:
+  release:
+    types: [published, prereleased]
+
+jobs:
+  build-and-publish:
+    name: Builds and publishes releases to PyPI
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@master
+      - name: Set up Python 3.7
+        uses: actions/setup-python@v1
+        with:
+          python-version: 3.7
+      - name: Install wheel
+        run: >-
+          pip install wheel
+      - name: Build
+        run: >-
+          python3 setup.py sdist bdist_wheel
+      - name: Publish release to PyPI
+        uses: pypa/gh-action-pypi-publish@master
+        with:
+          user: __token__
+          password: ${{ secrets.PYPI_TOKEN }}
diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml
new file mode 100644 (file)
index 0000000..490103e
--- /dev/null
@@ -0,0 +1,15 @@
+name: Release Drafter
+
+on:
+  push:
+    branches:
+      - master
+
+jobs:
+  update_release_draft:
+    runs-on: ubuntu-latest
+    steps:
+      # Drafts your next Release notes as Pull Requests are merged into "master"
+      - uses: release-drafter/release-drafter@v5
+        env:
+          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
new file mode 100644 (file)
index 0000000..d085533
--- /dev/null
@@ -0,0 +1,33 @@
+# This workflow will install Python dependencies, run tests and lint
+# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
+
+name: Test with Pre-commit and Tox
+
+on:
+  push:
+    branches: [master]
+  pull_request:
+    branches: [master]
+
+jobs:
+  build:
+    runs-on: ubuntu-latest
+    strategy:
+      matrix:
+        python-version: [3.7, 3.8]
+
+    steps:
+      - uses: actions/checkout@v2
+      - name: Set up Python ${{ matrix.python-version }}
+        uses: actions/setup-python@v1
+        with:
+          python-version: ${{ matrix.python-version }}
+      - name: Install dependencies
+        run: |
+          python -m pip install --upgrade pip
+          pip install tox tox-gh-actions pre-commit
+          pre-commit install-hooks
+      - name: Lint with pre-commit
+        run: pre-commit run --all-files
+      - name: Test with tox
+        run: tox
index 7f827883b05d50c424c140dec6ec04fc62787aaa..42b4250bf9dd1500d35ef9f1007ae7f2c9296e59 100644 (file)
@@ -1,5 +1,5 @@
 {
     "python.linting.pylintEnabled": true,
     "python.linting.enabled": true,
-    "python.pythonPath": "/Users/marcelvanderveldt/Workdir/musicassistant/venv/bin/python3"
+    "python.pythonPath": "venv/bin/python3"
 }
\ No newline at end of file
index bcf7d076d1343a81b34b4f64903a435f5f633be2..b198c5af6d9306f57bb6b131d37f1665e21da558 100644 (file)
@@ -1,25 +1,15 @@
-Metadata-Version: 2.1
+Metadata-Version: 1.2
 Name: music-assistant
-Version: 0.0.20
-Summary: Music library manager and player based on sox.
-Home-page: https://github.com/marcelveldt/musicassistant
+Version: 1.0.0
+Summary: UNKNOWN
+Home-page: https://music-assistant.github.io/
 Author: Marcel van der Veldt
-Author-email: m.vanderveldt@outlook.com
+Author-email: marcelveldt@users.noreply.github.com
 License: UNKNOWN
-Download-URL: https://github.com/marcelveldt/musicassistant
-Description: # musicassistant
-        Music Assistant - A library manager for (streaming) media
-        
-        work in progress !!
-        More info soon
-        
+Download-URL: https://github.com/music-assistant/server/archive/1.0.0.zip
+Project-URL: Bug Reports, https://github.com/music-assistant/server/issues
+Project-URL: Website, https://music-assistant.github.io/
+Project-URL: Discord, https://discord.gg/9xHYFY
+Description: UNKNOWN
 Platform: UNKNOWN
-Classifier: Development Status :: 4 - Beta
-Classifier: Intended Audience :: Developers
-Classifier: Natural Language :: English
-Classifier: Programming Language :: Python :: 3
-Classifier: Programming Language :: Python :: 3.7
-Classifier: Programming Language :: Python :: 3.8
-Classifier: Topic :: Home Automation
 Requires-Python: >=3.7
-Description-Content-Type: text/markdown
index 3ccf0ae7426f3d83efdf769c4d892145e9503e73..f8adc6fd26f251878f2167144936595367083de1 100644 (file)
@@ -8,7 +8,6 @@ music_assistant/cache.py
 music_assistant/config.py
 music_assistant/constants.py
 music_assistant/database.py
-music_assistant/homeassistant.py
 music_assistant/http_streamer.py
 music_assistant/mass.py
 music_assistant/metadata.py
@@ -19,23 +18,34 @@ music_assistant/web.py
 music_assistant.egg-info/PKG-INFO
 music_assistant.egg-info/SOURCES.txt
 music_assistant.egg-info/dependency_links.txt
+music_assistant.egg-info/entry_points.txt
 music_assistant.egg-info/not-zip-safe
 music_assistant.egg-info/requires.txt
 music_assistant.egg-info/top_level.txt
 music_assistant/models/__init__.py
+music_assistant/models/config_entry.py
 music_assistant/models/media_types.py
 music_assistant/models/musicprovider.py
 music_assistant/models/player.py
 music_assistant/models/player_queue.py
 music_assistant/models/playerprovider.py
-music_assistant/models/playerstate.py
-music_assistant/musicproviders/__init__.py
-music_assistant/musicproviders/file.py
-music_assistant/musicproviders/qobuz.py
-music_assistant/musicproviders/spotify.py
-music_assistant/musicproviders/tunein.py
-music_assistant/playerproviders/__init__.py
-music_assistant/playerproviders/chromecast.py
-music_assistant/playerproviders/sonos.py
-music_assistant/playerproviders/squeezebox.py
-music_assistant/playerproviders/webplayer.py
\ No newline at end of file
+music_assistant/models/provider.py
+music_assistant/models/streamdetails.py
+music_assistant/providers/__init__.py
+music_assistant/providers/chromecast/__init__.py
+music_assistant/providers/chromecast/const.py
+music_assistant/providers/chromecast/models.py
+music_assistant/providers/chromecast/player.py
+music_assistant/providers/demo/__init__.py
+music_assistant/providers/demo/demo_musicprovider.py
+music_assistant/providers/demo/demo_playerprovider.py
+music_assistant/providers/home_assistant/__init__.py
+music_assistant/providers/qobuz/__init__.py
+music_assistant/providers/sonos/__init__.py
+music_assistant/providers/sonos/sonos.py
+music_assistant/providers/spotify/__init__.py
+music_assistant/providers/squeezebox/__init__.py
+music_assistant/providers/squeezebox/constants.py
+music_assistant/providers/squeezebox/discovery.py
+music_assistant/providers/squeezebox/socket_client.py
+music_assistant/providers/tunein/__init__.py
\ No newline at end of file
diff --git a/music_assistant.egg-info/entry_points.txt b/music_assistant.egg-info/entry_points.txt
new file mode 100644 (file)
index 0000000..42295dd
--- /dev/null
@@ -0,0 +1,4 @@
+[console_scripts]
+mass = music_assistant.__main__:main
+musicassistant = music_assistant.__main__:main
+
index fe7c02a0b20a5b2dcc044788cbd2459d75f1a865..23611bd71982c45e6777952c2988e07e9652a372 100644 (file)
@@ -1,10 +1,10 @@
 argparse==1.4.0
 cytoolz==0.10.1
-aiohttp==3.6.2
+aiohttp[speedups]==3.6.2
 requests==2.24.0
 pychromecast==7.2.1
 asyncio-throttle==1.0.1
-aiosqlite==0.3.0
+aiosqlite==0.15.0
 pytaglib==1.4.6
 python-slugify==4.0.1
 memory-tempfile==2.2.3
@@ -15,4 +15,10 @@ soco==0.19
 pillow==7.2.0
 aiohttp_cors==0.7.0
 unidecode==1.1.1
+hass-client==0.0.6
+PyJWT==1.7.1
+aiohttp_jwt==0.6.1
+zeroconf==0.28.4
+passlib==1.7.2
+cryptography==3.1
 uvloop
index 0619e1c473e676a51ec42827756569e0ad0b9b0d..3056d156ffa50986e90763e04ace014209d972e6 100755 (executable)
@@ -1,7 +1,7 @@
 """All constants for Music Assistant."""
 
-__version__ = 1.0.0
-REQUIRED_PYTHON_VER = 3.7
+__version__ = "1.0.0"
+REQUIRED_PYTHON_VER = "3.7"
 
 CONF_USERNAME = "username"
 CONF_PASSWORD = "password"
index 715874cc99cc152692a459453a3ef163c1186212..a7237eda95263dcb53f0710fee4fe6eed2071a52 100755 (executable)
@@ -132,7 +132,8 @@ class Web:
             ]
         )
         webdir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "web/")
-        app.router.add_static("/", webdir, append_version=True)
+        if os.path.isdir(webdir):
+            app.router.add_static("/", webdir, append_version=True)
 
         # Add CORS support to all routes
         cors = aiohttp_cors.setup(
@@ -224,8 +225,10 @@ class Web:
 
     async def async_index(self, request):
         # pylint: disable=unused-argument
-        index_file = os.path.join(os.path.dirname(os.path.abspath(__file__)), "web/index.html")
-        return web.FileResponse(index_file)
+        webdir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "web/")
+        if not os.path.isdir(webdir):
+            raise web.HTTPFound('https://music-assistant.github.io/app')
+        return web.FileResponse(os.path.join(webdir, "index.html"))
 
     @login_required
     @routes.get("/api/library/artists")
index 62b689bf3d4956baefe70fd7be1d5e074366af54..39c4353b639d6b2119e97fc925f9928a66c5aade 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -1,9 +1,10 @@
 """Music Assistant setup."""
+import os
 from datetime import datetime as dt
 
 from setuptools import find_packages, setup
 
-import music_assistant.const as mass_const
+import music_assistant.constants as mass_const
 
 PROJECT_NAME = "Music Assistant"
 PROJECT_PACKAGE_NAME = "music_assistant"
@@ -28,6 +29,10 @@ PROJECT_URLS = {
 }
 
 PACKAGES = find_packages(exclude=["tests", "tests.*"])
+PACKAGE_FILES = []
+for (path, directories, filenames) in os.walk('music_assistant/'):
+    for filename in filenames:
+        PACKAGE_FILES.append(os.path.join('..', path, filename))
 
 with open("requirements.txt") as f:
     REQUIRES = f.read().splitlines()
@@ -46,7 +51,10 @@ setup(
     include_package_data=True,
     zip_safe=False,
     install_requires=REQUIRES,
-    python_requires=f">={MIN_PY_VERSION}",
+    python_requires=f">={mass_const.REQUIRED_PYTHON_VER}",
     test_suite="tests",
     entry_points={"console_scripts": ["mass = music_assistant.__main__:main", "musicassistant = music_assistant.__main__:main"]},
+    package_data={
+        'music_assistant': PACKAGE_FILES,
+    },
 )