Skip to content

Commit 79753d5

Browse files
authored
Merge pull request #37 from scikit-build/36-support-running-as-module
Add support for running ninja as python module
2 parents 4f7bc49 + b59e967 commit 79753d5

File tree

6 files changed

+34
-6
lines changed

6 files changed

+34
-6
lines changed

.circleci/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ references:
2828

2929
x64_build_job: &x64_build_job
3030
docker:
31-
- image: dockcross/manylinux-x64
31+
- image: dockcross/manylinux1-x64
3232
<<: *ci_steps
3333

3434
x86_build_job: &x86_build_job
3535
docker:
36-
- image: dockcross/manylinux-x86
36+
- image: dockcross/manylinux1-x86
3737
<<: *ci_steps
3838

3939
no_filters: &no_filters

.travis.yml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,38 @@ matrix:
1111
- os: osx
1212
language: generic
1313
env:
14-
- PYTHON_VERSION=3.7.2
14+
- PYTHON_VERSION=3.7.8
1515

1616
- os: osx
1717
language: generic
1818
env:
1919
- PYTHON_VERSION=2.7.15
2020

21+
before_cache:
22+
# Cleanup to avoid the cache to grow indefinitely as new package versions are released
23+
# see https://stackoverflow.com/questions/39930171/cache-brew-builds-with-travis-ci
24+
- brew cleanup
25+
2126
cache:
2227
directories:
23-
- $HOME/.pyenv/versions/3.7.2
28+
# Cache downloaded bottles
29+
- $HOME/Library/Caches/Homebrew
30+
# pyenv
31+
- $HOME/.pyenv_cache
32+
- $HOME/.pyenv/versions/3.7.8
2433
- $HOME/.pyenv/versions/2.7.15
34+
# scikit-ci-addons
2535
- $HOME/downloads
2636

2737
before_install:
38+
- |
39+
# Workaround the following error occuring because python installation is cached but gettext dependency is not
40+
# dyld: Library not loaded: /usr/local/opt/gettext/lib/libintl.8.dylib
41+
# Referenced from: /Users/travis/.pyenv/versions/3.7.2/bin/python
42+
# Reason: Incompatible library version: python requires version 11.0.0 or later, but libintl.8.dylib provides version 10.0.0
43+
if [[ "$TRAVIS_OS_NAME" == "osx" && "${PYTHON_VERSION}" == "3.7.8" ]]; then
44+
brew install gettext
45+
fi
2846
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then mkdir $HOME/bin; ln -s $(which pip2) $HOME/bin/pip; ln -s $(which python2) $HOME/bin/python; fi
2947
- python -m pip install --disable-pip-version-check --upgrade pip
3048
- pip install -U scikit-ci scikit-ci-addons

ninja/__main__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
from ninja import ninja
2+
3+
if __name__ == '__main__':
4+
ninja()

requirements-dev.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ scikit-build>=0.10.0
1010
setuptools>=28.0.0
1111
twine
1212
virtualenv>=15.0.3
13-
wheel==0.31.1
13+
wheel>=0.34
1414
wheeltools

scikit-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ build:
5151
commands:
5252
- |
5353
# Since there are no external shared libraries to bundle into the wheels
54-
# this step will fixup the wheel switching from 'linux' to 'manylinux1' tag
54+
# this step will fixup the wheel switching from 'linux' to 'manylinux' tag
5555
for whl in dist/*$(python -c "import wheel.pep425tags as w; print(w.get_platform())").whl; do
5656
auditwheel repair $whl -w ./dist/
5757
rm $whl

tests/test_ninja.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11

22
import pytest
3+
import subprocess
4+
import sys
35

46
import ninja
57

@@ -16,3 +18,7 @@ def _run(program, args):
1618

1719
def test_ninja_module():
1820
_run("ninja", ["--version"])
21+
22+
23+
def test_ninja_package():
24+
subprocess.check_call([sys.executable, "-m", "ninja", "--version"])

0 commit comments

Comments
 (0)