-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
python/locomotive-engineer: 2nd iteration - new project structure
- Loading branch information
Showing
18 changed files
with
221 additions
and
210 deletions.
There are no files selected for viewing
Binary file renamed
BIN
+52 KB
python/locomotiveengineer/.coverage → python/locomotive-engineer/.coverage
Binary file not shown.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,5 @@ | ||
[pytest] | ||
pythonpath = . | ||
addopts = --doctest-modules | ||
markers = | ||
task: exercise task/step |
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,211 @@ | ||
Running automated test file(s): | ||
|
||
|
||
=============================================================================== | ||
|
||
Running: pylint ./src | ||
************* Module locomotive_engineer.locomotive_engineer | ||
src/locomotive_engineer/locomotive_engineer.py:25:0: C0301: Line too long (102/100) (line-too-long) | ||
src/locomotive_engineer/locomotive_engineer.py:39:0: C0301: Line too long (110/100) (line-too-long) | ||
|
||
------------------------------------------------------------------- | ||
Your code has been rated at 9.05/10 (previous run: 10.00/10, -0.95) | ||
|
||
|
||
real 0m0.868s | ||
user 0m0.755s | ||
sys 0m0.116s | ||
|
||
=============================================================================== | ||
|
||
Running: ruff check --ignore E501 ./src | ||
|
||
real 0m0.104s | ||
user 0m0.034s | ||
sys 0m0.076s | ||
|
||
=============================================================================== | ||
|
||
Running: pyright --stats ./src | ||
Found 2 source files | ||
pyright 1.1.347 | ||
0 errors, 0 warnings, 0 informations | ||
Completed in 0.583sec | ||
|
||
Analysis stats | ||
Total files parsed and bound: 20 | ||
Total files checked: 2 | ||
|
||
Timing stats | ||
Find Source Files: 0sec | ||
Read Source Files: 0.01sec | ||
Tokenize: 0.03sec | ||
Parse: 0.04sec | ||
Resolve Imports: 0.05sec | ||
Bind: 0.05sec | ||
Check: 0.08sec | ||
Detect Cycles: 0sec | ||
|
||
real 0m1.453s | ||
user 0m1.211s | ||
sys 0m0.179s | ||
|
||
=============================================================================== | ||
|
||
Running: bandit --verbose --recursive ./src | ||
[main] INFO profile include tests: None | ||
[main] INFO profile exclude tests: None | ||
[main] INFO cli include tests: None | ||
[main] INFO cli exclude tests: None | ||
[main] INFO running on Python 3.12.1 | ||
Run started:2024-01-17 16:18:25.111547 | ||
Files in scope (2): | ||
./src/locomotive_engineer/__init__.py (score: {SEVERITY: 0, CONFIDENCE: 0}) | ||
./src/locomotive_engineer/locomotive_engineer.py (score: {SEVERITY: 0, CONFIDENCE: 0}) | ||
Files excluded (0): | ||
|
||
Test results: | ||
No issues identified. | ||
|
||
Code scanned: | ||
Total lines of code: 45 | ||
Total lines skipped (#nosec): 0 | ||
Total potential issues skipped due to specifically being disabled (e.g., #nosec BXXX): 0 | ||
|
||
Run metrics: | ||
Total issues (by severity): | ||
Undefined: 0 | ||
Low: 0 | ||
Medium: 0 | ||
High: 0 | ||
Total issues (by confidence): | ||
Undefined: 0 | ||
Low: 0 | ||
Medium: 0 | ||
High: 0 | ||
Files skipped (0): | ||
|
||
real 0m0.293s | ||
user 0m0.230s | ||
sys 0m0.066s | ||
|
||
=============================================================================== | ||
|
||
Running: refurb ./src | ||
|
||
real 0m1.159s | ||
user 0m1.082s | ||
sys 0m0.079s | ||
|
||
=============================================================================== | ||
|
||
python -m doctest -v ./src/locomotive_engineer/__init__.py ./src/locomotive_engineer/locomotive_engineer.py | ||
1 items had no tests: | ||
__init__ | ||
0 tests in 1 items. | ||
0 passed and 0 failed. | ||
Test passed. | ||
6 items had no tests: | ||
locomotive_engineer | ||
locomotive_engineer.add_missing_stops | ||
locomotive_engineer.extend_route_information | ||
locomotive_engineer.fix_list_of_wagons | ||
locomotive_engineer.fix_wagon_depot | ||
locomotive_engineer.get_list_of_wagons | ||
0 tests in 6 items. | ||
0 passed and 0 failed. | ||
Test passed. | ||
|
||
real 0m0.145s | ||
user 0m0.077s | ||
sys 0m0.071s | ||
|
||
|
||
=============================================================================== | ||
|
||
==> .coveragerc <== | ||
[run] | ||
omit = __init__.py, *_test.py | ||
|
||
Running: PYTHONPATH=./src pytest --verbose --cov=. --cov-branch --cov-report=term-missing --cov-report=xml:.coverage.xml -p no:randomly ./test | ||
============================= test session starts ============================== | ||
platform linux -- Python 3.12.1, pytest-7.4.3, pluggy-1.3.0 -- /home/vpayno/.pyenv/versions/3.12.1/bin/python | ||
cachedir: .pytest_cache | ||
rootdir: /home/vpayno/git_vpayno/exercism-workspace/python/locomotive-engineer | ||
configfile: pytest.ini | ||
plugins: anyio-4.2.0, libtmux-0.25.0, pylama-8.4.1, cov-4.1.0, datafiles-3.0.0, docker-2.0.1, subprocess-1.5.0, typeguard-4.1.5 | ||
collecting ... collected 5 items | ||
|
||
test/locomotive_engineer_test.py::LocomotiveEngineerTest::test_add_missing_stops PASSED [ 20%] | ||
test/locomotive_engineer_test.py::LocomotiveEngineerTest::test_extend_route_information PASSED [ 40%] | ||
test/locomotive_engineer_test.py::LocomotiveEngineerTest::test_fix_list_of_wagons PASSED [ 60%] | ||
test/locomotive_engineer_test.py::LocomotiveEngineerTest::test_fix_wagon_depot PASSED [ 80%] | ||
test/locomotive_engineer_test.py::LocomotiveEngineerTest::test_get_list_of_wagons PASSED [100%] | ||
|
||
---------- coverage: platform linux, python 3.12.1-final-0 ----------- | ||
Name Stmts Miss Branch BrPart Cover Missing | ||
-------------------------------------------------------------------- | ||
locomotive_engineer.py 19 0 2 0 100% | ||
-------------------------------------------------------------------- | ||
TOTAL 19 0 2 0 100% | ||
Coverage XML written to file .coverage.xml | ||
|
||
|
||
============================== 5 passed in 0.07s =============================== | ||
|
||
real 0m0.848s | ||
user 0m0.722s | ||
sys 0m0.127s | ||
|
||
=============================================================================== | ||
|
||
Running: coverage report --show-missing | ||
Name Stmts Miss Branch BrPart Cover Missing | ||
-------------------------------------------------------------------- | ||
locomotive_engineer.py 19 0 2 0 100% | ||
-------------------------------------------------------------------- | ||
TOTAL 19 0 2 0 100% | ||
|
||
real 0m0.161s | ||
user 0m0.095s | ||
sys 0m0.060s | ||
|
||
=============================================================================== | ||
|
||
coverage annotate | ||
|
||
real 0m0.181s | ||
user 0m0.113s | ||
sys 0m0.071s | ||
|
||
tail -n 10000 ./*,cover | grep -E -C 3 '^> def |^! ' | ||
|
||
> def get_list_of_wagons(*args: str) -> List[str]: | ||
> """Return a list of wagons. | ||
-- | ||
|
||
> def fix_list_of_wagons(each_wagons_id: List[int], missing_wagons: List[int]) -> List[int]: | ||
> """Fix the list of wagons. | ||
-- | ||
|
||
> def add_missing_stops(route: Dict[str, str | List[str]], **kwargs: str) -> Dict[str, str | List[str]]: | ||
> """Add missing stops to route dict. | ||
-- | ||
|
||
> def extend_route_information(route: Dict[str, str], more_route_information: Dict[str, str]) -> Dict[str, str]: | ||
> """Extend route information with more_route_information. | ||
-- | ||
|
||
> def fix_wagon_depot(wagons_rows: List[List[Tuple[int, str]]]) -> List[List[Tuple[int, str]]]: | ||
> """Fix the list of rows of wagons. | ||
|
||
=============================================================================== | ||
|
||
Running: misspell ./src/locomotive_engineer/__init__.py ./src/locomotive_engineer/locomotive_engineer.py | ||
|
||
real 0m0.021s | ||
user 0m0.025s | ||
sys 0m0.008s | ||
|
||
=============================================================================== | ||
|
File renamed without changes.
1 change: 1 addition & 0 deletions
1
python/locomotive-engineer/src/locomotive_engineer/locomotive_engineer.py
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 @@ | ||
../../locomotive_engineer.py |
Empty file.
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 @@ | ||
../locomotive_engineer_test.py |
Oops, something went wrong.