Skip to content

Commit 3f99a5e

Browse files
authored
Merge pull request #17 from dataiku/chore/update-plugin
Add python 3.8 and 3.9 support
2 parents a53621a + 1c31e58 commit 3f99a5e

File tree

6 files changed

+39
-35
lines changed

6 files changed

+39
-35
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Changelog
22

3+
## [Version 1.3.0](https://github.com/dataiku/dss-plugin-nlp-preparation/releases/tag/v1.3.0) - New feature - 2023-04
4+
- ✨ Added Python 3.8 and 3.9 support
5+
36
## [Version 1.2.2](https://github.com/dataiku/dss-plugin-nlp-preparation/releases/tag/v1.2.2) - Bugfix release - 2022-07
47
- Fix sudachipy version not being compatible with Python 3.6 anymore
58

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
same "printed page" as the copyright notice for easier
187187
identification within third-party archives.
188188

189-
Copyright 2021 Dataiku
189+
Copyright 2023 Dataiku
190190

191191
Licensed under the Apache License, Version 2.0 (the "License");
192192
you may not use this file except in compliance with the License.

Makefile

Lines changed: 27 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
SHELL:=/bin/bash
2-
31
# Makefile variables set automatically
42
plugin_id=`cat plugin.json | python -c "import sys, json; print(str(json.load(sys.stdin)['id']).replace('/',''))"`
53
plugin_version=`cat plugin.json | python -c "import sys, json; print(str(json.load(sys.stdin)['version']).replace('/',''))"`
@@ -9,7 +7,7 @@ last_commit_id=`git rev-parse HEAD`
97

108

119
plugin:
12-
@echo "Archiving plugin to dist/ folder..."
10+
@echo "[START] Archiving plugin to dist/ folder..."
1311
@cat plugin.json | json_pp > /dev/null
1412
@rm -rf dist
1513
@mkdir dist
@@ -18,38 +16,38 @@ plugin:
1816
@zip --delete dist/${archive_file_name} "tests/*"
1917
@zip -u dist/${archive_file_name} release_info.json
2018
@rm release_info.json
21-
@echo "Archiving plugin to dist/ folder: Done!"
19+
@echo "[SUCCESS] Archiving plugin to dist/ folder: Done!"
2220

23-
.ONESHELL:
2421
unit-tests:
25-
@set -e
2622
@echo "Running unit tests..."
27-
@PYTHON_VERSION=`python3 -V 2>&1 | sed 's/[^0-9]*//g' | cut -c 1,2`
28-
@PYTHON_VERSION_IS_CORRECT=`cat code-env/python/desc.json | python3 -c "import sys, json; print(str($$PYTHON_VERSION) in [x[-2:] for x in json.load(sys.stdin)['acceptedPythonInterpreters']]);"`
29-
@if [ $$PYTHON_VERSION_IS_CORRECT == "False" ]; then echo "Python version $$PYTHON_VERSION is not in acceptedPythonInterpreters"; exit 1; else echo "Python version $$PYTHON_VERSION is in acceptedPythonInterpreters"; fi
30-
@rm -rf ./env/
31-
@python3 -m venv env/
32-
@source env/bin/activate
33-
@pip install --upgrade pip
34-
@pip install --no-cache-dir -r tests/python/unit/requirements.txt
35-
@pip install --no-cache-dir -r code-env/python/spec/requirements.txt
36-
@export PYTHONPATH="$(PYTHONPATH):$(PWD)/python-lib"
37-
@export DICTIONARY_FOLDER_PATH="$(PWD)/resource/dictionaries"
38-
@export STOPWORDS_FOLDER_PATH="$(PWD)/resource/stopwords"
39-
@pytest tests/python/unit --alluredir=tests/allure_report
40-
@echo "Running unit tests: Done!"
23+
@( \
24+
PYTHON_VERSION=`python3 -c "import sys; print('PYTHON{}{}'.format(sys.version_info.major, sys.version_info.minor))"`; \
25+
PYTHON_VERSION_IS_CORRECT=`cat code-env/python/desc.json | python3 -c "import sys, json; print('$$PYTHON_VERSION' in json.load(sys.stdin)['acceptedPythonInterpreters']);"`; \
26+
if [ $$PYTHON_VERSION_IS_CORRECT == "False" ]; then echo "Python version $$PYTHON_VERSION is not in acceptedPythonInterpreters"; exit 1; else echo "Python version $$PYTHON_VERSION is in acceptedPythonInterpreters"; fi; \
27+
)
28+
@( \
29+
rm -rf ./env/; \
30+
python3 -m venv env/; \
31+
source env/bin/activate; \
32+
pip install --upgrade pip;\
33+
pip install --no-cache-dir -r tests/python/unit/requirements.txt; \
34+
pip install --no-cache-dir -r code-env/python/spec/requirements.txt; \
35+
export PYTHONPATH="$(PYTHONPATH):$(PWD)/python-lib"; \
36+
export DICTIONARY_FOLDER_PATH="$(PWD)/resource/dictionaries"; \
37+
export STOPWORDS_FOLDER_PATH="$(PWD)/resource/stopwords"; \
38+
pytest tests/python/unit --alluredir=tests/allure_report || ret=$$?; exit $$ret \
39+
)
4140

42-
.ONESHELL:
4341
integration-tests:
44-
@set -e
4542
@echo "Running integration tests..."
46-
@rm -rf ./env/
47-
@python3 -m venv env/
48-
@source env/bin/activate
49-
@pip install --upgrade pip
50-
@pip install --no-cache-dir -r tests/python/integration/requirements.txt
51-
@pytest tests/python/integration --alluredir=tests/allure_report
52-
@echo "Running integration tests: Done!"
43+
@( \
44+
rm -rf ./env/; \
45+
python3 -m venv env/; \
46+
source env/bin/activate; \
47+
pip3 install --upgrade pip;\
48+
pip install --no-cache-dir -r tests/python/integration/requirements.txt; \
49+
pytest tests/python/integration --alluredir=tests/allure_report || ret=$$?; exit $$ret \
50+
)
5351

5452
tests: unit-tests integration-tests
5553

code-env/python/desc.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
{
22
"acceptedPythonInterpreters": [
33
"PYTHON36",
4-
"PYTHON37"
4+
"PYTHON37",
5+
"PYTHON38",
6+
"PYTHON39"
57
],
68
"forceConda": false,
79
"installCorePackages": true,
10+
"corePackagesSet": "AUTO",
811
"installJupyterSupport": true
912
}

plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"id": "nlp-preparation",
3-
"version": "1.2.2",
3+
"version": "1.3.0",
44
"meta": {
55
"label": "Text Preparation",
66
"category": "Natural Language Processing",
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
pandas>=1.0,<1.1
2-
pytest==6.2.1
1+
pytest
2+
requests<2.22,>=2
33
dataiku-api-client
4-
git+git://github.com/dataiku/dataiku-plugin-tests-utils.git@master#egg=dataiku-plugin-tests-utils
4+
git+https://github.com/dataiku/dataiku-plugin-tests-utils.git@master#egg=dataiku-plugin-tests-utils

0 commit comments

Comments
 (0)