Skip to content
Snippets Groups Projects
Verified Commit 5e272d90 authored by Daniel Hornung's avatar Daniel Hornung
Browse files

Merge branch 'dev' into f-no-error-compare

parents 61f6d9b7 1967921c
No related branches found
No related tags found
2 merge requests!189ENH: add convenience functions,!185High level API serialization
Pipeline #50162 passed with warnings
...@@ -62,11 +62,11 @@ mypy: ...@@ -62,11 +62,11 @@ mypy:
allow_failure: true allow_failure: true
# run unit tests # run unit tests
unittest_py3.7: unittest_py3.8:
tags: [ docker ] tags: [ docker ]
stage: test stage: test
needs: [ ] needs: [ ]
image: python:3.7 image: python:3.8
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 ~/.pylinkahead.ini - touch ~/.pylinkahead.ini
...@@ -74,13 +74,6 @@ unittest_py3.7: ...@@ -74,13 +74,6 @@ unittest_py3.7:
- pip install . - pip install .
- python -m pytest unittests - python -m pytest unittests
unittest_py3.8:
tags: [ docker ]
stage: test
needs: [ ]
image: python:3.8
script: *python_test_script
# This needs to be changed once Python 3.9 isn't the standard Python in Debian # This needs to be changed once Python 3.9 isn't the standard Python in Debian
# anymore. # anymore.
unittest_py3.9: unittest_py3.9:
...@@ -121,8 +114,14 @@ unittest_py3.13: ...@@ -121,8 +114,14 @@ unittest_py3.13:
stage: test stage: test
needs: [ ] needs: [ ]
image: python:3.13-rc image: python:3.13-rc
script: *python_test_script script:
# TODO: Replace by '*python_test_script' as soon as 3.13 has been officially released.
# Python docker has problems with tox and pip so use plain pytest here
- apt update && apt install -y cargo
- touch ~/.pylinkahead.ini
- pip install pynose pytest pytest-cov jsonschema>=4.4.0 setuptools
- pip install .
- python -m pytest unittests
# Trigger building of server image and integration tests # Trigger building of server image and integration tests
trigger_build: trigger_build:
......
...@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ...@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added ### ### Added ###
* Support for Python 3.12 * Support for Python 3.12
* The `linkahead` module now opts into type checking and supports mypy.
### Changed ### ### Changed ###
...@@ -17,6 +18,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ...@@ -17,6 +18,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Removed ### ### Removed ###
* Support for Python 3.7
### Fixed ### ### Fixed ###
* [#104](https://gitlab.com/linkahead/linkahead-pylib/-/issues/104) Selecting * [#104](https://gitlab.com/linkahead/linkahead-pylib/-/issues/104) Selecting
......
...@@ -44,7 +44,7 @@ lint: ...@@ -44,7 +44,7 @@ lint:
.PHONY: lint .PHONY: lint
mypy: mypy:
mypy src/linkahead/common unittests mypy src/linkahead/common unittests --exclude high_level_api.py --exclude connection.py
.PHONY: mypy .PHONY: mypy
unittest: unittest:
......
...@@ -179,7 +179,7 @@ def setup_package(): ...@@ -179,7 +179,7 @@ def setup_package():
"Topic :: Scientific/Engineering :: Information Analysis", "Topic :: Scientific/Engineering :: Information Analysis",
], ],
packages=find_packages('src'), packages=find_packages('src'),
python_requires='>=3.7', python_requires='>=3.8',
package_dir={'': 'src'}, package_dir={'': 'src'},
install_requires=['lxml>=4.6.3', install_requires=['lxml>=4.6.3',
"requests[socks]>=2.26", "requests[socks]>=2.26",
......
...@@ -18,7 +18,7 @@ Or to speak it out directly in Python: ...@@ -18,7 +18,7 @@ Or to speak it out directly in Python:
r.get_property("alpha").value = 25 # setting properties (old api) r.get_property("alpha").value = 25 # setting properties (old api)
print(r.get_property("alpha").value + 25) # getting properties (old api) print(r.get_property("alpha").value + 25) # getting properties (old api)
from linkahead.high_level_api import convert_to_python_entity from linkahead.high_level_api import convert_to_python_object
obj = convert_to_python_object(r) # create a high level entity obj = convert_to_python_object(r) # create a high level entity
obj.r = 25 # setting properties (new api) obj.r = 25 # setting properties (new api)
print(obj.r + 25) # getting properties (new api) print(obj.r + 25) # getting properties (new api)
......
This diff is collapsed.
...@@ -354,6 +354,10 @@ class UnqualifiedPropertiesError(EntityError): ...@@ -354,6 +354,10 @@ class UnqualifiedPropertiesError(EntityError):
""" """
class EntityHasNoAclError(EntityError):
"""This entity has no ACL (yet)."""
class EntityDoesNotExistError(EntityError): class EntityDoesNotExistError(EntityError):
"""This entity does not exist.""" """This entity does not exist."""
......
[tox] [tox]
envlist=py37, py38, py39, py310, py311, py312, py313 envlist=py38, py39, py310, py311, py312, py313
skip_missing_interpreters = true skip_missing_interpreters = true
[testenv] [testenv]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment