Skip to content

Commit 67e24fb

Browse files
authored
Merge pull request #73 from thatch/thatch/nogil
Allow building with nogil
2 parents 3236d6e + 0ff0748 commit 67e24fb

9 files changed

Lines changed: 21 additions & 14 deletions

File tree

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313

1414
strategy:
1515
matrix:
16-
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
16+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
1717

1818
steps:
1919
- uses: actions/checkout@v4

portable-python.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
include: +pp-dev.yml
66

77
folders:
8-
build: "build/{family}-{version}" # Allows keeping builds per versions, and inspect them in parallel
8+
build: "build/{family}-{version}{abi_suffix}" # Allows keeping builds per versions, and inspect them in parallel
99

1010
# For quick iteration locally, you can add this to your pp-dev.yml:
1111
#folders:

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
click~=8.0
22
pyyaml~=6.0
33
requests<3.0
4-
runez~=5.0
4+
runez~=5.5
55
urllib3~=1.26

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
author="Zoran Simic zoran@simicweb.com",
88
keywords="python, portable, binary",
99
url="https://github.com/codrsquad/portable-python",
10-
python_requires=">=3.9",
10+
python_requires=">=3.10",
1111
entry_points={
1212
"console_scripts": [
1313
"portable-python = portable_python.__main__:main",
@@ -22,11 +22,11 @@
2222
"Operating System :: Unix",
2323
"Programming Language :: Python",
2424
"Programming Language :: Python :: 3",
25-
"Programming Language :: Python :: 3.9",
2625
"Programming Language :: Python :: 3.10",
2726
"Programming Language :: Python :: 3.11",
2827
"Programming Language :: Python :: 3.12",
2928
"Programming Language :: Python :: 3.13",
29+
"Programming Language :: Python :: 3.14",
3030
"Programming Language :: Python :: Implementation :: CPython",
3131
"Topic :: Software Development :: Build Tools",
3232
"Topic :: System :: Installation/Setup",

src/portable_python/__init__.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,9 @@ def __init__(self, python_spec=None, modules=None, prefix=None):
222222
runez.abort("Please provide full desired version: %s is not good enough" % runez.red(python_spec))
223223

224224
self.python_spec = python_spec
225-
self.folders = PPG.get_folders(base=os.getcwd(), family=python_spec.family, version=python_spec.version)
225+
self.folders = PPG.get_folders(
226+
base=os.getcwd(), family=python_spec.family, version=python_spec.version, abi_suffix=python_spec.abi_suffix
227+
)
226228
self.desired_modules = modules
227229
prefix = self.folders.formatted(prefix)
228230
self.prefix = prefix
@@ -237,7 +239,9 @@ def __init__(self, python_spec=None, modules=None, prefix=None):
237239
self.tarball_name = PPG.target.composed_basename(dest, extension=ext)
238240

239241
else:
240-
self.tarball_name = PPG.target.composed_basename(python_spec.family, python_spec.version, extension=ext)
242+
self.tarball_name = PPG.target.composed_basename(
243+
python_spec.family, python_spec.version, abi_suffix=python_spec.abi_suffix, extension=ext
244+
)
241245

242246
builder = PPG.family(python_spec.family).get_builder()
243247
self.python_builder = builder(self) # type: PythonBuilder

src/portable_python/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
destdir: "{build}"
1818
dist: dist
1919
logs: "{build}/logs"
20-
ppp-marker: /ppp-marker/{version}
20+
ppp-marker: /ppp-marker/{version}{abi_suffix}
2121
sources: build/sources
2222
2323
manifest:

src/portable_python/cpython.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,9 @@ def c_configure_args(self):
172172
yield f"-ltcl{version.mm}"
173173
yield f"-ltk{version.mm}"
174174

175+
if self.setup.python_spec.freethreading:
176+
yield "--disable-gil"
177+
175178
def xenv_LIBZSTD_CFLAGS(self):
176179
if self.version >= "3.14" and PPG.target.is_macos:
177180
# Normally ./configure will autodetect using pkg-config, but
@@ -199,7 +202,7 @@ def xenv_LIBMPDEC_LIBS(self):
199202
@runez.cached_property
200203
def prefix_lib_folder(self):
201204
"""Path to <prefix>/lib/pythonM.m folder"""
202-
return self.install_folder / f"lib/python{self.version.mm}"
205+
return self.install_folder / f"lib/python{self.version.mm}{self.setup.python_spec.abi_suffix}"
203206

204207
@runez.cached_property
205208
def prefix_config_folder(self):

src/portable_python/versions.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,13 +117,13 @@ def get_builder(self):
117117

118118

119119
class Folders:
120-
def __init__(self, config: Config, base=None, family=None, version=None):
120+
def __init__(self, config: Config, base=None, family=None, version=None, abi_suffix=None):
121121
self.config = config
122122
self.base_folder = runez.resolved_path(base)
123123
self.family = family
124124
self.version = Version.from_object(version)
125125
self.mm = self.version and self.version.mm
126-
self.completions = config.completions(family=family, version=version, mm=self.mm)
126+
self.completions = config.completions(family=family, version=version, mm=self.mm, abi_suffix=abi_suffix or "")
127127
self.build_folder = self._get_path("build")
128128
self.completions["build"] = self.build_folder
129129
self.components = self.build_folder / "components"
@@ -197,9 +197,9 @@ def grab_config(cls, paths=None, target=None):
197197
cls.target = cls.config.target
198198

199199
@classmethod
200-
def get_folders(cls, base=None, family="cpython", version=None):
200+
def get_folders(cls, base=None, family="cpython", version=None, abi_suffix=None):
201201
config = cls.config or Config()
202-
return Folders(config, base=base, family=family, version=version)
202+
return Folders(config, base=base, family=family, version=version, abi_suffix=abi_suffix)
203203

204204
@classmethod
205205
def family(cls, family_name, fatal=True) -> VersionFamily:

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = py{310,311,312,313}, coverage, docs, style
2+
envlist = py{310,311,312,313,314}, coverage, docs, style
33
skip_missing_interpreters = true
44

55
[testenv]

0 commit comments

Comments
 (0)