Skip to content

Commit bf870c1

Browse files
authored
Merge pull request #23 from pycompression/fixrtd
Fix readthedocs build
2 parents 55e8b1a + 9b3c8f9 commit bf870c1

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

.readthedocs.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@ build:
1414
os: "ubuntu-22.04"
1515
tools:
1616
python: "3"
17-
apt_packages:
18-
- python3
19-
- python3-pip
20-
- cmake
21-
- git
22-
- googletest
17+
18+
# Make sure zlib-ng is cloned alongside
19+
submodules:
20+
include: all

CHANGELOG.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ Changelog
99
1010
version 0.3.0-dev
1111
-----------------
12+
+ Source distributions on Linux now default to building with configure and
13+
make as it is faster and has less dependencies than CMake.
1214
+ Python 3.12 support was added. Python 3.7 support was dropped as it is end
1315
of life.
1416
+ Enabled installation on BSD

setup.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,7 @@
3939
class BuildZlibNGExt(build_ext):
4040
def build_extension(self, ext):
4141
# Add option to link dynamically for packaging systems such as conda.
42-
# Always link dynamically on readthedocs to simplify install.
43-
if (os.getenv("PYTHON_ZLIB_NG_LINK_DYNAMIC") is not None or
44-
os.environ.get("READTHEDOCS") is not None):
42+
if os.getenv("PYTHON_ZLIB_NG_LINK_DYNAMIC") is not None:
4543
# Check for zlib_ng include directories. This is useful when
4644
# installing in a conda environment.
4745
possible_prefixes = [sys.exec_prefix, sys.base_exec_prefix]
@@ -108,6 +106,9 @@ def build_zlib_ng():
108106
if sys.platform == "darwin": # Cmake does not work properly
109107
subprocess.run([os.path.join(build_dir, "configure")], **run_args)
110108
subprocess.run(["gmake", "libz-ng.a"], **run_args)
109+
elif sys.platform == "linux":
110+
subprocess.run([os.path.join(build_dir, "configure")], **run_args)
111+
subprocess.run(["make", "libz-ng.a", "-j", str(cpu_count)], **run_args)
111112
else:
112113
subprocess.run(["cmake", build_dir], **run_args)
113114
# Do not create test suite and do not perform tests to shorten build times.

0 commit comments

Comments
 (0)