Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added bin/__init__.py
Empty file.
12 changes: 11 additions & 1 deletion polyglotdb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,17 @@
__ver_patch__ = 1
__version__ = f"{__ver_major__}.{__ver_minor__}.{__ver_patch__}"

__all__ = ['query', 'io', 'corpus', 'config', 'exceptions', 'CorpusContext', 'CorpusConfig']
__all__ = ['query', 'io', 'corpus', 'config', 'exceptions', 'CorpusContext', 'CorpusConfig', 'pgdb']

# Inspired by: https://stackoverflow.com/a/43602645
import sys
from importlib.util import spec_from_loader, module_from_spec
from importlib.machinery import SourceFileLoader

spec = spec_from_loader("pgdb", SourceFileLoader("pgdb", "polyglotdb/command_line/pgdb"))
pgdb = module_from_spec(spec)
spec.loader.exec_module(pgdb)
sys.modules['pgdb'] = pgdb

import polyglotdb.query.annotations as graph

Expand Down
6 changes: 5 additions & 1 deletion bin/pgdb → polyglotdb/command_line/pgdb
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ def status(name):
pass


if __name__ == '__main__':
def main():
parser = argparse.ArgumentParser()
subparsers = parser.add_subparsers(help='Command to use')
install_parser = subparsers.add_parser("install")
Expand Down Expand Up @@ -311,3 +311,7 @@ if __name__ == '__main__':

if CONFIG_CHANGED:
save_config(CONFIG)


if __name__ == '__main__':
main()
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"
50 changes: 50 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
[metadata]
name = polyglotdb
description = ''
long_description = file: README.md
long_description_content_type = text/markdown
license = MIT
license_file = LICENSE
keywords='phonology corpus phonetics',
url='https://github.com/MontrealCorpusTools/PolyglotDB',
author='Montreal Corpus Tools',
author_email='[email protected]',
classifiers =
Development Status :: 3 - Alpha
Programming Language :: Python
Programming Language :: Python :: 3
Intended Audience :: Science/Research
License :: OSI Approved :: MIT License
Operating System :: OS Independent
Topic :: Scientific/Engineering
Topic :: Text Processing :: Linguistic
project_urls =
Documentation = 'http://polyglotdb.readthedocs.io/en/latest/'
Source = 'https://github.com/MontrealCorpusTools/PolyglotDB'
Tracker = 'https://github.com/MontrealCorpusTools/PolyglotDB/issues'

[options]
packages = find:
zip_safe = True
include_package_data = True
install_requires =
neo4j-driver >=4.3
praatio >=5.0
textgrid
conch_sounds
librosa
influxdb
tqdm
requests
python_requires = >=3.6

[options.entry_points]
console_scripts =
pgdb = polyglotdb.command_line.pgdb:main

[options.extras_require]
test =
pytest

[options.package_data]
polyglotdb.command_line = pgdb
87 changes: 5 additions & 82 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,27 +1,9 @@
import sys
#!/usr/bin/env python
import setuptools
import os
from setuptools import setup
from setuptools.command.test import test as TestCommand
import codecs


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', '--tb=long', 'tests', '-x']
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)

def read(rel_path):
here = os.path.abspath(os.path.dirname(__file__))
with codecs.open(os.path.join(here, rel_path), 'r') as fp:
Expand All @@ -43,65 +25,6 @@ def get_version(rel_path):
return "{}.{}.{}".format(major_version, minor_version, patch_version)


if __name__ == '__main__':
setup(name='polyglotdb',
version=get_version("polyglotdb/__init__.py"),
description='',
long_description=readme(),
long_description_content_type='text/markdown',
classifiers=[
'Development Status :: 3 - Alpha',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Topic :: Scientific/Engineering',
'Topic :: Text Processing :: Linguistic',
],
keywords='phonology corpus phonetics',
url='https://github.com/MontrealCorpusTools/PolyglotDB',
author='Montreal Corpus Tools',
author_email='[email protected]',
packages=['polyglotdb',
'polyglotdb.acoustics',
'polyglotdb.acoustics.formants',
'polyglotdb.acoustics.pitch',
'polyglotdb.acoustics.vot',
'polyglotdb.client',
'polyglotdb.corpus',
'polyglotdb.databases',
'polyglotdb.io',
'polyglotdb.io.types',
'polyglotdb.io.parsers',
'polyglotdb.io.inspect',
'polyglotdb.io.exporters',
'polyglotdb.io.importer',
'polyglotdb.io.enrichment',
'polyglotdb.query',
'polyglotdb.query.base',
'polyglotdb.query.annotations',
'polyglotdb.query.annotations.attributes',
'polyglotdb.query.discourse',
'polyglotdb.query.speaker',
'polyglotdb.query.lexicon',
'polyglotdb.query.metadata',
'polyglotdb.syllabification'],
package_data={'polyglotdb.databases': ['*.conf'],
'polyglotdb.acoustics.formants': ['*.praat']},
install_requires=[
'neo4j-driver~=4.3',
'praatio~=5.0',
'textgrid',
'conch_sounds',
'librosa',
'influxdb',
'tqdm',
'requests'
],
scripts=['bin/pgdb'],
cmdclass={'test': PyTest},
extras_require={
'testing': ['pytest'],
}
)
if __name__ == "__main__":
setuptools.setup(version=get_version("polyglotdb/__init__.py"))