Skip to content

Commit

Permalink
v 2.1 (out of beta)
Browse files Browse the repository at this point in the history
  • Loading branch information
mscuthbert committed Sep 28, 2015
1 parent ba08def commit de2b8e0
Show file tree
Hide file tree
Showing 15 changed files with 75 additions and 74 deletions.
88 changes: 44 additions & 44 deletions dist/dist.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
(normally not necessary, because it's slower and mostly duplicates multiprocessTest,
but should be done before making a release). Done automatically by Travis-CI on GitHub commit
5. then python3 test/testDocumentation.py # only designed for Python 3...
6. then test/testSerialization
6. WAS test/testSerialization -- covered in "all"
7. run documentation/make.py clean
8. run documentation/make.py [*]
Expand All @@ -37,9 +37,9 @@
then don't change anything until the next step is done.
(.gitignore SHOULD avoid uploading the large files created here...)
12. Create a new release on GitHub and upload the FIVE files created here. Use tag v2.0.1 (etc.).
12. Create a new release on GitHub and upload the THREE files created here. Use tag v2.0.1 (etc.).
Don't forget the "v" in the release tag.
Drag in this order: .egg, .tar.gz, .exe, no-corpus.egg, no-corpus.tar.gz
Drag in this order: .tar.gz, .exe, no-corpus.tar.gz
Finish this before doing the next step, even though it looks like it could be done in parallel.
Expand Down Expand Up @@ -71,7 +71,7 @@


'''
Build and upload music21 in three formats: egg, exe, and tar.
Build and upload music21 in two formats: exe, and tar.
Simply call from the command line.
'''
Expand All @@ -81,12 +81,12 @@

class Distributor(object):
def __init__(self):
self.fpEgg = None
#self.fpEgg = None
self.fpWin = None
self.fpTar = None

self.buildNoCorpus = True
self.fpEggNoCorpus = None
#self.fpEggNoCorpus = None
self.fpTarNoCorpus = None

self.version = base.VERSION_STR
Expand All @@ -107,7 +107,7 @@ def _initPaths(self):
self.fpDistDir = directory
self.fpPackageDir = parentDir # dir with setup.py
self.fpBuildDir = os.path.join(self.fpPackageDir, 'build')
self.fpEggInfo = os.path.join(self.fpPackageDir, 'music21.egg-info')
#self.fpEggInfo = os.path.join(self.fpPackageDir, 'music21.egg-info')

sys.path.insert(0, parentDir) # to get setup in as a possibility.

Expand All @@ -122,9 +122,9 @@ def updatePaths(self):
contents = os.listdir(self.fpDistDir)
for fn in contents:
fp = os.path.join(self.fpDistDir, fn)
if self.version in fn and fn.endswith('.egg'):
self.fpEgg = fp
elif self.version in fn and fn.endswith('.exe'):
#if self.version in fn and fn.endswith('.egg'):
# self.fpEgg = fp
if self.version in fn and fn.endswith('.exe'):
fpNew = fp.replace('.macosx-10.8-intel.exe', '.win32.exe')
fpNew = fpNew.replace('.macosx-10.8-x86_64.exe', '.win32.exe')
fpNew = fpNew.replace('.macosx-10.5-x86_64.exe', '.win32.exe')
Expand All @@ -143,30 +143,30 @@ def updatePaths(self):
elif self.version in fn and fn.endswith('.tar.gz'):
self.fpTar = fp

environLocal.warn('giving paths for egg, exe, and tar.gz/zip, respectively:')
for fn in [self.fpEgg, self.fpWin, self.fpTar]:
environLocal.warn('giving paths for exe, and tar.gz/zip, respectively:')
for fn in [self.fpWin, self.fpTar]:
if fn == None:
environLocal.warn('missing fn path')
else:
environLocal.warn(fn)

def removeCorpus(self, fp):
'''
Remove the corpus from a compressed file (.tar.gz or .egg) and
Remove the corpus from a compressed file (.tar.gz) and
create a new music21-noCorpus version.
Return the completed file path of the newly created edition.
NOTE: this function works only with Posix systems.
'''
TAR = 'TAR'
EGG = 'EGG'
#EGG = 'EGG'
if fp.endswith('.tar.gz'):
mode = TAR
modeExt = '.tar.gz'
elif fp.endswith('.egg'):
mode = EGG
modeExt = '.egg'
#elif fp.endswith('.egg'):
# mode = EGG
# modeExt = '.egg'
else:
raise Exception('incorrect source file path')

