Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
232 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[bumpversion] | ||
current_version = 0.0.0 | ||
files = setup.py saraswati/__init__.py | ||
search = version='{current_version}' | ||
__version__ = '{current_version}' | ||
version = u'{current_version}' | ||
release = u'{current_version}' | ||
commit = True | ||
tag = True | ||
tag_name = {new_version} | ||
allow_dirty = True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,6 @@ | ||
/.idea | ||
/.venv* | ||
*.pyc | ||
__pycache__ | ||
*.egg-info | ||
/var |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
# ============ | ||
# Main targets | ||
# ============ | ||
|
||
|
||
# ------------- | ||
# Configuration | ||
# ------------- | ||
|
||
$(eval venvpath := .venv) | ||
$(eval pip := $(venvpath)/bin/pip) | ||
$(eval python := $(venvpath)/bin/python) | ||
$(eval pytest := $(venvpath)/bin/pytest) | ||
$(eval bumpversion := $(venvpath)/bin/bumpversion) | ||
$(eval twine := $(venvpath)/bin/twine) | ||
$(eval sphinx := $(venvpath)/bin/sphinx-build) | ||
|
||
# Setup Python virtualenv | ||
setup-virtualenv: | ||
@test -e $(python) || python3 -m venv --system-site-packages $(venvpath) | ||
|
||
|
||
# ------- | ||
# Testing | ||
# ------- | ||
|
||
# Run the main test suite | ||
test: | ||
@test -e $(pytest) || $(MAKE) install-tests | ||
@$(pytest) tests -m 'not slow' | ||
|
||
test-refresh: install-tests test | ||
|
||
test-junit: install-tests | ||
@$(pytest) tests --junit-xml .pytest_results/pytest.xml | ||
|
||
test-coverage: install-tests | ||
@$(pytest) tests \ | ||
--junit-xml .pytest_results/pytest.xml \ | ||
--cov saraswati --cov-branch \ | ||
--cov-report term-missing \ | ||
--cov-report html:.pytest_results/htmlcov \ | ||
--cov-report xml:.pytest_results/coverage.xml | ||
|
||
# ------- | ||
# Release | ||
# ------- | ||
|
||
# Release this piece of software | ||
# Synopsis: | ||
# make release bump=minor (major,minor,patch) | ||
release: bumpversion push sdist pypi-upload | ||
|
||
|
||
# ------------- | ||
# Documentation | ||
# ------------- | ||
|
||
# Build the documentation | ||
docs-html: install-doctools | ||
touch doc/index.rst | ||
export SPHINXBUILD="`pwd`/$(sphinx)"; cd doc; make html | ||
|
||
|
||
# =============== | ||
# Utility targets | ||
# =============== | ||
bumpversion: install-releasetools | ||
@$(bumpversion) $(bump) | ||
|
||
push: | ||
git push && git push --tags | ||
|
||
sdist: | ||
@$(python) setup.py sdist | ||
|
||
pypi-upload: install-releasetools | ||
@$(twine) upload --skip-existing dist/*.tar.gz | ||
|
||
install-doctools: setup-virtualenv | ||
@$(pip) install --quiet --requirement requirements-docs.txt --upgrade | ||
|
||
install-releasetools: setup-virtualenv | ||
@$(pip) install --quiet --requirement requirements-release.txt --upgrade | ||
|
||
install-tests: setup-virtualenv | ||
@$(pip) install --quiet --editable .[test] --upgrade | ||
@$(python) setup.py --quiet develop | ||
@touch $(venvpath)/bin/activate | ||
@mkdir -p .pytest_results |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
bump2version==1.0.0 | ||
twine==3.4.1 | ||
keyring==23.0.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
# -*- coding: utf-8 -*- | ||
# (c) 2018-2021 The Hiveeyes Developers | ||
import os | ||
|
||
from setuptools import setup, find_packages | ||
|
||
here = os.path.abspath(os.path.dirname(__file__)) | ||
README = open(os.path.join(here, 'README.rst')).read() | ||
|
||
setup(name='saraswati', | ||
version='0.0.0', | ||
description='Saraswati - a robust, multi-channel audio recording, transmission and storage system', | ||
long_description=README, | ||
license="AGPL 3, EUPL 1.2", | ||
classifiers=[ | ||
"Development Status :: 3 - Alpha", | ||
"Environment :: Console", | ||
"Environment :: Plugins", | ||
"Intended Audience :: Developers", | ||
"Intended Audience :: Education", | ||
"Intended Audience :: Information Technology", | ||
"Intended Audience :: Manufacturing", | ||
"Intended Audience :: Science/Research", | ||
"Intended Audience :: System Administrators", | ||
"Intended Audience :: Telecommunications Industry", | ||
"License :: OSI Approved :: GNU Affero General Public License v3", | ||
"License :: OSI Approved :: European Union Public Licence 1.2 (EUPL 1.2)", | ||
"Environment :: Console", | ||
"Environment :: Web Environment", | ||
"Operating System :: POSIX", | ||
"Operating System :: Unix", | ||
"Operating System :: MacOS", | ||
"Programming Language :: Python", | ||
"Programming Language :: Python :: 3.6", | ||
"Programming Language :: Python :: 3.7", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Topic :: Communications", | ||
"Topic :: Education", | ||
"Topic :: Internet", | ||
"Topic :: Internet :: WWW/HTTP", | ||
"Topic :: Scientific/Engineering :: Interface Engine/Protocol Translator", | ||
"Topic :: Software Development :: Embedded Systems", | ||
"Topic :: Software Development :: Libraries", | ||
"Topic :: Software Development :: Pre-processors", | ||
"Topic :: Software Development :: Testing", | ||
"Topic :: System :: Archiving", | ||
"Topic :: System :: Distributed Computing", | ||
"Topic :: System :: Monitoring", | ||
"Topic :: System :: Networking :: Monitoring", | ||
"Topic :: System :: Systems Administration", | ||
"Topic :: Text Processing", | ||
"Topic :: Utilities", | ||
], | ||
author='Andreas Motl', | ||
author_email='andreas@hiveeyes.org', | ||
url='https://github.com/hiveeyes/saraswati', | ||
keywords='audio multi-channel recording transmission storage robust', | ||
packages=find_packages(), | ||
include_package_data=True, | ||
package_data={ | ||
}, | ||
zip_safe=False, | ||
test_suite='tests', | ||
install_requires=[], | ||
extras_require={ | ||
"test": [ | ||
'pytest>=4.6.7', | ||
'pytest-cov>=2.8.1', | ||
] | ||
}, | ||
tests_require=[], | ||
entry_points={ | ||
'console_scripts': [ | ||
'saraswati = saraswati.commands:run', | ||
], | ||
}, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import logging | ||
|
||
from gi.overrides import Gst | ||
|
||
from tests.util import load_module_from_file | ||
|
||
|
||
def test_spike(): | ||
|
||
spike = load_module_from_file("python/examples/flac-timestamp-chunked.py") | ||
|
||
# Setup logging | ||
spike.setup_logging(level=logging.DEBUG) | ||
|
||
# Setup PyGObject and GStreamer | ||
Gst.init(None) | ||
|
||
# Run a basic pipeline test | ||
pipe = spike.BasicPipeline() | ||
pipe.setup() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import imp | ||
|
||
try: | ||
import hashlib | ||
md = hashlib.md5 | ||
except ImportError: | ||
import md5 | ||
md = md5.new | ||
|
||
|
||
def load_module_from_file(path): | ||
""" | ||
http://code.davidjanes.com/blog/2008/11/27/how-to-dynamically-load-python-code/ | ||
:param path: | ||
:return: | ||
""" | ||
try: | ||
fp = open(path, 'rb') | ||
digest = md(path.encode('utf-8')).hexdigest() | ||
return imp.load_source(digest, path, fp) | ||
finally: | ||
try: | ||
fp.close() | ||
except: | ||
pass |