Skip to content

Commit

Permalink
Drop Python 3.7 support
Browse files Browse the repository at this point in the history
  • Loading branch information
Avasam committed Mar 14, 2024
1 parent 06b006d commit 74f1db0
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 39 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ max_line_length = 88 # Same as Black
[*.md]
trim_trailing_whitespace = false

[*.{yaml,yml}]
[*.{yaml,yml,json}]
indent_size = 2
5 changes: 2 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12-dev']
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12-dev']
architecture: ['x64', 'x86']

steps:
Expand Down Expand Up @@ -116,7 +116,6 @@ jobs:
strategy:
fail-fast: false
matrix:
# mypy 1.5 dropped support for python 3.7
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v3
Expand All @@ -131,7 +130,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
Expand Down
4 changes: 1 addition & 3 deletions .isort.cfg
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
[isort]
py_version = 37
py_version = 38
profile = black
combine_as_imports = true
skip = setup.py
# TODO: Decide if this is wanted:
# combine_straight_imports = true
3 changes: 1 addition & 2 deletions Pythonwin/pywin/test/test_pywin.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ def setUpClass(cls):
def _restore_oe():
sys.stdout, sys.stderr = cls.std_oe_orig

if sys.version_info >= (3, 8):
cls.addClassCleanup(_restore_oe)
cls.addClassCleanup(_restore_oe)
sys.argv[1:] = ["/new", src_dir + "\\_dbgscript.py"]
if not _indebugger:
thisApp.InitInstance()
Expand Down
4 changes: 0 additions & 4 deletions build_all.bat
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
py -3.7-32 setup.py -q build
@if errorlevel 1 goto failed
py -3.7 setup.py -q build
@if errorlevel 1 goto failed
py -3.8-32 setup.py -q build
@if errorlevel 1 goto failed
py -3.8 setup.py -q build
Expand Down
5 changes: 1 addition & 4 deletions com/win32com/test/pippo_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,7 @@ def Method3(self, in1):


def BuildTypelib():
if sys.version_info >= (3, 8):
from setuptools.modified import newer
else:
from distutils.dep_util import newer
from setuptools.modified import newer

this_dir = os.path.dirname(__file__)
idl = os.path.abspath(os.path.join(this_dir, "pippo.idl"))
Expand Down
5 changes: 0 additions & 5 deletions make_all.bat
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@ py autoduck\make.py
rem Now the binaries.

rem (bdist_wininst needs --target-version to name the installers correctly!)
py -3.7-32 setup.py -q bdist_wininst --skip-build --target-version=3.7
py -3.7-32 setup.py -q bdist_wheel --skip-build
py -3.7 setup.py -q bdist_wininst --skip-build --target-version=3.7
py -3.7 setup.py -q bdist_wheel --skip-build

py -3.8-32 setup.py -q bdist_wininst --skip-build --target-version=3.8
py -3.8-32 setup.py -q bdist_wheel --skip-build
py -3.8 setup.py -q bdist_wininst --skip-build --target-version=3.8
Expand Down
2 changes: 1 addition & 1 deletion mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
show_column_numbers = true
warn_unused_ignores = true
; Target the oldest supported version in editors
python_version = 3.7
python_version = 3.8

strict = false
implicit_reexport = true
Expand Down
2 changes: 1 addition & 1 deletion pyrightconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"typeCheckingMode": "basic",
// Target the oldest supported version in editors
"pythonVersion": "3.7",
"pythonVersion": "3.8",
// Keep it simple for now by allowing both mypy and pyright to use `type: ignore`
"enableTypeIgnoreComments": true,
// Exclude from scanning when running pyright
Expand Down
11 changes: 3 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,10 @@
from setuptools.command.build_ext import build_ext
from setuptools.command.install import install
from setuptools.command.install_lib import install_lib
from setuptools.modified import newer_group

from distutils.command.install_data import install_data

if sys.version_info >= (3, 8):
from setuptools.modified import newer_group
else:
from distutils.dep_util import newer_group

# some modules need a static CRT to avoid problems caused by them having a
# manifest.
static_crt_modules = ["winxpgui"]
Expand Down Expand Up @@ -947,8 +943,8 @@ def install(self):
# This is crazy - in setuptools 61.1.0 (and probably some earlier versions), the
# install_lib and build comments don't agree on where the .py files to install can
# be found, so we end up with a warning logged:
# `warning: my_install_lib: 'build\lib.win-amd64-3.7' does not exist -- no Python modules to install`
# (because they are actually in `build\lib.win-amd64-cpython-37`!)
# `warning: my_install_lib: 'build\lib.win-amd64-3.8' does not exist -- no Python modules to install`
# (because they are actually in `build\lib.win-amd64-cpython-38`!)
# It's not an error though, so we end up with .exe installers lacking our lib files!
builder = self.get_finalized_command("build")
if os.path.isdir(builder.build_platlib) and not os.path.isdir(self.build_dir):
Expand Down Expand Up @@ -2248,7 +2244,6 @@ def convert_optional_data_files(files):
"Intended Audience :: Developers",
"License :: OSI Approved :: Python Software Foundation License",
"Operating System :: Microsoft :: Windows",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
Expand Down
7 changes: 0 additions & 7 deletions win32/src/_win32sysloader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,9 @@ static PyObject *PyLoadModule(PyObject *self, PyObject *args)
if (!modName)
return NULL;

// Python 3.7 vs 3.8 use different flags for LoadLibraryEx and we match them.
// See github issue 1787.
#if (PY_VERSION_HEX < 0x03080000)
HINSTANCE hinst = LoadLibraryEx(modName, NULL,
LOAD_WITH_ALTERED_SEARCH_PATH);
#else
HINSTANCE hinst = LoadLibraryEx(modName, NULL,
LOAD_LIBRARY_SEARCH_DEFAULT_DIRS |
LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR);
#endif
PyMem_Free(modName);
if (hinst == NULL) {
Py_INCREF(Py_None);
Expand Down

0 comments on commit 74f1db0

Please sign in to comment.