mirror of
https://github.com/ilri/csv-metadata-quality.git
synced 2024-11-17 11:37:03 +01:00
Fix path to data/licenses.json
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
When we install and run this from CI, this file needs to exist in the package's folder inside site-packages. Then we can use __file__ to get the path relative to the package. See: https://python-packaging.readthedocs.io/en/latest/non-code-files.html
This commit is contained in:
parent
34142c3e6b
commit
1491e1edb0
1
MANIFEST.in
Normal file
1
MANIFEST.in
Normal file
@ -0,0 +1 @@
|
||||
include csv_metadata_quality/data/licenses.json
|
@ -2,7 +2,7 @@
|
||||
|
||||
|
||||
import json
|
||||
from importlib.resources import files
|
||||
import os
|
||||
|
||||
from ftfy.badness import is_bad
|
||||
|
||||
@ -58,7 +58,7 @@ def is_mojibake(field):
|
||||
def load_spdx_licenses():
|
||||
"""Returns a Python list of SPDX short license identifiers."""
|
||||
|
||||
with open(files("csv_metadata_quality").joinpath("data/licenses.json")) as f:
|
||||
with open(os.path.join(os.path.dirname(__file__), "data/licenses.json")) as f:
|
||||
licenses = json.load(f)
|
||||
|
||||
# List comprehension to extract the license ID for each license
|
||||
|
Loading…
Reference in New Issue
Block a user