-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Python 3.10 / structure fixes / tox introduction
Too large changeset to be honest (for one commit), but breaking this into smaller ones is a pain, as the changes depend on each other. Anyways: - Proper restructuring so that you can just pip install . - Add `tox` with tests running in 3.10, 3.11. and 3.12. - Updated pandas and numpy to latest versions. - Change CI to also use pip install . and tox for testing - README.md update. Python 3.8 and 3.9 have now been dropped. If you need them, use an older version of this tool.
- Loading branch information
1 parent
fc242c4
commit 8a9f98b
Showing
12 changed files
with
177 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,11 +11,11 @@ LicenseTool is a Python program that has two primary functions: | |
|
||
## Installation | ||
|
||
You need to have Python version 3.6 (or newer) installed in your system. This has only been tested in Linux, we do not plan to test or support Windows or Mac platforms in any way or manner as Yocto builds are done on Linux anyway. | ||
You need to have Python version 3.10 (or newer) installed in your system. This has only been tested in Linux, we do not plan to test or support Windows or Mac platforms in any way or manner as Yocto builds are done on Linux anyway. | ||
|
||
We highly recommend using a [Python virtual environment](https://docs.python.org/3/tutorial/venv.html). | ||
|
||
Python 3.10 will give you unfortunately a lot of warnings. They just love deprecating APIs in the Python world, don't they? | ||
If you need to use older versions of Python (3.6 - 3.9), use `v1.0` of this tool. | ||
|
||
## User installation | ||
|
||
|
@@ -24,7 +24,7 @@ git clone [email protected]:PelionIoT/licensetool.git | |
cd licensetool | ||
python3 -m venv venv | ||
source venv/bin/activate | ||
pip install -r requirements.txt | ||
pip install . | ||
``` | ||
|
||
## Developer installation | ||
|
@@ -42,7 +42,7 @@ The license file is generated as part of the Yocto build. In Foundries.io LmP-bu | |
|
||
### Generate CSV-formatted license file | ||
|
||
`python licensetool.py list <input manifest file> <output>` | ||
`licensetool list <input manifest file> <output>` | ||
|
||
This will generate two output files, | ||
|
||
|
@@ -51,7 +51,7 @@ This will generate two output files, | |
|
||
### Generate license changes file | ||
|
||
`python licensetool.py changes <previous manifest file> <current manifest file> <output file>` | ||
`licensetool changes <previous manifest file> <current manifest file> <output file>` | ||
|
||
This will generate two output files, | ||
|
||
|
@@ -60,22 +60,26 @@ This will generate two output files, | |
|
||
### Other options | ||
|
||
Run the tool with `python licensetool.py` to get information on optional parameters. | ||
Run the tool with `licensetool` to get information on optional parameters. | ||
|
||
## Tests | ||
|
||
Tests and test material are located in [tests](tests)-folder. | ||
You can run them from the root folder: | ||
|
||
```bash | ||
tox | ||
``` | ||
pytest -v -o junit_family=xunit1 --cov=. --cov-report xml:coverage.xml --cov-report html:test-results/cov_html --junitxml=xunit-reports/xunit.xml | ||
or just directly for just one Python-version. | ||
```bash | ||
pytest -v | ||
``` | ||
|
||
## Contributions | ||
|
||
All contributions must pass: | ||
- Clear written statement that author agrees to Apache 2.0 license and is the original author of the changes. | ||
- Code review, so submit a pull request (PR). | ||
- Run `pylint licensetool.py tests/*.py` and make sure the score does not get worse (10/10 now). | ||
- Run `tox` and make sure the score does not get worse (10/10 now). | ||
- Include necessary test case updates, so that coverage does not decrease - provide evidence in the PR. | ||
- Include required documentation updates. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1 @@ | ||
pylint==2.11.0 | ||
pytest | ||
pytest-mock | ||
pytest-cov | ||
tox | ||
pycodestyle | ||
coverage | ||
wheel | ||
bandit | ||
-e .[dev] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/usr/bin/env python3 | ||
# | ||
# Copyright (c) 2024 Izuma Networks | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
|
||
from .main import ( | ||
read_manifest_file, | ||
gen_list, | ||
gen_changes, | ||
_DATA_SHEET_NAME, | ||
main, | ||
) | ||
|
||
|
||
__all__ = [ | ||
'read_manifest_file', | ||
'gen_list', | ||
'gen_changes', | ||
'_DATA_SHEET_NAME', | ||
'main', | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1 @@ | ||
pandas==1.5.3 | ||
jinja2 | ||
openpyxl | ||
-e . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.