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

Fixes for py312 rf7 #2699

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Programming Language :: Python :: 3.12
Topic :: Software Development :: Testing
""".strip().splitlines()

Expand Down Expand Up @@ -100,7 +101,7 @@ def run(self):
package_dir={'': SOURCE_DIR},
packages=find_packages(SOURCE_DIR),
package_data=PACKAGE_DATA,
python_requires='>=3.8, <3.12',
python_requires='>=3.8, <3.13',
# Robot Framework package data is not included, but RIDE does not need it.
# Always install everything, since we may be switching between versions
options={'install': {'force': True}},
Expand Down
2 changes: 1 addition & 1 deletion src/robotide/contrib/testrunner/TestRunnerAgent.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def _is_logged(level):
out = current.output
if out is None:
return True
return out._xmllogger._log_message_is_logged(level)
return out._is_logged(level)


class TestRunnerAgent:
Expand Down
16 changes: 8 additions & 8 deletions src/robotide/editor/editordialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ def __init__(self, controller, item=None, plugin=None, title=None):
self._create_buttons()
self.SetSizer(self._sizer)
self._sizer.Fit(self)
self.Layout()
self._editors[0].set_focus()

def _add_comment_editor(self, item):
Expand All @@ -75,10 +76,11 @@ def _create_line(self):
self._sizer.Add(line, 0, wx.GROW | wx.ALIGN_CENTER_VERTICAL | wx.RIGHT | wx.TOP, 5)
else:
self._sizer.Add(line, 0, wx.GROW | wx.RIGHT | wx.TOP, 5)
self._sizer.Fit(self)

def _create_help(self):
self._sizer.Add(HelpLabel(self, label=get_help(self._title)),
flag=wx.ALL, border=2)
self._sizer.Add(HelpLabel(self, label=get_help(self._title)), flag=wx.ALL, border=2)
self._sizer.Fit(self)

def _create_buttons(self, **kwargs):
buttons = self.CreateStdDialogButtonSizer(wx.OK | wx.CANCEL)
Expand All @@ -91,6 +93,7 @@ def _create_buttons(self, **kwargs):
item.SetForegroundColour(Colour(self.color_secondary_foreground))
item.SetOwnForegroundColour(Colour(self.color_secondary_foreground))
self._sizer.Add(buttons, 0, wx.ALIGN_CENTER | wx.ALL, 5)
self._sizer.Fit(self)

def get_value(self):
return [e.get_value() for e in self._editors]
Expand Down Expand Up @@ -127,8 +130,7 @@ def _get_editors(self, var):
value = var.value if var and var.value else ''
validator = ListVariableNameValidator(self._controller, name)
return [VariableNameEditor(self, name, _('Name'), validator),
ListValueEditor(self, value, _('Value'),
settings=self.plugin.global_settings)]
ListValueEditor(self, value, _('Value'), settings=self.plugin.global_settings)]

def _execute(self):
""" Just ignore it """
Expand All @@ -142,8 +144,7 @@ def _get_editors(self, var):
value = var.value if var and var.value else ''
validator = DictionaryVariableNameValidator(self._controller, name)
return [VariableNameEditor(self, name, _('Name'), validator),
ListValueEditor(self, value, _('Value'),
settings=self.plugin.global_settings)]
ListValueEditor(self, value, _('Value'), settings=self.plugin.global_settings)]

def _execute(self):
""" Just ignore it """
Expand All @@ -160,8 +161,7 @@ def _get_editors(self, item):
alias = item.alias if item else ''
self._suggester = LibrariesSuggester(self._controller, self._history_suggester)
return [FileNameEditor(self, name, _('Name'), self._controller, suggestion_source=self._suggester),
ValueEditor(self, args, _('Args')),
ValueEditor(self, alias, _('Alias'))]
ValueEditor(self, args, _('Args')), ValueEditor(self, alias, _('Alias'))]

def get_value(self):
values = _Dialog.get_value(self)
Expand Down
2 changes: 2 additions & 0 deletions src/robotide/editor/fieldeditors.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ def __init__(self, parent, value, label=None, validator=None,
if validator:
self.set_validator(validator)
self.SetSizer(self._sizer)
self._sizer.Fit(self)
self.Layout()

def _create_editor(self, value, label, settings):
sizer = wx.BoxSizer(wx.HORIZONTAL)
Expand Down
2 changes: 1 addition & 1 deletion src/robotide/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
# limitations under the License.
#
# Automatically generated by `tasks.py`.
VERSION = 'v2.1dev11'
VERSION = 'v2.1dev12'
8 changes: 7 additions & 1 deletion src/robotide/widgets/dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ def __init__(self, title='', parent=None, size=None, style=None, message=None):
self.SetForegroundColour(Colour(self.color_foreground))
if self.message:
sizer = wx.BoxSizer(wx.VERTICAL)
self.SetSizer(sizer)
content = wx.StaticText(self, -1, self.message)
button = wx.Button(self, wx.ID_OK, '', style=style)
content.SetBackgroundColour(Colour(self.color_background))
Expand All @@ -119,6 +118,8 @@ def __init__(self, title='', parent=None, size=None, style=None, message=None):
sizer.Add(content, 0, wx.ALL | wx.EXPAND, 3)
sizer.Add(wx.StaticText(self, -1, "\n\n"), 0, wx.ALL, 3)
sizer.Add(button, 0, wx.ALIGN_CENTER | wx.BOTTOM, 5)
self.SetSizer(sizer)
sizer.Fit(self)
self.CenterOnParent()

def _create_buttons(self, sizer):
Expand All @@ -132,13 +133,15 @@ def _create_buttons(self, sizer):
item.SetForegroundColour(Colour(self.color_secondary_foreground))
item.SetOwnForegroundColour(Colour(self.color_secondary_foreground))
sizer.Add(buttons, flag=wx.ALIGN_CENTER | wx.ALL, border=5)
sizer.Fit(self)

def _create_horizontal_line(self, sizer):
line = wx.StaticLine(self, size=(20, -1), style=wx.LI_HORIZONTAL)
if wx.VERSION < (4, 1, 0):
sizer.Add(line, border=5, flag=wx.GROW | wx.ALIGN_CENTER_VERTICAL | wx.RIGHT | wx.TOP)
else:
sizer.Add(line, border=5, flag=wx.GROW | wx.RIGHT | wx.TOP)
sizer.Fit(self)

def execute(self):
retval = None
Expand All @@ -162,10 +165,13 @@ def __init__(self, title, content, padding=0, font_size=-1):
# set Left to Right direction (while we don't have localization)
self.SetLayoutDirection(wx.Layout_LeftToRight)
szr = sizers.VerticalSizer()
self.SetMinClientSize((200, 300))
self.html_wnd = HtmlWindow(self, text=content)
self.html_wnd.SetStandardFonts(size=font_size)
szr.add_expanding(self.html_wnd, padding=padding)
self.SetSizer(szr)
szr.Fit(self)
self.Layout()

def on_key(self, event):
""" In the event we need to process key events"""
Expand Down
14 changes: 6 additions & 8 deletions tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,8 @@
code = compile(f.read(), "version.py", 'exec')
exec(code)

FINAL_RELEASE = bool(re.match("^(\d*\.){1,2}\d*$", VERSION))
wxPythonDownloadUrl = \
"https://wxpython.org/"
FINAL_RELEASE = bool(re.match("^(\\d*\\.){1,2}\\d*$", VERSION))
wxPythonDownloadUrl = "https://wxpython.org/"


# Developemnt tasks
Expand Down Expand Up @@ -226,10 +225,10 @@ def update_robot(ctx, _version=''):
ctx.run('cp -r ../robotframework/src/robot src/robotide/lib/')
# Prevent .pyc matching grep expressions
_clean()
_run_sed_on_matching_files(ctx, 'from robot\..* import', 's/from robot\./from robotide.lib.robot./')
_run_sed_on_matching_files(ctx, 'from robot\\..* import', 's/from robot\\./from robotide.lib.robot./')
_run_sed_on_matching_files(ctx, 'from robot import', 's/from robot import/from robotide.lib.robot import/')
with open(join(ROBOTIDE_PACKAGE, 'lib', 'robot-commit'), 'w') as rf_version_file:
rf_version_file.write('{}\n'.format(rf_commit_hash))
rf_version_file.write('{}\\n'.format(rf_commit_hash))
_log('Updated bundled Robot Framework to version {}/{}'.format(target, rf_commit_hash))


Expand All @@ -239,8 +238,7 @@ def generate_big_project(ctx, _install=False, upgrade=False, args=''):
_ = ctx
_remove_bytecode_files()
if _install or upgrade:
rfgen_url = \
"https://raw.github.com/robotframework/Generator/master/rfgen.py"
rfgen_url = "https://raw.github.com/robotframework/Generator/master/rfgen.py"
_log("Installing/upgrading rfgen.py from github.")
_f = open('rfgen.py', 'wb')
_f.write(urllib.urlopen(rfgen_url).read())
Expand Down Expand Up @@ -437,7 +435,7 @@ def _clean(keep_dist=False):

def _remove_bytecode_files():
for d in SOURCE_DIR, TEST_DIR:
_remove_files_matching(d, r'.*\.pyc')
_remove_files_matching(d, r'.*\\.pyc')


def _remove_files_matching(directory, pattern):
Expand Down
Loading