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

TVB-3110: 3rd party dependencies licences #734

Merged
merged 4 commits into from
Nov 25, 2024
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
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ interact with TVB Web Graphical Interface.
### Testing

For testing our packages, PyTest framework can be used. We also need a few more dependencies for tests specific,
which are listed in setup.py files.
which are listed in pyproject.toml files.

Pytest will run all files in the current directory and its subdirectories
of the form test_*.py or *_test.py.
Expand All @@ -100,16 +100,16 @@ The command for running our tests has two forms:
2. The second alternative form of running TVB tests, when installing TVB from Pypi, is:

pip install -U tvb-framework
# install optional dependencies needed just for tests (search "extras_require" in tvb_framework/setup.py)
# install optional dependencies needed just for tests (search "extras_require" in tvb_framework/pyproject.toml)
pip install pytest pytest-benchmark pytest-mock BeautifulSoup4
pytest --pyargs tvb.tests.framework

pip install -U tvb-library
# install optional dependencies (from variable LIBRARY_REQUIRED_EXTRA in tvb_library/setup.py)
# install optional dependencies (from variable LIBRARY_REQUIRED_EXTRA in tvb_library/pyproject.toml)
pip install h5py pytest pytest-benchmark pytest-xdist tvb-gdist tvb-data
pytest --pyargs tvb.tests.library

- For all the tests to run correctly, the dependencies specified as LIBRARY_REQUIRED_EXTRA in [setup.py](https://github.com/the-virtual-brain/tvb-root/blob/master/tvb_library/setup.py) should be installed
- For all the tests to run correctly, the dependencies specified as LIBRARY_REQUIRED_EXTRA in [pyproject.toml](https://github.com/the-virtual-brain/tvb-root/blob/master/tvb_library/pyproject.toml) should be installed
- Make sure that tvb-data package is installed from [Zenodo](https://zenodo.org/record/10128131)

### Coverage
Expand Down
2 changes: 1 addition & 1 deletion tvb_build/Jenkinsfile-TVBRun
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pipeline {
unstash 'step1'
unzip zipFile: 'tvb_build/build/TVB_build_step1.zip', dir: 'tvb_build/docker/step1'
script {
VERSION_TAG = sh(script: "curl -s 'https://raw.githubusercontent.com/the-virtual-brain/tvb-root/master/tvb_framework/setup.py' | grep VERSION | head -1 | tr -d 'VERSION = \"'", returnStdout: true). trim()
VERSION_TAG = sh(script: "curl -s 'https://raw.githubusercontent.com/the-virtual-brain/tvb-root/master/tvb_framework/pyproject.toml' | awk '/\\[project\\]/ {found=1} found && /version/ {print; exit}' | tr -d '\"' | awk -F'=' '{print \$2}'", returnStdout: true).trim()
LAST_SHA = sh(script: "curl -s 'https://api.github.com/repos/the-virtual-brain/tvb-root/commits' | grep sha | head -1 | cut -d ':' -f2 | tr -d '\",'", returnStdout: true).trim()

def dockerContext = "tvb_build/docker"
Expand Down
2 changes: 1 addition & 1 deletion tvb_build/docker/requirements_group
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
numpy<2
siibra
cryptography
sqlalchemy
pyAesCrypt
Expand Down Expand Up @@ -49,7 +50,6 @@ lxml
pylems
docutils
Pillow
siibra
bctpy
kubernetes
watchdog
Expand Down
18 changes: 16 additions & 2 deletions tvb_build/tvb_build/third_party_licenses/build_licenses.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,20 @@
\n\n\n"


def parse_versions(str_versions: str):
versions = str_versions[1:-1].split(',')
parsed_versions = []
temp = ''
paren_level = 0
for version in versions:
paren_level += version.count('(') - version.count(')')
temp = temp + ',' + version if temp else version
if paren_level == 0:
parsed_versions.append(temp)
temp = ''
return parsed_versions


def _invalid_version(expected, actual):
"""
Check if current found version of 3rd party library is
Expand All @@ -86,7 +100,7 @@ def _invalid_version(expected, actual):
if actual.startswith(expected):
return False
if expected.startswith('['):
expected = expected[1:-1].split(',')
expected = parse_versions(expected)
return actual not in expected
return True

Expand Down Expand Up @@ -169,7 +183,7 @@ def generate_artefact(root_folder_to_introspect, excludes=None, actual_libs=None
# Run stand-alone.
all_libs = parser.read_default()
to_exclude = []
for libname, libattr in all_libs.iteritems():
for libname, libattr in all_libs.items():
if 'Desktop' in libattr["description"] or 'unused' in libattr['env']:
to_exclude.append(libname)
all_libs[libname] = libattr["version"]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Copyright (c) 2012 Omoto Kenji
Copyright (c) 2011 Sam Stephenson
Copyright (c) 2011 Josh Peek

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
(This is the MIT license)
(This is the MIT license, note that libffi-src is a separate product with its own license)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
Copyright 2002, 2003 - Bill Bumgarner, Ronald Oussoren, Steve Majewski, Lele Gaifax, et.al.
Copyright 2003-2024 - Ronald Oussoren

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
This project is licensed under the ISC License, reproduced below.

Copyright (c) 2013-2014, Aaron Jacobs <[email protected]>

Permission to use, copy, modify, and/or distribute this software for any purpose
with or without fee is hereby granted, provided that the above copyright notice
and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
THIS SOFTWARE.
Loading
Loading