Expand Down Expand Up @@ -197,11 +197,11 @@ def removeCorpus(self, fp):
tf.extractall(path=fpDir)
os.system('mv %s %s' % (fpSrcDir, fpDstDir))

elif mode == EGG:
os.system('mkdir %s' % fpDstDir)
# need to create dst dir to unzip into
tf = zipfile.ZipFile(fp, 'r')
tf.extractall(path=fpDstDir)
#elif mode == EGG:
# os.system('mkdir %s' % fpDstDir)
# # need to create dst dir to unzip into
# tf = zipfile.ZipFile(fp, 'r')
# tf.extractall(path=fpDstDir)

tf.close() # done after extraction

Expand All @@ -210,15 +210,15 @@ def removeCorpus(self, fp):
fp = os.path.join(fpDstDir, 'music21', 'corpus', fn)
os.system('rm -r %s' % fp)

fp = os.path.join(fpDstDir, 'music21', 'corpus', 'metadataCache')
fp = os.path.join(fpDstDir, 'music21', 'corpus', '_metadataCache')
os.system('rm -r %s' % fp)


# adjust the sources Txt file
if mode == TAR:
sourcesTxt = os.path.join(fpDstDir, 'music21.egg-info', 'SOURCES.txt')
elif mode == EGG:
sourcesTxt = os.path.join(fpDstDir, 'EGG-INFO', 'SOURCES.txt')
#elif mode == EGG:
# sourcesTxt = os.path.join(fpDstDir, 'EGG-INFO', 'SOURCES.txt')

# files will look like 'music21/corpus/haydn' in SOURCES.txt
post = []
Expand Down Expand Up @@ -246,10 +246,10 @@ def removeCorpus(self, fp):
# just name of dir
cmd = 'tar -C %s -czf %s %s/' % (fpDir, fpDst, fnDstDir)
os.system(cmd)
elif mode == EGG:
# zip and name with egg: give dst, then source
cmd = 'cd %s; zip -r %s %s' % (fpDir, fnDst, fnDstDir)
os.system(cmd)
#elif mode == EGG:
# # zip and name with egg: give dst, then source
# cmd = 'cd %s; zip -r %s %s' % (fpDir, fnDst, fnDstDir)
# os.system(cmd)

# remove directory that was compressed
if os.path.exists(fpDstDir):
Expand All @@ -267,7 +267,7 @@ def build(self):
'''
# call setup.py
#import setup # -- for some reason does not work unless called from command line
for buildType in ['bdist_egg',
for buildType in [#'bdist_egg',
'bdist_wininst',
'sdist --formats=gztar'
]:
Expand All @@ -291,26 +291,26 @@ def build(self):
self.updatePaths()
#exit()
# remove build dir, egg-info dir
environLocal.warn('removing %s (except on windows...do it yourself)' % self.fpEggInfo)
os.system('rm -r %s' % self.fpEggInfo)
#environLocal.warn('removing %s (except on windows...do it yourself)' % self.fpEggInfo)
#os.system('rm -r %s' % self.fpEggInfo)
environLocal.warn('removing %s (except on windows...do it yourself)' % self.fpBuildDir)
os.system('rm -r %s' % self.fpBuildDir)

if self.buildNoCorpus is True:
# create no corpus versions
self.fpTarNoCorpus = self.removeCorpus(fp=self.fpTar)
self.fpEggNoCorpus = self.removeCorpus(fp=self.fpEgg)


def uploadPyPi(self):
'''
Upload source package to PyPI -- currently source file is too big for PyPi...sigh...
'''
environLocal.warn('putting bdist_egg on pypi -- looks redundant, but we have to do it again')
savePath = os.getcwd()
os.chdir(self.fpPackageDir)
os.system('%s setup.py bdist_egg upload' % PY)
os.chdir(savePath)
#self.fpEggNoCorpus = self.removeCorpus(fp=self.fpEgg)


# def uploadPyPi(self):
# '''
# Upload source package to PyPI -- currently source file is too big for PyPi...sigh...
# '''
# environLocal.warn('putting bdist_egg on pypi -- looks redundant, but we have to do it again')
# savePath = os.getcwd()
# os.chdir(self.fpPackageDir)
# os.system('%s setup.py bdist_egg upload' % PY)
# os.chdir(savePath)

