Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Now picks up Windows Ipopt binary files that are adjacent to setup.py (restores regression) #220

Merged
merged 19 commits into from
Sep 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
channels: conda-forge
miniforge-variant: Mambaforge
- name: Install basic dependencies
run: mamba install -y -v lapack "libblas=*=*netlib" cython>=0.26 "ipopt=${{ matrix.ipopt-version }}" numpy>=1.15 pkg-config>=0.29.2 setuptools>=39.0 --file docs/requirements.txt
run: mamba install -y -v lapack "libblas=*=*netlib" "cython>=0.26,<3" "ipopt=${{ matrix.ipopt-version }}" numpy>=1.15 pkg-config>=0.29.2 setuptools>=39.0 --file docs/requirements.txt
- name: Install CyIpopt
run: |
rm pyproject.toml
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ jobs:
miniforge-variant: Mambaforge
- name: Install basic dependencies
run: |
mamba install -q -y lapack "libblas=*=*netlib" cython>=0.26 "ipopt=${{ matrix.ipopt-version }}" numpy>=1.15 pkg-config>=0.29.2 setuptools>=39.0
mamba install -q -y lapack "libblas=*=*netlib" "ipopt=${{ matrix.ipopt-version }}" "numpy>=1.15" "pkg-config>=0.29.2" "setuptools>=39.0" "cython=0.29.*"
- run: echo "IPOPTWINDIR=USECONDAFORGEIPOPT" >> $GITHUB_ENV
- name: Install CyIpopt
run: |
rm pyproject.toml
Expand All @@ -45,7 +46,7 @@ jobs:
run: |
python -c "import cyipopt"
mamba remove lapack
mamba install -q -y cython>=0.26 "ipopt=${{ matrix.ipopt-version }}" numpy>=1.15 pkg-config>=0.29.2 setuptools>=39.0 pytest>=3.3.2
mamba install -q -y "ipopt=${{ matrix.ipopt-version }}" "numpy>=1.15" "pkg-config>=0.29.2" "setuptools>=39.0" "pytest>=3.3.2" "cython=0.29.*"
mamba list
pytest
- name: Test with pytest and scipy, new ipopt
Expand All @@ -54,6 +55,6 @@ jobs:
# Ipopt needed different libfortrans.
if: (matrix.ipopt-version != '3.12' && matrix.python-version != '3.11') || (matrix.ipopt-version != '3.12' && matrix.python-version != '3.10' && matrix.os != 'macos-latest')
run: |
mamba install -q -y -c conda-forge "cython>=0.26" "ipopt=${{ matrix.ipopt-version }}" "numpy>=1.15" "pkg-config>=0.29.2" "setuptools>=39.0" "scipy=1.9.*" "pytest>=3.3.2"
mamba install -q -y -c conda-forge "ipopt=${{ matrix.ipopt-version }}" "numpy>=1.15" "pkg-config>=0.29.2" "setuptools>=39.0" "scipy=1.9.*" "pytest>=3.3.2" "cython=0.29.*"
mamba list
pytest
26 changes: 26 additions & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: windows

on: [push, pull_request]

# cancels prior builds for this workflow when new commit is pushed
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
name: Manually install on Windows with Ipopt binaries
runs-on: windows-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- run: python -m pip install numpy "cython<3" setuptools
- run: Invoke-WebRequest -Uri "https://github.com/coin-or/Ipopt/releases/download/releases%2F3.13.3/Ipopt-3.13.3-win64-msvs2019-md.zip" -OutFile "Ipopt-3.13.3-win64-msvs2019-md.zip"
- run: 7z x Ipopt-3.13.3-win64-msvs2019-md.zip
- run: mv Ipopt-3.13.3-win64-msvs2019-md/* .
- run: python setup.py install
- run: python examples/hs071.py
8 changes: 8 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,18 @@ def handle_ext_modules_general_os():
# environment variable is set to USECONDAFORGEIPOPT then this setup will be
# run.
if sys.platform == "win32" and ipoptdir == "USECONDAFORGEIPOPT":
print('Using Conda Forge Ipopt on Windows.')
ext_module_data = handle_ext_modules_win_32_conda_forge_ipopt()
elif sys.platform == "win32" and ipoptdir:
print('Using Ipopt in {} directory on Windows.'.format(ipoptdir))
ext_module_data = handle_ext_modules_win_32_other_ipopt()
elif sys.platform == "win32" and not ipoptdir:
ipoptdir = os.path.abspath(os.path.dirname(__file__))
msg = 'Using Ipopt adjacent to setup.py in {} on Windows.'
print(msg.format(ipoptdir))
ext_module_data = handle_ext_modules_win_32_other_ipopt()
else:
print('Using Ipopt found with pkg-config.')
ext_module_data = handle_ext_modules_general_os()
EXT_MODULES, DATA_FILES, include_package_data = ext_module_data
# NOTE : The `name` kwarg here is the distribution name, i.e. the name that
Expand Down