Skip to content

Commit

Permalink
build: PYRFC_BUILD_CYTHON env var for cythonizing
Browse files Browse the repository at this point in the history
  • Loading branch information
bsrdjan committed May 13, 2023
1 parent 68a8c60 commit 6e8ad48
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ cd PyRFC
python -m pip install .
# or
python -m build --wheel --sdist --outdir dist
# or
PYRFC_BUILD_CYTHON=yes python -m build --wheel --sdist --outdir dist
pip install --upgrade --no-index --find-links=dist pyrfc
```

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
PACKAGE_NAME = "pyrfc"
MODULE_NAME = "_cyrfc"

build_cython = sys.platform.startswith("linux")
build_cython = sys.platform.startswith("linux") or bool(os.environ.get("PYRFC_BUILD_CYTHON"))

# build from source on Linux
CMDCLASS = {}
Expand Down
13 changes: 8 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@ minversion = 4.5
envlist =
format, lint, docs, reuse, sdist, pack,
py38, py39, py310, py311
package = wheel
skip_missing_interpreters = false
isolated_build = true

[testenv:.pkg]
passenv = SAPNWRFC_HOME
passenv = SAPNWRFC_HOME, PYRFC_BUILD_CYTHON

[testenv]
description = Build binary wheels and run unit tests
passenv = SAPNWRFC_HOME
passenv = SAPNWRFC_HOME, PYRFC_BUILD_CYTHON
deps =
build
Cython
Expand All @@ -24,12 +25,13 @@ commands =
python -m build --wheel --outdir dist
# unit test
python -m pytest tests --testdox --html-report=./report {posargs}
# python -c "import pyrfc; print(pyrfc.__version__)"

[testenv:sdist]
description = Build sdist
platform = linux
skip_install = true
passenv = SAPNWRFC_HOME
passenv = SAPNWRFC_HOME, PYRFC_BUILD_CYTHON
deps =
Cython
build
Expand All @@ -47,7 +49,8 @@ deps = sphinx
commands =
sphinx-build -b html -a -E -d {envtmpdir}/doctrees . {envtmpdir}/html
# git checkout gh-pages
# yes | cp -Rf {env_tmp_dir}/html/. .
# yes | cp -Rf {envtmpdir}/html/. .


[testenv:format]
description = Run formatter
Expand Down Expand Up @@ -102,7 +105,7 @@ commands =
description = Build the test package, a prep for unit tests
platform = darwin
skip_install = true
passenv = SAPNWRFC_HOME
passenv = SAPNWRFC_HOME, PYRFC_BUILD_CYTHON
allowlist_externals =
find
tar
Expand Down

0 comments on commit 6e8ad48

Please sign in to comment.