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

docs: Update guide for SCANOSS install on Ubuntu 24 #595

Closed

Conversation

o-konoval
Copy link
Collaborator

@o-konoval o-konoval commented Sep 5, 2024

Additional steps need for install SCANOSS on Ubuntu 23.04, Fedora 38, Debian 11, etc.

Pull Request

Description

Additional steps need for install SCANOSS on Ubuntu 23.04, Fedora 38, Debian 11, etc.
These steps included in this PR that update documentation.

Fixes # (issue)
Users with last versions of OSes like Ubuntu may have problems with installing SCANOSS following current Guide.
Additional instructions for these users added.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Code cleanup/refactoring
  • Documentation update
  • This change requires a documentation update
  • CI system update
  • Test Coverage update

Testing

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration.

Test Configuration:

  • Ubuntu 24.04.1 (on VirtualBox)
  • Java: v17
  • LPVS Release: v1.5.2

Checklist:

  • My code follows the style guidelines of this project
  • My code meets the required code coverage for lines (90% and above)
  • My code meets the required code coverage for branches (80% and above)
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Additional steps need for install SCANOSS on  Ubuntu 2023.04, Fedora 38, Debian 11, etc. 

Signed-off-by: o-konoval <[email protected]>
@codecov-commenter
Copy link

codecov-commenter commented Sep 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.67%. Comparing base (421db32) to head (27fd724).

Additional details and impacted files
@@            Coverage Diff            @@
##               main     #595   +/-   ##
=========================================
  Coverage     93.67%   93.67%           
  Complexity      608      608           
=========================================
  Files            49       49           
  Lines          2104     2104           
  Branches        244      244           
=========================================
  Hits           1971     1971           
  Misses           61       61           
  Partials         72       72           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@o-konoval o-konoval marked this pull request as ready for review September 5, 2024 12:55
m-rudyk
m-rudyk previously approved these changes Sep 5, 2024
Copy link
Collaborator

@m-rudyk m-rudyk left a comment

Choose a reason for hiding this comment

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

please consider suggestion in review. Otherwise approved.

doc/quick-start-guide-and-build.md Outdated Show resolved Hide resolved
doc/quick-start-guide-and-build.md Outdated Show resolved Hide resolved
doc/quick-start-guide-and-build.md Outdated Show resolved Hide resolved
Taking in attention review comments from @tdrozdovsky  @m-rudyk 

Signed-off-by: o-konoval <[email protected]>
Change hyphen by  comma

