-
-
Notifications
You must be signed in to change notification settings - Fork 100
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
Dropping Python2 support schedule and what to do #392
Comments
I'd propose to also drop support for Python 3.6 (supporting only non-EOL Pythons, currently 3.7+), especially because the existing releases will continue to support Python 2.7 and older 3.x versions. |
On further consideration, I notice that current releases don't advertise their supported Python versions. Before cutting a release dropping support, this project should cut a release declaring support. |
I see you're working on this. That's great. I have a suggestion - let's put something like:
In setup.cfg. |
I agree. One of the major differences between Python3.6 and 3.7 is that the syntax for asynchronous processing has changed( Backward compatibility and wide availability of versions is great, but the fact that the latest features are not available is a barrier to entry for newcomers. It would be beneficial to the community to sort out the EOL Python problems. |
Those are great suggestions 👍! This is a package with a long history, so precedent was may being followed. The introduction of modern ways of doing things is great. |
Since there seems to be no objection, I will create the
|
I made In case of developments based on supporting only Python3, please use those. I will post the related issue and revise this issue kanban shortly. |
I would remove the However, the Why is
|
A "Summary of changes" has been added to the kanban to summarize the current progress and work to date. |
If "type hints in dynamically defined modules"(#400) were implemented to the ...
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from typing import Optional, Tuple
...
class IPicture(IUnknown):
"""Picture Object"""
if TYPE_CHECKING:
@property
def Handle(self) -> int: ...
@property
def hPal(self) -> int: ...
@hPal.setter
def hPal(self, phpal: int) -> None: ...
@property
def Type(self) -> int: ...
@property
def Width(self) -> int: ...
@property
def Height(self) -> int: ...
def Render(self, hdc: int, x: int, y: int, cx: int, cy: int, xSrc: int, ySrc: int, cxSrc: int, cySrc: int, prcWBounds: Optional[int]) -> int: ...
@property
def CurDC(self) -> int: ...
def SelectPicture(self, hdcIn: int) -> Tuple[int, int]: ...
@property
def KeepOriginalFormat(self) -> bool: ...
@KeepOriginalFormat.setter
def KeepOriginalFormat(self, pfkeep: bool) -> None: ...
def PictureChanged(self) -> int: ...
def SaveAsFile(self, pstm: Optional[int], fSaveMemCopy: bool) -> int: ...
@property
def Attributes(self) -> int: ...
def SetHdc(self, hdc: int) -> int: ...
_case_insensitive_ = True
_iid_ = GUID('{7BF80980-BF32-101A-8BBB-00AA00300CAB}')
_idlflags_ = ['hidden']
... (Argument and return types need a little more scrutiny) `stdole.IPicture._methods_` definitionIPicture._methods_ = [
COMMETHOD(
['propget'],
HRESULT,
'Handle',
(['out', 'retval'], POINTER(OLE_HANDLE), 'phandle')
),
COMMETHOD(
['propget'],
HRESULT,
'hPal',
(['out', 'retval'], POINTER(OLE_HANDLE), 'phpal')
),
COMMETHOD(
['propget'],
HRESULT,
'Type',
(['out', 'retval'], POINTER(c_short), 'ptype')
),
COMMETHOD(
['propget'],
HRESULT,
'Width',
(['out', 'retval'], POINTER(OLE_XSIZE_HIMETRIC), 'pwidth')
),
COMMETHOD(
['propget'],
HRESULT,
'Height',
(['out', 'retval'], POINTER(OLE_YSIZE_HIMETRIC), 'pheight')
),
COMMETHOD(
[],
HRESULT,
'Render',
(['in'], c_int, 'hdc'),
(['in'], c_int, 'x'),
(['in'], c_int, 'y'),
(['in'], c_int, 'cx'),
(['in'], c_int, 'cy'),
(['in'], OLE_XPOS_HIMETRIC, 'xSrc'),
(['in'], OLE_YPOS_HIMETRIC, 'ySrc'),
(['in'], OLE_XSIZE_HIMETRIC, 'cxSrc'),
(['in'], OLE_YSIZE_HIMETRIC, 'cySrc'),
(['in'], c_void_p, 'prcWBounds')
),
COMMETHOD(
['propput'],
HRESULT,
'hPal',
(['in'], OLE_HANDLE, 'phpal')
),
COMMETHOD(
['propget'],
HRESULT,
'CurDC',
(['out', 'retval'], POINTER(c_int), 'phdcOut')
),
COMMETHOD(
[],
HRESULT,
'SelectPicture',
(['in'], c_int, 'hdcIn'),
(['out'], POINTER(c_int), 'phdcOut'),
(['out'], POINTER(OLE_HANDLE), 'phbmpOut')
),
COMMETHOD(
['propget'],
HRESULT,
'KeepOriginalFormat',
(['out', 'retval'], POINTER(VARIANT_BOOL), 'pfkeep')
),
COMMETHOD(
['propput'],
HRESULT,
'KeepOriginalFormat',
(['in'], VARIANT_BOOL, 'pfkeep')
),
COMMETHOD([], HRESULT, 'PictureChanged'),
COMMETHOD(
[],
HRESULT,
'SaveAsFile',
(['in'], c_void_p, 'pstm'),
(['in'], VARIANT_BOOL, 'fSaveMemCopy'),
(['out'], POINTER(c_int), 'pcbSize')
),
COMMETHOD(
['propget'],
HRESULT,
'Attributes',
(['out', 'retval'], POINTER(c_int), 'pdwAttr')
),
COMMETHOD(
[],
HRESULT,
'SetHdc',
(['in'], OLE_HANDLE, 'hdc')
),
] If an executable method is defined, we must write an implementation to pass args to the method defined by metaclass. So I will define each method and property under |
The last major version of supporting Python 2.7 ( I added the "Summary of changes" to the kanban of this issue to explain what will change from |
I noticed that the ITrackingHandler._methods_ = [
COMMETHOD(
[dispid(1610743808)],
HRESULT,
'MarshaledObject',
(['in'], VARIANT, 'obj'),
(['in'], POINTER(_ObjRef), 'or')
),
COMMETHOD(
[dispid(1610743809)],
HRESULT,
'UnmarshaledObject',
(['in'], VARIANT, 'obj'),
(['in'], POINTER(_ObjRef), 'or')
),
COMMETHOD(
[dispid(1610743810)],
HRESULT,
'DisconnectedObject',
(['in'], VARIANT, 'obj')
),
] Since When generating function annotations for methods with such arguments, I am trying to implement them so that memo
|
Such as the They are not compatible with the Python language specifications. IAccessible._methods_ = [
...
COMMETHOD(
[dispid(-5003), 'hidden', 'propget'],
HRESULT,
'accName',
(['in', 'optional'], VARIANT, 'varChild'),
(['out', 'retval'], POINTER(BSTR), 'pszName')
),
...
COMMETHOD(
[dispid(-5003), 'hidden', 'propput'],
HRESULT,
'accName',
(['in', 'optional'], VARIANT, 'varChild'),
(['in'], BSTR, 'pszName')
),
...
] Range._disp_methods_ = [
...
DISPMETHOD(
[dispid(6), 'propget'],
VARIANT,
'Value',
(['in', 'optional'], VARIANT, 'RangeValueDataType')
),
...
DISPMETHOD(
[dispid(6), 'propput'],
None,
'Value',
(['in', 'optional'], VARIANT, 'RangeValueDataType'),
(['in'], VARIANT, 'rhs')
),
...
] To avoid Honestly, a more complex callback or |
When I did As PEP561, we have to make it explicit in I don't think it is urgent as it is not an error at runtime, but I will write a PR so that we can resolve it at the same time when fix runtime bugs or next release. |
From #216 (comment),
|
Unless there are regression reports, I am considering releasing version |
Thank you for all participants! |
Overviews
This package still supports Python 2.7.
However, it is planned to end support for Python2.7 in #216.
The timing is mid-2023 or maybe even earlier.
And by discussions in this issue, it is planned to support only non-EOL Pythons(3.7+) at drop-2.7 timing.
This issue will close when a version is released that no longer supports Python 2.7.
The community guidelines up to the dropping Python2 support
master
branch would be in maintenance-only-mode. Except for fixing regressions, new contributions to codebase and documentation should be merged into thedrop_py2
branch.drop_py2
.black==22.12.0
, and format the codebase that you changed before submitting PR.black
with--check --diff --color
.How to add
drop_py2
branch to your forked local and remote repositorygit remote add upstream git://github.com/enthought/comtypes.git
git fetch upstream
git checkout -b drop_py2 upstream/drop_py2
git push origin drop_py2
To track current progress
See
drop_py2
labeled issues or PRs and the milestone for current status.Summary of changes
Release title should be "1.3.0 Dropping Python 2.7 support and fix ancient bugs"
Schedule
From #216 (comment),
Miscellaneous
This kanban will be updated as the situation requires.
Any opinions would be appreciated.
The text was updated successfully, but these errors were encountered: