python3Packages.youseedee: 0.5.3 -> 0.6.0

This commit is contained in:
Martin Weinelt 2024-09-29 17:07:59 +02:00
parent d1dfb0c5be
commit f6e31ace00
2 changed files with 34 additions and 11 deletions

View File

@ -1,16 +1,33 @@
diff --git a/lib/youseedee/__init__.py b/lib/youseedee/__init__.py
index d2aeab3..c706277 100644
index 8db9c5f..9ad6618 100644
--- a/lib/youseedee/__init__.py
+++ b/lib/youseedee/__init__.py
@@ -29,10 +29,7 @@ UCD_URL = "https://unicode.org/Public/UCD/latest/ucd/UCD.zip"
@@ -38,12 +38,7 @@ UCD_URL = "https://unicode.org/Public/UCD/latest/ucd/UCD.zip"
def ucd_dir():
- ucddir = os.path.expanduser("~/.youseedee")
- if not os.path.isdir(ucddir):
"""Return the directory where Unicode data is stored"""
- ucddir = expanduser("~/.youseedee")
- try:
- os.mkdir(ucddir)
- except FileExistsError:
- pass
- return ucddir
+ return "@ucd_dir@"
def up_to_date():
@@ -65,14 +60,6 @@ def up_to_date():
def ensure_files():
"""Ensure the Unicode data files are downloaded and up to date, and download them if not"""
- if not os.path.isfile(os.path.join(ucd_dir(), "UnicodeData.txt")):
- download_files()
- if not up_to_date():
- # Remove the zip if it exists
- zip_path = os.path.join(ucd_dir(), "UCD.zip")
- if os.path.isfile(zip_path):
- os.unlink(zip_path)
- download_files()
return

View File

@ -3,6 +3,8 @@
buildPythonPackage,
fetchPypi,
substituteAll,
setuptools,
setuptools-scm,
filelock,
requests,
unicode-character-database,
@ -10,12 +12,12 @@
buildPythonPackage rec {
pname = "youseedee";
version = "0.5.3";
format = "setuptools";
version = "0.6.0";
pyproject = true;
src = fetchPypi {
inherit pname version;
hash = "sha256-hQkI8kdropLiO86LXDy6eQma3FEg48gLldU7bFg9dzI=";
hash = "sha256-9w6yr28zq0LgOvMp5fCFaHGOwK4wbbDo/g1jH4Uky0E=";
};
patches = [
@ -27,16 +29,20 @@ buildPythonPackage rec {
})
];
propagatedBuildInputs = [
build-system = [
setuptools
setuptools-scm
];
dependencies = [
filelock
requests
];
doCheck = true;
# Package has no unit tests, but we can check an example as per README.rst:
checkPhase = ''
runHook preCheck
python -m youseedee 0x078A | grep -q "'Block': 'Thaana'"
python -m youseedee 0x078A | grep -qE "Block\s+Thaana"
runHook postCheck
'';