tonybaloney / wily

A Python application for tracking, reporting on timing and complexity in Python code
Apache License 2.0
1.2k stars 58 forks source link

Wily Build not wokring #228

Open liaochris opened 10 months ago

liaochris commented 10 months ago

I wanted to obtain wily statistics for an entire repository, similarly to (https://stribny.name/blog/2019/05/measuring-python-code-complexity-with-wily/). I cloned a copy of wily from github, but when I try to build it using the wily command, I get the error that the wily repo is not a valid git repo. The report function also does not work, as would be expected by the error below. The first revision in wily report . is mine because I was doing some simple experimenting.

chrisliao@linux6:~$ wily build wily
Defaulting back to the filesystem archiver, not a valid git repo
Found 0 revisions from 'filesystem' archiver in '/home/chrisliao'.
Running operators - halstead,maintainability,cyclomatic,raw

Completed building wily history, run `wily report <file>` or `wily index` to see more.
chrisliao@linux6:~$ cd wily && wily report . -n 5
Using default metrics ['halstead.h1', 'raw.loc', 'maintainability.mi', 'cyclomatic.complexity']
-----------History for ['cyclomatic.complexity', 'halstead.h1', 'maintainability.mi', 'raw.loc']------------
╒════════════╤══════════════╤════════════╤═══════════════╤═══════════════════╤═══════════════════╤═════════════════╕
│ Revision   │ Author       │ Date       │ Cyclomatic    │ Unique Operands   │ Maintainability   │ Lines of Code   │
│            │              │            │ Complexity    │                   │ Index             │                 │
╞════════════╪══════════════╪════════════╪═══════════════╪═══════════════════╪═══════════════════╪═════════════════╡
│ b91446e    │ liaochris    │ 2023-11-14 │ Not found '.' │ Not found '.'     │ Not found '.'     │ Not found '.'   │
├────────────┼──────────────┼────────────┼───────────────┼───────────────────┼───────────────────┼─────────────────┤
│ 2590691    │ Anthony Shaw │ 2023-10-10 │ Not found '.' │ Not found '.'     │ Not found '.'     │ Not found '.'   │
├────────────┼──────────────┼────────────┼───────────────┼───────────────────┼───────────────────┼─────────────────┤
│ 4ac2334    │ Anthony Shaw │ 2023-10-10 │ Not found '.' │ Not found '.'     │ Not found '.'     │ Not found '.'   │
├────────────┼──────────────┼────────────┼───────────────┼───────────────────┼───────────────────┼─────────────────┤
│ ee7014a    │ Anthony Shaw │ 2023-10-10 │ Not found '.' │ Not found '.'     │ Not found '.'     │ Not found '.'   │
├────────────┼──────────────┼────────────┼───────────────┼───────────────────┼───────────────────┼─────────────────┤
│ a79b62e    │ Anthony Shaw │ 2023-10-10 │ Not found '.' │ Not found '.'     │ Not found '.'     │ Not found '.'   │
╘════════════╧══════════════╧════════════╧═══════════════╧═══════════════════╧═══════════════════╧═════════════════╛
tbpassin commented 1 month ago

Same error for me. Wily version 1.25.0 on Windows 10, Python 3.12. The directory I specify for build does have the .git directory for the project, and it is a working git archive.

[LATER] I had to run wily index first. index works on the current directory so I had to cd to the top of the git repo first. index doesn't accept a path parameter, which seems on undesirable omission.

q-caron commented 1 month ago

Hello everyone,

I have the same here: image

I am running under Windows 10 Entreprise version 22H2, Python 3.11.8, poetry 1.8.3, wily 1.25.0 and git version 2.45.2.windows.1

When running the build command on my project root, I get the following output: image

Let me know if you need any other information.

[UPDATE] : After creating a Python module in the root folder of my project, I get some info using the rank command: image

So maybe the build command should list all packages containing Python modules?...