Repository: collective/collective.workspace (language: python)

Issue:
Deprecation warning when importing InitializeClass



Discussion / hints:

Fix patch:
diff --git a/travis.cfg b/.gha.cfg
similarity index 100%
rename from travis.cfg
rename to .gha.cfg
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index 442884b..0000000
--- a/.travis.yml
+++ /dev/null
@@ -1,41 +0,0 @@
-language: python
-cache:
-  pip: true
-  directories:
-    - eggs
-python:
-  - 2.7
-  - 3.6
-  - 3.7
-matrix:
-  fast_finish: true
-firefox: "latest"
-env:
-  matrix:
-    - PLONE_VERSION=5.2.x
-    - PLONE_VERSION=5.1.x
-matrix:
-  exclude:
-    - python: 3.6
-      env: PLONE_VERSION=5.1.x
-    - python: 3.7
-      env: PLONE_VERSION=5.1.x
-before_install:
-  - mkdir -p $HOME/buildout-cache/{eggs,downloads}
-  - mkdir $HOME/.buildout
-  - echo "[buildout]" > $HOME/.buildout/default.cfg
-  - echo "download-cache = $HOME/buildout-cache/downloads" >> $HOME/.buildout/default.cfg
-  - echo "eggs-directory = $HOME/buildout-cache/eggs" >> $HOME/.buildout/default.cfg
-  - wget https://github.com/mozilla/geckodriver/releases/download/v0.26.0/geckodriver-v0.26.0-linux64.tar.gz
-  - mkdir geckodriver && tar zxvf geckodriver-v0.26.0-linux64.tar.gz -C geckodriver
-  - export PATH=$PATH:$PWD/geckodriver
-install:
-  - pip install -r requirements.txt
-  - sed -ie "s#plone-x.x.x.cfg#plone-$PLONE_VERSION.cfg#" travis.cfg
-  - buildout -c travis.cfg
-services:
-  - xvfb
-before_script:
-  - "export ROBOT_HTTP_PORT=55001"
-script:
-  - bin/test
diff --git a/CHANGES.rst b/CHANGES.rst
index ea4c1e4..99f1db0 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -1,11 +1,11 @@
 Changelog
 =========
 
-3.0b3 (unreleased)
+3.0.0 (unreleased)
 ------------------
 
