Skip to content

Commit

Permalink
Merge branch 'master' into python-311
Browse files Browse the repository at this point in the history
  • Loading branch information
huberrob authored Sep 26, 2023
2 parents 92c631c + 4dd9dad commit c6cce29
Show file tree
Hide file tree
Showing 9 changed files with 291 additions and 232 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,5 +91,10 @@ jobs:
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

- name: Run test suite with coverage
run: hatch run cov
8 changes: 4 additions & 4 deletions fuji_server/harvester/metadata_harvester.py
Original file line number Diff line number Diff line change
Expand Up @@ -476,13 +476,13 @@ def parse_signposting_http_link_format(self, signposting_link_format_text):
for link_prop in parsed_link[1:]:
link_prop = str(link_prop).strip()
if link_prop.startswith('anchor'):
anchor_match = re.search('anchor\s*=\s*\"?([^,;"]+)\"?', link_prop)
anchor_match = re.search(r'anchor\s*=\s*\"?([^,;"]+)\"?', link_prop)
if link_prop.startswith('rel'):
rel_match = re.search('rel\s*=\s*\"?([^,;"]+)\"?', link_prop)
rel_match = re.search(r'rel\s*=\s*\"?([^,;"]+)\"?', link_prop)
elif link_prop.startswith('type'):
type_match = re.search('type\s*=\s*\"?([^,;"]+)\"?', link_prop)
type_match = re.search(r'type\s*=\s*\"?([^,;"]+)\"?', link_prop)
elif link_prop.startswith('formats'):
formats_match = re.search('formats\s*=\s*\"?([^,;"]+)\"?', link_prop)
formats_match = re.search(r'formats\s*=\s*\"?([^,;"]+)\"?', link_prop)
if type_match:
found_type = type_match[1]
if rel_match:
Expand Down
2 changes: 1 addition & 1 deletion fuji_server/helper/identifier_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def __init__(self, idstring, logger = None):
#workaround to identify arks properly:
self.identifier = self.identifier.replace('/ark:' , '/ark:/' )
self.identifier = self.identifier.replace('/ark://', '/ark:/')
generic_identifiers_org_pattern = '^([a-z0-9\._]+):(.+)'
generic_identifiers_org_pattern = r'^([a-z0-9\._]+):(.+)'

if self.is_uuid():
self.identifier_schemes = ['uuid']
Expand Down
4 changes: 2 additions & 2 deletions fuji_server/helper/metadata_collector_xml.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ def get_mapped_xml_metadata(self, tree, mapping):
res[prop] = propcontent[0].get('tree').text
else:
res[prop] = lxml.etree.tostring(propcontent[0].get('tree'), method='text', encoding='unicode')
res[prop] = re.sub('\s+', ' ', res[prop])
res[prop] = re.sub(r'\s+', ' ', res[prop])
res[prop] = res[prop].strip()
else:
for propelem in propcontent:
Expand All @@ -324,7 +324,7 @@ def get_mapped_xml_metadata(self, tree, mapping):
res[prop].append(propelem.get('tree').text)
else:
resprop = lxml.etree.tostring(propelem.get('tree'), method='text', encoding='unicode')
resprop = re.sub('\s+', ' ', resprop)
resprop = re.sub(r'\s+', ' ', resprop)
resprop = resprop.strip()
res[prop].append(resprop)

Expand Down
42 changes: 20 additions & 22 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,33 +16,31 @@ classifiers = [
"Topic :: Scientific/Engineering :: Information Analysis"
]
dependencies = [
"beautifulsoup4~=4.8.2",
"configparser~=5.0.2",
"connexion[swagger-ui]~=2.9.0",
"beautifulsoup4~=4.12",
"configparser~=6.0",
"connexion[swagger-ui]~=2.14",
"extruct~=0.13.0",
"feedparser~=6.0.8",
"flask~=1.1.4",
"flask-cors~=3.0.10",
"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",
"hashid~=3.1.4",
"idutils~=1.1.5",
"jmespath~=0.10.0",
"levenshtein~=0.12.0",
"lxml~=4.7",
"markupsafe~=2.0.1",
"idutils~=1.2",
"jmespath~=1.0",
"levenshtein~=0.21.1",
"lxml~=4.9",
"pandas~=1.3",
"pyRdfa3~=3.5.3",
"pyld~=2.0.3",
"pyyaml!=6.0.0,!=5.4.0,!=5.4.1",
"rapidfuzz~=3.1.2",
"rdflib~=6.1.1",
"requests~=2.24.0",
"sparqlwrapper~=1.8.5",
"pyRdfa3~=3.5",
"pyld~=2.0",
"pyyaml!=6.0.0,!=5.4.0,!=5.4.1", # 6.0.1
"rapidfuzz~=3.3",
"rdflib~=6.1",
"requests~=2.31",
"sparqlwrapper~=1.8",
"tika~=1.24",
"tldextract~=3.1.2",
"urlextract~=1.2.0",
"waitress~=2.1.1",
"werkzeug~=1.0"
"tldextract~=3.1",
"urlextract~=1.2",
"waitress~=2.1"
]
description = "FUJI (FAIRsFAIR Data Objects Assessment Service), A service to evaluate FAIR data objects based on FAIRsFAIR Metrics"
keywords = [
Expand Down

Large diffs are not rendered by default.

184 changes: 92 additions & 92 deletions tests/functional/cassettes/test_evaluation/test_evaluation.yaml

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion tests/functional/test_evaluation.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
HTTP_200_OK = 200


@pytest.mark.vcr
# TODO: Re-enable the vcr canning
# @pytest.mark.vcr
def test_evaluation(client: FlaskClient) -> None:
"""Functional test of the /evaluate endpoint.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ interactions:
Connection:
- keep-alive
User-Agent:
- python-requests/2.24.0
- python-requests/2.31.0
method: GET
uri: https://raw.githubusercontent.com/jshttp/mime-db/master/db.json
response:
Expand Down Expand Up @@ -430,13 +430,13 @@ interactions:
Cross-Origin-Resource-Policy:
- cross-origin
Date:
- Fri, 22 Sep 2023 10:46:04 GMT
- Mon, 25 Sep 2023 18:07:29 GMT
ETag:
- W/"96f0b8a97b963debd2b8196710f6fb55a22c1b719160c77161bc768dee120c17"
Expires:
- Fri, 22 Sep 2023 10:51:04 GMT
- Mon, 25 Sep 2023 18:12:29 GMT
Source-Age:
- '118'
- '41'
Strict-Transport-Security:
- max-age=31536000
Vary:
Expand All @@ -450,15 +450,15 @@ interactions:
X-Content-Type-Options:
- nosniff
X-Fastly-Request-ID:
- e606b501f70c3be36f71c3aede5d9c042e8f9e8e
- b8cdb072c5d83461fe5450e6872cd4f9e3022cf1
X-Frame-Options:
- deny
X-GitHub-Request-Id:
- 808A:881C:10E2BFD:1194D78:650D1E28
- DEAC:5405:253AA4D:26E6CD0:651112C5
X-Served-By:
- cache-fra-eddf8230101-FRA
- cache-fra-eddf8230078-FRA
X-Timer:
- S1695379565.574322,VS0,VE1
- S1695665249.046498,VS0,VE1
X-XSS-Protection:
- 1; mode=block
status:
Expand Down

0 comments on commit c6cce29

Please sign in to comment.