diff --git a/pyproject.toml b/pyproject.toml deleted file mode 100644 index 226e1b5..0000000 --- a/pyproject.toml +++ /dev/null @@ -1,22 +0,0 @@ -[build-system] -requires = ["setuptools"] -build-backend = "setuptools.build_meta" - -[project] -name = "py-scopes" -version = "3.0.1" -description = "Implementation of the strange 'scopes' paradigma in Python" -readme = "README.md" -license = {text = "MIT"} -keywords = ["scopes"] -authors = [{name = "Helmut Merz", email = "helmutm@cy55.de"}] - -dependencies = [ - "transaction", - "psycopg[binary]", - "SQLAlchemy", - "zope.sqlalchemy", -] - -[project.optional-dependencies] -test = ["pytest"] diff --git a/scopes/storage/tracking.py b/scopes/storage/tracking.py index dc74605..785e0a1 100644 --- a/scopes/storage/tracking.py +++ b/scopes/storage/tracking.py @@ -22,7 +22,7 @@ class Track(object): headFields = ['taskId', 'userName'] prefix = 'rec' - def __init__(self, *keys, data=None, timeStamp=None, trackId=None, container=None): + def __init__(self, *keys, **kw): self.head = {} for ix, k in enumerate(keys): self.head[self.headFields[ix]] = k @@ -30,10 +30,10 @@ class Track(object): if self.head.get(k) is None: self.heaad[k] = '' setattr(self, k, self.head[k]) - self.data = data or {} - self.timeStamp = timeStamp - self.trackId = trackId - self.container = container + self.data = kw.get('data') or {} + self.timeStamp = kw.get('timeStamp') + self.trackId = kw.get('trackId') + self.container = kw.get('container') def update(self, data, overwrite=False): if data is None: diff --git a/tests/test_storage.py b/scopes/tests.py similarity index 97% rename from tests/test_storage.py rename to scopes/tests.py index 97390e5..89ee6f4 100644 --- a/tests/test_storage.py +++ b/scopes/tests.py @@ -11,7 +11,7 @@ from scopes.storage.common import Storage, getEngine, sessionFactory from scopes.storage import proxy from scopes.storage import tracking -engine = getEngine('postgresql+psycopg', 'testdb', 'testuser', 'secret') +engine = getEngine('postgresql', 'ccotest', 'ccotest', 'cco') scopes.storage.common.engine = engine scopes.storage.common.Session = sessionFactory(engine) diff --git a/setup.py b/setup.py index ecd37c5..67de77b 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,47 @@ -from setuptools import setup +from setuptools import setup, find_packages +import os -setup() +version = '2.0' +long_description = ( + open('README.md').read() + + '\n' + + 'Contributors\n' + '============\n' + + '\n' + + open('CONTRIBUTORS.txt').read() + + '\n' + + open('CHANGES.txt').read() + + '\n') + +setup(name='py-scopes', + version=version, + description="combined triple and event storage for the cco application platform", + long_description=long_description, + # Get more strings from + # http://pypi.python.org/pypi?%3Aaction=list_classifiers + classifiers=[ + "Programming Language :: Python", + ], + keywords='', + author='cyberconcepts.org team', + author_email='team@cyberconcepts.org', + url='http://www.cyberconcepts.org', + license='MIT', + packages=find_packages(), + #package_dir = {'': 'src'}, + #namespace_packages=['cco'], + include_package_data=True, + zip_safe=False, + install_requires=[ + 'setuptools', + 'transaction', + 'psycopg2-binary', + 'SQLAlchemy', + 'zope.sqlalchemy', + # -*- Extra requirements: -*- + ], + entry_points=""" + # -*- Entry points: -*- + """, + )