diff --git a/.codeclimate.yml b/.codeclimate.yml deleted file mode 100644 index 094144a5f5..0000000000 --- a/.codeclimate.yml +++ /dev/null @@ -1,8 +0,0 @@ -# Save as .codeclimate.yml (note leading .) in project root directory -languages: - Ruby: false - JavaScript: true - PHP: false - Python: true -exclude_paths: - - "music21/ext" \ No newline at end of file diff --git a/.gitignore b/.gitignore index 763265d2d7..04aa7dd0e4 100644 --- a/.gitignore +++ b/.gitignore @@ -21,6 +21,7 @@ __pycache__/ # OSX .DS_Store +**/.DS_Store # C extensions *.so @@ -40,6 +41,7 @@ develop-eggs lib lib64 __pycache__ +**/__pycache__ venv # Installer logs diff --git a/.gitignore_global b/.gitignore_global deleted file mode 100644 index 780245818b..0000000000 --- a/.gitignore_global +++ /dev/null @@ -1,3 +0,0 @@ -.DS_Store -__pycache__ - diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e9f64d722a..404de757fc 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -19,6 +19,17 @@ own projects that import and extend `music21`. [Code of Conduct](README.md) +## Preparing to Contribute ## + +Be sure to install all of the requirements in `requirements_dev.txt` via: + +``` +pip3 install -r requirements_dev.txt +``` + +There are several tools needed for fully testing music21 that aren't included +in the standard `requirements.txt`. + ## Issue Tickets ## Please use the provided templates for bug reports or feature proposals. For issues diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index 8d8ff2d5bc..0000000000 --- a/MANIFEST.in +++ /dev/null @@ -1,15 +0,0 @@ -global-include *.p.gz *.py *.txt *.xml *.krn *.mxl *.musicxml *.pdf *.html *.ipynb *.css *.js *.png *.jpg *.mid *.abc *.json *.md *.rst *.rntxt *.command *.scl *nwc *.nwctxt *.wav *.mei LICENSE -global-exclude *ipynb_checkpoints* *-checkpoint.ipynb -prune venv -prune .idea -prune .ropeproject -prune .github -global-exclude venv -global-exclude .idea -global-exclude .ropeproject -global-exclude .github -prune dist -prune .mypy_cache -prune music21/.mypy_cache -prune obsolete -prune documentation diff --git a/README.md b/README.md index 0f9375a5dd..3688dc645e 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,9 @@ # music21 # -music21 -- A Toolkit for Computational Musicology +`music21` -- A Toolkit for Computer-Aided Musical Analysis and +Computational Musicology -Copyright © 2006-2022, Michael Scott Asato Cuthbert +Copyright © 2006-2022, [Michael Scott Asato Cuthbert](http://www.trecento.com) For more information, visit: https://web.mit.edu/music21 @@ -13,13 +14,13 @@ https://tinyurl.com/m21colab And to install, see: https://web.mit.edu/music21/doc/usersGuide/usersGuide_01_installing.html -Music21 runs on Python 3.8+. Use version 4 on Python 2 or Py3.4, version 5 +`Music21` runs on Python 3.8+. Use version 4 on Python 2 or Py3.4, version 5 on Py3.5, version 6 on Py3.6, version 7 on Py3.7. Released under the BSD (3-clause) license. See LICENSE. Externally provided software (including the MIT licensed Lilypond/MusicXML test Suite) and music encoding in the corpus may have different licenses and/or copyrights. -A no-corpus version of music21 is available also on GitHub. +A no-corpus version of `music21` is available also on GitHub. [![Build Status](https://github.com/cuthbertLab/music21/workflows/maincheck/badge.svg)](https://github.com/cuthbertLab/music21) [![Lint Status](https://github.com/cuthbertLab/music21/workflows/PyLint/badge.svg)](https://github.com/cuthbertLab/music21) @@ -41,7 +42,7 @@ See: https://groups.google.com/forum/#!forum/music21list ## Community Code of Conduct ## -Music21 encourages contributions, discussions, and usage from all people interested in +`Music21` encourages contributions, discussions, and usage from all people interested in music and computers. This encouragement extends to all people regardless of (among other aspects) gender, race, sexual orientation, disability, religion, appearance, veteran status, gender identity, socioeconomic status, or nationality. @@ -56,7 +57,15 @@ sometimes make mistakes and will, in general, accept sincere regrets for such ca Blatant or repeated violations of the code will result in the removal of the contributor’s participation in the community. -The maintainers of music21 and associated sites will commit themselves to enforcing +The maintainers of `music21` and associated sites will commit themselves to enforcing this code of conduct. Users who notice violations, including instances of abuse, harassment, or otherwise unacceptable behavior are requested to contact cuthbert@mit.edu. Maintainers will respect confidentiality with regard to reports. + +## Acknowledgements ## + +The development of `music21` has been supported by +the generosity of the Seaver Institute and the +National Endowment for the Humanities. MIT's Music and Theater Arts Section +and the School of Humanities, Arts, and Social Sciences encouraged Cuthbert +in its development. diff --git a/documentation/source/installing/installLinux.rst b/documentation/source/installing/installLinux.rst index 8577520d72..f8c89afa5e 100644 --- a/documentation/source/installing/installLinux.rst +++ b/documentation/source/installing/installLinux.rst @@ -4,20 +4,27 @@ Installing `music21` on GNU/Linux ============================================ -GNU/Linux, FreeBSD, etc. are supported by `music21`. However, by choosing to use -Unix-like systems you should be an advanced user -- the music21list should not -be used for general installation/configuration problems that are specific to +GNU/Linux, FreeBSD, etc. generally work on `music21`. Many people, including +all of the major developers of `music21` run it on various deployed GNU/Linux, +Unix, AWS-Unix, etc. systems throughout the world. However, no system except +recent Mac and Windows OSes are officially supported. + +By choosing to use Unix-like systems you should be an advanced user on your +OS, able to deal with the issues of libraries, linkage, external files, etc. +specific to (and different on) each Unix-like system. The music21list should not +be used for installation/configuration problems on your operating system. Because of the number of different Unix variants, the list -maintainers can only help with `music21`-specific problems post installation or -Mac/PC problems. +maintainers will only entertain `music21`-specific problems on Unix **post** +installation and configuration. -To reiterate: **GNU/Linux is not a system for which support questions will be answered** +To reiterate: **GNU/Linux is not a system for which support +questions will be answered** Check Your Version of Python ---------------------------------------------- -`Music21` requires Python 3.7+. +`Music21` requires Python 3.8+. To determine the Python version you have installed, open a shell or terminal and enter the following command-line argument (where "$" is the prompt): @@ -26,11 +33,11 @@ or terminal and enter the following command-line argument (where "$" is the prom it should display something like: - Python 3.9.2 + Python 3.10.7 -if so, you're okay. If not, go to https://www.python.org/downloads/ -and download a newer version. Multiple versions of Python can exist -on a single computer without any problems. +if so, you're okay. If not, upgrade your version of Python. This is +often a problem on some AWS configuations, Google Colab, etc. +which do not ship by default with recent versions of Python. Download `music21` @@ -41,10 +48,24 @@ Download the newest version with: pip3 install --upgrade music21 +Configure `music21` +---------------------------------------------- +Configure music21 with: + + python3 -m music21.configure + +It is important to put the path to your MusicXML reader during these +prompts. Music21 cannot find where your XML reader (probably MuseScore) +is installed on most Unix/Linux systems. If you do not know about +filepaths and how to find them, you should probably not be using +GNU/Linux, FreeBSD, etc. with `music21`. + + After Installation ------------------------------- -After a successful installation, you may proceed to :ref:`Notes ` to +After a successful installation, you may proceed to +:ref:`Notes ` to begin using `music21`. @@ -53,6 +74,7 @@ Installation Help If you have followed all the instructions and still encounter problems, start over from scratch and try it again very carefully. -If you still have problems contact an expert in your operating system. -The `music21` staff cannot help with Unix installation problems except -as paid support. +If you still have problems **contact an expert in your operating system**. + +The `music21` maintainers cannot help with Unix installation problems except +as paid support. See Consulting in the FAQ for details on paid support. diff --git a/documentation/source/installing/installMac.rst b/documentation/source/installing/installMac.rst index 9198559bf1..cb233cff8f 100644 --- a/documentation/source/installing/installMac.rst +++ b/documentation/source/installing/installMac.rst @@ -13,14 +13,15 @@ Trust us that it should work. Downloading Python 3 from python.org --------------------------------------- -Though Macs come with Python, it's a very old version. We recommend -updating that by going to https://www.python.org/downloads and getting -Python 3.9 or later. +Though most Macs come with Python, it's usually a very old version. +We recommend updating that by going to https://www.python.org/downloads +and getting the latest version. (The `music21` team strongly recommends using the version of Python 3 from the python.org website and not the Conda version -(or Enthought Canopy) because it is fully compatible with -`matplotlib`. If you have no plans on plotting functions, +(or Enthought Canopy) because music21 is fully compatible with +`matplotlib` on the python.org site. +If you have no plans on plotting functions, feel free to use any flavor of Python 3.) @@ -65,7 +66,7 @@ it should display in Terminal something like the following: .. image:: images/macScreenPythonVersion.* :width: 650 -If it says 3.7 or higher (or possibly a number like 3.9.2), you're okay. +If it says 3.8 or higher (or possibly a number like 3.10.7), you're okay. If it says 2.7 or 3.4 or something, go to https://www.python.org/downloads/ and download a newer version. Multiple versions of Python can exist @@ -88,56 +89,24 @@ Exit python by typing `quit()`. Starting the Configuration Assistant ----------------------------------------------------- -If you downloaded the `music21` project from Github, the project folder will -contain a script that runs a configuration assistant. Double click on the -installer.command file to start. This should open a Terminal window and run -the Configuration Assistant. As this is a program downloaded from the Internet, -the System will likely warn you about running it. Go ahead and click "Open". +If you only installed the `music21` package with `pip` (for +instance, by running `sudo pip3 install music21`), you should run +the assistant from a command prompt:: -More likely, if you only installed the `music21` package with `pip` (for -instance, by running `sudo pip3 install music21`), you may run the Configuration -Assistant from a Python shell after importing `music21`, like this:: + python3 -m music21.configure + +You can also run the Configuration Assistant from a Python shell + like this:: import music21 music21.configure.run() -Otherwise, you may launch the assistant from a command prompt:: - - python3 -m music21.configure - After waiting a few moments to load modules, the Configuration Assistant begins. .. image:: images/macScreenConfigAssistantStart.* :width: 650 -The first option is to install `music21` in its standard location -(see below, The Installation Destination). Enter "y" or "yes", or -press return to accept the default of "yes". If you installed via pip, you -won't be asked this question. - -Before installation begins you may be asked for your Mac password. (The cursor -won't move or display any letters when you type in the password. Just rest assured -that the characters are being transmitted). -As Python packages are stored in a System directory, you need to give permission -to write files to that location. - -(If you don't get a prompt but instead start getting -a lot of errors, you probably do not have an administrator account on your Mac. -To make yourself one, quit the installation program (just close the window), open -System Preferences from the Apple menu in the upper left corner of your screen, click on -Users and Groups (4th Row). Click on the lock on the lower-left corner -- you'll need -your Mac password. Then click "Allow user to administer this computer". Then -close System Preferences and click the music21 `installer.command` button again and -go back one step.) - -During installation, a large amount of text will display showing files being copied. -Sorry about the mess. Just ignore it! It means it's working. - -.. image:: images/macScreenConfigAssistantStart.* - :width: 650 - -After installation the Configuration Assistant will try to -configure your setup. If you have never used `music21` before, +If you have never used `music21` before, following these prompts is recommended. Selecting a MusicXML reader is the first step. @@ -149,7 +118,7 @@ The Configuration Assistant will attempt to find a MusicXML reader on your system. If it can't find any, you will be asked to open a URL to download MuseScore, a simple and free MusicXML reader and easy writer. Installing MuseScore is -recommended for users who do not have Finale, Sibelius, MuseScore, +recommended for users who do not have Finale, Sibelius, Dorico, MuseScore, or another MusicXML reader. If one or more MusicXML readers are found, skip ahead to the next instructions. diff --git a/documentation/source/installing/installWindows.rst b/documentation/source/installing/installWindows.rst index 67b4be25f1..9cf2dead05 100644 --- a/documentation/source/installing/installWindows.rst +++ b/documentation/source/installing/installWindows.rst @@ -13,7 +13,7 @@ is written in and in which you will write your own programs that use `music21`. Windows users should download and install Python version -3.8 or higher. +3.10 or higher. To get Python for Windows, go to https://www.python.org/downloads/ and click on the "Windows installer" link. It is probably the @@ -37,7 +37,7 @@ typing in "IDLE" or (on Windows Vista and newer) typing in "IDLE" in the Search Programs list. The first lines of text displayed will include a version number. -Make sure it begins with 3.7 or higher. +Make sure it begins with 3.10 or higher. If your version is too old, download a newer version as above. @@ -66,15 +66,15 @@ Python on your system. Try uninstalling all of them along with `music21` and then restarting from scratch). You should then configure `music21` to find your helper programs -such as MuseScore or Finale. In IDLE -type:: +such as MuseScore or Finale. In the command prompt, type:: + + python3 -m music21.configure + +Or, in IDLE type:: import music21 music21.configure.run() -or in the command prompt, type:: - - python3 -m music21.configure After Installation ------------------------------- diff --git a/installer.command b/installer.command deleted file mode 100755 index 5e3e90acb5..0000000000 --- a/installer.command +++ /dev/null @@ -1,13 +0,0 @@ -#! /bin/sh - -# this is a launcher for users of osx; double click to use - -# change to the current directory -DIRFILE=$(dirname "$0") -eval cd \"$DIRFILE\" -python installer.py - - - - - diff --git a/installer.py b/installer.py deleted file mode 100644 index 964b5431ab..0000000000 --- a/installer.py +++ /dev/null @@ -1,47 +0,0 @@ -# -*- coding: utf-8 -*- -# ------------------------------------------------------------------------------ -# Name: installer.py -# Purpose: install and configure -# -# Authors: Christopher Ariza -# Michael Scott Asato Cuthbert -# -# Copyright: Copyright © 2009-2016 Michael Scott Asato Cuthbert -# License: BSD, see license.txt -# ------------------------------------------------------------------------------ - -import os -import sys - - -def main(): - sys.stdout.write('Starting the music21 Configuration Assistant.\n' - + 'Module loading could take a few moments, please wait...') - sys.stdout.flush() - - if 'music21' in os.listdir(os.getcwd()): - p1 = os.path.join(os.getcwd(), 'music21') - if p1 not in sys.path: - sys.path.append(p1) - if 'music21' in os.listdir(p1): - p2 = os.path.join(p1, 'music21') - if p2 not in sys.path: - sys.path.append(os.path.join(p2, 'music21')) - - run = False - try: - from music21 import configure - run = True - except ImportError: - pass - - - # need to be sure that we have the configure.py file found in the right place - - if run: - ca = configure.ConfigurationAssistant() - ca.run() - - -if __name__ == '__main__': - main() diff --git a/music21/_version.py b/music21/_version.py index 141d89bbb5..0fdd088122 100644 --- a/music21/_version.py +++ b/music21/_version.py @@ -20,20 +20,25 @@ Q: Why is this here and not in music21/__init__.py? -A: Keeping the information here makes it available to Music21's setup.py file -by simply reading this file in and evaluating its contents. +A: Keeping the information here makes it available to package managers and others who +have not yet installed all of music21, by simply reading this file in and evaluating its contents. -Importantly, that means that Music21's setup.py *doesn't* need to import any -part of Music21's code during the installation process. Not importing any part +Importantly, that means that Music21's setup system (currently Hatch) +*doesn't* need to import any part of Music21's code during the installation process. +Not importing any part of Music21 makes installation cleaner, and also helps other software - like package managers in various Linux distributions - work with Music21 without complaint. + +Thanks to Andrew Hankinson for suggesting this way of dealing with versions to begin with. + + Changing Versions ================== When it's time to update Music21's version, just change the numbers in the -tuple assigned to __version_info__, and the __version__ string will be +tuple assigned to __version__ string and the __version_info__ tuple will be updated along with it. When changing, update the single test case in base.py. @@ -58,7 +63,7 @@ def get_version_tuple(vv): return tuple(v) -__version__ = '8.0.0rc2' +__version__ = '8.1.0' __version_info__ = get_version_tuple(__version__) diff --git a/music21/base.py b/music21/base.py index bdb43a8ca0..5d766ede39 100644 --- a/music21/base.py +++ b/music21/base.py @@ -27,7 +27,7 @@ >>> music21.VERSION_STR -'8.0.0rc2' +'8.1.0' Alternatively, after doing a complete import, these classes are available under the module "base": diff --git a/music21/configure.py b/music21/configure.py index d3d9f50f15..76256a88d7 100644 --- a/music21/configure.py +++ b/music21/configure.py @@ -22,8 +22,6 @@ from importlib import reload # Python 3.4 -import io - # assume that we will manually add this dir to sys.path top get access to # all modules before installation from music21 import common @@ -121,51 +119,6 @@ def getSitePackages(): return sysconfig.get_path('purelib') -def findInstallations(): - ''' - Find all music21 references that are found in "site-packages", or - possibly look at the running code as well. - ''' - found = [] - sitePackages = getSitePackages() - for fn in sorted(os.listdir(sitePackages)): - if fn.startswith('music21'): - found.append(os.path.join(sitePackages, fn)) - try: - # see if we can import music21 - import music21 # pylint: disable=redefined-outer-name - found.append(music21.__path__[0]) # list, get first item - except ImportError: - pass - return found - - -def findInstallationsEggInfo(): - ''' - Find all music21 eggs found in site packages, or possibly look - at the running code as well. - ''' - found = findInstallations() - # only get those that end w/ egg-info - post = [] - for fp in found: - unused_dir, fn = os.path.split(fp) - if fn.endswith('egg-info') or fn.endswith('egg'): - post.append(fn) - return post - - -def findInstallationsEggInfoStr(): - ''' - Return a string presentation, or the string None - ''' - found = findInstallationsEggInfo() - if not found: - return 'None' - else: - return ','.join(found) - - def getUserData(): ''' Return a dictionary with user data @@ -177,8 +130,6 @@ def getUserData(): except ImportError: post['music21.version'] = 'None' - post['music21 egg-info current'] = findInstallationsEggInfoStr() - if hasattr(os, 'uname'): uname = os.uname() post['os.uname'] = f'{uname[0]}, {uname[2]}, {uname[4]}' @@ -219,34 +170,6 @@ def _crawlPathUpward(start, target): return match -def findSetup(): - ''' - Find the setup.py script and returns the path to the setup.py file. - ''' - # find setup.py - # look in current directory and ascending - match = _crawlPathUpward(start=os.getcwd(), target='setup.py') - # if no match, search downward if music21 is in this directory - if match is None: - if 'music21' in os.listdir(os.getcwd()): - sub = os.path.join(os.getcwd(), 'music21') - if 'setup.py' in os.listdir(sub): - match = os.path.join(sub, 'setup.py') - - # if still not found, try to get from importing music21. - # this may not be correct, as this might be a previous music21 installation - # if match is None: - # try: - # import music21 - # fpMusic21 = music21.__path__[0] # list, get first item - # except ImportError: - # fpMusic21 = None - # if fpMusic21 is not None: - # match = _crawlPathUpward(start=fpMusic21, target='setup.py') - - environLocal.printDebug([f'found setup.py: {match}']) - return match - # ------------------------------------------------------------------------------ # error objects, not exceptions @@ -416,7 +339,7 @@ def _askTryAgain(self, default=True, force=None): False >>> prompt._askTryAgain(force='') # gets default True - >>> prompt._askTryAgain(force='blah') # error gets false + >>> prompt._askTryAgain(force='blah') # error gets False False ''' # need to call a yes or no on using default @@ -808,69 +731,6 @@ def _performAction(self, simulate=False): # perform action -class AskInstall(YesOrNo): - ''' - Ask the user if they want to move music21 to the normal place... - ''' - def __init__(self, default=True, tryAgain=True, - promptHeader=None): - super().__init__(default=default, tryAgain=tryAgain, promptHeader=promptHeader) - - # define platforms that this will run on - self._platforms = ['darwin', 'nix'] - - msg = ( - 'Would you like to install music21 in the normal ' - + 'place for Python packages (i.e., site-packages)?' - ) - self.appendPromptHeader(msg) - - def _performActionNix(self, simulate=False): - fp = findSetup() - if fp is None: - return None - - self._writeToUser(['You must authorize writing in the following directory:', - getSitePackages(), - ' ', - 'Please provide your user password to complete this operation.', - '']) - - stdoutSrc = sys.stdout - # stderrSrc = sys.stderr - - fileLikeOpen = io.StringIO() - sys.stdout = fileLikeOpen - - directory, unused_fn = os.path.split(fp) - pyPath = sys.executable - cmd = f'cd {directory!r}; sudo {pyPath!r} setup.py install' - post = os.system(cmd) - - fileLikeOpen.close() - sys.stdout = stdoutSrc - # sys.stderr = stderrSrc - return post - - def _performAction(self, simulate=False): - '''The action here is to install in site packages, if the user agrees. - ''' - result = self.getResult() - if result is not True: - return None - - platform = common.getPlatform() - if platform == 'win': - post = None - elif platform == 'darwin': - post = self._performActionNix() - elif platform == 'nix': - post = self._performActionNix() - else: - post = self._performActionNix() - return post - - class AskSendInstallationReport(YesOrNo): ''' Ask the user if they want to send a report @@ -1178,7 +1038,7 @@ def _performAction(self, simulate=False): # us['autoDownload'] = 'deny' # automatically writes environment.set('autoDownload', 'deny') elif result == 3: - raise DialogException('user selected an option that terminates installer.') + raise DialogException('user selected an option that terminates configuration.') if result in [1, 2]: self._writeToUser([f"Auto Download set to: {environment.get('autoDownload')}", ' ']) @@ -1436,27 +1296,18 @@ def __init__(self, simulate=False): self._simulate = simulate self._platform = common.getPlatform() - # get and store if there is a current egg-info files - self._lastEggInfo = findInstallationsEggInfoStr() - # add dialogs to list self._dialogs = [] self.getDialogs() def getDialogs(self): - if 'site-packages' not in common.getSourceFilePath().parts: - d = AskInstall(default=True) - self._dialogs.append(d) - d = SelectMusicXMLReader(default=1) self._dialogs.append(d) d = AskAutoDownload(default=True) self._dialogs.append(d) - # provide original egg info files - additionalEntries = {'music21 egg-info previous': self._lastEggInfo} - d = AskSendInstallationReport(default=True, additionalEntries=additionalEntries) + d = AskSendInstallationReport(default=True) self._dialogs.append(d) d = AskOpenInBrowser( @@ -1723,12 +1574,6 @@ def testRe(self): def testConfigurationAssistant(self): unused_ca = ConfigurationAssistant(simulate=True) - def testAskInstall(self): - unused_d = AskInstall() - # d.askUser() - # d.getResult() - # d.performAction() - def testGetUserData(self): unused_d = AskSendInstallationReport() # d.askUser() diff --git a/music21/corpus/_metadataCache/core.p.gz b/music21/corpus/_metadataCache/core.p.gz index bede32c922..48df9de4dc 100644 Binary files a/music21/corpus/_metadataCache/core.p.gz and b/music21/corpus/_metadataCache/core.p.gz differ diff --git a/music21/test/coverageM21.py b/music21/test/coverageM21.py index ec6b42e609..f19593ff97 100644 --- a/music21/test/coverageM21.py +++ b/music21/test/coverageM21.py @@ -13,7 +13,6 @@ omit_modules = [ 'dist/dist.py', - 'installer.py', 'music21/test/*', 'music21/configure.py', 'music21/figuredBass/examples.py', diff --git a/py.typed b/py.typed new file mode 100644 index 0000000000..e69de29bb2 diff --git a/pyproject.toml b/pyproject.toml index e80e677982..65c4dea157 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ name = "music21" dynamic = [ "version", ] -description = "A Toolkit for Computer-Aided Musical Analysis." +description = "A Toolkit for Computer-Aided Musical Analysis and Computational Musicology." readme = "README.md" license = "BSD-3-Clause" requires-python = ">=3.8" @@ -35,6 +35,8 @@ classifiers = [ "Topic :: Multimedia :: Sound/Audio :: MIDI", "Topic :: Software Development :: Libraries :: Python Modules", ] + +# when hatch-requirements-txt is stable, replace with that dependencies = [ "chardet", "joblib", @@ -60,8 +62,5 @@ path = "music21/_version.py" [tool.hatch.build.targets.sdist] include = [ "music21", -] - -exclude = [ - "*/py.typed" + "py.typed", # indicates source is typed. ] diff --git a/requirements_dev.txt b/requirements_dev.txt index 4e9dda38ba..f2e882eb4e 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -2,6 +2,7 @@ pylint flake8 flake8-quotes +hatchling mypy coveralls scipy diff --git a/requirements-minimum.txt b/requirements_minimum.txt similarity index 100% rename from requirements-minimum.txt rename to requirements_minimum.txt diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 6334f2f4b2..0000000000 --- a/setup.cfg +++ /dev/null @@ -1,5 +0,0 @@ -[pycodestyle] -count = False -ignore = E121,E123,E126,E127,E128,E133,E261,E266,E303,W503 -max-line-length = 100 -statistics = True diff --git a/setup.py b/setup.py deleted file mode 100644 index b5cf2b4753..0000000000 --- a/setup.py +++ /dev/null @@ -1,80 +0,0 @@ -##!/usr/bin/env python3 -# -*- coding: utf-8 -*- -# ------------------------------------------------------------------------------ -# Name: setup.py -# Purpose: install -# -# Authors: Christopher Ariza -# Michael Scott Asato Cuthbert -# -# Copyright: (c) 2009-2021 Michael Scott Asato Cuthbert -# License: BSD, see license.txt -# ------------------------------------------------------------------------------ - -import os -import setuptools - -# Do not import music21 directly. -# Instead, read the _version.py file and exec its contents. -path = os.path.join(os.path.dirname(__file__), 'music21', '_version.py') -with open(path, 'r') as f: - lines = f.read() - exec(lines) - -m21version = __version__ - -DESCRIPTION = 'A Toolkit for Computer-Aided Musical Analysis.' -DESCRIPTION_LONG = """A Toolkit for Computer-Aided Musical Analysis. - Developed by Michael Scott Asato Cuthbert. - The development of music21 is supported by the - generosity of the Seaver Institute and the NEH.""" - -requirements_path = os.path.join( - os.path.dirname(__file__), "requirements.txt" -) -with open(requirements_path, 'r') as f: - INSTALL_REQUIRES = f.read().splitlines() - -classifiers = [ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Console', - 'Environment :: Web Environment', - 'Intended Audience :: End Users/Desktop', - 'Intended Audience :: Developers', - 'Intended Audience :: Education', - 'Intended Audience :: Science/Research', - 'License :: OSI Approved :: BSD License', - 'Natural Language :: English', - 'Operating System :: MacOS', - 'Operating System :: Microsoft :: Windows', - 'Operating System :: POSIX', - 'Operating System :: OS Independent', - 'Programming Language :: Python', - 'Programming Language :: Python :: 3 :: Only', - 'Topic :: Multimedia :: Sound/Audio', - 'Topic :: Multimedia :: Sound/Audio :: MIDI', - 'Topic :: Multimedia :: Sound/Audio :: Conversion', - 'Topic :: Artistic Software', - 'Topic :: Software Development :: Libraries :: Python Modules', -] - -download_base = 'https://github.com/cuthbertLab/music21/releases/download/' - -if __name__ == '__main__': - setuptools.setup( - name='music21', - version=m21version, - python_requires='>=3.8', - description=DESCRIPTION, - long_description=DESCRIPTION_LONG, - author='Michael Scott Asato Cuthbert', - author_email='cuthbert@mit.edu', - license='BSD', - url='https://github.com/cuthbertLab/music21', - classifiers=classifiers, - download_url=f'{download_base}v{m21version}/music21-{m21version}.tar.gz', - packages=setuptools.find_namespace_packages(), - install_requires=INSTALL_REQUIRES, - include_package_data=True, - zip_safe=False, - )