plone / plone.recipe.codeanalysis

provides static code analysis for Buildout-based Python projects, including flake8, JSHint, CSS Lint, and other code checks
https://pypi.org/project/plone.recipe.codeanalysis/
11 stars 5 forks source link

Python3.8 multiprocessing support #229

Closed janjaapdriessen closed 3 years ago

janjaapdriessen commented 4 years ago

On python3.8 I get the error:

...
AttributeError: Can't pickle local object 'code_analysis.<locals>.taskrunner'

Moving def taskrunner to the module level fixes this issue. I don't see a test case for multiprocessing, and the version pins in buildout.cfg are a bit outdated. Let's see whether the tests pass on travis on python3.8.

mister-roboto commented 4 years ago

@janjaapdriessen you need to sign the Plone Contributor Agreement in order to merge this pull request.

Learn about the Plone Contributor Agreement: http://docs.plone.org/develop/coredev/docs/contributors_agreement_explained.html

janjaapdriessen commented 4 years ago

I did the contributor agreement dance, waiting for approval.

tisto commented 4 years ago

@janjaapdriessen can you provide steps to reproduce? We are running stuff on 3.8 and I never saw the error above.

janjaapdriessen commented 4 years ago

I added the multiprocessing setting to this repo's own buildout config and ran buildout with python3.8.5 (I had to remove the version pins for zope.i18nmessageid and zope.security in order to install all dependencies). Running bin/code-analysis gives the pickle attribute error only when I move the taskrunner back inside the code_analysis function.

janjaapdriessen commented 4 years ago

@tisto could you have a look at this PR again please? You might have missed my last comment, I didn't mention you.

tisto commented 4 years ago

@janjaapdriessen the problem is that Travis is red (most likely unrelated to your PR) which makes it impossible to merge and release this PR right now. Unfortunately, I do not have the time to look into it. I am happy to merge PRs and do a release but I can not work on fixing things these days...

janjaapdriessen commented 3 years ago

@tisto I asked @sirex to revive rubygemsrecipe from bitbucket, there is a 0.3.0 release that makes the buildout work again, we no longer need to run buildout twice, which is nice. However, I can not get the travis builds to work on python2.7, because of an issue with newer versions of zipp, zipp < 2 only installs with older versions of pip/setuptools. Would you be okay with removing 2.7 support?

tisto commented 3 years ago

@janjaapdriessen I'd prefer to keep the Python 2 compatibility for a while. At least as long as Plone 5.2 is the main Plone release and still supports Python 2. We will break tons of existing buildouts when we drop Python2 support. The zipp issue should be fixable.

janjaapdriessen commented 3 years ago

Continuing in another PR because I opened this PR before signing the contributors agreement.