Skip to content

Commit

Permalink
Modernize the package and prepare for a final release (#49)
Browse files Browse the repository at this point in the history
- Fixed classifiers
- Fixed version
- Modernize imports
- Switch to GitHub actions

Closes #47
  • Loading branch information
ale-rt authored Feb 17, 2021
1 parent d490a59 commit 556df91
Show file tree
Hide file tree
Showing 15 changed files with 183 additions and 86 deletions.
File renamed without changes.
54 changes: 54 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -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
41 changes: 0 additions & 41 deletions .travis.yml

This file was deleted.

6 changes: 3 additions & 3 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -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)
------------------
Expand Down
1 change: 0 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,5 @@ global-exclude *.pyc

# added by check_manifest.py
include *.py
include .travis.yml
include buildout.cfg
include development.cfg
8 changes: 0 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
@@ -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
====================
Expand Down
19 changes: 0 additions & 19 deletions plone-4.3.x.cfg

This file was deleted.

59 changes: 54 additions & 5 deletions plone-5.1.x.cfg
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
49 changes: 48 additions & 1 deletion plone-5.2.x.cfg
Original file line number Diff line number Diff line change
@@ -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
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -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
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -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",
Expand Down
6 changes: 5 additions & 1 deletion src/collective/workspace/pas.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions src/collective/workspace/tests/test_workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -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="[email protected]", username="user1", password="123"
email="[email protected]", username="user1", password="Plone123"
)
self.workspace = api.content.create(
container=self.portal, type="Workspace", id="a-workspace"
Expand Down Expand Up @@ -127,7 +127,7 @@ def test_reparent_team_member(self):
user=self.user1.getId(), groups=(u"Admins",),
)
user2 = api.user.create(
email="[email protected]", username="user2", password="123"
email="[email protected]", username="user2", password="Plone123"
)
self.ws[self.user1.getId()].update({"user": user2.getId()})
self.assertNotIn(self.user1.getId(), self.workspace._team)
Expand Down
12 changes: 11 additions & 1 deletion versions.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

0 comments on commit 556df91

Please sign in to comment.