Skip to content
Snippets Groups Projects
Verified Commit d1ca6174 authored by Timm Fitschen's avatar Timm Fitschen
Browse files

Merge branch 'dev' into f-string-ids

parents b36a0989 1ecb0883
Branches
No related tags found
No related merge requests found
Pipeline #48232 failed
Showing with 174 additions and 895 deletions
...@@ -13,6 +13,7 @@ __pycache__/ ...@@ -13,6 +13,7 @@ __pycache__/
dist/ dist/
build/ build/
src/caosdb/version.py src/caosdb/version.py
src/linkahead/version.py
# documentation # documentation
_apidoc _apidoc
......
# #
# This file is a part of the CaosDB Project. # This file is a part of the LinkAhead Project.
# #
# Copyright (C) 2018 Research Group Biomedical Physics, # Copyright (C) 2018 Research Group Biomedical Physics,
# Max-Planck-Institute for Dynamics and Self-Organization Göttingen # Max-Planck-Institute for Dynamics and Self-Organization Göttingen
...@@ -44,7 +44,7 @@ code_style: ...@@ -44,7 +44,7 @@ code_style:
- make style - make style
allow_failure: true allow_failure: true
# pylint tests for pycaosdb # pylint tests for pylinkahead
pylint: pylint:
tags: [ docker ] tags: [ docker ]
stage: linting stage: linting
...@@ -61,7 +61,7 @@ unittest_py3.7: ...@@ -61,7 +61,7 @@ unittest_py3.7:
image: python:3.7 image: python:3.7
script: &python_test_script script: &python_test_script
# Python docker has problems with tox and pip so use plain pytest here # Python docker has problems with tox and pip so use plain pytest here
- touch ~/.pycaosdb.ini - touch ~/.pylinkahead.ini
- pip install nose pytest pytest-cov python-dateutil jsonschema>=4.4.0 - pip install nose pytest pytest-cov python-dateutil jsonschema>=4.4.0
- pip install . - pip install .
- python -m pytest unittests - python -m pytest unittests
...@@ -82,7 +82,7 @@ unittest_py3.9: ...@@ -82,7 +82,7 @@ unittest_py3.9:
script: script:
# verify that this actually is Python 3.9 # verify that this actually is Python 3.9
- python3 -c "import sys; assert sys.version.startswith('3.9')" - python3 -c "import sys; assert sys.version.startswith('3.9')"
- touch ~/.pycaosdb.ini - touch ~/.pylinkahead.ini
- make unittest - make unittest
...@@ -148,7 +148,7 @@ pages_prepare: &pages_prepare ...@@ -148,7 +148,7 @@ pages_prepare: &pages_prepare
refs: refs:
- /^release-.*$/i - /^release-.*$/i
script: script:
- echo "Deploying" - echo "Deploying documentation"
- make doc - make doc
- cp -r build/doc/html public - cp -r build/doc/html public
artifacts: artifacts:
......
...@@ -9,6 +9,50 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ...@@ -9,6 +9,50 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added ### ### Added ###
### Changed ###
### Deprecated ###
### Removed ###
### Fixed ###
### Security ###
### Documentation ###
## [0.14.0] - 2024-02-20
### Added ###
* `utils.merge_entities` now has a `merge_id_with_resolved_entity` keyword
which allows to identify property values with each other in case that one is
an id and the other is an Entity with this id. Default is ``False``, so no
change to the default behavior.
* `apiutils.escape_quoted_text` for escaping text in queries.
### Changed ###
* `cached_query()` now also caches uniqueness related exceptions.
## [0.13.2] - 2023-12-15
### Fixed ###
* [#113](https://gitlab.com/linkahead/linkahead-pylib/-/issues/113) Container could fail to delete when there were reference properties.
* HTTP status 431 (Headers too long) now also raises an URI too long exception.
## [0.13.1] - 2023-10-11 ##
### Fixed ###
* no Error when no configuration file is used
[Issue](https://gitlab.com/linkahead/linkahead-pylib/-/issues/107)
## [0.13.0] - 2023-10-10 ##
### Added ###
* New `page_length` parameter for `caosdb.execute_query` and * New `page_length` parameter for `caosdb.execute_query` and
`caosdb.Query.execute`. See docstrings for more details. `caosdb.Query.execute`. See docstrings for more details.
* `Entity.remove_value_from_property` function that removes a given value from a * `Entity.remove_value_from_property` function that removes a given value from a
...@@ -20,6 +64,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ...@@ -20,6 +64,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* `Message.__init__` signature changed and `type` defaults to "Info" now. * `Message.__init__` signature changed and `type` defaults to "Info" now.
* `Message.__eq__` changed. Equality is equality of `type`, `code`, and * `Message.__eq__` changed. Equality is equality of `type`, `code`, and
`description` now. `description` now.
* Rename from CaosDB to LinkAhead. For proper migration, follow the instructions
in `migration_to_linkahead.md` and check the documentation at [docs.indiscale.com](https://docs.indiscale.com/caosdb-pylib/README_SETUP.html#migration).
### Deprecated ### ### Deprecated ###
...@@ -27,16 +73,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ...@@ -27,16 +73,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
messages have been deprecated. Warnings are raised correspondingly. messages have been deprecated. Warnings are raised correspondingly.
* `Message.get_code`. Use the `code` property instead. * `Message.get_code`. Use the `code` property instead.
### Removed ###
### Fixed ### ### Fixed ###
- Detection for cyclic references when converting entites using the high level API. - Detection for cyclic references when converting entites using the high level API.
### Security ###
### Documentation ###
## [0.12.0] - 2023-06-02 ## ## [0.12.0] - 2023-06-02 ##
### Added ### ### Added ###
......
...@@ -20,6 +20,6 @@ authors: ...@@ -20,6 +20,6 @@ authors:
given-names: Stefan given-names: Stefan
orcid: https://orcid.org/0000-0001-7214-8125 orcid: https://orcid.org/0000-0001-7214-8125
title: CaosDB - Pylib title: CaosDB - Pylib
version: 0.12.0 version: 0.14.0
doi: 10.3390/data4020083 doi: 10.3390/data4020083
date-released: 2023-06-02 date-released: 2024-02-20
\ No newline at end of file
* caosdb-server >= 0.8.0 * caosdb-server >= 0.12.0
* Python >= 3.8 * Python >= 3.8
* pip >= 20.0.2 * pip >= 20.0.2
......
# ** header v3.0 # ** header v3.0
# This file is a part of the CaosDB Project. # This file is a part of the LinkAhead Project.
# #
# Copyright (C) 2020 IndiScale GmbH <info@indiscale.com> # Copyright (C) 2020 IndiScale GmbH <info@indiscale.com>
# Copyright (C) 2020 Daniel Hornung <d.hornung@indiscale.com> # Copyright (C) 2020 Daniel Hornung <d.hornung@indiscale.com>
...@@ -40,7 +40,7 @@ style: ...@@ -40,7 +40,7 @@ style:
.PHONY: style .PHONY: style
lint: lint:
pylint --unsafe-load-any-extension=y -d all -e E,F src/caosdb/common pylint --unsafe-load-any-extension=y -d all -e E,F src/linkahead/common
.PHONY: lint .PHONY: lint
unittest: unittest:
......
...@@ -41,7 +41,7 @@ the preferred way is also a merge request as describe above (the documentation r ...@@ -41,7 +41,7 @@ the preferred way is also a merge request as describe above (the documentation r
However, you can also create an issue for it. However, you can also create an issue for it.
* You can also contact us at **info (AT) caosdb.org** and join the * You can also contact us at **info (AT) caosdb.org** and join the
CaosDB community on CaosDB community on
[#caosdb:matrix.org](https://matrix.to/#/!unwwlTfOznjEnMMXxf:matrix.org). [#linkahead:matrix.org](https://matrix.to/#/!unwwlTfOznjEnMMXxf:matrix.org).
## License ## License
......
...@@ -128,3 +128,6 @@ Build documentation in `build/` with `make doc`. ...@@ -128,3 +128,6 @@ Build documentation in `build/` with `make doc`.
### Troubleshooting ### ### Troubleshooting ###
If the client is to be executed directly from the `/src` folder, an initial `.\setup.py install --user` must be called. If the client is to be executed directly from the `/src` folder, an initial `.\setup.py install --user` must be called.
## Migration ##
TODO
# Release Guidelines for the CaosDB Python Client Library # Release Guidelines for the CaosDB Python Client Library
This document specifies release guidelines in addition to the general release This document specifies release guidelines in addition to the general release
guidelines of the CaosDB Project guidelines of the LinkAhead Project
([RELEASE_GUIDELINES.md](https://gitlab.com/caosdb/caosdb/blob/dev/RELEASE_GUIDELINES.md)) ([RELEASE_GUIDELINES.md](https://gitlab.com/caosdb/caosdb/blob/dev/RELEASE_GUIDELINES.md))
## General Prerequisites ## General Prerequisites
......
#!/usr/bin/env python3
# encoding: utf-8
#
# ** header v3.0
# This file is a part of the CaosDB Project.
#
# Copyright (C) 2021 Indiscale GmbH <info@indiscale.com>
# Copyright (C) 2021 Henrik tom Wörden <h.tomwoerden@indiscale.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
# ** end header
#
import os
base_root = "src/linkahead/"
initcontent = """
from {module} import *
from warnings import warn
warn(("CaosDB was renamed to LinkAhead. Please import this library as `import {module}`. Using the"
" old name, starting with caosdb, is deprecated."), DeprecationWarning)
"""
for root, dirs, files in os.walk(base_root, topdown=False):
if root.endswith("__pycache__"):
continue
cdir = os.path.join("src/caosdb", root[len(base_root):])
os.makedirs(cdir, exist_ok=True)
for fi in files:
if not fi.endswith(".py"):
continue
path = os.path.join(cdir, fi)
with open(path, 'w') as cur:
if fi == "__init__.py":
cur.write(initcontent.format(module=".".join(
os.path.join(root, fi[:-3]).split('/')[1:-1])))
else:
cur.write(initcontent.format(module=".".join(
os.path.join(root, fi[:-3]).split('/')[1:])))
#!/usr/bin/env python3 #!/usr/bin/env python3
"""A small example to get started with caosdb-pylib. """A small example to get started with caosdb-pylib.
Make sure that a `pycaosdb.ini` is readable at one of the expected locations. Make sure that a `pylinkahead.ini` is readable at one of the expected locations.
""" """
import random import random
......
# To be found be the caosdb package, the INI file must be located either in # To be found be the caosdb package, the INI file must be located either in
# - $CWD/pycaosdb.ini # - $CWD/pylinkahead.ini
# - $HOME/.pycaosdb.ini # - $HOME/.pylinkahead.ini
# - the location given in the env variable PYCAOSDBINI # - the location given in the env variable PYCAOSDBINI
[Connection] [Connection]
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# #
# ** header v3.0 # ** header v3.0
# This file is a part of the CaosDB Project. # This file is a part of the LinkAhead Project.
# #
# Copyright (C) 2018 Research Group Biomedical Physics, # Copyright (C) 2018 Research Group Biomedical Physics,
# Max-Planck-Institute for Dynamics and Self-Organization Göttingen # Max-Planck-Institute for Dynamics and Self-Organization Göttingen
......
#!/usr/bin/env python3 #!/usr/bin/env python3
# ** header v3.0 # ** header v3.0
# This file is a part of the CaosDB Project. # This file is a part of the LinkAhead Project.
# #
# Copyright (c) 2019 IndiScale GmbH # Copyright (c) 2019 IndiScale GmbH
# Copyright (c) 2019 Daniel Hornung <d.hornung@indiscale.com> # Copyright (c) 2019 Daniel Hornung <d.hornung@indiscale.com>
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
As a result, only a specific user or group may access it. As a result, only a specific user or group may access it.
This script assumes that the user specified in the pycaosdb.ini This script assumes that the user specified in the pylinkahead.ini
configuration can create new entities. configuration can create new entities.
""" """
......
git merge linkahead-rename-step-1
# resolve potential conflicts and commit
rm -rf src/linkahead
git mv src/caosdb/ src/linkahead
rm -rf src/caosdb
python3 create_slim_linkahead_wrapper.py
git add src
git ci -m "MAINT: rename caosdb to linkahead (module)"
git merge linkahead-rename-step-2
# resolve potential conflicts and commit
git merge dev
#!/bin/bash #!/bin/bash
rm -rf dist/ build/ .eggs/ rm -rf dist/ build/ .eggs/
python setup.py sdist bdist_wheel python setup.py sdist bdist_wheel
python setup-caosdb.py sdist bdist_wheel export PKGNAME=caosdb
python setup.py sdist bdist_wheel
python -m twine upload dist/* python -m twine upload dist/*
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
#
#
"""linkahead"""
import os
import subprocess
import sys
from setuptools import find_packages, setup
########################################################################
# The following code is largely based on code in numpy
########################################################################
#
# Copyright (c) 2005-2019, NumPy Developers.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
#
# * Neither the name of the NumPy Developers nor the names of any
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
########################################################################
ISRELEASED = False
MAJOR = 0
MINOR = 12
MICRO = 1
# Do not tag as pre-release until this commit
# https://github.com/pypa/packaging/pull/515
# has made it into a release. Probably we should wait for pypa/packaging>=21.4
# https://github.com/pypa/packaging/releases
PRE = "" # "dev" # e.g. rc0, alpha.1, 0.beta-23
if PRE:
VERSION = "{}.{}.{}-{}".format(MAJOR, MINOR, MICRO, PRE)
else:
VERSION = "{}.{}.{}".format(MAJOR, MINOR, MICRO)
# Return the git revision as a string
def git_version():
def _minimal_ext_cmd(cmd):
# construct minimal environment
env = {}
for k in ['SYSTEMROOT', 'PATH', 'HOME']:
v = os.environ.get(k)
if v is not None:
env[k] = v
# LANGUAGE is used on win32
env['LANGUAGE'] = 'C'
env['LANG'] = 'C'
env['LC_ALL'] = 'C'
out = subprocess.check_output(cmd, stderr=subprocess.STDOUT, env=env)
return out
try:
out = _minimal_ext_cmd(['git', 'rev-parse', 'HEAD'])
GIT_REVISION = out.strip().decode('ascii')
except (subprocess.SubprocessError, OSError):
GIT_REVISION = "Unknown"
return GIT_REVISION
def get_version_info():
# Adding the git rev number needs to be done inside write_version_py(),
# otherwise the import of linkahead.version messes up the build under
# Python 3.
FULLVERSION = VERSION
# Magic which is only really needed in the pipelines. Therefore: a lot of dark pipeline magic.
if os.path.exists('.git'):
GIT_REVISION = git_version()
elif os.path.exists('linkahead_pylib_commit'):
with open('linkahead_pylib_commit', 'r') as f:
GIT_REVISION = f.read().strip()
elif os.path.exists('src/linkahead/version.py'):
# must be a source distribution, use existing version file
try:
from linkahead.version import git_revision as GIT_REVISION
except ImportError:
raise ImportError("Unable to import git_revision. Try removing "
"src/linkahead/version.py and the build directory "
"before building.")
else:
GIT_REVISION = "Unknown"
if not ISRELEASED:
FULLVERSION += '.dev0+' + GIT_REVISION[:7]
return FULLVERSION, GIT_REVISION
def write_version_py(filename='src/linkahead/version.py'):
cnt = """
# THIS FILE IS GENERATED FROM linkahead SETUP.PY
#
short_version = '%(version)s'
version = '%(version)s'
full_version = '%(full_version)s'
git_revision = '%(git_revision)s'
release = %(isrelease)s
if not release:
version = full_version
"""
FULLVERSION, GIT_REVISION = get_version_info()
a = open(filename, 'w')
try:
a.write(cnt % {'version': VERSION,
'full_version': FULLVERSION,
'git_revision': GIT_REVISION,
'isrelease': str(ISRELEASED)})
finally:
a.close()
def setup_package():
# load README
with open("README.md", "r") as fh:
long_description = fh.read()
src_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "src")
sys.path.insert(0, src_path)
# Rewrite the version file everytime
write_version_py()
metadata = dict(
name='caosdb',
version=get_version_info()[0],
description='Deprecated! Please install linkahead.',
long_description=long_description,
long_description_content_type="text/markdown",
author='Timm Fitschen',
author_email='t.fitschen@indiscale.com',
url='https://www.linkahead.org',
license="AGPLv3+",
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)",
"Operating System :: OS Independent",
"Topic :: Database",
"Topic :: Scientific/Engineering :: Information Analysis",
],
packages=find_packages('src'),
python_requires='>=3.7',
package_dir={'': 'src'},
install_requires=['lxml>=4.6.3',
"requests[socks]>=2.26",
"python-dateutil>=2.8.2",
'PyYAML>=5.4.1',
'future',
],
extras_require={'keyring': ['keyring>=13.0.0'],
'jsonschema': ['jsonschema>=4.4.0']},
setup_requires=["pytest-runner>=2.0,<3dev"],
tests_require=["pytest", "pytest-cov", "coverage>=4.4.2",
"jsonschema>=4.4.0"],
package_data={
'linkahead': ['cert/indiscale.ca.crt', 'schema-pycaosdb-ini.yml'],
},
scripts=["src/linkahead/utils/linkahead_admin.py"]
)
try:
setup(**metadata)
finally:
del sys.path[0]
return
if __name__ == '__main__':
setup_package()
...@@ -2,8 +2,9 @@ ...@@ -2,8 +2,9 @@
# -*- encoding: utf-8 -*- # -*- encoding: utf-8 -*-
# #
# #
"""caosdb""" """linkahead"""
import os import os
import re
import subprocess import subprocess
import sys import sys
...@@ -47,7 +48,7 @@ from setuptools import find_packages, setup ...@@ -47,7 +48,7 @@ from setuptools import find_packages, setup
ISRELEASED = False ISRELEASED = False
MAJOR = 0 MAJOR = 0
MINOR = 12 MINOR = 14
MICRO = 1 MICRO = 1
# Do not tag as pre-release until this commit # Do not tag as pre-release until this commit
# https://github.com/pypa/packaging/pull/515 # https://github.com/pypa/packaging/pull/515
...@@ -91,25 +92,26 @@ def git_version(): ...@@ -91,25 +92,26 @@ def git_version():
def get_version_info(): def get_version_info():
# Adding the git rev number needs to be done inside write_version_py(), # Adding the git rev number needs to be done inside write_version_py(),
# otherwise the import of caosdb.version messes up the build under # otherwise the import of linkahead.version messes up the build under
# Python 3. # Python 3.
FULLVERSION = VERSION FULLVERSION = VERSION
# Magic which is only really needed in the pipelines. Therefore: a lot of dark pipeline magic.
GIT_REVISION = "Unknown"
if os.path.exists('.git'): if os.path.exists('.git'):
GIT_REVISION = git_version() GIT_REVISION = git_version()
elif os.path.exists('caosdb_pylib_commit'): elif os.path.exists('linkahead_pylib_commit'):
with open('caosdb_pylib_commit', 'r') as f: with open('linkahead_pylib_commit', 'r') as f:
GIT_REVISION = f.read().strip() GIT_REVISION = f.read().strip()
elif os.path.exists('src/caosdb/version.py'): elif os.path.exists('src/linkahead/version.py'):
# must be a source distribution, use existing version file # must be a source distribution, use existing version file
try: with open('src/linkahead/version.py') as fi:
from caosdb.version import git_revision as GIT_REVISION rev_pattern = re.compile(r"^git_revision = '(?P<rev>.*)'$")
except ImportError: for line in fi.readlines():
raise ImportError("Unable to import git_revision. Try removing " match = rev_pattern.match(line)
"src/caosdb/version.py and the build directory " if match is not None:
"before building.") GIT_REVISION = match.group('rev')
else: break
GIT_REVISION = "Unknown"
if not ISRELEASED: if not ISRELEASED:
FULLVERSION += '.dev0+' + GIT_REVISION[:7] FULLVERSION += '.dev0+' + GIT_REVISION[:7]
...@@ -117,9 +119,9 @@ def get_version_info(): ...@@ -117,9 +119,9 @@ def get_version_info():
return FULLVERSION, GIT_REVISION return FULLVERSION, GIT_REVISION
def write_version_py(filename='src/caosdb/version.py'): def write_version_py(filename='src/linkahead/version.py'):
cnt = """ cnt = """
# THIS FILE IS GENERATED FROM caosdb SETUP.PY # THIS FILE IS GENERATED FROM linkahead SETUP.PY
# #
short_version = '%(version)s' short_version = '%(version)s'
version = '%(version)s' version = '%(version)s'
...@@ -153,15 +155,21 @@ def setup_package(): ...@@ -153,15 +155,21 @@ def setup_package():
# Rewrite the version file everytime # Rewrite the version file everytime
write_version_py() write_version_py()
if 'PKGNAME' in os.environ and os.environ['PKGNAME'] == 'caosdb':
pname = 'caosdb'
pdesc = 'Deprecated! Please install linkahead.'
else:
pname = 'linkahead'
pdesc = 'Python Interface for LinkAhead'
metadata = dict( metadata = dict(
name='caosdb', name=pname,
version=get_version_info()[0], version=get_version_info()[0],
description='Python Interface for CaosDB', description=pdesc,
long_description=long_description, long_description=long_description,
long_description_content_type="text/markdown", long_description_content_type="text/markdown",
author='Timm Fitschen', author='Timm Fitschen',
author_email='t.fitschen@indiscale.com', author_email='t.fitschen@indiscale.com',
url='https://www.caosdb.org', url='https://www.linkahead.org',
license="AGPLv3+", license="AGPLv3+",
classifiers=[ classifiers=[
"Programming Language :: Python :: 3", "Programming Language :: Python :: 3",
...@@ -185,9 +193,12 @@ def setup_package(): ...@@ -185,9 +193,12 @@ def setup_package():
tests_require=["pytest", "pytest-cov", "coverage>=4.4.2", tests_require=["pytest", "pytest-cov", "coverage>=4.4.2",
"jsonschema>=4.4.0"], "jsonschema>=4.4.0"],
package_data={ package_data={
'caosdb': ['cert/indiscale.ca.crt', 'schema-pycaosdb-ini.yml'], 'linkahead': ['cert/indiscale.ca.crt', 'schema-pycaosdb-ini.yml'],
}, },
scripts=["src/caosdb/utils/caosdb_admin.py"] scripts=[
"src/linkahead/utils/caosdb_admin.py",
"src/linkahead/utils/linkahead_admin.py"
]
) )
try: try:
setup(**metadata) setup(**metadata)
......
# -*- coding: utf-8 -*-
#
# ** header v3.0
# This file is a part of the CaosDB Project.
#
# Copyright (C) 2018 Research Group Biomedical Physics,
# Max-Planck-Institute for Dynamics and Self-Organization Göttingen
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
# ** end header
#
"""CaosDB Python bindings. from linkahead import *
from warnings import warn
Tries to read from the inifile specified in the environment variable `PYCAOSDBINI` or alternatively warn(("CaosDB was renamed to LinkAhead. Please import this library as `import linkahead`. Using the"
in `~/.pycaosdb.ini` upon import. After that, the ini file `pycaosdb.ini` in the current working " old name, starting with caosdb, is deprecated."), DeprecationWarning)
directory will be read additionally, if it exists.
"""
from os import environ, getcwd
# Import of the connection function (which is used to connect to the DB):
from os.path import expanduser, join
# Import of convenience methods:
import caosdb.apiutils
from caosdb.common import administration
from caosdb.common.datatype import (BOOLEAN, DATETIME, DOUBLE, FILE, INTEGER,
LIST, REFERENCE, TEXT)
from caosdb.common.state import State, Transition
# Import of the basic API classes:
from caosdb.common.models import (ACL, ALL, FIX, NONE, OBLIGATORY, RECOMMENDED,
SUGGESTED, Container, DropOffBox, Entity,
File, Info, Message, Permissions, Property,
Query, QueryTemplate, Record, RecordType,
delete, execute_query, get_global_acl,
get_known_permissions, raise_errors)
from caosdb.utils.get_entity import get_entity_by_name, get_entity_by_path, get_entity_by_id
from caosdb.configuration import _read_config_files, configure, get_config
from caosdb.connection.connection import configure_connection, get_connection
from caosdb.exceptions import *
try:
from caosdb.version import version as __version__
except ModuleNotFoundError:
version = "uninstalled"
__version__ = version
_read_config_files()
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment