Skip to content

Commit

Permalink
Update build scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
mmcauliffe committed Aug 27, 2024
1 parent 5e62354 commit 823597a
Show file tree
Hide file tree
Showing 6 changed files with 160 additions and 77 deletions.
5 changes: 0 additions & 5 deletions conch/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
__ver_major__ = 0
__ver_minor__ = 3
__ver_patch__ = 2
__ver_tuple__ = (__ver_major__, __ver_minor__, __ver_patch__)
__version__ = "%d.%d.%d" % __ver_tuple__

from .main import analyze_segments, acoustic_similarity_directories, acoustic_similarity_mapping, \
acoustic_similarity_directory, analyze_long_file
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'alabaster'
html_theme = 'pydata-sphinx-theme'

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
Expand Down
1 change: 1 addition & 0 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ dependencies:
- praatio
- pytest
- reaper
- setuptools_scm
- pip:
- build
- twine
Expand Down
85 changes: 85 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
[build-system]
requires = [
"setuptools>=45", "wheel", "setuptools_scm>=6.2"
]
build-backend = "setuptools.build_meta"

[tool.setuptools_scm]
write_to = "conch/_version.py"

[tool.black]
line-length = 99

[tool.isort]
line_length = 99
profile = "black"
known_first_party = [
"conch"
]

[tool.interrogate]
ignore-init-method = true
ignore-init-module = false
ignore-magic = false
ignore-semiprivate = false
ignore-private = false
ignore-module = false
ignore-property-decorators = false
fail-under = 95
exclude = [
"tests",
"build",
"dist",
"setup.py",
"docs"
]
verbose = 100
omit-covered-files = false
quiet = false
generate-badge = "docs/source/_static"
badge-format = "svg"
whitelist-regex = []
ignore-regex = []
color = true


[tool.check-manifest]
ignore = [
".deepsource.toml",
".readthedocs.yaml",
]

[tool.coverage.run]
source = ["conch"]
concurrency = ["multiprocessing"]
branch = true
parallel = true
omit = [
".tox/*"
]


[tool.coverage.report]
show_missing = true
exclude_lines = [
"pragma: no cover",
"if __name__ == .__main__.:",
"raise AssertionError",
"raise NotImplementedError",
"pass",
"if sys.platform",
"except ImportError:",
"except KeyboardInterrupt:",
"except Exception as e:",
"except Exception:",
"if call_back",
"if is_set",
"if TYPE_CHECKING:",
"def history_save_handler() -> None:",
"class ExitHooks(object):",
"def main() -> None:",
"if os.path.exists",
"@abstractmethod",
'if "MFA_ERROR"',
]
fail_under = 50
74 changes: 71 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,73 @@
[metadata]
description-file = README.md
name = Conch-sounds
description = Analyze acoustic similarity in Python
long_description = file: README.md
long_description_content_type = text/markdown
url = https://github.com/mmcauliffe/Conch-sounds
author = Michael McAuliffe
author_email = [email protected]
maintainer = Michael McAuliffe
maintainer_email = [email protected]
license = MIT
license_file = LICENSE
license_files = LICENSE
classifiers = Development Status :: 3 - Alpha
Programming Language :: Python
Programming Language :: Python :: 3
Operating System :: OS Independent
Topic :: Scientific/Engineering
Topic :: Text Processing :: Linguistic
keywords = phonetics
acoustics
acoustic similarity

[bdist_wheel]
universal = 1
[options]
packages = find:
install_requires =
numpy
librosa
pysoundfile
scipy
praatio
pyraat
python_requires = >=3.8
include_package_data = True

[options.packages.find]
exclude = tests

[options.extras_require]
dev =
coverage
coveralls
interrogate
pytest
pytest-mypy
setuptools-scm
tomli
tox
tox-conda
docs =
interrogate
numpydoc
pydata-sphinx-theme
sphinx
sphinx-design
testing =
coverage
coveralls
pytest

[options.package_data]
conch.analysis.pitch =
*.praat
conch.analysis.formants =
*.praat
conch.analysis.intensity =
*.praat
conch.analysis.mfcc =
*.praat

[tool:pytest]
testpaths = tests
norecursedirs = data
70 changes: 2 additions & 68 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,70 +1,4 @@
import sys
import os
import setuptools_scm # noqa
from setuptools import setup
from setuptools.command.test import test as TestCommand

import conch


def readme():
with open('README.md') as f:
return f.read()


class PyTest(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = ['--strict', '--verbose', '-x', '--tb=long', 'tests']
if os.environ.get('TRAVIS', False):
self.test_args.insert(0, '--runslow')
self.test_suite = True

def run_tests(self):
if __name__ == '__main__': # Fix for multiprocessing infinite recursion on Windows
import pytest
errcode = pytest.main(self.test_args)
sys.exit(errcode)


if __name__ == '__main__':
setup(name='conch-sounds',
version=conch.__version__,
description='Analyze acoustic similarity in Python',
classifiers=[
'Development Status :: 3 - Alpha',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Operating System :: OS Independent',
'Topic :: Scientific/Engineering',
'Topic :: Text Processing :: Linguistic',
],
keywords='phonetics, acoustics similarity',
url='https://github.com/mmcauliffe/Conch',
download_url='https://github.com/mmcauliffe/Conch/tarball/{}'.format(
conch.__version__),
author='Michael McAuliffe',
author_email='[email protected]',
packages=['conch',
'conch.analysis',
'conch.analysis.amplitude_envelopes',
'conch.analysis.formants',
'conch.analysis.intensity',
'conch.analysis.mfcc',
'conch.analysis.pitch',
'conch.distance'],
package_data={'conch.analysis.pitch': ['*.praat'],
'conch.analysis.formants': ['*.praat'],
'conch.analysis.intensity': ['*.praat'],
'conch.analysis.mfcc': ['*.praat']},
install_requires=[
'numpy',
'scipy',
'praatio',
'librosa',
'pyraat'
],
cmdclass={'test': PyTest},
extras_require={
'testing': ['pytest'],
}
)
setup()

0 comments on commit 823597a

Please sign in to comment.