| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
__name__ attribute
|
|
|
|
|
|
|
|
|
|
|
| |
for LazyObject
functools.wraps was breaking the behavior of LazyObject because it tried to
access attributes of the LazyObject that triggers an import which could
sometime fails in this situation where some modules are marked as deprecated
but aren't imported yet.
For example see https://forge.extranet.logilab.fr/cubicweb/cubicweb/blob/3.24.0/cubicweb/schemas/__init__.py#L51
|
|
|
|
| |
Actually the old compatibility code actually prevented this bug so back it up.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
deprecation utils are called
There was a missmatched combination of:
* the frame wasn't always correctly grabbed
* grabbing the frame in the situation of a decorator didn't make any sens, so
switch to func.__module__
* the tests were bad and expected "[logilab.common]" while it should have been
"[test_deprecation]" because it was there that the depreciation was declared
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
argument_removed and DeprecationWrapper
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
'input_function'
When no parameter was given to the class, None was used as the `input`.
It used to work because when `input` (the argument) was None `raw_input` of six
was used instead. (-> self._input = input or raw_input).
Now that six has been dropped, we cannot have `input=None` in the arguments list
anymore and use the builtin `input` at the same time.
This patch suggests to deprecate this argument in favor of a new one called
`input_function`. If no `input_function`, let's use the `input` builtin.
For backward compatibility, if `input` should be given, it's caught in the
`kwargs` and used as `input_function`, and a deprecation warning is shown.
|
|
|
|
|
|
|
|
|
|
|
| |
logilab-pytest has a side effect of printing DeprecationWarnings by default,
when running modutils tests without logilab-pytest binary this fail.
In debian package we run python3 -m "logilab.common.pytest" and thus
DeprecationWarning are not displayed and tests fail.
Fix this by ensuring DeprecationWarning are displayed before running tests of
unittest_modutils.py
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
The original KeyError comes from 57e242dffe89 which no justification. I
believe it was meant to be a ValueError as in other errors in this
function. Also, _ensure_correctly_typed() in cubicweb/web/formfields.py
will catch ValueError.
Adding a test for this.
|
|
|
|
|
|
|
|
| |
The "options" iteration variable hid the original function
parameters, therefore only the options of the last group
were registered.
Rename the iteration variable and everything's fine.
|
| |
|
|
|
|
|
|
| |
Use io.open() which has a consistent interface between Python 2 and Python 3.
In particular, `newline` parameter is meant to control "universal new lines"
and it is None by default so we don't need to specify it.
|
| |
|
|
|
|
|
|
|
|
|
| |
To detect in whih module the instance was created we previously detect the
filename in python stack and then use modpath_from_file(). Since the later is
now deprecated, we should force passing the module at instantiation with
__module__=__name__.
Deprecate old usage
|
|
|
|
|
| |
This method is to be replaced by register_modnames() to avoid using deprecated
modpath_from_file()
|
|
|
|
|
|
| |
The method will likely fail if there somes symlinks in your python environment
and will certainly fail on a file that isn't in sys.path (like custom importers
using sys.meta_path).
|
|
|
|
|
|
| |
Alternative to register_objects() to inspect modules names instead of
directories.
Avoiding using bogus logilab.common.modutils.modpath_from_file()
|
|
|
|
|
|
| |
Because "modutils" module may also be found in source directory,
this test may fail under some circumstances (like Debian package build,
for instance).
|
|
|
|
| |
Closes #3691182
|
|
|
|
|
|
| |
And adjust all tests accordingly.
Drop docstring example from fileutils.abspath_listdir since I could not have
it skipped.
|
|
|
|
| |
Closes #8396846.
|
|
|
|
| |
to have a clean CI report
|
| |
|
|
|
|
| |
also use io.StingIO in unittest_changelog
|
|
|
|
| |
we should not get a traceback in this case. Closes #6060938
|
| |
|
|
|
|
|
|
|
| |
This allows client libraries to avoid importing pytest module which has
spurious monkeypatches of unittest.
Drop deprecated API about coverage control.
|
|
|
|
| |
float is the default type used in apply_units.
|
|
|
|
|
| |
Add tests for UMessage.get_payload() (taken from CubicWeb).
Closes #1716128.
|