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

GitHub workflow #140

Merged
merged 7 commits into from
Jan 30, 2021
Merged

Conversation

bnavigator
Copy link
Collaborator

@bnavigator bnavigator commented Dec 30, 2020

See https://github.com/bnavigator/Slycot/tree/github-workflow for the GitHub Actions results.

Tasks:

  • Ubuntu

    • setup.py install
    • Conda
    • Pip
  • macOS

    • Conda
    • Pip
  • Windows

    • Conda
  • Python Versions: 3.6 to 3.9

  • Streamline LAPACK linking. The conda-forge packages nowadays always link against the reference implementation but you can use a different one (=the same as numpy) during runtime.

  • do Add CI test for import slycot; slycot.test #137 : Test slycot.test()

Builds on #143

@@ -0,0 +1,3 @@
$PYTHON setup.py build_ext install -- \
-DNumPy_INCLUDE_DIR=${SP_DIR}/numpy/core/include \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just filed scikit-build/scikit-build#524 because I think scikit-build should find the venv numpy before system numpy.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This recipe is taken from the conda-forge feedstock.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we sure the problem is not the fiddling with the python path in

Slycot/CMakeLists.txt

Lines 21 to 32 in 055e9d6

# base site dir, use python installation for location specific includes
execute_process(
COMMAND "${PYTHON_EXECUTABLE}" -c
"import os,numpy; print(os.path.dirname(numpy.__path__[0]))"
OUTPUT_VARIABLE PYTHON_SITE
OUTPUT_STRIP_TRAILING_WHITESPACE)
if(WIN32)
string(REPLACE "\\" "/" PYTHON_SITE ${PYTHON_SITE})
endif()
find_package(PythonLibs REQUIRED)
find_package(NumPy REQUIRED)
?

find_package(NumPy ) is not a scikit-build feature but from CMake.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

find_package(NumPy ) is not a scikit-build feature but from CMake.

I am wrong here. Scikit-build's FindNumpy is a different thing than FindPython with NumPy component from CMake.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool - that find_package finds the right thing without extra magic. I've noted that on the scikit-build issue.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might not help us (see my comment linking to the disussion there), because it sets different output variables in cmake. We need to find the correct f2py too. I was experimenting with FindF2PY from scikit-build yesterday. Curious if all the old windows hacks in setup.py and the CMake files are still necessary. They do not seem to work for my setup in the workflow so far.

@roryyorke
Copy link
Collaborator

Thanks for working on this!

It looks like this PR will drop Python <= 3.5 (I think Numpy is about to go >= 3.7 anyway); I think that's worth explicitly noting.

@bnavigator
Copy link
Collaborator Author

It looks like this PR will drop Python <= 3.5 (I think Numpy is about to go >= 3.7 anyway); I think that's worth explicitly noting.

See also python-control/python-control#481

@bnavigator
Copy link
Collaborator Author

  • Streamline conda recipes / sync with conda-forge feedstock?
  • Streamline LAPACK linking? The conda-forge packages nowadays always link against the reference implementation but you can use a different one (=the same as numpy) during runtime.

@repagh, I remember that prior to the 0.4.0 release you advocated for keeping these different conda recipes. Is this still true? Do we need to test them all?

@bnavigator bnavigator force-pushed the github-workflow branch 3 times, most recently from 56de0c9 to 9abde05 Compare January 11, 2021 20:06
@bnavigator bnavigator force-pushed the github-workflow branch 2 times, most recently from 6c47df1 to 8c216a3 Compare January 11, 2021 22:06
@bnavigator bnavigator marked this pull request as ready for review January 11, 2021 23:03
@roryyorke
Copy link
Collaborator

This looks good, but I'm in no position to review the details. One thing I did wonder about: why are the test matrices generated by scripts, and not known upfront?

Will we remove Travis CI config after this is merged?

For anyone else reviewing, you can see output here: https://github.com/bnavigator/Slycot/actions

The warnings there seem to be due to a third-party package; @bnavigator has already queried it conda-incubator/setup-miniconda#132 (comment)

Given that free Travis CI is disappearing, I think we should merge this. @murrayrm , @repagh, objections?

@bnavigator
Copy link
Collaborator Author

why are the test matrices generated by scripts, and not known upfront?

The test matrix generation is based upon which wheel and conda packages are created. With all the exceptions and special cases for combinations of OS and LAPACK implementation, statically defining the matrices would be very complicated.

@murrayrm
Copy link
Member

No objections to merging on my end. I note that the full CI build seems to take ~30 minutes, but of course it is testing on all sorts of different configurations and OS's.

@bnavigator
Copy link
Collaborator Author

Most of the time is wasted by the conda resolver. Especially on Windows. This could be fixed be a frozen environment, which we update manually, but that is maybe something for another PR.

@roryyorke roryyorke merged commit a070bbb into python-control:master Jan 30, 2021
@bnavigator bnavigator deleted the github-workflow branch May 3, 2022 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add CI test for import slycot; slycot.test Consider switching CI to Github Workflows, include Windows
3 participants