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

Add patch for use with Python 3.11 #34

Merged
merged 2 commits into from
Oct 25, 2022
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 .circleci/config.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion .scripts/build_steps.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 22 additions & 8 deletions LICENSE.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

45 changes: 36 additions & 9 deletions README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 13 additions & 6 deletions build-locally.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ source:
- patches/gh94.patch
- patches/gh95.patch
- patches/gh96.patch
- patches/0001-Fix-Python-3.11-by-removing-use-of-sysconfig._is_pyt.patch

build:
number: 7
number: 8
noarch: python
script: {{ PYTHON }} -m pip install . -vv

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
From a8daf66c07ba9e23c6cdae85c799111a3e3bb4a4 Mon Sep 17 00:00:00 2001
From: Chris Burr <[email protected]>
Date: Tue, 25 Oct 2022 13:46:35 +0200
Subject: [PATCH] Fix Python 3.11 by removing use of
sysconfig._is_python_source_dir

---
crossenv/__init__.py | 4 ++--
crossenv/utils.py | 7 +++++++
2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/crossenv/__init__.py b/crossenv/__init__.py
index d12fd82..9821b12 100644
--- a/crossenv/__init__.py
+++ b/crossenv/__init__.py
@@ -16,7 +16,7 @@ import platform
import pprint
import re

-from .utils import F
+from .utils import F, is_python_source_dir
from . import utils

__version__ = '1.3.0'
@@ -245,7 +245,7 @@ class CrossEnvBuilder(venv.EnvBuilder):
else:
self.host_project_base = os.path.dirname(host)

- if sysconfig._is_python_source_dir(self.host_project_base):
+ if is_python_source_dir(self.host_project_base):
self.host_makefile = os.path.join(self.host_project_base, 'Makefile')
pybuilddir = os.path.join(self.host_project_base, 'pybuilddir.txt')
try:
diff --git a/crossenv/utils.py b/crossenv/utils.py
index 4c048ae..9a22708 100644
--- a/crossenv/utils.py
+++ b/crossenv/utils.py
@@ -125,3 +125,10 @@ def install_script(name, dst, context=None, perms=0o755):

with overwrite_file(dst, perms=perms) as fp:
fp.write(src)
+
+
+def is_python_source_dir(d):
+ for fn in ("Setup", "Setup.local"):
+ if os.path.isfile(os.path.join(d, "Modules", fn)):
+ return True
+ return False
--
2.38.1