Signed-off-by: o-konoval <[email protected]>
@o-kopysov o-kopysov added the documentation Improvements or additions to documentation label Sep 5, 2024
@o-kopysov o-kopysov added this to the v2.0.0 milestone Sep 5, 2024
- SCANOSS Python package by following the [guidelines](https://github.com/scanoss/scanoss.py#installation). Install it using the command:
- SCANOSS Python package by following the [guidelines](https://github.com/scanoss/scanoss.py#installation).

For installing SCANOSS on Ubuntu 2023.04, Fedora 38, Debian 11, etc. or later versions of mentioned OSes please follow the note at the end of the paragraph otherwise install it using the command:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please do not use such abbreviations.

Copy link
Collaborator Author

@o-konoval o-konoval Sep 5, 2024

Choose a reason for hiding this comment

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

Please clarify -is it related to names of OSes? I do not know how to inform an user if needed special steps if no information of OS name and version.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I mention the abbreviation OS here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks for comment. Is there a variant? And how to inform user that needed to use pipx instead pip if no OS reference? May be Python version? But on scanoss guide they referenced to name of OSes and versions.

Copy link
Collaborator

Choose a reason for hiding this comment

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

My suggestion is the following.

Could you try to install ScanOSS using such a command? In case of failure, please refer to the official documentation of ScanOSS.

@@ -145,6 +147,29 @@ Before building _LPVS_ from source code, ensure that you have the following prer
sudo apt install mysql-server
```


> [!NOTE]
> For installing SCANOSS on Ubuntu 2023.04, Fedora 38, Debian 11, etc. or later versions of mentioned OSes, a few additional steps are required, as previously mentioned command : `pip3 install scanoss` will not work correctly. [More details](https://github.com/scanoss/scanoss.py/blob/main/PACKAGE.md#externally-managed-environments-on-linux)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same as above

Copy link
Collaborator

@o-kopysov o-kopysov left a comment

Choose a reason for hiding this comment

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

As far as I remember, we use other commands to install scanoss:
pip3 install --require-hashes -r requirements.txt

Why don't you use this command in the guideline?

Ubuntu 2023.4->Ubuntu 23.04, adding comma

Signed-off-by: o-konoval <[email protected]>
Signed-off-by: o-konoval <[email protected]>
@o-konoval
Copy link
Collaborator Author

As far as I remember, we use other commands to install scanoss: pip3 install --require-hashes -r requirements.txt

Why don't you use this command in the guideline?

Fixed

```
- Install `scanoss` by using `pipx`:
```bash
pipx install scanoss
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why don't you use --require-hashes -r requirements.txt here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Unfortunately pipx does not support such syntax. Need additionally check how to use pipx with specified requirements defined in file.

qa@qa-VirtualBox:~/Downloads/LPVS$ pipx install -help
usage: pipx install [-h] [--quiet] [--verbose] [--include-deps] [--force]
[--suffix SUFFIX] [--python PYTHON]
[--preinstall PREINSTALL] [--system-site-packages]
[--index-url INDEX_URL] [--editable] [--pip-args PIP_ARGS]
[package_spec ...]

The install command is the preferred way to globally install apps
from python packages on your system. It creates an isolated virtual
environment for the package, then ensures the package's apps are
accessible on your $PATH. The package's manual pages installed in
share/man/man[1-9] can be viewed with man on an operating system where
it is available and the path in the environment variable PIPX_MAN_DIR
(default: /home/qa/.local/share/man) is in the man search path
($MANPATH).

The result: apps you can run from anywhere, located in packages
you can cleanly upgrade or uninstall. Guaranteed to not have
dependency version conflicts or interfere with your OS's python
packages. 'sudo' is not required to do this.

pipx install PACKAGE_NAME ...
pipx install --python PYTHON PACKAGE_NAME
pipx install VCS_URL
pipx install ./LOCAL_PATH
pipx install ZIP_FILE
pipx install TAR_GZ_FILE

The PACKAGE_SPEC argument is passed directly to pip install.

The default virtual environment location is /home/qa/.local/share/pipx
and can be overridden by setting the environment variable PIPX_HOME
(Virtual Environments will be installed to $PIPX_HOME/venvs).

The default app location is /home/qa/.local/bin and can be
overridden by setting the environment variable PIPX_BIN_DIR.

The default manual pages location is /home/qa/.local/share/man and
can be overridden by setting the environment variable PIPX_MAN_DIR.

The default python executable used to install a package is
/usr/bin/python3 and can be overridden
by setting the environment variable PIPX_DEFAULT_PYTHON.

positional arguments:
package_spec package name(s) or pip installation spec(s)

options:
-h, --help show this help message and exit
--quiet, -q Give less output. May be used multiple times
corresponding to the WARNING, ERROR, and CRITICAL
logging levels.
--verbose, -v Give more output.
--include-deps Include apps of dependent packages
--force, -f Modify existing virtual environment and files in
PIPX_BIN_DIR and PIPX_MAN_DIR
--suffix SUFFIX Optional suffix for virtual environment and executable
names. NOTE: The suffix feature is experimental and
subject to change.
--python PYTHON Python to install with. Possible values can be the
executable name (python3.11), the version to pass to
py launcher (3.11), or the full path to the
executable.Requires Python 3.8 or above.
--preinstall PREINSTALL
Optional packages to be installed into the Virtual
Environment before installing the main package.
--system-site-packages
Give the virtual environment access to the system
site-packages dir.
--index-url INDEX_URL, -i INDEX_URL
Base URL of Python Package Index
--editable, -e Install a project in editable mode
--pip-args PIP_ARGS Arbitrary pip arguments to pass directly to pip
install/upgrade commands

Copy link
Collaborator

Choose a reason for hiding this comment

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

Please find the solution first. This is a known issue. Please refer to pypa/pipx#359

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Seems pipx still does not have official solution for installing from a requirement file.

As confirmation of it-
recently opened PR and issue for: Preinstall from requirements file
pypa/pipx#1536
pypa/pipx#1525

If this PR will be merged seems will be standard possibility to use requirement file as syntax is:
pipx install -v --preinstall-from-file /tmp/httpx-req.txt --preinstall-from-file /tmp/attrs-req.txt dunk (it taken from the PR)

Another way by using additional packet:
pipx install cookiecutter
pipx runpip cookicutter install -r requirements.txt
But I can not run it as some downloaded packets have other hashes than in the file of requirements.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Got it. Will be added to the guide after pipx feature official release.

@o-kopysov o-kopysov closed this Sep 9, 2024
@o-kopysov o-kopysov deleted the docs-update-guide-for-SCANOSS-install-on-Ubuntu-24 branch September 9, 2024 05:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants