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

Update SLICOT to 5.7 with BSD license #152

Merged
merged 17 commits into from
Feb 21, 2021
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
17 changes: 14 additions & 3 deletions .github/workflows/slycot-build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,31 @@ jobs:

build-setup:
# Super fast sniff build. If this fails, don't start the other jobs
name: Build setup.py on Ubuntu
name: Build sdist on Ubuntu
runs-on: ubuntu-latest
steps:
- name: Checkout Slycot
uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: 'recursive'
- name: Set up Python
uses: actions/setup-python@v2
- name: Setup Ubuntu
run: |
sudo apt-get -y install gfortran cmake --fix-missing
sudo apt-get -y install libblas-dev liblapack-dev
pip install scikit-build numpy scipy pytest
- name: Install Slycot
run: python setup.py install
- name: Create Slycot sdist
run: python setup.py sdist

- name: Install Slycot sdist
run: |
mkdir cleancwd
cd cleancwd
tar xfz ../dist/slycot-*.tar.gz
cd slycot-*
python setup.py install
- name: Run tests
run: pytest

Expand Down Expand Up @@ -71,6 +80,7 @@ jobs:
uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: 'recursive'
- name: Set up Python
uses: actions/setup-python@v2
with:
Expand Down Expand Up @@ -139,6 +149,7 @@ jobs:
uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: 'recursive'
- name: Setup Conda
uses: conda-incubator/setup-miniconda@v2
with:
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "slycot/src/SLICOT-Reference"]
path = slycot/src/SLICOT-Reference
url = https://github.com/bnavigator/SLICOT-Reference
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ include slycot/*.py
include slycot/version.py.in
include slycot/src/*.f
include slycot/tests/*.py

graft slycot/src/SLICOT-Reference
9 changes: 9 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -194,3 +194,12 @@ Importing ``slycot`` or running ``pytest`` without ``--pyargs slycot`` from
inside the source directory will fail, unless the compiled wrapper library has
been installed into that directory. Note that the ``[tool:pytest]`` section
in ``setup.cfg`` enforces the ``--pyargs slycot`` argument by default.

License
-------
Up until version 0.4, Slycot used a version of SLICOT that was released under
the GPLv2 license. This requires Slycot to be released under the same license. In
December 2020, SLICOT 5.7 was released under BSD-3-Clause. However, as the
existing Slycot wrappers have been submitted by many contributors, we cannot
move away from GPLv2 unless we get the permission to do so by all authors.
Thus, Slycot remains licensed under GPLv2 until further notice.
30 changes: 29 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,34 @@ def get_version_info(srcdir=None):

return FULLVERSION, GIT_REVISION


def check_submodules():
""" verify that the submodules are checked out and clean
use `git submodule update --init`; on failure
"""
if not os.path.exists('.git'):
return
with open('.gitmodules') as f:
for l in f:
if 'path' in l:
p = l.split('=')[-1].strip()
if not os.path.exists(p):
raise ValueError('Submodule %s missing' % p)

proc = subprocess.Popen(['git', 'submodule', 'status'],
stdout=subprocess.PIPE)
status, _ = proc.communicate()
status = status.decode("ascii", "replace")
for line in status.splitlines():
if line.startswith('-') or line.startswith('+'):
raise ValueError('Submodule not clean: %s' % line)


class sdist_checked(sdist):
""" check submodules on sdist to prevent incomplete tarballs """
def run(self):
# slycot had no submodules currently
check_submodules()
sdist.run(self)

def setup_package():
src_path = os.path.dirname(os.path.abspath(__file__))
Expand All @@ -210,6 +237,7 @@ def setup_package():
license='GPL-2.0',
classifiers=[_f for _f in CLASSIFIERS.split('\n') if _f],
platforms=["Windows", "Linux", "Solaris", "Mac OS-X", "Unix"],
cmdclass={"sdist": sdist_checked},
cmake_args=['-DSLYCOT_VERSION:STRING=' + VERSION,
'-DGIT_REVISION:STRING=' + gitrevision,
'-DISRELEASE:STRING=' + str(ISRELEASED),
Expand Down
Loading