Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does PyGradle work with Python3.8 - re.py line 145 enum no attribute IntFlag #343

Open
jshingler opened this issue May 19, 2020 · 3 comments

Comments

@jshingler
Copy link

Okay, ... Still a newbie to python, ... I use gradle in professional life, ... I was excited to see python plugin for gradle, ...

been looking into this off and on for 2 days, .... thought maybe I was doing something wrong, ... starting to think that maybe pygradle doesnt work work Python3.8?

See output below.

gradle build

Task :installBuildRequirements FAILED
Error installing package using [/root/workspace/build/venv/bin/python, /root/workspace/build/venv/bin/pip, install, --disable-pip-version-check, --no-deps, --upgrade, /home/gradle/.gradle/caches/modules-2/files-2.1/pypi/enum34/1.1.6/14ef5878333ff91099893d615192c8cd0b1525a/enum34-1.1.6.tar.gz]
Processing /home/gradle/.gradle/caches/modules-2/files-2.1/pypi/enum34/1.1.6/14ef5878333ff91099893d615192c8cd0b1525a/enum34-1.1.6.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 1, in
File "/root/workspace/build/venv/lib/python3.8/site-packages/setuptools/init.py", line 6, in
import distutils.core
File "/root/workspace/build/venv/lib/python3.8/distutils/init.py", line 1, in
import imp
File "/root/workspace/build/venv/lib/python3.8/imp.py", line 27, in
import tokenize
File "/root/workspace/build/venv/lib/python3.8/tokenize.py", line 32, in
import re
File "/root/workspace/build/venv/lib/python3.8/re.py", line 145, in
class RegexFlag(enum.IntFlag):
AttributeError: module 'enum' has no attribute 'IntFlag'

----------------------------------------

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-req-build-491x_3qg/

@jshingler
Copy link
Author

Even set it up in a NEW Docker container just to make sure something in my environment wasn't the problem.

@wssrcok
Copy link

wssrcok commented Jul 21, 2020

this enum problem you just need to force version, I found it somewhere in the issue a while ago.
python {
... other config ...
forceVersion('pypi', 'flake8', '3.2.1')
forceVersion('pypi', 'six', '1.13.0')
}

@alghoshal
Copy link

alghoshal commented Aug 22, 2024

For anyone still struggling, yes with some effort pygradle does work with Python3.8.
See pygradle_python3_example for details: https://github.com/alghoshal/pygradle_python3_example/blob/main/README.md
Also my comment on another issue: #351 (comment)

For the enum bit, that's primarily a flake8-3.6 dependency on enum34, which is not supported in Python-3.

See fixDownloadedIvyModules.sh (Line No 25) for removal of the dependency from the flake8-3.6.0.ivy file:
https://github.com/alghoshal/pygradle_python3_example/blob/main/scripts/fixDownloadedIvyModules.sh#L25

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants