Closed ckartchner closed 3 years ago
β Merging this PR will increase code quality in the affected files by 0.27%.
Quality metrics | Before | After | Change |
---|---|---|---|
Complexity | 0.40 β | 0.42 β | 0.02 π |
Method Length | 33.33 β | 32.70 β | -0.63 π |
Working memory | 7.55 π | 7.35 π | -0.20 π |
Quality | 85.76% β | 86.03% β | 0.27% π |
Other metrics | Before | After | Change |
---|---|---|---|
Lines | 194 | 207 | 13 |
Changed files | Quality Before | Quality After | Quality Change |
---|---|---|---|
setup.py | 53.93% π | 53.52% π | -0.41% π |
pip_chill/init.py | 98.83% β | 99.00% β | 0.17% π |
tests/test_pip_chill.py | 87.48% β | 87.43% β | -0.05% π |
Here are some functions in these files that still need a tune-up:
File | Function | Complexity | Length | Working Memory | Quality | Recommendation |
---|---|---|---|---|---|---|
tests/test_pip_chill.py | TestPip_chill.test_pip_ommitted.test_all.test_hashes.test_command_line_interface_omits_ignored | 1 β | 52 β | 10 π | 75.17% β | Extract out complex expressions |
The emojis denote the absolute quality of the code:
The π and π indicate whether the quality has improved or gotten worse with this pull request.
Please see our documentation here for details on how these metrics are calculated.
We are actively working on this report - lots more documentation and extra metrics to come!
Let us know what you think of it by mentioning @sourcery-ai in a comment.
Stale pull request message
Hi Ricardo. Thanks for your work on this project! It has helped me clean-up some of the sprawling dependencies in a few of the web applications I work on. :+1:
As an attempt to give back, I've tried to address issue #30 (pip-chill not executable as a package) with this PR
For packages that use no special characters, adding a
__main__.py
to the package directory is enough to enablepython -m <package_name>
, however, in this case, since the package is in the directory pip_chill (and pip-chill is an invalid module name), this only enablespython -m pip_chill
and notpython -m pip-chill
.The work around in this PR is to both add a pip-chill.py to the top level directory which behaves identically to the
__main__.py
, and add this file to the py_modules section of setup.pyWith these changes,
python -m pip-chill
,python -m pip_chill
andpip-chill
are all valid ways to execute the program.The inspiration for this change came from the solution pip-run is using.
As an aside, maybe consider increasing the amount of time it takes for an issue to auto-close as stale, or remove auto-closing all together? I started looking at this issue last weekend, but didn't comment as I was merely exploring and didn't want to make any commitments. I was surprised to find the issue closed when I came back to create my PR today. It looks like this isn't the first potentially useful enhancement that auto-closer has moved to the closed pile.