Skip to content

Commit

Permalink
Merge pull request #1 from programmfabrik/fix-regex-import
Browse files Browse the repository at this point in the history
fixed imports (as discussed in #73578)
  • Loading branch information
StiftungAusNachlass authored Sep 19, 2024
2 parents 86f722f + 6fd5ae5 commit 888a6ce
Show file tree
Hide file tree
Showing 6 changed files with 5,261 additions and 13 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,7 @@ node_modules/
.idea
.DS_Store
.env
server/src-node/bundle.js
server/src-node/bundle.js
*.whl
**/unpacked/
*.pyc
13 changes: 6 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,17 @@ build-web:
build-server:
mkdir -p build/$(PLUGIN_NAME)/server

mkdir server/src-python/hanta_numpy_nltk
pip download HanTa numpy nltk -d server/src-python/hanta_numpy_nltk
# download "regex" as .tar.gz. Specific version, see https://github.com/psf/black/issues/1207
wget https://files.pythonhosted.org/packages/source/r/regex/regex-2019.11.1.tar.gz -P server/src-python/hanta_numpy_nltk
mkdir server/src-python/hanta_numpy_nltk/unpacked

# unpack regex.gz and the .whl-files
# unpack the .whl-files
mkdir -p $(UNPACKED_DIR)
for whl_file in $(LIBRARY_DIR)/*.whl; do \
echo "Unpacking $$whl_file to $(UNPACKED_DIR)"; \
unzip -q $$whl_file -d $(UNPACKED_DIR); \
done
tar -xzf server/src-python/hanta_numpy_nltk/regex-2019.11.1.tar.gz -C $(UNPACKED_DIR)

# overwrite unpacked regex library folder
cp -rf server/src-python/hanta_numpy_nltk/regex $(UNPACKED_DIR)

cp -rf server/data build/$(PLUGIN_NAME)/server/data
cp -rf server/src-python build/$(PLUGIN_NAME)/server/src-python
Expand All @@ -47,7 +45,8 @@ build-server:
clean:
rm -rf build
rm -f server/src-node/bundle.js
rm -rf server/src-python/hanta_numpy_nltk
rm -f server/src-python/hanta_numpy_nltk/*.whl
rm -rf server/src-python/hanta_numpy_nltk/unpacked

zip: build
cd build && zip ${ZIP_NAME} -r $(PLUGIN_NAME)/
Expand Down
3 changes: 3 additions & 0 deletions server/src-python/hanta_numpy_nltk/regex/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from .regex import *
from . import regex
__all__ = regex.__all__
Loading

0 comments on commit 888a6ce

Please sign in to comment.