Skip to content
Snippets Groups Projects
Commit 05a66ce2 authored by payno's avatar payno
Browse files

Merge branch 'handle_pkg_resource_deprecation' into 'main'

pkg_resources: handle 'pkg_resources' deprecation

See merge request workflow/ewoksapps/est!136
parents 3aeb4e79 17488b82
No related branches found
No related tags found
No related merge requests found
...@@ -2,6 +2,15 @@ include: ...@@ -2,6 +2,15 @@ include:
- project: workflow/ewoksadmin/ewoksci - project: workflow/ewoksadmin/ewoksci
file: .gitlab-ci-template.yml file: .gitlab-ci-template.yml
variables:
WARNING1: "ignore::DeprecationWarning:silx.resources" # Fix in https://github.com/silx-kit/silx/pull/4078
WARNING2: "ignore::DeprecationWarning:pkg_resources" # Distribution.activate
WARNING3: "ignore::DeprecationWarning:Orange.util" # Fix in https://github.com/biolab/orange3/commit/671f184be00169e0a5196e9871ee0156dd35c19f
WARNING4: "ignore::DeprecationWarning:orangewidget.gui" # Fix in https://github.com/biolab/orange-widget-base/commit/2c6b4cfbba035f7f89bb886a02d8330f2710ce7d
WARNING5: "ignore::DeprecationWarning:jupyter_client.session"
WARNING6: "ignore::DeprecationWarning:silx.gui.widgets.ElidedLabel"
IGNORE_WARNINGS: "-W ${WARNING1} -W ${WARNING2} -W ${WARNING3} -W ${WARNING4} -W ${WARNING5} -W ${WARNING6}"
flake8_nb: flake8_nb:
extends: .flake8_nb extends: .flake8_nb
...@@ -11,29 +20,31 @@ test-3.8: ...@@ -11,29 +20,31 @@ test-3.8:
- python -m pip install --pre .[test,full] - python -m pip install --pre .[test,full]
- python -m pytest --cov=./ -v . - python -m pytest --cov=./ -v .
timeout: 20m timeout: 20m
variables:
PYTEST_OPTIONS: "--import-mode=importlib --cov=./src -v"
PYTEST_WARNINGS: "-W error ${IGNORE_WARNINGS}"
test-3.8-minimal: test-3.8-minimal:
extends: .test-3.8_glx extends: .test-3.8_glx
script: script:
- python -m pip install --pre .[test] - python -m pip install --pre .[test]
- python -m pytest -v . - python -m pytest --import-mode=importlib -v -W error ${IGNORE_WARNINGS} .
timeout: 20m timeout: 20m
test-3.8-pymca: test-3.8-pymca:
extends: .test-3.8_glx extends: .test-3.8_glx
script: script:
- python -m pip install --pre .[test,pymca] - python -m pip install --pre .[test,pymca]
- python -m pytest -v . - python -m pytest --import-mode=importlib -v -W error ${IGNORE_WARNINGS} .
timeout: 20m timeout: 20m
test-3.8-larch: test-3.8-larch:
extends: .test-3.8_glx extends: .test-3.8_glx
script: script:
- python -m pip install --pre .[test,larch] - python -m pip install --pre .[test,larch]
- python -m pytest -v . - python -m pytest --import-mode=importlib -v -W error ${IGNORE_WARNINGS} .
timeout: 20m timeout: 20m
test-3.8-larch-example: test-3.8-larch-example:
extends: .test-3.8_glx extends: .test-3.8_glx
script: script:
...@@ -45,6 +56,9 @@ build_sdist: ...@@ -45,6 +56,9 @@ build_sdist:
test_sdist-3.9: test_sdist-3.9:
extends: .test_sdist-3.9_glx extends: .test_sdist-3.9_glx
variables:
PYTEST_OPTIONS: "--import-mode=importlib -v"
PYTEST_WARNINGS: "-W error ${IGNORE_WARNINGS}"
build_doc: build_doc:
extends: .build_doc extends: .build_doc
......
...@@ -22,7 +22,7 @@ keywords = ...@@ -22,7 +22,7 @@ keywords =
[options] [options]
package_dir= package_dir=
=src =src
packages=find: packages=find_namespace:
python_requires = >=3.6 python_requires = >=3.6
install_requires = install_requires =
numpy numpy
...@@ -31,8 +31,7 @@ install_requires = ...@@ -31,8 +31,7 @@ install_requires =
silx >=0.15 silx >=0.15
Pint Pint
ewoks[orange] >=0.1 ewoks[orange] >=0.1
namespace_packages = ewoksorange >= 0.7.0rc0
orangecontrib
[options.packages.find] [options.packages.find]
where=src where=src
...@@ -65,6 +64,7 @@ full = ...@@ -65,6 +64,7 @@ full =
%(larch)s %(larch)s
%(orange)s %(orange)s
test = test =
%(full)s
pytest >=7 pytest >=7
testbook testbook
ipykernel ipykernel
......
__import__("pkg_resources").declare_namespace(__name__)
# orangecontrib is a namespace modules shared by multiple Orange add-on so it
# needs to declare namespace.
...@@ -28,9 +28,9 @@ WIDGET_HELP_PATH = ( ...@@ -28,9 +28,9 @@ WIDGET_HELP_PATH = (
# Entry point for main Orange categories/widgets discovery # Entry point for main Orange categories/widgets discovery
def widget_discovery(discovery): def widget_discovery(discovery):
import pkg_resources from ewoksorange.pkgmeta import get_distribution
dist = pkg_resources.get_distribution("est") dist = get_distribution("est")
pkgs = [ pkgs = [
"orangecontrib.est.widgets.pymca", "orangecontrib.est.widgets.pymca",
"orangecontrib.est.widgets.larch", "orangecontrib.est.widgets.larch",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment