Skip to content

Commit 3f01c95

Browse files
authored
Merge pull request #30 from pycompression/macos
Add macos to ci.yml
2 parents 605a2d3 + d9f70fe commit 3f01c95

File tree

4 files changed

+42
-9
lines changed

4 files changed

+42
-9
lines changed

.github/workflows/ci.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,22 @@ jobs:
8282
- name: Upload coverage report
8383
if: ${{ matrix.python-version == 3.6 && matrix.linking_method == 'static'}} # Only upload coverage once
8484
uses: codecov/codecov-action@v1
85+
86+
macos:
87+
runs-on: macos-latest
88+
needs: lint
89+
steps:
90+
- name: Install python 3.6
91+
uses: actions/[email protected]
92+
with:
93+
submodules: recursive
94+
- name: Set up Python 3.6
95+
uses: actions/[email protected]
96+
with:
97+
python-version: 3.6
98+
- name: Install tox and upgrade setuptools and pip
99+
run: pip install --upgrade tox setuptools pip
100+
- name: Install build dependencies
101+
run: brew install yasm automake autoconf
102+
- name: Run tests
103+
run: tox -e py3

CHANGELOG.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ Changelog
77
.. This document is user facing. Please word the changes in such a way
88
.. that users understand how the changes affect the new version.
99
10+
version 0.3.1-dev
11+
-----------------
12+
+ Make a tiny change in setup.py so python-isal can be build on Mac OS X.
13+
1014
version 0.3.0
1115
-----------------
1216
+ Set included ISA-L library at version 2.30.0.

README.rst

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,19 @@ Installation
4747
------------
4848
Installation with pip
4949
.....................
50-
Python-isal can be installed with::
5150

52-
pip install isal
53-
54-
This will include a staticallly linked version of isa-l. On Linux, wheels
55-
are provided. If a wheel is not provided for your system the installation will
56-
build ISA-L first in a temporary directory. Please check the `ISA-L homepage
57-
<https://github.com/intel/isa-l>`_ for the build requirements.
51+
+ Linux: ``pip install isal``. Wheels are provided, so installation should
52+
be almost instantaneous.
53+
+ MacOS: make sure ``gcc``, ``yasm``, ``automake`` and ``autoconf`` packages
54+
are installed. These can be installed via `Homebrew <https://brew.sh/>`_ with
55+
``brew install gcc yasm automake autoconf``. Then proceed with ``pip
56+
install isal``. The package will be build on your computer.
57+
+ Windows: Installation is not supported yet.
58+
59+
The installation will include a staticallly linked version of isa-l. On Linux,
60+
wheels are provided. If a wheel is not provided for your system the
61+
installation will build ISA-L first in a temporary directory. Please check the
62+
`ISA-L homepage <https://github.com/intel/isa-l>`_ for the build requirements.
5863

5964
The latest development version of python-isal can be installed with::
6065

setup.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,15 @@ def build_isa_l():
9797
build_env = os.environ.copy()
9898
# Add -fPIC flag to allow static compilation
9999
build_env["CFLAGS"] = build_env.get("CFLAGS", "") + " -fPIC"
100-
100+
if hasattr(os, "sched_getaffinity"):
101+
cpu_count = len(os.sched_getaffinity(0))
102+
else: # sched_getaffinity not available on all platforms
103+
cpu_count = os.cpu_count() or 1 # os.cpu_count() can return None
101104
run_args = dict(cwd=build_dir, env=build_env)
102105
subprocess.run(os.path.join(build_dir, "autogen.sh"), **run_args)
103106
subprocess.run([os.path.join(build_dir, "configure"),
104107
"--prefix", temp_prefix], **run_args)
105-
subprocess.run(["make", "-j", str(len(os.sched_getaffinity(0)))],
108+
subprocess.run(["make", "-j", str(cpu_count)],
106109
**run_args)
107110
subprocess.run(["make", "install"], **run_args)
108111
shutil.rmtree(build_dir)
@@ -142,6 +145,8 @@ def build_isa_l():
142145
"Development Status :: 3 - Alpha",
143146
"Topic :: System :: Archiving :: Compression",
144147
"License :: OSI Approved :: MIT License",
148+
"Operating System :: POSIX :: Linux",
149+
"Operating System :: MacOS"
145150
],
146151
python_requires=">=3.6",
147152
ext_modules=[

0 commit comments

Comments
 (0)