Skip to content

Fix readthedocs build #23

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

Merged
merged 7 commits into from
Dec 22, 2023
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
10 changes: 4 additions & 6 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ build:
os: "ubuntu-22.04"
tools:
python: "3"
apt_packages:
- python3
- python3-pip
- cmake
- git
- googletest

# Make sure zlib-ng is cloned alongside
submodules:
include: all
2 changes: 2 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ Changelog

version 0.3.0-dev
-----------------
+ Source distributions on Linux now default to building with configure and
make as it is faster and has less dependencies than CMake.
+ Python 3.12 support was added. Python 3.7 support was dropped as it is end
of life.
+ Enabled installation on BSD
Expand Down
7 changes: 4 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@
class BuildZlibNGExt(build_ext):
def build_extension(self, ext):
# Add option to link dynamically for packaging systems such as conda.
# Always link dynamically on readthedocs to simplify install.
if (os.getenv("PYTHON_ZLIB_NG_LINK_DYNAMIC") is not None or
os.environ.get("READTHEDOCS") is not None):
if os.getenv("PYTHON_ZLIB_NG_LINK_DYNAMIC") is not None:
# Check for zlib_ng include directories. This is useful when
# installing in a conda environment.
possible_prefixes = [sys.exec_prefix, sys.base_exec_prefix]
Expand Down Expand Up @@ -108,6 +106,9 @@ def build_zlib_ng():
if sys.platform == "darwin": # Cmake does not work properly
subprocess.run([os.path.join(build_dir, "configure")], **run_args)
subprocess.run(["gmake", "libz-ng.a"], **run_args)
elif sys.platform == "linux":
subprocess.run([os.path.join(build_dir, "configure")], **run_args)
subprocess.run(["make", "libz-ng.a", "-j", str(cpu_count)], **run_args)
else:
subprocess.run(["cmake", build_dir], **run_args)
# Do not create test suite and do not perform tests to shorten build times.
Expand Down