Skip to content

Commit

Permalink
[FIX] for python2.7 support
Browse files Browse the repository at this point in the history
  • Loading branch information
Konstantinos committed Nov 2, 2019
2 parents 50f365e + 542b223 commit eb8ad63
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 11 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Changelog
=========

1.3.0.post0 (2019-11-01)
1.3.1 (2019-11-02)
-------------------

- fix for python2.7

1.3.0 (2019-11-01)
-------------------
Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ Overview
:alt: Supported versions
:target: https://pypi.org/project/music-album-creation

.. |commits_since| image:: https://img.shields.io/github/commits-since/boromir674/music-album-creator/v1.3.0.post0.svg
.. |commits_since| image:: https://img.shields.io/github/commits-since/boromir674/music-album-creator/v1.3.1.svg
:alt: Commits since latest release
:target: https://github.com/boromir674/music-album-creator/compare/v1.3.0.post0...master
:target: https://github.com/boromir674/music-album-creator/compare/v1.3.1...master


.. |supported-implementations| image:: https://img.shields.io/pypi/implementation/music-album-creator.svg
Expand Down
19 changes: 15 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,30 @@
import os
import re

from setuptools import find_packages, setup

my_dir = os.path.dirname(os.path.realpath(__file__))



# SOURCE_DIR_NAME
src = 'src'
name = 'music_album_creation'



def readme():
with open(os.path.join(my_dir, 'README.rst')) as f:
return f.read()
# return str(resource_string(__name__, 'README.rst'))

with open(os.path.join(my_dir, src, name, '__init__.py')) as f:
_version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', f.read(), re.MULTILINE).group(1)


setup(
name='music_album_creation',
version='1.3.0.post0',
version=_version,
description='A CLI application intending to automate offline music library building.',
long_description=readme(),
long_description_content_type='text/x-rst',
Expand Down Expand Up @@ -61,12 +72,12 @@ def readme():
'Topic :: Multimedia :: Sound/Audio',
],
url='https://github.com/boromir674/music-album-creator',
download_url='https://github.com/boromir674/music-album-creator/archive/v1.3.0.post0.tar.gz', # help easy_install do its tricks
download_url='https://github.com/boromir674/music-album-creator/archive/v{}.tar.gz'.format(_version), # help easy_install do its tricks
author='Konstantinos Lampridis',
author_email='k.lampridis@hotmail.com',
license='GNU GPLv3',
packages=find_packages(where='src'),
package_dir={'': 'src'}, # this is required by distutils
packages=find_packages(where=src),
package_dir={'': src}, # this is required by distutils
# py_modules=[splitext(basename(path))[0] for path in glob('src/*.py')],
include_package_data=True, # Include all data files in packages that distutils are aware of through the MANIFEST.in file
# package_data={
Expand Down
2 changes: 1 addition & 1 deletion src/music_album_creation/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = '1.3.0.post0'
__version__ = '1.3.1'

import logging.config
from os import path
Expand Down
4 changes: 2 additions & 2 deletions src/music_album_creation/dialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
# __all__ = ['store_album_dialog', 'interactive_metadata_dialogs']


class InputFactory:
class InputFactory(object):
__instance = None

def __new__(cls, *args, **kwargs):
if not cls.__instance:
cls.__instance = super().__new__(cls)
cls.__instance = super(InputFactory, cls).__new__(cls)
if sys.version_info.major == 2:
cls.__instance._input = raw_input # NOQA
else:
Expand Down
6 changes: 6 additions & 0 deletions tests/test_input.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from music_album_creation.dialogs import ask_input


def test_ask_input():
assert hasattr(ask_input, '_input')
assert type(ask_input._input).__name__ == 'builtin_function_or_method'

0 comments on commit eb8ad63

Please sign in to comment.