diff --git a/README.md b/README.md index 48fce71..b5a878d 100644 --- a/README.md +++ b/README.md @@ -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 ``` diff --git a/setup.py b/setup.py index d530948..ee5fd2b 100644 --- a/setup.py +++ b/setup.py @@ -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 = {} diff --git a/tox.ini b/tox.ini index 8a4a4ff..3209004 100644 --- a/tox.ini +++ b/tox.ini @@ -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 @@ -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 @@ -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 @@ -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