Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Jérome Perrin
erp5
Commits
d24bb26f
Commit
d24bb26f
authored
Mar 10, 2024
by
Kazuhiko Shiozaki
Committed by
Jérome Perrin
May 15, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
py3: follow changes on astroid.
parent
3ec8ac75
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
11 deletions
+25
-11
product/ERP5Type/Tool/ComponentTool.py
product/ERP5Type/Tool/ComponentTool.py
+8
-8
product/ERP5Type/patches/pylint.py
product/ERP5Type/patches/pylint.py
+7
-1
product/ERP5Type/tests/testDynamicClassGeneration.py
product/ERP5Type/tests/testDynamicClassGeneration.py
+10
-2
No files found.
product/ERP5Type/Tool/ComponentTool.py
View file @
d24bb26f
...
@@ -159,16 +159,16 @@ class ComponentTool(BaseTool):
...
@@ -159,16 +159,16 @@ class ComponentTool(BaseTool):
erp5
.
component
.
filesystem_import_dict
=
None
erp5
.
component
.
filesystem_import_dict
=
None
erp5
.
component
.
ref_manager
.
gc
()
erp5
.
component
.
ref_manager
.
gc
()
# Clear
pylint
cache
# Clear
astroid (pylint)
cache
try
:
if
six
.
PY2
:
from
astroid.builder
import
MANAGER
from
astroid.builder
import
MANAGER
except
ImportError
:
pass
else
:
else
:
astroid_cache
=
MANAGER
.
astroid_cache
from
astroid.builder
import
AstroidManager
for
k
in
astroid_cache
.
keys
():
MANAGER
=
AstroidManager
()
if
k
.
startswith
(
'erp5.component.'
)
and
k
not
in
component_package_list
:
astroid_cache
=
MANAGER
.
astroid_cache
del
astroid_cache
[
k
]
for
k
in
list
(
astroid_cache
.
keys
()):
if
k
.
startswith
(
'erp5.component.'
)
and
k
not
in
component_package_list
:
del
astroid_cache
[
k
]
if
reset_portal_type_at_transaction_boundary
:
if
reset_portal_type_at_transaction_boundary
:
portal
.
portal_types
.
resetDynamicDocumentsOnceAtTransactionBoundary
()
portal
.
portal_types
.
resetDynamicDocumentsOnceAtTransactionBoundary
()
...
...
product/ERP5Type/patches/pylint.py
View file @
d24bb26f
...
@@ -42,7 +42,13 @@ OptionsManagerMixIn.read_config_file = lambda *args, **kw: None
...
@@ -42,7 +42,13 @@ OptionsManagerMixIn.read_config_file = lambda *args, **kw: None
## Pylint transforms and plugin to generate AST for ZODB Components
## Pylint transforms and plugin to generate AST for ZODB Components
from
astroid.builder
import
AstroidBuilder
from
astroid.builder
import
AstroidBuilder
from
astroid.exceptions
import
AstroidBuildingException
from
astroid.exceptions
import
AstroidBuildingException
from
astroid
import
MANAGER
,
node_classes
from
astroid
import
node_classes
if
six
.
PY2
:
from
astroid
import
MANAGER
else
:
from
astroid
import
AstroidManager
MANAGER
=
AstroidManager
()
try
:
try
:
from
astroid.builder
import
_guess_encoding
from
astroid.builder
import
_guess_encoding
...
...
product/ERP5Type/tests/testDynamicClassGeneration.py
View file @
d24bb26f
...
@@ -2224,7 +2224,11 @@ def function_foo(*args, **kwargs):
...
@@ -2224,7 +2224,11 @@ def function_foo(*args, **kwargs):
def
_assertAstroidCacheContent
(
self
,
def
_assertAstroidCacheContent
(
self
,
must_be_in_cache_set
,
must_be_in_cache_set
,
must_not_be_in_cache_set
):
must_not_be_in_cache_set
):
from
astroid.builder
import
MANAGER
if
six
.
PY2
:
from
astroid.builder
import
MANAGER
else
:
from
astroid.builder
import
AstroidManager
MANAGER
=
AstroidManager
()
should_not_be_in_cache_list
=
[]
should_not_be_in_cache_list
=
[]
for
modname
in
MANAGER
.
astroid_cache
:
for
modname
in
MANAGER
.
astroid_cache
:
if
(
modname
.
startswith
(
'checkPythonSourceCode'
)
or
if
(
modname
.
startswith
(
'checkPythonSourceCode'
)
or
...
@@ -2497,7 +2501,11 @@ from %(namespace)s.erp5_version import %(reference)s
...
@@ -2497,7 +2501,11 @@ from %(namespace)s.erp5_version import %(reference)s
reference
=
imported_reference
))
reference
=
imported_reference
))
component
.
checkSourceCode
()
component
.
checkSourceCode
()
from
astroid.builder
import
MANAGER
if
six
.
PY2
:
from
astroid.builder
import
MANAGER
else
:
from
astroid.builder
import
AstroidManager
MANAGER
=
AstroidManager
()
imported_module
=
self
.
_getComponentFullModuleName
(
imported_reference
)
imported_module
=
self
.
_getComponentFullModuleName
(
imported_reference
)
self
.
assertEqual
(
self
.
assertEqual
(
MANAGER
.
astroid_cache
[
self
.
_getComponentFullModuleName
(
imported_reference
,
version
=
'bar'
)],
MANAGER
.
astroid_cache
[
self
.
_getComponentFullModuleName
(
imported_reference
,
version
=
'bar'
)],
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment