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

Keep support for python 3.6 and 3.7 #811

Closed
wants to merge 1 commit into from
Closed
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
8 changes: 4 additions & 4 deletions packaging/_pyyaml_pep517.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,17 @@ def current(cls):


def _expose_config_settings(real_method, *args, **kwargs):
from contextlib import nullcontext
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nullcontext was introduced in python 3.7

from contextlib import ExitStack
import inspect

sig = inspect.signature(real_method)
boundargs = sig.bind(*args, **kwargs)

config = boundargs.arguments.get('config_settings')

ctx = ActiveConfigSettings(config) if config else nullcontext()

with ctx:
with ExitStack() as stack:
if config:
stack.enter_context(ActiveConfigSettings(config))
return real_method(*args, **kwargs)


Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ def build_extensions(self):
if with_ext is not None and not with_ext:
continue
if with_cython:
print(f"BUILDING CYTHON EXT; {self.include_dirs=} {self.library_dirs=} {self.define=}")
Copy link
Author

@woutdenolf woutdenolf Jun 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this f-string syntax was introduced in python 3.8

print(f"BUILDING CYTHON EXT; include_dirs={self.include_dirs} library_dirs={self.library_dirs} define={self.define}")
ext.sources = self.cython_sources(ext.sources, ext)
try:
self.build_extension(ext)
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py38,py39,py310,py311,py312
envlist = py36,py37,py38,py39,py310,py311,py312

[testenv]
deps =
Expand Down