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

Commit

Permalink
Simplified
Browse files Browse the repository at this point in the history
  • Loading branch information
Dimiter Naydenov committed Oct 29, 2019
1 parent f885a23 commit 1f95bb5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 35 deletions.
38 changes: 5 additions & 33 deletions tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,12 @@ def clean_build(c):
"""
c.run("rm -fr build/")
c.run("rm -fr dist/")
c.run(
"rm -fr xmlstarlet/config.h " "xmlstarlet/Makefile " "xmlstarlet/config.status"
)
c.run("rm -fr .eggs/")
c.run("find . -name '*.egg-info' -exec rm -fr {} +")
c.run("find . -name '*.egg' -exec rm -f {} +")
c.run("python setup.py sdist")


@task
Expand All @@ -130,20 +132,6 @@ def clean_python(c):
c.run("find . -name '__pycache__' -exec rm -fr {} +")


@task
def clean_c(c):
"""
Clean up C file artifacts
"""
c.run("cd xmlstar")
c.run("make maintainer-clean-am || true")
c.run("rm -f Makefile.in Makefile configure config.* config.h.in~ aclocal.m4")
c.run("rm -f install-sh test-driver missing depcomp compile")
c.run("cd ..")
c.run("cd libxml2 && make distclean || true && cd ..")
c.run("cd libxslt && make distclean || true && cd ..")


@task
def clean_tests(c):
"""
Expand All @@ -162,33 +150,17 @@ def clean(c):
pass


@task
def dist_c(c):
c.run(
"cd xmlstar "
"&& autoreconf -sif "
"--enable-static-libs "
"--enable-maintainer-mode "
"--prefix=/usr "
"&& make -j "
# "&& make tests || true "
"; cd .."
)


@task
def dist(c):
"""
Build source and wheel packages
"""
c.run("python setup.py sdist")
c.run("python setup.py bdist_wheel")
c.run("python setup.py develop")
c.run("python setup.py sdist bdist_wheel")


@task(pre=[clean, dist])
def release(c):
"""
Make a release of the python package to pypi
"""
c.run("twine upload --verbose dist/*")
c.run("twine check --verbose dist/* && twine upload --verbose dist/*")
5 changes: 3 additions & 2 deletions xmlstarlet/xmlstarlet_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@
print(
subprocess.getoutput(
"set -xe && cd xmlstarlet/ "
"&& (test -f config.h || (test -f configure && ./configure)) "
"&& make -j && make check && set +xe && cd .. "
"&& (test -f config.h && make -j && make check) "
"|| (test -f configure && ./configure --prefix=/usr) "
"&& (make -j && make check) && set +xe && cd .. "
)
)

Expand Down

0 comments on commit 1f95bb5

Please sign in to comment.