From 2220e3278cb148119117f59156d62a3868904889 Mon Sep 17 00:00:00 2001 From: Heinz-Alexander Fuetterer Date: Wed, 27 Sep 2023 06:34:39 +0200 Subject: [PATCH] chore: update remaining python dependencies Refs: #380 --- .github/workflows/ci.yml | 31 +++++---------- fuji_server/helper/linked_vocab_helper.py | 2 +- pyproject.toml | 46 ++++++++++++++--------- 3 files changed, 38 insertions(+), 41 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3a55d423..be16d941 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,7 +24,7 @@ jobs: # docs: # runs-on: ubuntu-22.04 # steps: - # - uses: actions/checkout@v3 + # - uses: actions/checkout@v4 # - name: Set up Python 3.11 # uses: actions/setup-python@v4 # with: @@ -50,16 +50,16 @@ jobs: lint: runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Cache python dependencies uses: actions/cache@v3 with: path: | ~/.cache/pip ~/.cache/pre-commit - key: pip-lint-${{ hashFiles('.pre-commit-config.yaml', 'pyproject.toml') }} + key: lint-${{ hashFiles('.pre-commit-config.yaml', 'pyproject.toml') }} restore-keys: | - pip-lint- + lint- - name: Set up Python 3.11 uses: actions/setup-python@v4 with: @@ -71,30 +71,17 @@ jobs: tests: runs-on: ubuntu-22.04 - strategy: - matrix: - python-version: ['3.11'] steps: - - uses: actions/checkout@v3 - - name: Cache python dependencies - uses: actions/cache@v3 - with: - path: ~/.cache/pip - key: pip-tests-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }} - restore-keys: | - pip-tests-${{ matrix.python-version }}- - - name: Set up Python ${{ matrix.python-version }} + - uses: actions/checkout@v4 + - name: Set up Python 3.11 uses: actions/setup-python@v4 with: - python-version: ${{ matrix.python-version }} + python-version: '3.11' + cache: pip - name: Install python dependencies run: | python -m pip install --upgrade pip setuptools wheel - python -m pip install hatch - - # TODO: remove, once dependencies are updated - - run: hatch run python -m pip list - - run: hatch run python -m pip list --outdated + python -m pip install --upgrade hatch - name: Run test suite with coverage run: hatch run cov diff --git a/fuji_server/helper/linked_vocab_helper.py b/fuji_server/helper/linked_vocab_helper.py index 06d2d8dd..cdd6d6df 100644 --- a/fuji_server/helper/linked_vocab_helper.py +++ b/fuji_server/helper/linked_vocab_helper.py @@ -128,7 +128,7 @@ def get_linked_vocab_by_iri(self, IRI, isnamespaceIRI=False, firstonly = True): comb_regex = reg_res.get('regex').lstrip('^').rstrip('$') else: if '?' in reg_res.get('pattern'): - reg_res['pattern']=reg_res.get('pattern').replace('?','\?') + reg_res['pattern']=reg_res.get('pattern').replace('?',r'\?') comb_regex = reg_res.get('pattern').split('$1')[0].rstrip('/#') if comb_regex not in tested_patterns: diff --git a/pyproject.toml b/pyproject.toml index 5dacd299..fe7f30db 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,30 +16,32 @@ classifiers = [ "Topic :: Scientific/Engineering :: Information Analysis" ] dependencies = [ + # dependencies with major version on zero are defined with + # major.minor.patch, because they can potentially introduce breaking changes + # in minor version updates anytime "beautifulsoup4~=4.12", "configparser~=6.0", "connexion[swagger-ui]~=2.14", - "extruct~=0.13.0", + "extruct~=0.16.0", "feedparser~=6.0", - "flask~=2.2.5", # pin due to flask 2.3.0 json_encoder issue "flask-cors~=4.0", - "flask-limiter<=2.0.0", + "flask-limiter~=3.5", "hashid~=3.1.4", "idutils~=1.2", "jmespath~=1.0", - "levenshtein~=0.21.1", + "levenshtein~=0.22.0", "lxml~=4.9", - "pandas~=1.3", + "pandas~=2.1", "pyRdfa3~=3.5", "pyld~=2.0", - "pyyaml!=6.0.0,!=5.4.0,!=5.4.1", # 6.0.1 + "pyyaml~=6.0", "rapidfuzz~=3.3", - "rdflib~=6.1", + "rdflib~=7.0", "requests~=2.31", - "sparqlwrapper~=1.8", - "tika~=1.24", - "tldextract~=3.1", - "urlextract~=1.2", + "sparqlwrapper~=2.0", + "tika~=2.6", + "tldextract~=3.4", + "urlextract~=1.8", "waitress~=2.1" ] description = "FUJI (FAIRsFAIR Data Objects Assessment Service), A service to evaluate FAIR data objects based on FAIRsFAIR Metrics" @@ -66,22 +68,21 @@ dev = [ "fuji[testing]" ] docs = [ - "docutils>=0.14,<0.18", - "myst-parser~=0.16", - "sphinx~=4.2", - "sphinx-rtd-theme~=1.0" + "myst-parser~=2.0", + "sphinx~=7.2", + "sphinx-rtd-theme~=1.3" ] lint = [ - "pre-commit~=3.3" + "pre-commit~=3.4" ] report = [ - "bokeh~=2.4", + "bokeh~=3.2", "jupyter~=1.0" ] testing = [ "pytest~=7.4", "pytest-cov~=4.1", - "pytest-randomly~=3.1", + "pytest-randomly~=3.15", "pytest-recording~=0.13", "pytest-xdist~=3.3" ] @@ -130,6 +131,15 @@ lint = "pre-commit run --all-files --color=always {args}" test = "pytest {args}" [tool.pytest.ini_options] +filterwarnings = [ + # warnings from pyrdfa + "ignore: the imp module is deprecated in favour of importlib and slated for removal in Python 3.12:DeprecationWarning", + # warnings from feedparser + "ignore:'cgi' is deprecated and slated for removal in Python 3.13:DeprecationWarning", + # warnings from tika + "ignore:pkg_resources is deprecated as an API:DeprecationWarning", + "ignore:Deprecated call to `pkg_resources.declare_namespace:DeprecationWarning" +] markers = [ "manual", # tests which should be triggered manual only "noci", # tests which should not run on the CI