-- Nothing changed yet.
-
+- Fix deprecation a warning
+  (Fixes #47) [ale-rt]
 
 3.0b2 (2020-06-05)
 ------------------
diff --git a/MANIFEST.in b/MANIFEST.in
index 8161b3d..c62e4ff 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -8,6 +8,5 @@ global-exclude *.pyc
 
 # added by check_manifest.py
 include *.py
-include .travis.yml
 include buildout.cfg
 include development.cfg
diff --git a/Makefile b/Makefile
index 18e989c..5d3ae6b 100644
--- a/Makefile
+++ b/Makefile
@@ -24,10 +24,8 @@ help: ## This help message
 update: ## Update Make and Buildout
 	wget -O Makefile https://raw.githubusercontent.com/kitconcept/buildout/master/Makefile
 	wget -O requirements.txt https://raw.githubusercontent.com/kitconcept/buildout/master/requirements.txt
-	wget -O plone-4.3.x.cfg https://raw.githubusercontent.com/kitconcept/buildout/master/plone-4.3.x.cfg
 	wget -O plone-5.1.x.cfg https://raw.githubusercontent.com/kitconcept/buildout/master/plone-5.1.x.cfg
 	wget -O plone-5.2.x.cfg https://raw.githubusercontent.com/kitconcept/buildout/master/plone-5.2.x.cfg
-	wget -O travis.cfg https://raw.githubusercontent.com/kitconcept/buildout/master/travis.cfg
 	wget -O versions.cfg https://raw.githubusercontent.com/kitconcept/buildout/master/versions.cfg
 
 .installed.cfg: bin/buildout *.cfg
@@ -47,12 +45,6 @@ py2:
 	bin/pip install --upgrade pip
 	bin/pip install -r requirements.txt
 
-.PHONY: Build Plone 4.3
-build-plone-4.3: py2 ## Build Plone 4.3
-	bin/pip install --upgrade pip
-	bin/pip install -r requirements.txt
-	bin/buildout -c plone-4.3.x.cfg
-
 .PHONY: Build Plone 5.0
 build-plone-5.0: py2 ## Build Plone 5.0
 	bin/pip install --upgrade pip
diff --git a/README.rst b/README.rst
index eee6643..425241a 100644
--- a/README.rst
+++ b/README.rst
@@ -1,5 +1,5 @@
-.. image:: https://travis-ci.org/collective/collective.workspace.svg?branch=master
-    :target: https://travis-ci.org/collective/collective.workspace
+.. image:: https://github.com/collective/collective.workspace/workflows/tests/badge.svg
+    :target: https://github.com/collective/collective.workspace/actions?query=workflow%3Atests
 
 collective.workspace
 ====================
diff --git a/plone-4.3.x.cfg b/plone-4.3.x.cfg
deleted file mode 100644
index 91fb553..0000000
--- a/plone-4.3.x.cfg
+++ /dev/null
@@ -1,19 +0,0 @@
-[buildout]
-extends =
-    base.cfg
-    https://dist.plone.org/release/4.3.19/versions.cfg
-    versions.cfg
-
-[versions]
-pytz = 2017.3
-zope.interface = 4.1.0
-# fixes zlib failure: https://stackoverflow.com/questions/34631806/fail-during-installation-of-pillow-python-module-in-linux
-# Pillow = 5.4.1
-future = 0.17.1
-six = 1.11.0
-# fixes: SyntaxError: invalid syntax (more.py, line 340)
-zipp = 0.5.2
-# more-itertools >= 6.0.0 dropped python2.7 support
-more-itertools = 5.0.0
-# Error: The requirement ('Pygments>=2.5.1') is not allowed by your [versions] constraint (2.2.0)
-Pygments = 2.5.2
diff --git a/plone-5.1.x.cfg b/plone-5.1.x.cfg
index 1e19768..4764d92 100644
--- a/plone-5.1.x.cfg
+++ b/plone-5.1.x.cfg
@@ -1,20 +1,25 @@
 [buildout]
 extends =
     base.cfg
-    https://dist.plone.org/release/5.1.6/versions.cfg
+    https://dist.plone.org/release/5.1.7/versions.cfg
     versions.cfg
+show-picked-versions = true
 
 [versions]
+plone.testing = 5.0.0
+
+# Error: The requirement ('virtualenv>=20.0.35') is not allowed by your [versions] constraint (20.0.26)
+virtualenv = 20.0.35
+
+# Error: The requirement ('distlib<1,>=0.3.1') is not allowed by your [versions] constraint (0.3.0)
+distlib = 0.3.1
+
 # fixes: SyntaxError: invalid syntax (more.py, line 340)
 zipp = 0.5.2
 
-# plone.restapi specific
-plone.schema = 1.2.0
-
 # zest.releaser
 zest.releaser = 6.20.1
 twine = 1.11.0
-requests = 2.18.4
 towncrier = 19.2.0
 zestreleaser.towncrier = 1.1.0
 # docutils = 0.13.1
@@ -29,3 +34,47 @@ sphinx-rtd-theme = 0.2.4
 Jinja2 = 2.10
 Babel = 2.5.1
 astunparse = 1.6.2
+
+PyYAML = 5.3
+argh = 0.26.2
+bleach = 3.2.1
+flake8-debugger = 3.2.1
+flake8-print = 3.1.4
+mccabe = 0.6.1
+pathtools = 0.1.2
+pkginfo = 1.6.1
+pyflakes = 1.6.0
+pyparsing = 2.4.7
+pyroma = 2.6
+readme = 0.7.1
+requests-toolbelt = 0.9.1
+watchdog = 0.9.0
+zest.pocompile = 1.5.0
+
+# Required by:
+# plone.recipe.codeanalysis==3.0.1
+check-manifest = 0.42
+
+# Required by:
+# bleach==3.2.1
+packaging = 20.4
+
+# Required by:
+# importlib-metadata==1.6.1
+pathlib2 = 2.3.5
+
+# Required by:
+# check-manifest==0.42
+pep517 = 0.9.1
+
+# Required by:
+# readme==0.7.1
+readme-renderer = 28.0
+
+# Required by:
+# pathlib2==2.3.5
+scandir = 1.10.0
+
+# Required by:
+# bleach==3.2.1
+webencodings = 0.5.1
diff --git a/plone-5.2.x.cfg b/plone-5.2.x.cfg
index 714bc95..afeba1e 100644
--- a/plone-5.2.x.cfg
+++ b/plone-5.2.x.cfg
@@ -1,6 +1,53 @@
 [buildout]
 extends =
     base.cfg
-    https://dist.plone.org/release/5.2.1/versions.cfg
+    https://dist.plone.org/release/5.2.3/versions.cfg
 find-links += https://dist.plone.org/thirdparty/
 versions=versions
+show-picked-versions = true
+
+[versions]
+black = 20.8b1
+
+# Error: The requirement ('virtualenv>=20.0.35') is not allowed by your [versions] constraint (20.0.26)
+virtualenv = 20.0.35
+
+# Error: The requirement ('pep517>=0.9') is not allowed by your [versions] constraint (0.8.2)
+pep517 = 0.9.1
+
+# cryptography 3.4 requires a rust compiler installed on the system:
+# https://github.com/pyca/cryptography/blob/master/CHANGELOG.rst#34---2021-02-07
+cryptography = 3.3.2
+
+PyYAML = 5.3
+argh = 0.26.2
+flake8 = 3.8.3
+flake8-coding = 1.3.2
+flake8-debugger = 3.2.1
+flake8-print = 3.1.4
+mccabe = 0.6.1
+pathtools = 0.1.2
+plone.recipe.codeanalysis = 3.0.1
+prompt-toolkit = 1.0.18
+pyflakes = 2.2.0
+pyroma = 2.6
+readme = 0.7.1
+watchdog = 0.9.0
+zest.pocompile = 1.5.0
+
+# Required by:
+# plone.recipe.codeanalysis==3.0.1
+check-manifest = 0.42
+
+# Required by:
+# flake8-debugger==3.2.1
+# flake8-print==3.1.4
+pycodestyle = 2.6.0
+
+# Required by:
+# prompt-toolkit==1.0.18
+wcwidth = 0.2.5
+
+SecretStorage = 3.1.2
+jeepney = 0.4.3
+keyring = 21.2.1
diff --git a/requirements.txt b/requirements.txt
index f6ac0d7..8466fed 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,3 +1,4 @@
 # Keep this file in sync with: https://github.com/kitconcept/buildout/edit/master/requirements.txt
 setuptools==42.0.2
-zc.buildout==2.13.2
+zc.buildout==2.13.3
+wheel
diff --git a/setup.py b/setup.py
index ea9c387..31b3efd 100644
--- a/setup.py
+++ b/setup.py
@@ -1,6 +1,6 @@
 from setuptools import setup, find_packages
 
-version = "3.0b3.dev0"
+version = "3.0.0.dev0"
 
 long_description = (
     open("README.rst").read() + "\n" + "Contributors\n"
@@ -30,6 +30,7 @@
         "Programming Language :: Python :: 2.7",
         "Programming Language :: Python :: 3.6",
         "Programming Language :: Python :: 3.7",
+        "Programming Language :: Python :: 3.8",
         "Topic :: Software Development :: Libraries :: Python Modules",
     ],
     keywords="plone workspace collaboration",
diff --git a/src/collective/workspace/pas.py b/src/collective/workspace/pas.py
index 38157ce..8166abb 100644
--- a/src/collective/workspace/pas.py
+++ b/src/collective/workspace/pas.py
@@ -1,6 +1,5 @@
 # coding=utf-8
 from AccessControl import ClassSecurityInfo
-from App.class_init import InitializeClass
 from borg.localrole.interfaces import ILocalRoleProvider
 from collective.workspace.interfaces import IWorkspace
 from plone import api
@@ -10,6 +9,11 @@
 from zope.interface import implementer
 
 
+try:
+    from AccessControl.class_init import InitializeClass
+except ImportError:
+    from App.class_init import InitializeClass
+
 try:
     from Products.CMFPlone.utils import safe_nativestring
 except ImportError:
diff --git a/versions.cfg b/versions.cfg
index bd4e3f7..52d0af6 100644
--- a/versions.cfg
+++ b/versions.cfg
@@ -24,7 +24,6 @@ pycodestyle = 2.3.1
 # Release
 zest.releaser = 6.17.0
 twine = 1.11.0
-requests = 2.18.4
 towncrier = 19.2.0
 zestreleaser.towncrier = 1.1.0
 docutils = 0.13.1
@@ -38,3 +37,14 @@ sphinxcontrib-httpdomain = 1.5.0
 sphinx-rtd-theme = 0.2.4
 Jinja2 = 2.10
 Babel = 2.5.1
+
+# plone.rest(api) specific pins
+
+# Latest version compatible with Python 2
+httpie = 1.0.3
+
+# Latest version compatible with Python 2
+PyJWT = 1.7.1
+
+importlib-metadata = 1.6.1
+importlib-resources = 3.3.1


Test patch:
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
new file mode 100644
index 0000000..37676bb
--- /dev/null
+++ b/.github/workflows/tests.yml
@@ -0,0 +1,54 @@
+# Inspired by:
+# https://github.com/zopefoundation/meta/tree/master/config/pure-python
+name: tests
+
+on:
+  push:
+    branches: [master]
+  pull_request:
+  schedule:
+    - cron: "0 12 * * 0" # run once a week on Sunday
+
+jobs:
+  tests:
+    runs-on: ubuntu-latest
+    strategy:
+      matrix:
+        config:
+          - ["Py2.7-Plone5.1", "2.7", "5.1"]
+          - ["Py2.7-Plone5.2", "2.7", "5.2"]
+          - ["Py3.6-Plone5.2", "3.6", "5.2"]
+          - ["Py3.7-Plone5.2", "3.7", "5.2"]
+          - ["Py3.8-Plone5.2", "3.8", "5.2"]
+    steps:
+      - uses: actions/checkout@v2
+      - name: Set up Python ${{ matrix.config[1] }}
+        uses: actions/setup-python@v2
+        with:
+          python-version: ${{ matrix.config[1] }}
+      - name: Pip cache
+        uses: actions/cache@v2
+        with:
+          path: |
+            ~/.cache/pip
+            **/eggs
+            **/downloads
+          key: ${{ runner.os }}-cache-${{ hashFiles('setup.*', '*.cfg') }}-${{ matrix.config[0] }}
+          restore-keys: |
+            ${{ runner.os }}-cache-
+      - name: Install dependencies
+        run: |
+          sudo apt-get install libxml2-dev libxslt-dev xvfb
+          mkdir -p $HOME/buildout-cache/{eggs,downloads}
+          mkdir $HOME/.buildout
+          echo "[buildout]" > $HOME/.buildout/default.cfg
+          echo "download-cache = $HOME/buildout-cache/downloads" >> $HOME/.buildout/default.cfg
+          echo "eggs-directory = $HOME/buildout-cache/eggs" >> $HOME/.buildout/default.cfg
+          wget https://github.com/mozilla/geckodriver/releases/download/v0.26.0/geckodriver-v0.26.0-linux64.tar.gz
+          mkdir geckodriver && tar zxvf geckodriver-v0.26.0-linux64.tar.gz -C geckodriver
+          python -m pip install --upgrade pip
+          pip install -r requirements.txt
+          sed -ie "s#plone-x.x.x.cfg#plone-${{ matrix.config[2] }}.x.cfg#" .gha.cfg
+          buildout -c .gha.cfg
+      - name: Test
+        run: PATH=$PATH:$PWD/geckodriver ROBOT_HTTP_PORT=55001 xvfb-run --server-args="-screen 0 1600x1200x24" ./bin/test
diff --git a/src/collective/workspace/tests/test_workspace.py b/src/collective/workspace/tests/test_workspace.py
index e19aaf0..c10280b 100644
--- a/src/collective/workspace/tests/test_workspace.py
+++ b/src/collective/workspace/tests/test_workspace.py
@@ -22,7 +22,7 @@ def setUp(self):
         self.request = self.layer["request"]
         zope.login(self.app["acl_users"], SITE_OWNER_NAME)
         self.user1 = api.user.create(
-            email="user1@example.com", username="user1", password="123"
+            email="user1@example.com", username="user1", password="Plone123"
         )
         self.workspace = api.content.create(
             container=self.portal, type="Workspace", id="a-workspace"
@@ -127,7 +127,7 @@ def test_reparent_team_member(self):
             user=self.user1.getId(), groups=(u"Admins",),
         )
         user2 = api.user.create(
-            email="user2@example.com", username="user2", password="123"
+            email="user2@example.com", username="user2", password="Plone123"
         )
         self.ws[self.user1.getId()].update({"user": user2.getId()})
         self.assertNotIn(self.user1.getId(), self.workspace._team)