#os.system('cd %s; %s setup.py bdist_egg upload' %
# (self.fpPackageDir, PY))
Expand Down
2 changes: 1 addition & 1 deletion music21/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@
Changing this number invalidates old pickles -- do it if the old pickles create a problem.
'''

__version_info__ = (2, 0, 12)
__version_info__ = (2, 1, 0)
__version__ = '.'.join(str(x) for x in __version_info__)

3 changes: 0 additions & 3 deletions music21/analysis/correlate.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
#-------------------------------------------------------------------------------
'''
Various tools and utilities to find correlations between disparate objects in a Stream.
See the chapter :ref:`overviewFormats` for more information and examples of
converting formats into and out of music21.
'''


Expand Down
3 changes: 2 additions & 1 deletion music21/analysis/metrical.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
'''
Various tools and utilities for doing metrical or rhythmic analysis.
See the chapter :ref:`overviewMeters` for more information on defining
See the chapter :ref:`User's Guide Chapter 14: Time Signatures <usersGuide_14_timeSignatures>`
for more information on defining
metrical structures in music21.
'''
from music21 import stream
Expand Down
2 changes: 1 addition & 1 deletion music21/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<class 'music21.base.Music21Object'>
>>> music21.VERSION_STR
'2.0.12'
'2.1.0'
Alternatively, after doing a complete import, these classes are available
under the module "base":
Expand Down
2 changes: 1 addition & 1 deletion music21/documentation/make.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def __init__(self, command='html'):
self.cpus_to_use = max(1, multiprocessing.cpu_count() - 1) # @UndefinedVariable
if self.cpus_to_use == 1:
self.useMultiprocessing = False

self.useMultiprocessing = False # too unstable still
self.documentationDirectoryPath = None
self.autogenDirectoryPath = None
self.buildDirectoryPath = None
Expand Down
3 changes: 2 additions & 1 deletion music21/documentation/source/about/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ Can I synthesize new sounds with music21?

I'm ready to give it a try, but how do I install `music21`?

Please see the complete install instructions: :ref:`install`.
Please see the complete install instructions:
:ref:`Installing music21 <usersGuide_01_installing>`.

`Music21` doesn't have some feature that I need, how do I get it added?

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ packages, type ``no`` and press Enter.
:width: 650

See :ref:`environment` for more information on configuring user settings.
Otherwise, head to: :ref:`usersGuide_00_introduction` for further demos and
Otherwise, head to: :ref:`What is Music21? <what>` for further demos and
tutorials on using music21.


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,4 +164,4 @@ as well. In addition, the SVN features of Eclipse let you stay updated
with the latest versions of music21. Eclipse + PyDev + Git is the
only supported method for developers to contribute to music21.

Details are at :ref:`usingEclipse` and :ref:`usingGit`
Details are at :ref:`usingGit`
13 changes: 3 additions & 10 deletions music21/documentation/source/installing/installLinux.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,6 @@ maintainers can only help with music21-specific problems post installation or
Mac/PC problems.


Alternative Installation Methods
----------------------------------------------

The following instructions are for general users. If you are an advanced user
and have installed other Python packages before, or want to use an EGG, SVN, PIP3,
or setuptools, you should read :ref:`installAdvanced`.


Check Your Version of Python
----------------------------------------------

Expand Down Expand Up @@ -61,7 +53,8 @@ Installing Music21 with setup.py

First, uncompress the .tar.gz file.

Open a shell or terminal, enter the outer-most music21 directory, and use `python` to execute the setup.py file with the 'install' argument: ::
Open a shell or terminal, enter the outer-most music21 directory, and use `python`
to execute the setup.py file with the 'install' argument: ::

$ cd /path/to/dir/music21-version
$ python setup.py install
Expand Down Expand Up @@ -93,7 +86,7 @@ http://docs.python.org/using/cmdline.html#envvar-PYTHONPATH
After Installation
-------------------------------

After a successful installation, you may proceed to :ref:`usersGuide_01_Installing` to
After a successful installation, you may proceed to :ref:`Notes usersGuide_02_notes` to
begin using `music21`.


Expand Down
7 changes: 6 additions & 1 deletion music21/documentation/source/installing/installMac.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ comes up, just follow the instructions below *carefully* and you shouldn't
have any problems.


To upgrade later, just do

sudo pip install --upgrade music21


Starting Python and Checking the Version
----------------------------------------------

Expand Down Expand Up @@ -179,7 +184,7 @@ and `music21-2.0.0` folder from your desktop now.
Open up the Mac Terminal (under Applications/Utilities/Terminal). You might want
to drag it to the dock. You'll use it often.

After a successful installation, you may proceed to :ref:`usersGuide_01_Installing` to
After a successful installation, you may proceed to :ref:`Notes <usersGuide_02_notes>` to
begin using music21.


Expand Down
4 changes: 2 additions & 2 deletions music21/documentation/source/installing/installWindows.rst
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ and then restarting from scratch).
After Installation
-------------------------------

After a successful installation, you may proceed to :ref:`usersGuide_01_Installing` to
begin using music21.
After a successful installation, you may proceed to :ref:`Notes <usersGuide_02_notes>`
to begin using music21.



Expand Down
4 changes: 2 additions & 2 deletions music21/documentation/source/tutorials/graphing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,8 @@ and which notes are not::
>>> majorScale = [0, 2, 4, 5, 7, 9, 11]
>>> for pitchClass in range(12):
... n = note.Note()
... n.pitchClass = pitchClass
... frequency = n.frequency
... n.pitch.pitchClass = pitchClass
... frequency = n.pitch.frequency
... for scale in data.keys():
... if (pitchClass - scale) % 12 in majorScale:
... data[scale].append((pitchClass, frequency))
Expand Down
9 changes: 5 additions & 4 deletions music21/mei/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,10 +344,11 @@ def safePitch(name, accidental=None, octave=''):

def makeDuration(base=0.0, dots=0):
'''
Given a ``base`` duration and a number of ``dots``, create a :class:`Duration` instance with the
Given a ``base`` duration and a number of ``dots``, create a :class:`~music21.duration.Duration`
instance with the
appropriate ``quarterLength`` value.
:param number base: The base duration that will be augmented.
:param float base: The base duration that will be augmented.
:param int dots: The number of dots with which to augment the ``base`` duration.
:returns: A :class:`Duration` corresponding to the fully-augmented value.
:rtype: :class:`music21.duration.Duration`
Expand Down Expand Up @@ -2706,8 +2707,8 @@ def measureFromElement(elem, backupNum, expectedNs, slurBundle=None, activeMeter
:param elem: The ``<measure>`` element to process.
:type elem: :class:`~xml.etree.ElementTree.Element`
:param int backupNum: A fallback value for the resulting :class:`Measure` objects' ``number``
attribute.
:param int backupNum: A fallback value for the resulting :class:`~music21.measure.Measure` objects'
number attribute.
:param expectedNs: A list of the expected @n attributes for the <staff> tags in this <measure>.
If an expected <staff> isn't in the <measure>, it will be created with a full-measure rest.
:type expectedNs: iterable of str
Expand Down
5 changes: 4 additions & 1 deletion music21/meter.py
Original file line number Diff line number Diff line change
Expand Up @@ -2655,7 +2655,10 @@ class TimeSignature(base.Music21Object):
>>> tsCut.symbol
'cut'
For complete details on using this object, see :ref:`overviewMeters`.
For complete details on using this object, see
:ref:`User's Guide Chapter 14: Time Signatures <usersGuide_14_timeSignatures>` and
:ref:`User's Guide Chapter 55: Advanced Meter <usersGuide_55_advancedMeter>` and
That's it for the simple aspects of `TimeSignature` objects. You know
enough to get started now!
Expand Down

0 comments on commit de2b8e0

Please sign in to comment.