Skip to content
This repository has been archived by the owner on Feb 24, 2024. It is now read-only.

Commit

Permalink
Travis build
Browse files Browse the repository at this point in the history
  • Loading branch information
dimiter committed Oct 29, 2019
1 parent 66e243c commit 44701af
Show file tree
Hide file tree
Showing 8 changed files with 70 additions and 112 deletions.
9 changes: 6 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@ python:
- 3.6
- 3.5
- 3.4
- 2.7
install: pip install -U tox-travis
script: tox
install:
- docker pull quay.io/pypa/manylinux1_x86_64

script:
- docker run --rm -e PLAT=manylinux2010_x86_64 -v `pwd`:/io quay.io/pypa/manylinux2010_x86_64:latest /io/build_wheels.sh

deploy:
provider: pypi
distributions: sdist bdist_wheel
Expand Down
3 changes: 0 additions & 3 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,3 @@ pylint = "*"
pytest = "*"
isort = "*"
black = "==19.3b0"

[packages]
xmlstarlet_cffi = {path = ".", editable = true}
111 changes: 34 additions & 77 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions build_wheels.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash
set -e -x

# Install a system package required by our library
yum install -y libxslt-devel

# Compile wheels
for PYBIN in /opt/python/*/bin; do
"${PYBIN}/pip" install -r /io/requirements.txt
"${PYBIN}/pip" wheel /io/ -w wheelhouse/
done

# Bundle external shared libraries into the wheels
for whl in wheelhouse/*.whl; do
auditwheel repair "$whl" --plat $PLAT -w /io/wheelhouse/
done

# Install packages and test
for PYBIN in /opt/python/*/bin/; do
"${PYBIN}/pip" install xmlstarlet --no-index -f /io/wheelhouse
(cd "$HOME"; "${PYBIN}/pytest" -v)
done
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

requirements = ["cffi>=1.0.0"]

setup_requirements = ["pytest-runner", "cffi>=1.0.0"]
setup_requirements = ["pytest-runner", "setuptools", "wheel", "cffi>=1.0.0"]

test_requirements = ["pytest"]

Expand Down
27 changes: 2 additions & 25 deletions tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def clean_tests(c):
shutil.rmtree(COVERAGE_DIR, ignore_errors=True)


@task(pre=[clean_build, clean_python, clean_c, clean_tests, clean_docs])
@task(pre=[clean_build, clean_python, clean_tests, clean_docs])
def clean(c):
"""
Runs all clean sub-tasks
Expand All @@ -163,31 +163,8 @@ def clean(c):

@task
def dist_c(c):
c.run(
"cd libxml2 "
"&& autoreconf -sif "
"&& ./configure "
"--prefix=/usr "
"--without-lzma "
"&& make -j "
# "&& make tests || true "
"; cd .."
)
c.run(
"cd libxslt "
"&& autoreconf -sif "
"&& ./configure "
"--prefix=/usr "
"--with-libxml-src=$(pwd)/../libxml2 "
"&& make -j "
# "&& make tests || true "
"; cd .."
)
c.run("cd xmlstar "
"&& autoreconf -sif "
"&& ./configure "
"--with-libxml-src=$(pwd)/../libxml2 "
"--with-libxslt-src=$(pwd)/../libxslt "
"--enable-static-libs "
"--enable-maintainer-mode "
"--prefix=/usr "
Expand All @@ -197,7 +174,7 @@ def dist_c(c):



@task(pre=[dist_c])
@task
def dist(c):
"""
Build source and wheel packages
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ setenv =
deps =
pipenv
commands_pre = pipenv install --dev
commands = invoke clean dist test
commands = invoke dist test
6 changes: 4 additions & 2 deletions xmlstarlet_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@
C_SOURCE_DIR = os.path.relpath(os.path.join(ROOT_DIR, "xmlstar"), ROOT_DIR)

LIBRARIES = ["xml2", "xslt", "exslt"]
LIBRARY_DIRS = ["/usr/lib64"]
SOURCES = [
os.path.relpath(s, ROOT_DIR)
for s in glob(os.path.join(ROOT_DIR, C_SOURCE_DIR, "src", "*"))
if s.endswith(".c")
]
INCLUDE_DIRS = [
os.path.join(ROOT_DIR, "libxml2", "include"),
os.path.join(ROOT_DIR, "libxslt"),
"/usr/include",
"/usr/include/libxml2",
os.path.join(ROOT_DIR, C_SOURCE_DIR),
os.path.join(ROOT_DIR, C_SOURCE_DIR, "src"),
]
Expand Down Expand Up @@ -57,6 +58,7 @@
sources=SOURCES,
include_dirs=INCLUDE_DIRS,
libraries=LIBRARIES,
library_dirs=LIBRARY_DIRS,
)


Expand Down

0 comments on commit 44701af

Please sign in to comment.