diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 8dc7dc1ba..a397fbc91 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -10,9 +10,14 @@ on: # default: "v0.4.0" upload_to_pypi: type: boolean - description: Whether the artifacts should be uploaded to PyPI + description: Should upload required: false - default: false + default: true + test_pypi: + type: boolean + description: Use Test PyPI + required: false + default: true jobs: build_wheels: @@ -71,7 +76,17 @@ jobs: path: dist - uses: pypa/gh-action-pypi-publish@release/v1 + if: github.event.inputs.test_pypi == 'false' with: user: __token__ password: ${{ secrets.PYPI_API_TOKEN }} verbose: true + + - uses: pypa/gh-action-pypi-publish@release/v1 + if: github.event.inputs.test_pypi == 'true' + with: + repository-url: https://test.pypi.org/legacy/ + user: __token__ + password: ${{ secrets.TESTPYPI_API_TOKEN }} + verbose: true + diff --git a/pyproject.toml b/pyproject.toml index 738c6f79c..43e97359d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -48,7 +48,7 @@ before-all = [ "unzip scip.zip", "mv scip_install scip" ] -environment = { SCIPOPTDIR="$(pwd)/scip", LD_LIBRARY_PATH="$(pwd)/scip/lib:$LD_LIBRARY_PATH", DYLD_LIBRARY_PATH="$(pwd)/scip/lib:$DYLD_LIBRARY_PATH", PATH="$(pwd)/scip/bin:$PATH", PKG_CONFIG_PATH="$(pwd)/scip/lib/pkgconfig:$PKG_CONFIG_PATH"} +environment = { SCIPOPTDIR="$(pwd)/scip", LD_LIBRARY_PATH="$(pwd)/scip/lib:$LD_LIBRARY_PATH", DYLD_LIBRARY_PATH="$(pwd)/scip/lib:$DYLD_LIBRARY_PATH", PATH="$(pwd)/scip/bin:$PATH", PKG_CONFIG_PATH="$(pwd)/scip/lib/pkgconfig:$PKG_CONFIG_PATH", RELEASE="true"} [tool.cibuildwheel.macos] @@ -64,7 +64,7 @@ fi unzip scip.zip mv scip_install src/scip ''' -environment = {SCIPOPTDIR="$(pwd)/src/scip", LD_LIBRARY_PATH="$(pwd)/src/scip/lib:LD_LIBRARY_PATH", DYLD_LIBRARY_PATH="$(pwd)/src/scip/lib:$DYLD_LIBRARY_PATH", PATH="$(pwd)/src/scip/bin:$PATH", PKG_CONFIG_PATH="$(pwd)/src/scip/lib/pkgconfig:$PKG_CONFIG_PATH"} +environment = {SCIPOPTDIR="$(pwd)/src/scip", LD_LIBRARY_PATH="$(pwd)/src/scip/lib:LD_LIBRARY_PATH", DYLD_LIBRARY_PATH="$(pwd)/src/scip/lib:$DYLD_LIBRARY_PATH", PATH="$(pwd)/src/scip/bin:$PATH", PKG_CONFIG_PATH="$(pwd)/src/scip/lib/pkgconfig:$PKG_CONFIG_PATH", RELEASE="true"} repair-wheel-command = [ "delocate-listdeps {wheel}", "delocate-wheel --require-archs {delocate_archs} -w {dest_dir} {wheel}", @@ -81,5 +81,5 @@ before-all = [ "mv .\\test .\\scip" ] before-build = "pip install delvewheel" -environment = { SCIPOPTDIR='D:\\a\\PySCIPOpt\\PySCIPOpt\\scip' } +environment = { SCIPOPTDIR='D:\\a\\PySCIPOpt\\PySCIPOpt\\scip', RELEASE="true" } repair-wheel-command = "delvewheel repair --add-path c:/bin;c:/lib;c:/bin/src;c:/lib/src;D:/a/PySCIPOpt/PySCIPOpt/scip/;D:/a/PySCIPOpt/PySCIPOpt/scip/lib/;D:/a/PySCIPOpt/PySCIPOpt/scip/bin/ -w {dest_dir} {wheel}" diff --git a/setup.py b/setup.py index 7918c17dd..9424b5749 100644 --- a/setup.py +++ b/setup.py @@ -85,7 +85,7 @@ on_github_actions = os.getenv('GITHUB_ACTIONS') == 'true' -release_mode = os.getenv('SCIPOPTSUITE_VERSION') is not None +release_mode = os.getenv('RELEASE') == 'true' compile_with_line_tracing = on_github_actions and not release_mode extensions = [ diff --git a/tests/test_model.py b/tests/test_model.py index d50437417..96e7e51a9 100644 --- a/tests/test_model.py +++ b/tests/test_model.py @@ -345,7 +345,7 @@ def test_setLogFile_none(): os.remove(log_file_name) def test_locale(): - on_release = os.getenv('SCIPOPTSUITE_VERSION') is not None + on_release = os.getenv('RELEASE') is not None if on_release: pytest.skip("Skip this test on release builds")