mirror of
https://github.com/ilri/csv-metadata-quality.git
synced 2024-12-30 07:54:31 +01:00
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
|
import json
|
||||||
from importlib.resources import files
|
import os
|
||||||
|
|
||||||
from ftfy.badness import is_bad
|
from ftfy.badness import is_bad
|
||||||
|
|
||||||
@ -58,7 +58,7 @@ def is_mojibake(field):
|
|||||||
def load_spdx_licenses():
|
def load_spdx_licenses():
|
||||||
"""Returns a Python list of SPDX short license identifiers."""
|
"""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)
|
licenses = json.load(f)
|
||||||
|
|
||||||
# List comprehension to extract the license ID for each license
|
# List comprehension to extract the license ID for each license
|
||||||
|
1
setup.py
1
setup.py
@ -32,5 +32,6 @@ setuptools.setup(
|
|||||||
entry_points={
|
entry_points={
|
||||||
"console_scripts": ["csv-metadata-quality = csv_metadata_quality.__main__:main"]
|
"console_scripts": ["csv-metadata-quality = csv_metadata_quality.__main__:main"]
|
||||||
},
|
},
|
||||||
|
include_package_data=True,
|
||||||
install_requires=install_requires,
|
install_requires=install_requires,
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user