From 1a78c0b99d0103d83c7942a9675c16614eb1ecba Mon Sep 17 00:00:00 2001 From: Hugo Date: Fri, 5 Apr 2019 08:37:01 +0300 Subject: [PATCH 1/4] Move production code to src/ --- MANIFEST.in | 2 +- RELEASING.md | 9 +++++---- setup.py | 5 +++-- {pylast => src/pylast}/__init__.py | 0 {pylast => src/pylast}/version.py | 0 5 files changed, 9 insertions(+), 7 deletions(-) rename {pylast => src/pylast}/__init__.py (100%) rename {pylast => src/pylast}/version.py (100%) diff --git a/MANIFEST.in b/MANIFEST.in index a82ada5..4aef3a7 100755 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,4 +1,4 @@ -include pylast/*.py +include src/pylast/*.py include setup.py include README.md include COPYING diff --git a/RELEASING.md b/RELEASING.md index e615ace..a89d169 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -1,13 +1,14 @@ # Release Checklist + * [ ] Get master to the appropriate code release state. [Travis CI](https://travis-ci.org/pylast/pylast) should be running cleanly for all merges to master. * [ ] Remove `.dev0` suffix from the version and update version and date in the changelog: ```bash git checkout master -edit CHANGELOG.md pylast/version.py +edit CHANGELOG.md src/pylast/version.py ``` * [ ] Commit and tag with the version number: ```bash -git add CHANGELOG.md pylast/version.py +git add CHANGELOG.md src/pylast/version.py git commit -m "Release 3.0.0" git tag -a 3.0.0 -m "Release 3.0.0" ``` @@ -29,11 +30,11 @@ git push --tags * [ ] Increment version and append `.dev0`, and add Unreleased to the changelog: ```bash git checkout master -edit CHANGELOG.md pylast/version.py +edit CHANGELOG.md src/pylast/version.py ``` * [ ] Commit and push: ```bash -git add CHANGELOG.md pylast/version.py +git add CHANGELOG.md src/pylast/version.py git commit -m "Start new release cycle" git push ``` diff --git a/setup.py b/setup.py index f7c494f..c718213 100755 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ import sys from setuptools import find_packages, setup version_dict = {} -with open("pylast/version.py") as f: +with open("src/pylast/version.py") as f: exec(f.read(), version_dict) version = version_dict["__version__"] @@ -72,7 +72,8 @@ setup( "Programming Language :: Python :: Implementation :: PyPy", ], keywords=["Last.fm", "music", "scrobble", "scrobbling"], - packages=find_packages(exclude=("tests*",)), + packages=find_packages(where="src"), + package_dir={"": "src"}, license="Apache2", ) diff --git a/pylast/__init__.py b/src/pylast/__init__.py similarity index 100% rename from pylast/__init__.py rename to src/pylast/__init__.py diff --git a/pylast/version.py b/src/pylast/version.py similarity index 100% rename from pylast/version.py rename to src/pylast/version.py From c3b36433b2074a64bc3e45f9e8f32b745c2734bc Mon Sep 17 00:00:00 2001 From: Hugo Date: Fri, 5 Apr 2019 09:00:31 +0300 Subject: [PATCH 2/4] Don't fail due to Last.fm bug --- tests/test_album.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/test_album.py b/tests/test_album.py index 2d47720..09b1f8f 100755 --- a/tests/test_album.py +++ b/tests/test_album.py @@ -2,6 +2,7 @@ """ Integration (not unit) tests for pylast.py """ +import pytest import unittest import warnings @@ -11,6 +12,10 @@ from .test_pylast import TestPyLastWithLastFm class TestPyLastAlbum(TestPyLastWithLastFm): + + # Last.fm bug + # https://getsatisfaction.com/lastfm/topics/gettoptags-getting-wrong-tags + @pytest.mark.xfail def test_album_tags_are_topitems(self): # Arrange album = self.network.get_album("Test Artist", "Test Album") From b9ef29fa21ba3a9c34fb051d28144273e88820fe Mon Sep 17 00:00:00 2001 From: Hugo Date: Fri, 5 Apr 2019 10:48:58 +0300 Subject: [PATCH 3/4] Simplify via https://blog.ionelmc.ro/2014/05/25/python-packaging/#the-structure --- MANIFEST.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MANIFEST.in b/MANIFEST.in index 4aef3a7..82c478f 100755 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,4 +1,4 @@ -include src/pylast/*.py +graft src include setup.py include README.md include COPYING From ab77165ecc923fbd13a3bf215232c0e9bcb90ab7 Mon Sep 17 00:00:00 2001 From: Hugo Date: Sun, 14 Apr 2019 18:35:10 +0300 Subject: [PATCH 4/4] Revert "Don't fail due to Last.fm bug" This reverts commit c3b36433b2074a64bc3e45f9e8f32b745c2734bc. --- tests/test_album.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/tests/test_album.py b/tests/test_album.py index 09b1f8f..2d47720 100755 --- a/tests/test_album.py +++ b/tests/test_album.py @@ -2,7 +2,6 @@ """ Integration (not unit) tests for pylast.py """ -import pytest import unittest import warnings @@ -12,10 +11,6 @@ from .test_pylast import TestPyLastWithLastFm class TestPyLastAlbum(TestPyLastWithLastFm): - - # Last.fm bug - # https://getsatisfaction.com/lastfm/topics/gettoptags-getting-wrong-tags - @pytest.mark.xfail def test_album_tags_are_topitems(self): # Arrange album = self.network.get_album("Test Artist", "Test Album")